use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class LStore 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();
assert value.getType().equals(Type.LONG);
ins.pop(value);
variables.set(index, new VariableContext(ins, value));
return ins;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class LSub method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext two = stack.pop();
StackContext one = stack.pop();
ins.pop(two, one);
Value result = Value.UNKNOWN;
if (!two.getValue().isUnknownOrNull() && !one.getValue().isUnknownOrNull()) {
long l2 = (long) two.getValue().getValue(), l1 = (long) one.getValue().getValue();
result = new Value(l1 - l2);
}
StackContext ctx = new StackContext(ins, Type.LONG, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class InstanceOf 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, Type.INT, Value.UNKNOWN);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class InvokeSpecial method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
int count = method.getType().size();
for (int i = 0; i < count; ++i) {
StackContext arg = stack.pop();
ins.pop(arg);
}
StackContext object = stack.pop();
ins.pop(object);
if (!method.getType().isVoid()) {
StackContext ctx = new StackContext(ins, method.getType().getReturnValue(), Value.UNKNOWN);
stack.push(ctx);
ins.push(ctx);
}
if (myMethod != null) {
ins.invoke(myMethod);
assert myMethod.getCode() != null;
// add possible method call to execution
Execution execution = frame.getExecution();
execution.invoke(ins, myMethod);
frame.getExecution().order(frame, myMethod);
}
return ins;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class GetField 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);
StackContext ctx = new StackContext(ins, field.getType(), Value.UNKNOWN);
stack.push(ctx);
ins.push(ctx);
if (myField != null) {
frame.getExecution().order(frame, myField);
}
return ins;
}
Aggregations