Class InsnContext


  • public final class InsnContext
    extends Object
    Records one execution of one Instruction by the abstract Execution - its operand-stack pops and pushes (with def-use links back to the InsnContext that produced each value) and its local reads.
    • Constructor Detail

      • InsnContext

        public InsnContext​(Instruction insn,
                           Frame frame)
        Creates a context for one execution of an instruction within a frame.
        Parameters:
        insn - the executed instruction
        frame - the frame executing it
    • Method Detail

      • getFrame

        public Frame getFrame()
        Returns:
        the frame
      • getPops

        public List<StackCtx> getPops()
        Returns:
        the popped stack values, in pop order (index 0 = top of stack)
      • getPushes

        public List<StackCtx> getPushes()
        Returns:
        the pushes
      • getReads

        public List<VarCtx> getReads()
        Returns:
        the reads
      • getBranches

        public List<Frame> getBranches()
        Returns:
        the branches
      • pop

        public void pop​(StackCtx... ctx)
        Records each popped stack value and back-links it to this instruction.
        Parameters:
        ctx - the popped stack contexts
      • push

        public void push​(StackCtx... ctx)
        Records the stack values this instruction pushed.
        Parameters:
        ctx - the pushed stack contexts
      • read

        public void read​(VarCtx... ctx)
        Records each read local slot and back-links it to this instruction.
        Parameters:
        ctx - the local-slot contexts read
      • branch

        public void branch​(Frame f)
        Records a frame forked by this instruction at a branch target.
        Parameters:
        f - the forked frame
      • getInstruction

        public Instruction getInstruction()
        Returns:
        the instruction
      • resolve

        public InsnContext resolve()
        Follows def-use to the instruction that actually produced this context's value.
        Returns:
        the producing context, or this one when the chain ends here