Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/memnode.cpp @ 253:b0fe4deeb9fb
6726999: nsk/stress/jck12a/jck12a010 assert(n != null,"Bad immediate dominator info.")
Summary: Escape Analysis fixes.
Reviewed-by: never, rasbold
author | kvn |
---|---|
date | Mon, 28 Jul 2008 17:12:52 -0700 |
parents | 02a35ad4adf8 |
children | c3e045194476 |
comparison
equal
deleted
inserted
replaced
252:be7facf71163 | 253:b0fe4deeb9fb |
---|---|
92 Node *MemNode::optimize_simple_memory_chain(Node *mchain, const TypePtr *t_adr, PhaseGVN *phase) { | 92 Node *MemNode::optimize_simple_memory_chain(Node *mchain, const TypePtr *t_adr, PhaseGVN *phase) { |
93 const TypeOopPtr *tinst = t_adr->isa_oopptr(); | 93 const TypeOopPtr *tinst = t_adr->isa_oopptr(); |
94 if (tinst == NULL || !tinst->is_known_instance_field()) | 94 if (tinst == NULL || !tinst->is_known_instance_field()) |
95 return mchain; // don't try to optimize non-instance types | 95 return mchain; // don't try to optimize non-instance types |
96 uint instance_id = tinst->instance_id(); | 96 uint instance_id = tinst->instance_id(); |
97 Node *start_mem = phase->C->start()->proj_out(TypeFunc::Memory); | |
97 Node *prev = NULL; | 98 Node *prev = NULL; |
98 Node *result = mchain; | 99 Node *result = mchain; |
99 while (prev != result) { | 100 while (prev != result) { |
100 prev = result; | 101 prev = result; |
102 if (result == start_mem) | |
103 break; // hit one of our sentinals | |
101 // skip over a call which does not affect this memory slice | 104 // skip over a call which does not affect this memory slice |
102 if (result->is_Proj() && result->as_Proj()->_con == TypeFunc::Memory) { | 105 if (result->is_Proj() && result->as_Proj()->_con == TypeFunc::Memory) { |
103 Node *proj_in = result->in(0); | 106 Node *proj_in = result->in(0); |
104 if (proj_in->is_Call()) { | 107 if (proj_in->is_Allocate() && proj_in->_idx == instance_id) { |
108 break; // hit one of our sentinals | |
109 } else if (proj_in->is_Call()) { | |
105 CallNode *call = proj_in->as_Call(); | 110 CallNode *call = proj_in->as_Call(); |
106 if (!call->may_modify(t_adr, phase)) { | 111 if (!call->may_modify(t_adr, phase)) { |
107 result = call->in(TypeFunc::Memory); | 112 result = call->in(TypeFunc::Memory); |
108 } | 113 } |
109 } else if (proj_in->is_Initialize()) { | 114 } else if (proj_in->is_Initialize()) { |
113 if (alloc != NULL && alloc->_idx != instance_id) { | 118 if (alloc != NULL && alloc->_idx != instance_id) { |
114 result = proj_in->in(TypeFunc::Memory); | 119 result = proj_in->in(TypeFunc::Memory); |
115 } | 120 } |
116 } else if (proj_in->is_MemBar()) { | 121 } else if (proj_in->is_MemBar()) { |
117 result = proj_in->in(TypeFunc::Memory); | 122 result = proj_in->in(TypeFunc::Memory); |
123 } else { | |
124 assert(false, "unexpected projection"); | |
118 } | 125 } |
119 } else if (result->is_MergeMem()) { | 126 } else if (result->is_MergeMem()) { |
120 result = step_through_mergemem(phase, result->as_MergeMem(), t_adr, NULL, tty); | 127 result = step_through_mergemem(phase, result->as_MergeMem(), t_adr, NULL, tty); |
121 } | 128 } |
122 } | 129 } |