use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class Return method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext object = stack.pop();
ins.pop(object);
frame.stop();
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class SALoad 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);
// sign extend
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.InstructionContext in project runelite by runelite.
the class SAStore method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext value = stack.pop();
StackContext index = stack.pop();
StackContext array = stack.pop();
ins.pop(value, index, array);
array.getValue().arraySet(index.getValue(), value.getValue());
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class SiPush method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
// sign extend
StackContext ctx = new StackContext(ins, Type.INT, new Value((int) s));
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class Swap method getOriginal.
public StackContext getOriginal(StackContext sctx) {
// sctx = stack pushed by this instruction, return stack popped by this instruction
InstructionContext ctx = sctx.getPushed();
assert ctx.getInstruction() == this;
int idx = ctx.getPushes().indexOf(sctx);
assert idx == 0 || idx == 1;
return ctx.getPops().get(idx);
}
Aggregations