Class JSRInlinerAdapter.Instantiation
- java.lang.Object
-
- Enclosing class:
- JSRInlinerAdapter
private class JSRInlinerAdapter.Instantiation extends java.util.AbstractMap<LabelNode,LabelNode>
An instantiation of a subroutine.
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description Instantiation(JSRInlinerAdapter.Instantiation parent, java.util.BitSet subroutineInsns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, isEmpty, keySet, put, putAll, remove, size, toString, values
-
-
-
-
Field Detail
-
parent
final JSRInlinerAdapter.Instantiation parent
The instantiation from which this one was created (or null for the instantiation of the main "subroutine").
-
subroutineInsns
final java.util.BitSet subroutineInsns
The original instructions that belong to the subroutine which is instantiated. Bit i is set iff instruction at index i belongs to this subroutine.
-
clonedLabels
final 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.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.
-
returnLabel
final LabelNode returnLabel
The return label for this instantiation, to which all original returns will be mapped.
-
-
Constructor Detail
-
Instantiation
Instantiation(JSRInlinerAdapter.Instantiation parent, java.util.BitSet subroutineInsns)
-
-
Method Detail
-
findOwner
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.Typically, the return value is either
this
ornull
.this
indicates that this instantiation will generate the version of this instruction that we will execute, andnull
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).
- Parameters:
insnIndex
- the index of an instruction in the original code.- Returns:
- the "owner" of a particular instruction relative to this instantiation.
-
getClonedLabelForJumpInsn
LabelNode getClonedLabelForJumpInsn(LabelNode labelNode)
Returns the clone of the given original label that is appropriate for use in a jump instruction.- Parameters:
labelNode
- a label of the original code.- Returns:
- a clone of the given label for use in a jump instruction in the inlined code.
-
getClonedLabel
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.- Parameters:
labelNode
- a label of the original code.- Returns:
- a clone of the given label for use by a try/catch block or a variable annotation in the inlined code.
-
get
public LabelNode get(java.lang.Object key)
-
equals
public boolean equals(java.lang.Object other)
-
-