use of net.runelite.asm.attributes.code.instruction.types.ArrayStoreInstruction in project runelite by runelite.
the class ModArith method getInsInExpr.
private static List<InstructionContext> getInsInExpr(InstructionContext ctx, Set<Instruction> set, boolean imul) {
List<InstructionContext> l = new ArrayList<>();
if (ctx == null || set.contains(ctx.getInstruction())) {
return l;
}
set.add(ctx.getInstruction());
if (imul) {
if (!(ctx.getInstruction() instanceof IMul) & !(ctx.getInstruction() instanceof LMul)) {
l.add(ctx);
return l;
}
} else {
// invoke and array store pops are unrelated to each other
if (ctx.getInstruction() instanceof InvokeInstruction || ctx.getInstruction() instanceof ArrayStoreInstruction || ctx.getInstruction() instanceof ArrayLoad || ctx.getInstruction() instanceof If || ctx.getInstruction() instanceof If0 || ctx.getInstruction() instanceof LCmp || ctx.getInstruction() instanceof DivisionInstruction || ctx.getInstruction() instanceof IShR) {
return l;
}
l.add(ctx);
}
for (StackContext s : ctx.getPops()) {
l.addAll(getInsInExpr(s.getPushed(), set, imul));
}
for (StackContext s : ctx.getPushes()) {
for (InstructionContext i : s.getPopped()) {
l.addAll(getInsInExpr(i, set, imul));
}
}
return l;
}
Aggregations