Class StateTransitions


  • public final class StateTransitions
    extends Object
    Computes state transitions for IR instructions.
    • Method Detail

      • apply

        public static SimulationState apply​(SimulationState state,
                                            IRInstruction instr)
        Apply an instruction's effect to the simulation state.
        Parameters:
        state - the current state before the instruction
        instr - the instruction to execute
        Returns:
        the new state after the instruction
      • getPopCount

        public static int getPopCount​(IRInstruction instr)
        Get the number of stack slots an instruction pops.
        Parameters:
        instr - the instruction to size
        Returns:
        the slot count, counting long and double operands as two, 0 for unrecognized forms
      • getPushCount

        public static int getPushCount​(IRInstruction instr)
        Get the number of stack slots an instruction pushes.
        Parameters:
        instr - the instruction to size
        Returns:
        the slot count, counting long and double results as two, 0 for unrecognized forms