use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class LAnd 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 LCmp 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();
if (l1 > l2) {
result = new Value(1);
} else if (l1 == l2) {
result = new Value(0);
} else if (l1 < l2) {
result = new Value(-1);
}
}
StackContext ctx = new StackContext(ins, Type.INT, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class LDC method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext ctx = new StackContext(ins, Type.getType(value), new Value(value));
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class LUShR 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().as(long.class), l1 = (long) two.getValue().as(long.class);
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 MonitorEnter 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);
return ins;
}
Aggregations