use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class DStore method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
Variables variables = frame.getVariables();
StackContext value = stack.pop();
ins.pop(value);
variables.set(index, new VariableContext(ins, value));
return ins;
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class Dup method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext obj = stack.pop();
ins.pop(obj);
StackContext ctx = new StackContext(ins, obj.getType(), obj.getValue());
stack.push(ctx);
ins.push(ctx);
ctx = new StackContext(ins, obj.getType(), obj.getValue());
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class Dup method getOtherBranch.
@Override
public StackContext getOtherBranch(StackContext sctx) {
InstructionContext ctx = sctx.getPushed();
assert ctx.getInstruction() == this;
List<StackContext> pushes = ctx.getPushes();
assert pushes.contains(sctx);
int idx = pushes.indexOf(sctx);
assert idx == 0 || idx == 1;
return pushes.get(~idx & 1);
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class CALoad method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext index = stack.pop();
StackContext array = stack.pop();
ins.pop(index, array);
// zero extended to int
StackContext ctx = new StackContext(ins, Type.INT, array.getValue().arrayGet(index.getValue()).cast(int.class));
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class CheckCast method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext value = stack.pop();
ins.pop(value);
StackContext ctx = new StackContext(ins, type, value.getValue());
stack.push(ctx);
ins.push(ctx);
return ins;
}
Aggregations