public final class PiNodes extends CompilerPhase
Modifier and Type | Field and Description |
---|---|
(package private) static boolean |
CHECK_REF_PI
Should we insert PI nodes for array references after bounds-checks
and null-checks?
|
private static Constructor<CompilerPhase> |
constructor
Constructor for this compiler phase
|
(package private) boolean |
insertion
Should we insert (true) or delete (false) PI nodes?
|
(package private) boolean |
typeChecks
Are we adding pi nodes for type checks only?
|
container
Constructor and Description |
---|
PiNodes(boolean insert)
Create the phase.
|
PiNodes(boolean insert,
boolean typeChecks)
Create the phase.
|
Modifier and Type | Method and Description |
---|---|
(package private) static void |
cleanUp(IR ir)
Change all PI nodes to INT_MOVE instructions
Side effect: invalidates SSA state
|
Constructor<CompilerPhase> |
getClassConstructor()
Get a constructor object for this compiler phase
|
static Instruction |
getGenerator(Instruction def) |
String |
getName()
A String representation of this phase
|
private void |
insertPiBcNodes(IR ir)
Insert Pi nodes for boundchecks.
|
private void |
insertPiCheckCastNodes(IR ir)
Insert Pi nodes for checkcast operations.
|
private void |
insertPiIfNodes(IR ir)
Insert PI nodes corresponding to compare operations.
|
private void |
insertPiNullCheckNodes(IR ir)
Insert Pi nodes for null check operations.
|
static boolean |
isBoundsCheckPi(Instruction def) |
static boolean |
isNotTakenPi(Instruction def) |
static boolean |
isNullCheckPi(Instruction def) |
static boolean |
isTakenPi(Instruction def) |
void |
perform(IR ir)
This is the method that actually does the work of the phase.
|
boolean |
printingEnabled(OptOptions options,
boolean before)
Should we print the IR either before or after this phase?
|
boolean |
shouldPerform(OptOptions options)
Should this phase be performed?
|
dumpIR, dumpIR, getCompilerPhaseConstructor, getCompilerPhaseConstructor, newExecution, performPhase, reportAdditionalStats, setContainer, verify
static final boolean CHECK_REF_PI
TODO: if this is false, then null-check elimination will be ineffective.
TODO: prove that null-check elimination is sound before turning this on again.
final boolean insertion
final boolean typeChecks
private static final Constructor<CompilerPhase> constructor
public PiNodes(boolean insert)
insert
- If true, we insert PI nodes, If false, we remove them.public PiNodes(boolean insert, boolean typeChecks)
insert
- If true, we insert PI nodes, If false, we remove them.typeChecks
- If true, we insert PI nodes only for type checks.public boolean shouldPerform(OptOptions options)
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilationpublic Constructor<CompilerPhase> getClassConstructor()
getClassConstructor
in class CompilerPhase
public String getName()
getName
in class CompilerPhase
public boolean printingEnabled(OptOptions options, boolean before)
printingEnabled
in class CompilerPhase
options
- controlling compiler optionsbefore
- control for the querypublic void perform(IR ir)
CompilerPhase
perform
in class CompilerPhase
ir
- the IR on which to apply the phaseprivate void insertPiIfNodes(IR ir)
ir
- the governing IRprivate void insertPiBcNodes(IR ir)
Each boundcheck Arr, Index will be followed by
PI Index, Index
ir
- the governing IRprivate void insertPiNullCheckNodes(IR ir)
Each checkcast obj will be followed by
PI obj, obj
ir
- the governing IRprivate void insertPiCheckCastNodes(IR ir)
Each checkcast obj will be followed by
ref_move obj, obj
ir
- the governing IRstatic void cleanUp(IR ir)
Side effect: invalidates SSA state
ir
- the governing IRpublic static Instruction getGenerator(Instruction def)
public static boolean isNotTakenPi(Instruction def)
public static boolean isTakenPi(Instruction def)
public static boolean isBoundsCheckPi(Instruction def)
public static boolean isNullCheckPi(Instruction def)