if (p.getType() == AbstractInsnNode.JUMP_INSN) { JumpInsnNode jump = (JumpInsnNode) p; parentCount[insnList.indexOf(jump.label)]++; TableSwitchInsnNode tsin = (TableSwitchInsnNode) p; for (LabelNode label : tsin.labels) { parentCount[insnList.indexOf(label)]++; parentCount[insnList.indexOf(tsin.dflt)]++; } else { LookupSwitchInsnNode lsin = (LookupSwitchInsnNode) p; for (LabelNode label : lsin.labels) { parentCount[insnList.indexOf(label)]++; parentCount[insnList.indexOf(lsin.dflt)]++; AbstractInsnNode next = p.getNext(); if(next!=null) { parentCount[insnList.indexOf(p.getNext())]++;
int index = insnList.indexOf(p); if (!access.get(index)) { access.set(index); JumpInsnNode jump = (JumpInsnNode) p; stack.push(jump.label); merge(tmp, insnList.indexOf(jump.label)); for (LabelNode label : tsin.labels) { stack.push(label); merge(tmp, insnList.indexOf(label)); merge(tmp, insnList.indexOf(tsin.dflt)); for (LabelNode label : lsin.labels) { stack.push(label); merge(tmp, insnList.indexOf(label)); merge(tmp, insnList.indexOf(lsin.dflt));
target.traps.add(new Trap(getLabel(tcb.start), getLabel(tcb.end), new LabelStmt[]{getLabel(tcb.handler)}, new String[]{tcb.type == null ? null : Type.getObjectType(tcb.type).getDescriptor()})); int handlerIdx = insnList.indexOf(tcb.handler); handlers.set(handlerIdx); BitSet x = exBranch[insnList.indexOf(p)]; if (x == null) { x = exBranch[insnList.indexOf(p)] = new BitSet(insnList.size());
/** * Returns the clone of the given original label that is appropriate for use in a jump * instruction. * * @param labelNode a label of the original code. * @return a clone of the given label for use in a jump instruction in the inlined code. */ LabelNode getClonedLabelForJumpInsn(final LabelNode labelNode) { // findOwner should never return null, because owner is null only if an instruction cannot be // reached from this subroutine. return findOwner(instructions.indexOf(labelNode)).clonedLabels.get(labelNode); }
/** * Returns the clone of the given original label that is appropriate for use in a jump * instruction. * * @param labelNode a label of the original code. * @return a clone of the given label for use in a jump instruction in the inlined code. */ LabelNode getClonedLabelForJumpInsn(final LabelNode labelNode) { // findOwner should never return null, because owner is null only if an instruction cannot be // reached from this subroutine. return findOwner(instructions.indexOf(labelNode)).clonedLabels.get(labelNode); }
Frame getFrameByNode(AbstractInsnNode node) { int insIndex = instructions.indexOf(node); Frame[] frames = analyzer.getFrames(); return null == frames || insIndex >= frames.length ? null : frames[insIndex]; }
/** * Returns the clone of the given original label that is appropriate for use in a jump * instruction. * * @param labelNode a label of the original code. * @return a clone of the given label for use in a jump instruction in the inlined code. */ LabelNode getClonedLabelForJumpInsn(final LabelNode labelNode) { // findOwner should never return null, because owner is null only if an instruction cannot be // reached from this subroutine. return findOwner(instructions.indexOf(labelNode)).clonedLabels.get(labelNode); }
Frame getFrameByNode(AbstractInsnNode node) { int insIndex = instructions.indexOf(node); Frame[] frames = analyzer.getFrames(); return null == frames || insIndex >= frames.length ? null : frames[insIndex]; }
public static void clearNextInstructions(MethodNode methodNode, AbstractInsnNode insnNode) { Iterator<AbstractInsnNode> iterator = methodNode.instructions.iterator(methodNode.instructions.indexOf(insnNode)); while (iterator.hasNext()) { iterator.next(); iterator.remove(); } }
Frame<BasicValue> getFrameByNode(AbstractInsnNode node) { int insIndex = instructions.indexOf(node); Frame<BasicValue>[] frames = analyzer.getFrames(); return null == frames || insIndex >= frames.length ? null : frames[insIndex]; }
/** Determines, for each instruction, to which subroutine(s) it belongs. */ private void findSubroutinesInsns() { // Find the instructions that belong to main subroutine. BitSet visitedInsns = new BitSet(); findSubroutineInsns(0, mainSubroutineInsns, visitedInsns); // For each subroutine, find the instructions that belong to this subroutine. for (Map.Entry<LabelNode, BitSet> entry : subroutinesInsns.entrySet()) { LabelNode jsrLabelNode = entry.getKey(); BitSet subroutineInsns = entry.getValue(); findSubroutineInsns(instructions.indexOf(jsrLabelNode), subroutineInsns, visitedInsns); } }
/** Determines, for each instruction, to which subroutine(s) it belongs. */ private void findSubroutinesInsns() { // Find the instructions that belong to main subroutine. BitSet visitedInsns = new BitSet(); findSubroutineInsns(0, mainSubroutineInsns, visitedInsns); // For each subroutine, find the instructions that belong to this subroutine. for (Map.Entry<LabelNode, BitSet> entry : subroutinesInsns.entrySet()) { LabelNode jsrLabelNode = entry.getKey(); BitSet subroutineInsns = entry.getValue(); findSubroutineInsns(instructions.indexOf(jsrLabelNode), subroutineInsns, visitedInsns); } }
/** Determines, for each instruction, to which subroutine(s) it belongs. */ private void findSubroutinesInsns() { // Find the instructions that belong to main subroutine. BitSet visitedInsns = new BitSet(); findSubroutineInsns(0, mainSubroutineInsns, visitedInsns); // For each subroutine, find the instructions that belong to this subroutine. for (Map.Entry<LabelNode, BitSet> entry : subroutinesInsns.entrySet()) { LabelNode jsrLabelNode = entry.getKey(); BitSet subroutineInsns = entry.getValue(); findSubroutineInsns(instructions.indexOf(jsrLabelNode), subroutineInsns, visitedInsns); } }
public boolean isBooleanOnStack(MethodNode mn, AbstractInsnNode node, int position) { int insnPosition = mn.instructions.indexOf(node); if (insnPosition >= currentFrames.length) { logger.info("Trying to access frame out of scope: " + insnPosition + "/" + currentFrames.length); return false; } Frame frame = currentFrames[insnPosition]; return frame.getStack(frame.getStackSize() - 1 - position) == BooleanValueInterpreter.BOOLEAN_VALUE; }
private int getIndexOfFirstInsn(final InstructionGroup group) { return method.instructions .indexOf(group.getNodes().get(0).getInstruction()); }