use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class L2D 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, Type.DOUBLE, object.getValue().cast(double.class));
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class LALoad 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.LONG, array.getValue().arrayGet(index.getValue()).cast(long.class));
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class L2I 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, Type.INT, object.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 LAdd 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.StackContext in project runelite by runelite.
the class IRem 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()) {
int i2 = (int) two.getValue().getValue(), i1 = (int) one.getValue().getValue();
if (i2 != 0)
result = new Value(i1 % i2);
}
StackContext ctx = new StackContext(ins, Type.INT, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
Aggregations