Mercurial > hg > graal-compiler
comparison src/share/vm/opto/loopopts.cpp @ 834:0f2d888530e7
6855164: SIGSEGV during compilation of method involving loop over CharSequence.
Summary: Don not split a block if it contains a FastLockNode with a PhiNode input.
Reviewed-by: kvn, never
author | cfang |
---|---|
date | Thu, 02 Jul 2009 16:18:19 -0700 |
parents | 98cb887364d3 |
children | bd02caa94611 fd50a67f97d1 |
comparison
equal
deleted
inserted
replaced
833:acba6af809c8 | 834:0f2d888530e7 |
---|---|
665 } else { | 665 } else { |
666 return false; | 666 return false; |
667 } | 667 } |
668 } | 668 } |
669 | 669 |
670 #ifdef _LP64 | |
671 static bool merge_point_safe(Node* region) { | 670 static bool merge_point_safe(Node* region) { |
672 // 4799512: Stop split_if_with_blocks from splitting a block with a ConvI2LNode | 671 // 4799512: Stop split_if_with_blocks from splitting a block with a ConvI2LNode |
673 // having a PhiNode input. This sidesteps the dangerous case where the split | 672 // having a PhiNode input. This sidesteps the dangerous case where the split |
674 // ConvI2LNode may become TOP if the input Value() does not | 673 // ConvI2LNode may become TOP if the input Value() does not |
675 // overlap the ConvI2L range, leaving a node which may not dominate its | 674 // overlap the ConvI2L range, leaving a node which may not dominate its |
676 // uses. | 675 // uses. |
677 // A better fix for this problem can be found in the BugTraq entry, but | 676 // A better fix for this problem can be found in the BugTraq entry, but |
678 // expediency for Mantis demands this hack. | 677 // expediency for Mantis demands this hack. |
678 // 6855164: If the merge point has a FastLockNode with a PhiNode input, we stop | |
679 // split_if_with_blocks from splitting a block because we could not move around | |
680 // the FastLockNode. | |
679 for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) { | 681 for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) { |
680 Node* n = region->fast_out(i); | 682 Node* n = region->fast_out(i); |
681 if (n->is_Phi()) { | 683 if (n->is_Phi()) { |
682 for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) { | 684 for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) { |
683 Node* m = n->fast_out(j); | 685 Node* m = n->fast_out(j); |
684 if (m->Opcode() == Op_ConvI2L) { | 686 if (m->is_FastLock()) |
685 return false; | 687 return false; |
686 } | 688 #ifdef _LP64 |
689 if (m->Opcode() == Op_ConvI2L) | |
690 return false; | |
691 #endif | |
687 } | 692 } |
688 } | 693 } |
689 } | 694 } |
690 return true; | 695 return true; |
691 } | 696 } |
692 #endif | |
693 | 697 |
694 | 698 |
695 //------------------------------place_near_use--------------------------------- | 699 //------------------------------place_near_use--------------------------------- |
696 // Place some computation next to use but not inside inner loops. | 700 // Place some computation next to use but not inside inner loops. |
697 // For inner loop uses move it to the preheader area. | 701 // For inner loop uses move it to the preheader area. |
769 IdealLoopTree *n_loop = get_loop(n_ctrl); | 773 IdealLoopTree *n_loop = get_loop(n_ctrl); |
770 for( uint j = 1; j < n_ctrl->req(); j++ ) | 774 for( uint j = 1; j < n_ctrl->req(); j++ ) |
771 if( get_loop(n_ctrl->in(j)) != n_loop ) | 775 if( get_loop(n_ctrl->in(j)) != n_loop ) |
772 return; | 776 return; |
773 | 777 |
774 #ifdef _LP64 | |
775 // Check for safety of the merge point. | 778 // Check for safety of the merge point. |
776 if( !merge_point_safe(n_ctrl) ) { | 779 if( !merge_point_safe(n_ctrl) ) { |
777 return; | 780 return; |
778 } | 781 } |
779 #endif | |
780 | 782 |
781 // Split compare 'n' through the merge point if it is profitable | 783 // Split compare 'n' through the merge point if it is profitable |
782 Node *phi = split_thru_phi( n, n_ctrl, policy ); | 784 Node *phi = split_thru_phi( n, n_ctrl, policy ); |
783 if( !phi ) return; | 785 if( !phi ) return; |
784 | 786 |