Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java @ 2703:42450f536d24
More cleanup towards separation of graphbuilding<>graph<>lirgeneration
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 18 May 2011 17:04:47 +0200 |
parents | d06cff53b77e |
children | efbdb3ea95c9 |
comparison
equal
deleted
inserted
replaced
2702:618f545fcac5 | 2703:42450f536d24 |
---|---|
458 newState.setupPhiForLocal(this, i); | 458 newState.setupPhiForLocal(this, i); |
459 } | 459 } |
460 } | 460 } |
461 } | 461 } |
462 | 462 |
463 public boolean isBackwardBranchTarget() { | |
464 return checkBlockFlag(BlockFlag.BackwardBranchTarget); | |
465 } | |
466 | |
467 public void setBackwardBranchTarget(boolean value) { | |
468 setBlockFlag(BlockFlag.BackwardBranchTarget, value); | |
469 } | |
470 | |
471 public boolean isCriticalEdgeSplit() { | 463 public boolean isCriticalEdgeSplit() { |
472 return checkBlockFlag(BlockFlag.CriticalEdgeSplit); | 464 return checkBlockFlag(BlockFlag.CriticalEdgeSplit); |
473 } | 465 } |
474 | 466 |
475 public void setCriticalEdgeSplit(boolean value) { | 467 public void setCriticalEdgeSplit(boolean value) { |
510 | 502 |
511 public boolean isLinearScanLoopHeader() { | 503 public boolean isLinearScanLoopHeader() { |
512 return checkBlockFlag(BlockFlag.LinearScanLoopHeader); | 504 return checkBlockFlag(BlockFlag.LinearScanLoopHeader); |
513 } | 505 } |
514 | 506 |
515 public void setLinearScanLoopHeader(boolean value) { | |
516 setBlockFlag(BlockFlag.LinearScanLoopHeader, value); | |
517 } | |
518 | |
519 public boolean isLinearScanLoopEnd() { | 507 public boolean isLinearScanLoopEnd() { |
520 return checkBlockFlag(BlockFlag.LinearScanLoopEnd); | 508 return checkBlockFlag(BlockFlag.LinearScanLoopEnd); |
521 } | |
522 | |
523 public void setLinearScanLoopEnd(boolean value) { | |
524 setBlockFlag(BlockFlag.LinearScanLoopEnd, value); | |
525 } | 509 } |
526 | 510 |
527 private void setBlockFlag(BlockFlag flag, boolean value) { | 511 private void setBlockFlag(BlockFlag flag, boolean value) { |
528 if (value) { | 512 if (value) { |
529 setBlockFlag(flag); | 513 setBlockFlag(flag); |
530 } else { | 514 } else { |
531 clearBlockFlag(flag); | 515 clearBlockFlag(flag); |
532 } | 516 } |
533 } | |
534 | |
535 public void copyBlockFlags(BlockBegin other) { | |
536 copyBlockFlag(other, BlockBegin.BlockFlag.ParserLoopHeader); | |
537 copyBlockFlag(other, BlockBegin.BlockFlag.ExceptionEntry); | |
538 copyBlockFlag(other, BlockBegin.BlockFlag.WasVisited); | |
539 } | 517 } |
540 | 518 |
541 @Override | 519 @Override |
542 public String toString() { | 520 public String toString() { |
543 StringBuilder builder = new StringBuilder(); | 521 StringBuilder builder = new StringBuilder(); |
639 public BlockEnd predAt(int j) { | 617 public BlockEnd predAt(int j) { |
640 // assert predecessors.get(j) == predecessors().get(j); | 618 // assert predecessors.get(j) == predecessors().get(j); |
641 return predecessors.get(j); | 619 return predecessors.get(j); |
642 } | 620 } |
643 | 621 |
644 public int firstLirInstructionId() { | |
645 return lirBlock.firstLirInstructionID; | |
646 } | |
647 | |
648 public void setFirstLirInstructionId(int firstLirInstructionId) { | |
649 lirBlock.firstLirInstructionID = firstLirInstructionId; | |
650 } | |
651 | |
652 public int lastLirInstructionId() { | |
653 return lirBlock.lastLirInstructionID; | |
654 } | |
655 | |
656 public void setLastLirInstructionId(int lastLirInstructionId) { | |
657 lirBlock.lastLirInstructionID = lastLirInstructionId; | |
658 } | |
659 | |
660 public boolean isPredecessor(BlockEnd block) { | 622 public boolean isPredecessor(BlockEnd block) { |
661 // assert predecessors.contains(block) == predecessors().contains(block); | 623 // assert predecessors.contains(block) == predecessors().contains(block); |
662 return predecessors.contains(block); | 624 return predecessors.contains(block); |
663 } | 625 } |
664 | 626 |
672 if (isExceptionEntry()) { | 634 if (isExceptionEntry()) { |
673 sb.append('E'); | 635 sb.append('E'); |
674 } | 636 } |
675 if (isParserLoopHeader()) { | 637 if (isParserLoopHeader()) { |
676 sb.append("LH"); | 638 sb.append("LH"); |
677 } | |
678 if (isBackwardBranchTarget()) { | |
679 sb.append('b'); | |
680 } | 639 } |
681 if (wasVisited()) { | 640 if (wasVisited()) { |
682 sb.append('V'); | 641 sb.append('V'); |
683 } | 642 } |
684 if (sb.length() != 0) { | 643 if (sb.length() != 0) { |