From dc58eb6c6610dd1f9d954067fc7057391f8bfb1e Mon Sep 17 00:00:00 2001 From: cfang Date: Thu, 2 Jul 2009 16:18:19 -0700 Subject: [PATCH] 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 --- src/share/vm/opto/loopopts.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/share/vm/opto/loopopts.cpp b/src/share/vm/opto/loopopts.cpp index 454c207fd..5084e3d82 100644 --- a/src/share/vm/opto/loopopts.cpp +++ b/src/share/vm/opto/loopopts.cpp @@ -667,7 +667,6 @@ static bool merge_point_too_heavy(Compile* C, Node* region) { } } -#ifdef _LP64 static bool merge_point_safe(Node* region) { // 4799512: Stop split_if_with_blocks from splitting a block with a ConvI2LNode // having a PhiNode input. This sidesteps the dangerous case where the split @@ -676,20 +675,25 @@ static bool merge_point_safe(Node* region) { // uses. // A better fix for this problem can be found in the BugTraq entry, but // expediency for Mantis demands this hack. + // 6855164: If the merge point has a FastLockNode with a PhiNode input, we stop + // split_if_with_blocks from splitting a block because we could not move around + // the FastLockNode. for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) { Node* n = region->fast_out(i); if (n->is_Phi()) { for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) { Node* m = n->fast_out(j); - if (m->Opcode() == Op_ConvI2L) { + if (m->is_FastLock()) return false; - } +#ifdef _LP64 + if (m->Opcode() == Op_ConvI2L) + return false; +#endif } } } return true; } -#endif //------------------------------place_near_use--------------------------------- @@ -771,12 +775,10 @@ void PhaseIdealLoop::split_if_with_blocks_post( Node *n ) { if( get_loop(n_ctrl->in(j)) != n_loop ) return; -#ifdef _LP64 // Check for safety of the merge point. if( !merge_point_safe(n_ctrl) ) { return; } -#endif // Split compare 'n' through the merge point if it is profitable Node *phi = split_thru_phi( n, n_ctrl, policy ); -- GitLab