/** * pops 2 operands from the stack */ public StackFrame pop2() { StackState ns = stackState.pop(2); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * pushes a null type onto the stack * * @return */ public StackFrame aconstNull() { StackState ns = stackState.aconstNull(); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * push an operand of the given type onto the stack * <p> * If the entry is wide then a corresponding TOP type will be created */ public StackFrame push(String type) { StackState ns = stackState.push(type); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * pops 3 operands from the stack */ public StackFrame pop3() { StackState ns = stackState.pop(3); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * pops an operand from the stack */ public StackFrame pop() { StackState ns = stackState.pop(1); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * pops 3 operands from the stack */ public StackFrame pop3() { StackState ns = stackState.pop(3); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * push an operand of the given type onto the stack * <p> * If the entry is wide then a corresponding TOP type will be created */ public StackFrame push(String type) { StackState ns = stackState.push(type); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * marks the value in potition initializedValueStackPosition as initialized. This also pops this value and everything above * it */ public StackFrame constructorCall(int initializedValueStackPosition) { StackEntry entry = stackState.getContents().get(stackState.getContents().size() - 1 - initializedValueStackPosition); StackState ns = stackState.constructorCall(initializedValueStackPosition, entry); LocalVariableState locals = localVariableState.constructorCall(entry); return new StackFrame(ns, locals, StackFrameType.FULL_FRAME); }
/** * marks the value in potition initializedValueStackPosition as initialized. This also pops this value and everything above * it */ public StackFrame constructorCall(int initializedValueStackPosition) { StackEntry entry = stackState.getContents().get(stackState.getContents().size() - 1 - initializedValueStackPosition); StackState ns = stackState.constructorCall(initializedValueStackPosition, entry); LocalVariableState locals = localVariableState.constructorCall(entry); return new StackFrame(ns, locals, StackFrameType.FULL_FRAME); }
/** * marks the value in potition initializedValueStackPosition as initialized. This also pops this value and everything above * it */ public StackFrame constructorCall(int initializedValueStackPosition) { StackEntry entry = stackState.getContents().get(stackState.getContents().size() - 1 - initializedValueStackPosition); StackState ns = stackState.constructorCall(initializedValueStackPosition, entry); LocalVariableState locals = localVariableState.constructorCall(entry); return new StackFrame(ns, locals, StackFrameType.FULL_FRAME); }
/** * remote the top two operands and replace them with an different operand * */ public StackFrame pop2push1(String type) { StackState ns = stackState.pop(2).push(type); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * replace the operand at the top of the stack with the given operand */ public StackFrame replace(String type) { // TODO: inefficinet StackState ns = stackState.pop(1).push(type); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * remote the top two operands and replace them with an different operand * */ public StackFrame pop4push1(String type) { StackState ns = stackState.pop(4).push(type); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * remote the top two operands and replace them with an different operand * */ public StackFrame pop2push1(String type) { StackState ns = stackState.pop(2).push(type); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * remote the top two operands and replace them with an different operand * */ public StackFrame pop2push1(String type) { StackState ns = stackState.pop(2).push(type); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * remote the top two operands and replace them with an different operand * */ public StackFrame pop4push1(String type) { StackState ns = stackState.pop(4).push(type); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * replace the operand at the top of the stack with the given operand */ public StackFrame replace(String type) { // TODO: inefficinet StackState ns = stackState.pop(1).push(type); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * replace the operand at the top of the stack with the given operand */ public StackFrame replace(String type) { // TODO: inefficinet StackState ns = stackState.pop(1).push(type); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
/** * remote the top two operands and replace them with an different operand * */ public StackFrame pop4push1(String type) { StackState ns = stackState.pop(4).push(type); return new StackFrame(ns, localVariableState, typeNoLocalChange(ns)); }
public void setupFrame(String... types) { final LocalVariableState localVariableState = new LocalVariableState(constPool, types); final StackFrame f = new StackFrame(new StackState(constPool), localVariableState, StackFrameType.FULL_FRAME); mergeStackFrames(f); }