/** * Marks the branch targets of the given jump offsets for the instruction * at the given offset. */ private void markBranchTargets(int offset, int[] jumpOffsets) { for (int index = 0; index < jumpOffsets.length; index++) { markBranchTarget(offset, jumpOffsets[index]); } }
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { // Mark the branch origin. markBranchOrigin(offset); // Check if this is the first instruction of a subroutine. checkSubroutine(offset); // Mark the branch targets of the default jump offset. markBranchTarget(offset, switchInstruction.defaultOffset); // Mark the branch targets of the jump offsets. markBranchTargets(offset, switchInstruction.jumpOffsets); // Mark the next instruction. markAfterBranchOrigin(offset + switchInstruction.length(offset)); }
/** * Marks the branch target and its subroutine start at the given offset. */ private void markBranch(int offset, int jumpOffset) { markBranchTarget(offset, jumpOffset); if (currentSubroutineStart != UNKNOWN) { markBranchSubroutineStart(offset, jumpOffset, currentSubroutineStart); } }
/** * Marks the branch target and its subroutine start at the given offset. */ private void markBranch(int offset, int jumpOffset) { markBranchTarget(offset, jumpOffset); if (currentSubroutineStart != UNKNOWN) { markBranchSubroutineStart(offset, jumpOffset, currentSubroutineStart); } }
/** * Marks the branch target and its subroutine start at the given offset. */ private void markBranch(int offset, int jumpOffset) { markBranchTarget(offset, jumpOffset); if (currentSubroutineStart != UNKNOWN) { markBranchSubroutineStart(offset, jumpOffset, currentSubroutineStart); } }
public void visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction) { // Mark the branch origin. markBranchOrigin(offset); // Check if this is the first instruction of a subroutine. checkSubroutine(offset); // Mark the branch target. markBranchTarget(offset, branchInstruction.branchOffset); byte opcode = branchInstruction.opcode; if (opcode == InstructionConstants.OP_JSR || opcode == InstructionConstants.OP_JSR_W) { // Mark the subroutine invocation. instructionMarks[offset] |= SUBROUTINE_INVOCATION; // Mark the subroutine start. int targetOffset = offset + branchInstruction.branchOffset; subroutineStarts[targetOffset] = targetOffset; } else if (opcode == InstructionConstants.OP_GOTO || opcode == InstructionConstants.OP_GOTO_W) { // Mark the next instruction. markAfterBranchOrigin(offset + branchInstruction.length(offset)); } }
markBranchTarget(offset, branchOffset);
markBranchTarget(offset, branchOffset);
markBranchTarget(offset, branchOffset);