1.1 --- a/src/share/vm/opto/memnode.cpp Fri Jul 25 16:03:40 2008 -0700 1.2 +++ b/src/share/vm/opto/memnode.cpp Mon Jul 28 17:12:52 2008 -0700 1.3 @@ -94,14 +94,19 @@ 1.4 if (tinst == NULL || !tinst->is_known_instance_field()) 1.5 return mchain; // don't try to optimize non-instance types 1.6 uint instance_id = tinst->instance_id(); 1.7 + Node *start_mem = phase->C->start()->proj_out(TypeFunc::Memory); 1.8 Node *prev = NULL; 1.9 Node *result = mchain; 1.10 while (prev != result) { 1.11 prev = result; 1.12 + if (result == start_mem) 1.13 + break; // hit one of our sentinals 1.14 // skip over a call which does not affect this memory slice 1.15 if (result->is_Proj() && result->as_Proj()->_con == TypeFunc::Memory) { 1.16 Node *proj_in = result->in(0); 1.17 - if (proj_in->is_Call()) { 1.18 + if (proj_in->is_Allocate() && proj_in->_idx == instance_id) { 1.19 + break; // hit one of our sentinals 1.20 + } else if (proj_in->is_Call()) { 1.21 CallNode *call = proj_in->as_Call(); 1.22 if (!call->may_modify(t_adr, phase)) { 1.23 result = call->in(TypeFunc::Memory); 1.24 @@ -115,6 +120,8 @@ 1.25 } 1.26 } else if (proj_in->is_MemBar()) { 1.27 result = proj_in->in(TypeFunc::Memory); 1.28 + } else { 1.29 + assert(false, "unexpected projection"); 1.30 } 1.31 } else if (result->is_MergeMem()) { 1.32 result = step_through_mergemem(phase, result->as_MergeMem(), t_adr, NULL, tty);