Class BranchTarget


  • public class BranchTarget
    extends java.lang.Object
    Wrapper for branch target information. This preserves a snapshot of the stack state for the branch target, allowing it to be matched against the stack state for the branch source.
    Version:
    1.0
    Author:
    Dennis M. Sosnoski
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String[] m_stackTypes
      Stack state for branch target.
      private InstructionHandle m_targetHandle
      Actual wrapped instruction handle.
    • Constructor Summary

      Constructors 
      Constructor Description
      BranchTarget​(InstructionHandle hand, java.lang.String[] types)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) InstructionHandle getInstruction()
      Get actual target instruction.
      (package private) java.lang.String[] getStack()
      Get stack state information.
      (package private) boolean matchStacks​(java.lang.String[] types)
      Matches the branch target stack state against the supplied stack state.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_targetHandle

        private final InstructionHandle m_targetHandle
        Actual wrapped instruction handle.
      • m_stackTypes

        private final java.lang.String[] m_stackTypes
        Stack state for branch target.
    • Constructor Detail

      • BranchTarget

        BranchTarget​(InstructionHandle hand,
                     java.lang.String[] types)
        Constructor.
        Parameters:
        hand - instruction handle
        types - array of types of values on stack
    • Method Detail

      • getInstruction

        InstructionHandle getInstruction()
        Get actual target instruction.
        Returns:
        handle for target instruction
      • getStack

        java.lang.String[] getStack()
        Get stack state information.
        Returns:
        array of type names on stack
      • matchStacks

        boolean matchStacks​(java.lang.String[] types)
        Matches the branch target stack state against the supplied stack state.
        Parameters:
        types - array of types of values on stack
        Returns:
        true if stack states match, false if not