| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | EscapeAnalysis.
Struct used to generate and maintain escape analysis results. |
| public static enum | EscapeAnalysis.
Lattice values used to indicate escape state for an object. |
| Modifier and Type | Field and Description |
|---|---|
| private ArrayList | latticeValues
Lattice values for each object register group |
| private int | regCount
ssaMeth.getRegCount() |
| private SsaMethod | ssaMeth
method we're processing |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | addEdge(EscapeAnalysis.
non-null; the EscapeSet for the object being put
intonon-null; the EscapeSet for the object being putCreates a link in the lattice between two EscapeSets due to a put instruction. |
| private int | Returns: index of the register or size of the lattice if it wasn't found.non-null; register being looked upFinds the index in the lattice for a particular register. |
| private SsaInsn | Returns: non-null; the instruction that produces the result for
the movenon-null; a move result instructionFinds the corresponding instruction for a given move result |
| private SsaInsn | Returns: non-null; the move result for the given instructionnon-null; an instruction that must always be
followed by a move resultFinds the corresponding move result for a given instruction |
| private void | insertExceptionThrow(SsaInsn
non-null; instruction causing the exceptionnon-null; index value that is out of boundsnon-null; set of instructions marked for
deletionReplaces instructions that trigger an ArrayIndexOutofBounds exception with an actual throw of the exception. |
| private void | insertPlainInsnBefore(SsaInsn
non-null; instruction to insert beforenon-null; sources of new instructionnon-null; result of new instructionopcode of new instruction newOpcode, Constant null-ok; constant for new instruction, if anyInserts a new PlainInsn before the given instruction. |
| private void | insertThrowingInsnBefore(SsaInsn
non-null; instruction to insert beforenon-null; sources of new instructionnon-null; result of new instructionopcode of new instruction newOpcode, Constant null-ok; constant for new instruction, if anyInserts a new ThrowingInsn before the given instruction. |
| private void | movePropagate()
Identifies extra moves added by scalar replacement and propagates the source of the move to any users of the result. |
| public static void | |
| private void | processInsn(SsaInsn
non-null; instruction to processProcess a single instruction, looking for new objects resulting from move result or move param. |
| private EscapeAnalysis. | Returns: non-null; an EscapeSet for the object referred to by the
move result pseudo instructionnon-null; move result pseudo instruction to processDetermine the origin of a move result pseudo instruction that generates an object. |
| private void | processPhiUse(SsaInsn
non-null; phi use being processednon-null; EscapeSet for the objectnon-null; worklist of instructions left to
process for this objectHandles phi uses of new objects. |
| private void | processRegister(RegisterSpec
non-null; register where new object is storednon-null; EscapeSet for the new objectIterate through all the uses of a new object. |
| private void | processUse(RegisterSpec
non-null; register holding definition of new objectnon-null; use of object being processednon-null; EscapeSet for the objectnon-null; worklist of instructions left to
process for this objectHandles non-phi uses of new objects. |
| private void | replaceDef(SsaInsn
non-null; move result instruction for arraynon-null; instruction for instantiating new arraysize of the new array length, ArrayList<RegisterSpec> non-null; mapping of array indices to new
registers to be populatedReplaces the instructions that define an array with equivalent registers. |
| private void | replaceNode(EscapeAnalysis.
non-null; the EscapeSet to merge all links intonon-null; the EscapeSet to remove all links fromMerges all links in the lattice among two EscapeSets. |
| private void | replaceUse(SsaInsn
non-null; move result instruction for arraynon-null; instruction for instantiating new arraynon-null; mapping of array indices to new
registersnon-null; set of instructions marked for
deletionReplaces the use for a scalar replaceable array. |
| private void | |
| private void |
| latticeValues | back to summary |
|---|---|
| private ArrayList<EscapeAnalysis. Lattice values for each object register group | |
| regCount | back to summary |
|---|---|
| private int regCount ssaMeth.getRegCount() | |
| ssaMeth | back to summary |
|---|---|
| private SsaMethod ssaMeth method we're processing | |
| EscapeAnalysis | back to summary |
|---|---|
| private EscapeAnalysis(SsaMethod ssaMeth) Constructs an instance.
| |
| addEdge | back to summary |
|---|---|
| private void addEdge(EscapeAnalysis. Creates a link in the lattice between two EscapeSets due to a put instruction. The object being put is the child and the object being put into is the parent. A child set must always have an escape state at least as high as its parent.
| |
| findSetIndex | back to summary |
|---|---|
| private int findSetIndex(RegisterSpec reg) Finds the index in the lattice for a particular register. Returns the size of the lattice if the register wasn't found.
| |
| getInsnForMove | back to summary |
|---|---|
| private SsaInsn getInsnForMove(SsaInsn moveInsn) Finds the corresponding instruction for a given move result | |
| getMoveForInsn | back to summary |
|---|---|
| private SsaInsn getMoveForInsn(SsaInsn insn) Finds the corresponding move result for a given instruction | |
| insertExceptionThrow | back to summary |
|---|---|
| private void insertExceptionThrow(SsaInsn insn, RegisterSpec index, HashSet<SsaInsn> deletedInsns) Replaces instructions that trigger an ArrayIndexOutofBounds exception with an actual throw of the exception.
| |
| insertPlainInsnBefore | back to summary |
|---|---|
| private void insertPlainInsnBefore(SsaInsn insn, RegisterSpecList newSources, RegisterSpec newResult, int newOpcode, Constant cst) Inserts a new PlainInsn before the given instruction. Todo move this somewhere more appropriate
| |
| insertThrowingInsnBefore | back to summary |
|---|---|
| private void insertThrowingInsnBefore(SsaInsn insn, RegisterSpecList newSources, RegisterSpec newResult, int newOpcode, Constant cst) Inserts a new ThrowingInsn before the given instruction. Todo move this somewhere more appropriate
| |
| movePropagate | back to summary |
|---|---|
| private void movePropagate() Identifies extra moves added by scalar replacement and propagates the source of the move to any users of the result. | |
| process | back to summary |
|---|---|
| public static void process(SsaMethod ssaMethod) Performs escape analysis on a method. Finds scalar replaceable arrays and replaces them with equivalent registers.
| |
| processInsn | back to summary |
|---|---|
| private void processInsn(SsaInsn insn) Process a single instruction, looking for new objects resulting from move result or move param.
| |
| processMoveResultPseudoInsn | back to summary |
|---|---|
| private EscapeAnalysis. Determine the origin of a move result pseudo instruction that generates an object. Creates a new EscapeSet for the new object accordingly.
| |
| processPhiUse | back to summary |
|---|---|
| private void processPhiUse(SsaInsn use, EscapeAnalysis. Handles phi uses of new objects. Will merge together the sources of a phi into a single EscapeSet. Adds the result of the phi to the worklist so its uses can be followed.
| |
| processRegister | back to summary |
|---|---|
| private void processRegister(RegisterSpec result, EscapeAnalysis. Iterate through all the uses of a new object.
| |
| processUse | back to summary |
|---|---|
| private void processUse(RegisterSpec def, SsaInsn use, EscapeAnalysis. Handles non-phi uses of new objects. Checks to see how instruction is used and updates the escape state accordingly.
| |
| replaceDef | back to summary |
|---|---|
| private void replaceDef(SsaInsn def, SsaInsn prev, int length, ArrayList<RegisterSpec> newRegs) Replaces the instructions that define an array with equivalent registers. For each entry in the array, a register is created, initialized to zero. A mapping between this register and the corresponding array index is added.
| |
| replaceNode | back to summary |
|---|---|
| private void replaceNode(EscapeAnalysis. Merges all links in the lattice among two EscapeSets. On return, the newNode will have its old links as well as all links from the oldNode. The oldNode has all its links removed.
| |
| replaceUse | back to summary |
|---|---|
| private void replaceUse(SsaInsn use, SsaInsn prev, ArrayList<RegisterSpec> newRegs, HashSet<SsaInsn> deletedInsns) Replaces the use for a scalar replaceable array. Gets and puts become move instructions, and array lengths and fills are handled. Can also identify ArrayIndexOutOfBounds exceptions and throw them if detected. | |
| run | back to summary |
|---|---|
| private void run() Runs escape analysis and scalar replacement of arrays. | |
| scalarReplacement | back to summary |
|---|---|
| private void scalarReplacement() Performs scalar replacement on all eligible arrays. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv ArrayList | childSets
list of objects that are put into this object |
| pack-priv EscapeAnalysis. | escape
escape state of the object |
| pack-priv ArrayList | parentSets
list of objects that this object is put into |
| pack-priv BitSet | regSet
set containing all registers related to an object |
| pack-priv boolean | replaceableArray
flag to indicate this object is a scalar replaceable array |
| Access | Constructor and Description |
|---|---|
| pack-priv | EscapeSet(int
the SSA register that defines the object reg, int the number of registers in the method size, EscapeAnalysis.the lattice value to initially set this to escStateConstructs an instance of an EscapeSet |
| childSets | back to summary |
|---|---|
| pack-priv ArrayList<EscapeAnalysis. list of objects that are put into this object | |
| escape | back to summary |
|---|---|
| pack-priv EscapeAnalysis. escape state of the object | |
| parentSets | back to summary |
|---|---|
| pack-priv ArrayList<EscapeAnalysis. list of objects that this object is put into | |
| regSet | back to summary |
|---|---|
| pack-priv BitSet regSet set containing all registers related to an object | |
| replaceableArray | back to summary |
|---|---|
| pack-priv boolean replaceableArray flag to indicate this object is a scalar replaceable array | |
| EscapeSet | back to summary |
|---|---|
| pack-priv EscapeSet(int reg, int size, EscapeAnalysis. Constructs an instance of an EscapeSet
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final EscapeAnalysis. | |
| public static final EscapeAnalysis. | |
| public static final EscapeAnalysis. | |
| public static final EscapeAnalysis. | |
| public static final EscapeAnalysis. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static EscapeAnalysis. | |
| public static EscapeAnalysis. |
| GLOBAL | back to summary |
|---|---|
| public static final EscapeAnalysis. | |
| INTER | back to summary |
|---|---|
| public static final EscapeAnalysis. | |
| METHOD | back to summary |
|---|---|
| public static final EscapeAnalysis. | |
| NONE | back to summary |
|---|---|
| public static final EscapeAnalysis. | |
| TOP | back to summary |
|---|---|
| public static final EscapeAnalysis. | |
| EscapeState | back to summary |
|---|---|
| private EscapeState() | |
| valueOf | back to summary |
|---|---|
| public static EscapeAnalysis. | |
| values | back to summary |
|---|---|
| public static EscapeAnalysis. | |