Class JSRInlinerAdapter.Instantiation

    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • 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.
    • 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
      • 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 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.
    • 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 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).

        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.
      • equals

        public boolean equals​(java.lang.Object other)
        Specified by:
        equals in interface java.util.Map<LabelNode,​LabelNode>
        Overrides:
        equals in class java.util.AbstractMap<LabelNode,​LabelNode>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<LabelNode,​LabelNode>
        Overrides:
        hashCode in class java.util.AbstractMap<LabelNode,​LabelNode>