Class StateTransitions
- java.lang.Object
-
- com.tonic.analysis.simulation.util.StateTransitions
-
public final class StateTransitions extends Object
Computes state transitions for IR instructions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SimulationStateapply(SimulationState state, IRInstruction instr)Apply an instruction's effect to the simulation state.static intgetPopCount(IRInstruction instr)Get the number of stack slots an instruction pops.static intgetPushCount(IRInstruction instr)Get the number of stack slots an instruction pushes.
-
-
-
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 instructioninstr- 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
-
-