Path: blob/master/runtime/compiler/z/codegen/J9CodeGenPhase.cpp
6004 views
/*******************************************************************************1* Copyright (c) 2000, 2020 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20*******************************************************************************/2122//On zOS XLC linker can't handle files with same name at link time23//This workaround with pragma is needed. What this does is essentially24//give a different name to the codesection (csect) for this file. So it25//doesn't conflict with another file with same name.2627#pragma csect(CODE,"TRJ9ZCGPhase#C")28#pragma csect(STATIC,"TRJ9ZCGPhase#S")29#pragma csect(TEST,"TRJ9ZCGPhase#T")3031#include "codegen/CodeGenPhase.hpp"32#include "codegen/CodeGenerator.hpp"33#include "codegen/InMemoryLoadStoreMarking.hpp"34#include "codegen/ReduceSynchronizedFieldLoad.hpp"35#include "codegen/UncommonBCDCHKAddressNode.hpp"3637// to decide if asyncchecks should be inserted at method exits38#define BYTECODESIZE_THRESHOLD_FOR_ASYNCCHECKS 3003940void41J9::Z::CodeGenPhase::performInMemoryLoadStoreMarkingPhase(TR::CodeGenerator * cg, TR::CodeGenPhase * phase)42{43InMemoryLoadStoreMarking obj = InMemoryLoadStoreMarking(cg);44obj.perform();45}4647void48J9::Z::CodeGenPhase::performReduceSynchronizedFieldLoadPhase(TR::CodeGenerator * cg, TR::CodeGenPhase * phase)49{50ReduceSynchronizedFieldLoad obj = ReduceSynchronizedFieldLoad(cg);5152if (obj.perform())53{54if (cg->comp()->getOption(TR_TraceCG))55{56cg->comp()->dumpMethodTrees("Post Reduce Synchronized Field Load Trees");57}58}59}6061void62J9::Z::CodeGenPhase::performUncommonBCDCHKAddressNodePhase(TR::CodeGenerator * cg, TR::CodeGenPhase * phase)63{64UncommonBCDCHKAddressNode obj = UncommonBCDCHKAddressNode(cg);65obj.perform();66}6768int69J9::Z::CodeGenPhase::getNumPhases()70{71return static_cast<int>(TR::CodeGenPhase::LastJ9ZPhase);72}7374const char *75J9::Z::CodeGenPhase::getName()76{77return TR::CodeGenPhase::getName(_currentPhase);78}7980const char *81J9::Z::CodeGenPhase::getName(TR::CodeGenPhase::PhaseValue phase)82{83switch (phase)84{85case InMemoryLoadStoreMarkingPhase:86return "InMemoryLoadStoreMarkingPhase";87case ReduceSynchronizedFieldLoadPhase:88return "ReduceSynchronizedFieldLoadPhase";89case UncommonBCDCHKAddressNodePhase:90return "UncommonBCDCHKAddressNodePhase";91default:92return J9::CodeGenPhase::getName(phase);93}94}95969798