use of net.runelite.asm.execution.StackContext 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.StackContext 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);
}
}
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class BAStore 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.StackContext in project runelite by runelite.
the class SubtractionInstruction method map.
@Override
default void map(ParallelExecutorMapping mappings, InstructionContext ctx, InstructionContext other) {
StackContext s1 = ctx.getPops().get(0), s2 = ctx.getPops().get(1);
StackContext o1 = other.getPops().get(0), o2 = other.getPops().get(1);
InstructionContext i1 = MappingExecutorUtil.resolve(s1.getPushed(), s1);
InstructionContext i2 = MappingExecutorUtil.resolve(s2.getPushed(), s2);
InstructionContext io1 = MappingExecutorUtil.resolve(o1.getPushed(), o1);
InstructionContext io2 = MappingExecutorUtil.resolve(o2.getPushed(), o2);
if (i1.getInstruction() instanceof GetFieldInstruction && io1.getInstruction() instanceof GetFieldInstruction) {
GetFieldInstruction f1 = (GetFieldInstruction) i1.getInstruction();
GetFieldInstruction f2 = (GetFieldInstruction) io1.getInstruction();
Field fi1 = f1.getMyField(), fi2 = f2.getMyField();
assert MappingExecutorUtil.isMaybeEqual(fi1, fi2);
if (fi1 != null && fi2 != null) {
mappings.map((Instruction) this, fi1, fi2);
}
}
if (i2.getInstruction() instanceof GetFieldInstruction && io2.getInstruction() instanceof GetFieldInstruction) {
GetFieldInstruction f1 = (GetFieldInstruction) i2.getInstruction();
GetFieldInstruction f2 = (GetFieldInstruction) io2.getInstruction();
Field fi1 = f1.getMyField(), fi2 = f2.getMyField();
assert MappingExecutorUtil.isMaybeEqual(fi1, fi2);
if (fi1 != null && fi2 != null) {
mappings.map((Instruction) this, fi1, fi2);
}
}
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class AConstNull method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext ctx = new StackContext(ins, Type.OBJECT, Value.NULL);
stack.push(ctx);
ins.push(ctx);
return ins;
}
Aggregations