485 }
486 for (int i = 0; i < srcAndRefPositions.length; ++i) {
487 if ((srcAndRefPositions[i] & block.srcAndRefPositions[i]) != 0) {
488 return true;
489 }
490 }
491 return false;
492 }
493
494 /**
495 * Marks this basic block as belonging to the given subroutine.
496 *
497 * @param id
498 * a subroutine id.
499 * @param nbSubroutines
500 * the total number of subroutines in the method.
501 */
502 void addToSubroutine(final long id, final int nbSubroutines) {
503 if ((status & VISITED) == 0) {
504 status |= VISITED;
505 srcAndRefPositions = new int[(nbSubroutines - 1) / 32 + 1];
506 }
507 srcAndRefPositions[(int) (id >>> 32)] |= (int) id;
508 }
509
510 /**
511 * Finds the basic blocks that belong to a given subroutine, and marks these
512 * blocks as belonging to this subroutine. This method follows the control
513 * flow graph to find all the blocks that are reachable from the current
514 * block WITHOUT following any JSR target.
515 *
516 * @param JSR
517 * a JSR block that jumps to this subroutine. If this JSR is not
518 * null it is added to the successor of the RET blocks found in
519 * the subroutine.
520 * @param id
521 * the id of this subroutine.
522 * @param nbSubroutines
523 * the total number of subroutines in the method.
524 */
525 void visitSubroutine(final Label JSR, final long id, final int nbSubroutines) {
|
485 }
486 for (int i = 0; i < srcAndRefPositions.length; ++i) {
487 if ((srcAndRefPositions[i] & block.srcAndRefPositions[i]) != 0) {
488 return true;
489 }
490 }
491 return false;
492 }
493
494 /**
495 * Marks this basic block as belonging to the given subroutine.
496 *
497 * @param id
498 * a subroutine id.
499 * @param nbSubroutines
500 * the total number of subroutines in the method.
501 */
502 void addToSubroutine(final long id, final int nbSubroutines) {
503 if ((status & VISITED) == 0) {
504 status |= VISITED;
505 srcAndRefPositions = new int[nbSubroutines / 32 + 1];
506 }
507 srcAndRefPositions[(int) (id >>> 32)] |= (int) id;
508 }
509
510 /**
511 * Finds the basic blocks that belong to a given subroutine, and marks these
512 * blocks as belonging to this subroutine. This method follows the control
513 * flow graph to find all the blocks that are reachable from the current
514 * block WITHOUT following any JSR target.
515 *
516 * @param JSR
517 * a JSR block that jumps to this subroutine. If this JSR is not
518 * null it is added to the successor of the RET blocks found in
519 * the subroutine.
520 * @param id
521 * the id of this subroutine.
522 * @param nbSubroutines
523 * the total number of subroutines in the method.
524 */
525 void visitSubroutine(final Label JSR, final long id, final int nbSubroutines) {
|