Search in sources :

Example 96 with InstructionContext

use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.

the class Return 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);
    frame.stop();
    return ins;
}
Also used : InstructionContext(net.runelite.asm.execution.InstructionContext) StackContext(net.runelite.asm.execution.StackContext) Stack(net.runelite.asm.execution.Stack)

Example 97 with InstructionContext

use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.

the class SALoad 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);
    // sign extend
    StackContext ctx = new StackContext(ins, Type.INT, array.getValue().arrayGet(index.getValue()).cast(int.class));
    stack.push(ctx);
    ins.push(ctx);
    return ins;
}
Also used : InstructionContext(net.runelite.asm.execution.InstructionContext) StackContext(net.runelite.asm.execution.StackContext) Stack(net.runelite.asm.execution.Stack)

Example 98 with InstructionContext

use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.

the class SAStore method execute.

@Override
public InstructionContext execute(Frame frame) {
    InstructionContext ins = new InstructionContext(this, frame);
    Stack stack = frame.getStack();
    StackContext value = stack.pop();
    StackContext index = stack.pop();
    StackContext array = stack.pop();
    ins.pop(value, index, array);
    array.getValue().arraySet(index.getValue(), value.getValue());
    return ins;
}
Also used : InstructionContext(net.runelite.asm.execution.InstructionContext) StackContext(net.runelite.asm.execution.StackContext) Stack(net.runelite.asm.execution.Stack)

Example 99 with InstructionContext

use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.

the class SiPush method execute.

@Override
public InstructionContext execute(Frame frame) {
    InstructionContext ins = new InstructionContext(this, frame);
    Stack stack = frame.getStack();
    // sign extend
    StackContext ctx = new StackContext(ins, Type.INT, new Value((int) s));
    stack.push(ctx);
    ins.push(ctx);
    return ins;
}
Also used : InstructionContext(net.runelite.asm.execution.InstructionContext) StackContext(net.runelite.asm.execution.StackContext) Value(net.runelite.asm.execution.Value) Stack(net.runelite.asm.execution.Stack)

Example 100 with InstructionContext

use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.

the class Swap method getOriginal.

public StackContext getOriginal(StackContext sctx) {
    // sctx = stack pushed by this instruction, return stack popped by this instruction
    InstructionContext ctx = sctx.getPushed();
    assert ctx.getInstruction() == this;
    int idx = ctx.getPushes().indexOf(sctx);
    assert idx == 0 || idx == 1;
    return ctx.getPops().get(idx);
}
Also used : InstructionContext(net.runelite.asm.execution.InstructionContext)

Aggregations

InstructionContext (net.runelite.asm.execution.InstructionContext)179 StackContext (net.runelite.asm.execution.StackContext)153 Stack (net.runelite.asm.execution.Stack)120 Value (net.runelite.asm.execution.Value)48 Field (net.runelite.asm.Field)18 Instruction (net.runelite.asm.attributes.code.Instruction)18 Variables (net.runelite.asm.execution.Variables)16 GetFieldInstruction (net.runelite.asm.attributes.code.instruction.types.GetFieldInstruction)15 VariableContext (net.runelite.asm.execution.VariableContext)14 Instructions (net.runelite.asm.attributes.code.Instructions)12 Frame (net.runelite.asm.execution.Frame)12 PushConstantInstruction (net.runelite.asm.attributes.code.instruction.types.PushConstantInstruction)11 Execution (net.runelite.asm.execution.Execution)11 LVTInstruction (net.runelite.asm.attributes.code.instruction.types.LVTInstruction)9 InvokeInstruction (net.runelite.asm.attributes.code.instruction.types.InvokeInstruction)8 IMul (net.runelite.asm.attributes.code.instructions.IMul)7 ClassFile (net.runelite.asm.ClassFile)6 Method (net.runelite.asm.Method)6 Label (net.runelite.asm.attributes.code.Label)6 DupInstruction (net.runelite.asm.attributes.code.instruction.types.DupInstruction)6