Class JSRInlinerAdapter.Instantiation
- Enclosing class:
JSRInlinerAdapter
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionA 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) final JSRInlinerAdapter.Instantiation
The instantiation from which this one was created (or null for the instantiation of the main "subroutine").(package private) final LabelNode
The return label for this instantiation, to which all original returns will be mapped.(package private) final BitSet
The original instructions that belong to the subroutine which is instantiated. -
Constructor Summary
ConstructorsConstructorDescriptionInstantiation
(JSRInlinerAdapter.Instantiation parent, BitSet subroutineInsns) -
Method Summary
Modifier and TypeMethodDescriptionentrySet()
boolean
(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.(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
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
parent
The instantiation from which this one was created (or null for the instantiation of the main "subroutine"). -
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
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
The return label for this instantiation, to which all original returns will be mapped.
-
-
Constructor Details
-
Instantiation
Instantiation(JSRInlinerAdapter.Instantiation parent, BitSet subroutineInsns)
-
-
Method Details
-
findOwner
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
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
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.
-
entrySet
-
get
-
equals
-
hashCode
public int hashCode()
-