119 field->print_name_on(st);
120 }
121 st->print(", idx=%d;", atp->index());
122 }
123 }
124 }
125
126 extern void print_alias_types();
127
128 #endif
129
130 Node *MemNode::optimize_simple_memory_chain(Node *mchain, const TypeOopPtr *t_oop, Node *load, PhaseGVN *phase) {
131 assert((t_oop != NULL), "sanity");
132 bool is_instance = t_oop->is_known_instance_field();
133 bool is_boxed_value_load = t_oop->is_ptr_to_boxed_value() &&
134 (load != NULL) && load->is_Load() &&
135 (phase->is_IterGVN() != NULL);
136 if (!(is_instance || is_boxed_value_load))
137 return mchain; // don't try to optimize non-instance types
138 uint instance_id = t_oop->instance_id();
139 Node *start_mem = phase->C->start()->proj_out(TypeFunc::Memory);
140 Node *prev = NULL;
141 Node *result = mchain;
142 while (prev != result) {
143 prev = result;
144 if (result == start_mem)
145 break; // hit one of our sentinels
146 // skip over a call which does not affect this memory slice
147 if (result->is_Proj() && result->as_Proj()->_con == TypeFunc::Memory) {
148 Node *proj_in = result->in(0);
149 if (proj_in->is_Allocate() && proj_in->_idx == instance_id) {
150 break; // hit one of our sentinels
151 } else if (proj_in->is_Call()) {
152 // ArrayCopyNodes processed here as well
153 CallNode *call = proj_in->as_Call();
154 if (!call->may_modify(t_oop, phase)) { // returns false for instances
155 result = call->in(TypeFunc::Memory);
156 }
157 } else if (proj_in->is_Initialize()) {
158 AllocateNode* alloc = proj_in->as_Initialize()->allocation();
159 // Stop if this is the initialization for the object instance which
|
119 field->print_name_on(st);
120 }
121 st->print(", idx=%d;", atp->index());
122 }
123 }
124 }
125
126 extern void print_alias_types();
127
128 #endif
129
130 Node *MemNode::optimize_simple_memory_chain(Node *mchain, const TypeOopPtr *t_oop, Node *load, PhaseGVN *phase) {
131 assert((t_oop != NULL), "sanity");
132 bool is_instance = t_oop->is_known_instance_field();
133 bool is_boxed_value_load = t_oop->is_ptr_to_boxed_value() &&
134 (load != NULL) && load->is_Load() &&
135 (phase->is_IterGVN() != NULL);
136 if (!(is_instance || is_boxed_value_load))
137 return mchain; // don't try to optimize non-instance types
138 uint instance_id = t_oop->instance_id();
139 Node *start_mem = phase->C->start()->proj_out_or_null(TypeFunc::Memory);
140 Node *prev = NULL;
141 Node *result = mchain;
142 while (prev != result) {
143 prev = result;
144 if (result == start_mem)
145 break; // hit one of our sentinels
146 // skip over a call which does not affect this memory slice
147 if (result->is_Proj() && result->as_Proj()->_con == TypeFunc::Memory) {
148 Node *proj_in = result->in(0);
149 if (proj_in->is_Allocate() && proj_in->_idx == instance_id) {
150 break; // hit one of our sentinels
151 } else if (proj_in->is_Call()) {
152 // ArrayCopyNodes processed here as well
153 CallNode *call = proj_in->as_Call();
154 if (!call->may_modify(t_oop, phase)) { // returns false for instances
155 result = call->in(TypeFunc::Memory);
156 }
157 } else if (proj_in->is_Initialize()) {
158 AllocateNode* alloc = proj_in->as_Initialize()->allocation();
159 // Stop if this is the initialization for the object instance which
|