use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class I2F 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.FLOAT, object.getValue().cast(float.class));
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class I2S 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);
// sign extended
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.InstructionContext in project runelite by runelite.
the class IAnd 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();
result = new Value(i1 & i2);
}
StackContext ctx = new StackContext(ins, Type.INT, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class IInc method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Variables var = frame.getVariables();
VariableContext vctx = var.get(index);
assert vctx.getType().isStackInt();
ins.read(vctx);
Value value = vctx.getValue();
if (!vctx.getValue().isUnknownOrNull()) {
int i = (int) vctx.getValue().getValue();
i += inc;
value = new Value(i);
}
vctx = new VariableContext(ins, Type.INT, value);
var.set(index, vctx);
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class IMul 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();
result = new Value(i1 * i2);
}
StackContext ctx = new StackContext(ins, Type.INT, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
Aggregations