use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class MonitorExit 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;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class NewArray method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext count = stack.pop();
ins.pop(count);
String t;
switch(type) {
case 4:
t = "[Z";
break;
case 5:
t = "[C";
break;
case 6:
t = "[F";
break;
case 7:
t = "[D";
break;
case 8:
t = "[B";
break;
case 9:
t = "[S";
break;
case 10:
t = "[I";
break;
case 11:
t = "[J";
break;
default:
throw new IllegalStateException("unknown array type " + type);
}
StackContext ctx = new StackContext(ins, new Type(t), Value.newArray(count.getValue()));
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class LDiv 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 (l2 != 0L)
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 LNeg 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);
Value result = Value.UNKNOWN;
if (!value.getValue().isUnknownOrNull()) {
long l = (long) value.getValue().getValue();
result = new Value(-l);
}
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 LShR 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;
}
Aggregations