use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class DALoad 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);
StackContext ctx = new StackContext(ins, Type.DOUBLE, array.getValue().arrayGet(index.getValue()).cast(double.class));
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class D2L 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.LONG, value.getValue().cast(long.class));
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class ALoad method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
Variables var = frame.getVariables();
VariableContext vctx = var.get(index);
ins.read(vctx);
StackContext ctx = new StackContext(ins, vctx);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class AStore method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
Variables variables = frame.getVariables();
StackContext object = stack.pop();
ins.pop(object);
variables.set(index, new VariableContext(ins, object));
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class ArrayStore method map.
@Override
public void map(ParallelExecutorMapping mapping, InstructionContext ctx, InstructionContext other) {
assert ctx.getInstruction().getClass() == other.getInstruction().getClass();
Field myField = this.getMyField(ctx), otherField = ((ArrayStore) other.getInstruction()).getMyField(other);
mapping.map(this, myField, otherField);
// map value
StackContext // value set to.
object1 = ctx.getPops().get(0), object2 = other.getPops().get(0);
InstructionContext base1 = MappingExecutorUtil.resolve(object1.getPushed(), object1);
InstructionContext base2 = MappingExecutorUtil.resolve(object2.getPushed(), object2);
if (base1.getInstruction() instanceof GetFieldInstruction && base2.getInstruction() instanceof GetFieldInstruction) {
GetFieldInstruction gf1 = (GetFieldInstruction) base1.getInstruction(), gf2 = (GetFieldInstruction) base2.getInstruction();
Field f1 = gf1.getMyField(), f2 = gf2.getMyField();
assert MappingExecutorUtil.isMaybeEqual(f1, f2);
if (f1 != null && f2 != null) {
mapping.map(this, f1, f2);
}
}
}
Aggregations