Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/z/codegen/J9CodeGenPhase.cpp
6004 views
1
/*******************************************************************************
2
* Copyright (c) 2000, 2020 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* 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-exception
21
*******************************************************************************/
22
23
//On zOS XLC linker can't handle files with same name at link time
24
//This workaround with pragma is needed. What this does is essentially
25
//give a different name to the codesection (csect) for this file. So it
26
//doesn't conflict with another file with same name.
27
28
#pragma csect(CODE,"TRJ9ZCGPhase#C")
29
#pragma csect(STATIC,"TRJ9ZCGPhase#S")
30
#pragma csect(TEST,"TRJ9ZCGPhase#T")
31
32
#include "codegen/CodeGenPhase.hpp"
33
#include "codegen/CodeGenerator.hpp"
34
#include "codegen/InMemoryLoadStoreMarking.hpp"
35
#include "codegen/ReduceSynchronizedFieldLoad.hpp"
36
#include "codegen/UncommonBCDCHKAddressNode.hpp"
37
38
// to decide if asyncchecks should be inserted at method exits
39
#define BYTECODESIZE_THRESHOLD_FOR_ASYNCCHECKS 300
40
41
void
42
J9::Z::CodeGenPhase::performInMemoryLoadStoreMarkingPhase(TR::CodeGenerator * cg, TR::CodeGenPhase * phase)
43
{
44
InMemoryLoadStoreMarking obj = InMemoryLoadStoreMarking(cg);
45
obj.perform();
46
}
47
48
void
49
J9::Z::CodeGenPhase::performReduceSynchronizedFieldLoadPhase(TR::CodeGenerator * cg, TR::CodeGenPhase * phase)
50
{
51
ReduceSynchronizedFieldLoad obj = ReduceSynchronizedFieldLoad(cg);
52
53
if (obj.perform())
54
{
55
if (cg->comp()->getOption(TR_TraceCG))
56
{
57
cg->comp()->dumpMethodTrees("Post Reduce Synchronized Field Load Trees");
58
}
59
}
60
}
61
62
void
63
J9::Z::CodeGenPhase::performUncommonBCDCHKAddressNodePhase(TR::CodeGenerator * cg, TR::CodeGenPhase * phase)
64
{
65
UncommonBCDCHKAddressNode obj = UncommonBCDCHKAddressNode(cg);
66
obj.perform();
67
}
68
69
int
70
J9::Z::CodeGenPhase::getNumPhases()
71
{
72
return static_cast<int>(TR::CodeGenPhase::LastJ9ZPhase);
73
}
74
75
const char *
76
J9::Z::CodeGenPhase::getName()
77
{
78
return TR::CodeGenPhase::getName(_currentPhase);
79
}
80
81
const char *
82
J9::Z::CodeGenPhase::getName(TR::CodeGenPhase::PhaseValue phase)
83
{
84
switch (phase)
85
{
86
case InMemoryLoadStoreMarkingPhase:
87
return "InMemoryLoadStoreMarkingPhase";
88
case ReduceSynchronizedFieldLoadPhase:
89
return "ReduceSynchronizedFieldLoadPhase";
90
case UncommonBCDCHKAddressNodePhase:
91
return "UncommonBCDCHKAddressNodePhase";
92
default:
93
return J9::CodeGenPhase::getName(phase);
94
}
95
}
96
97
98