Search in sources :

Example 91 with StackContext

use of net.runelite.asm.execution.StackContext 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 92 with StackContext

use of net.runelite.asm.execution.StackContext 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 93 with StackContext

use of net.runelite.asm.execution.StackContext 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 94 with StackContext

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

the class TableSwitch 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);
    for (Label i : branchi) {
        Frame other = frame.dup();
        other.jump(ins, i);
        ins.branch(other);
    }
    frame.jump(ins, defi);
    return ins;
}
Also used : InstructionContext(net.runelite.asm.execution.InstructionContext) Frame(net.runelite.asm.execution.Frame) StackContext(net.runelite.asm.execution.StackContext) Label(net.runelite.asm.attributes.code.Label) Stack(net.runelite.asm.execution.Stack)

Example 95 with StackContext

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

the class CastNull method visit.

private void visit(InstructionContext ictx) {
    if (!(ictx.getInstruction() instanceof CheckCast))
        return;
    if (notInteresting.contains(ictx.getInstruction()) || interesting.contains(ictx.getInstruction()))
        return;
    StackContext sctx = ictx.getPops().get(0);
    if (sctx.getPushed().getInstruction() instanceof AConstNull) {
        interesting.add(ictx.getInstruction());
    } else {
        interesting.remove(ictx.getInstruction());
        notInteresting.add(ictx.getInstruction());
    }
}
Also used : StackContext(net.runelite.asm.execution.StackContext) AConstNull(net.runelite.asm.attributes.code.instructions.AConstNull) CheckCast(net.runelite.asm.attributes.code.instructions.CheckCast)

Aggregations

StackContext (net.runelite.asm.execution.StackContext)162 InstructionContext (net.runelite.asm.execution.InstructionContext)153 Stack (net.runelite.asm.execution.Stack)119 Value (net.runelite.asm.execution.Value)47 Field (net.runelite.asm.Field)15 Variables (net.runelite.asm.execution.Variables)14 VariableContext (net.runelite.asm.execution.VariableContext)13 Instruction (net.runelite.asm.attributes.code.Instruction)12 GetFieldInstruction (net.runelite.asm.attributes.code.instruction.types.GetFieldInstruction)12 Instructions (net.runelite.asm.attributes.code.Instructions)8 PushConstantInstruction (net.runelite.asm.attributes.code.instruction.types.PushConstantInstruction)8 LVTInstruction (net.runelite.asm.attributes.code.instruction.types.LVTInstruction)7 Execution (net.runelite.asm.execution.Execution)7 Frame (net.runelite.asm.execution.Frame)7 DupInstruction (net.runelite.asm.attributes.code.instruction.types.DupInstruction)6 InvokeInstruction (net.runelite.asm.attributes.code.instruction.types.InvokeInstruction)6 Method (net.runelite.asm.pool.Method)5 ClassFile (net.runelite.asm.ClassFile)4 Method (net.runelite.asm.Method)4 Type (net.runelite.asm.Type)4