comparison src/share/vm/opto/machnode.cpp @ 216:8d191a7697e2

6715633: when matching a memory node the adr_type should not change Summary: verify the adr_type of a mach node was not changed Reviewed-by: rasbold, never
author kvn
date Fri, 20 Jun 2008 11:10:05 -0700
parents ba764ed4b6f2
children 1e026f8da827
comparison
equal deleted inserted replaced
215:273eaa04d9a1 216:8d191a7697e2
260 intptr_t disp = oper->constant_disp(); 260 intptr_t disp = oper->constant_disp();
261 int scale = oper->scale(); 261 int scale = oper->scale();
262 // Now we have collected every part of the ADLC MEMORY_INTER. 262 // Now we have collected every part of the ADLC MEMORY_INTER.
263 // See if it adds up to a base + offset. 263 // See if it adds up to a base + offset.
264 if (index != NULL) { 264 if (index != NULL) {
265 if (!index->is_Con()) { 265 const TypeNarrowOop* narrowoop = index->bottom_type()->isa_narrowoop();
266 const TypeNarrowOop* narrowoop = index->bottom_type()->isa_narrowoop(); 266 if (narrowoop != NULL) { // EncodeN, LoadN, LoadConN, LoadNKlass.
267 if (narrowoop != NULL) { 267 // Memory references through narrow oops have a
268 // Memory references through narrow oops have a 268 // funny base so grab the type from the index:
269 // funny base so grab the type from the index. 269 // [R12 + narrow_oop_reg<<3 + offset]
270 adr_type = narrowoop->make_oopptr(); 270 assert(base == NULL, "Memory references through narrow oops have no base");
271 return NULL; 271 offset = disp;
272 } 272 adr_type = narrowoop->make_oopptr()->add_offset(offset);
273 return NULL;
274 } else if (!index->is_Con()) {
273 disp = Type::OffsetBot; 275 disp = Type::OffsetBot;
274 } else if (disp != Type::OffsetBot) { 276 } else if (disp != Type::OffsetBot) {
275 const TypeX* ti = index->bottom_type()->isa_intptr_t(); 277 const TypeX* ti = index->bottom_type()->isa_intptr_t();
276 if (ti == NULL) { 278 if (ti == NULL) {
277 disp = Type::OffsetBot; // a random constant?? 279 disp = Type::OffsetBot; // a random constant??