private class JSRInlinerAdapter.Instantiation extends java.util.AbstractMap<LabelNode,LabelNode>
Modifier and Type | Field and Description |
---|---|
(package private) java.util.Map<LabelNode,LabelNode> |
clonedLabels
A map from labels from the original code to labels pointing at code specific to this
instantiation, for use in remapping try/catch blocks, as well as jumps.
|
(package private) JSRInlinerAdapter.Instantiation |
parent
The instantiation from which this one was created (or null for the instantiation
of the main "subroutine").
|
(package private) LabelNode |
returnLabel
The return label for this instantiation, to which all original returns will be mapped.
|
(package private) java.util.BitSet |
subroutineInsns
The original instructions that belong to the subroutine which is instantiated.
|
Constructor and Description |
---|
Instantiation(JSRInlinerAdapter.Instantiation parent,
java.util.BitSet subroutineInsns) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.util.Map.Entry<LabelNode,LabelNode>> |
entrySet() |
boolean |
equals(java.lang.Object other) |
(package private) JSRInlinerAdapter.Instantiation |
findOwner(int insnIndex)
Returns the "owner" of a particular instruction relative to this instantiation: the owner
refers to the Instantiation which will emit the version of this instruction that we will
execute.
|
LabelNode |
get(java.lang.Object key) |
(package private) LabelNode |
getClonedLabel(LabelNode labelNode)
Returns the clone of the given original label that is appropriate for use by a try/catch
block or a variable annotation.
|
(package private) LabelNode |
getClonedLabelForJumpInsn(LabelNode labelNode)
Returns the clone of the given original label that is appropriate for use in a jump
instruction.
|
int |
hashCode() |
clear, clone, containsKey, containsValue, isEmpty, keySet, put, putAll, remove, size, toString, values
final JSRInlinerAdapter.Instantiation parent
final java.util.BitSet subroutineInsns
final java.util.Map<LabelNode,LabelNode> clonedLabels
Note that in the presence of instructions belonging to several subroutines, we map the target label of a GOTO to the label used by the oldest instantiation (parent instantiations are older than their children). This avoids code duplication during inlining in most cases.
final LabelNode returnLabel
Instantiation(JSRInlinerAdapter.Instantiation parent, java.util.BitSet subroutineInsns)
JSRInlinerAdapter.Instantiation findOwner(int insnIndex)
Typically, the return value is either this
or null
. this
indicates that this instantiation will generate the version of this instruction that
we will execute, and null
indicates that this instantiation never executes the
given instruction.
Sometimes, however, an instruction can belong to multiple subroutines; this is called a shared instruction, and occurs when multiple subroutines branch to common points of control. In this case, the owner is the oldest instantiation which owns the instruction in question (parent instantiations are older than their children).
insnIndex
- the index of an instruction in the original code.LabelNode getClonedLabelForJumpInsn(LabelNode labelNode)
labelNode
- a label of the original code.LabelNode getClonedLabel(LabelNode labelNode)
labelNode
- a label of the original code.public LabelNode get(java.lang.Object key)
public boolean equals(java.lang.Object other)