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 const TypeNarrowOop* narrowoop = index->bottom_type()->isa_narrowoop(); |
265 const Type* t_index = index->bottom_type(); |
266 if (narrowoop != NULL) { // EncodeN, LoadN, LoadConN, LoadNKlass. |
266 if (t_index->isa_narrowoop()) { // EncodeN, LoadN, LoadConN, LoadNKlass. |
267 // Memory references through narrow oops have a |
267 // Memory references through narrow oops have a |
268 // funny base so grab the type from the index: |
268 // funny base so grab the type from the index: |
269 // [R12 + narrow_oop_reg<<3 + offset] |
269 // [R12 + narrow_oop_reg<<3 + offset] |
270 assert(base == NULL, "Memory references through narrow oops have no base"); |
270 assert(base == NULL, "Memory references through narrow oops have no base"); |
271 offset = disp; |
271 offset = disp; |
272 adr_type = narrowoop->make_oopptr()->add_offset(offset); |
272 adr_type = t_index->make_ptr()->add_offset(offset); |
273 return NULL; |
273 return NULL; |
274 } else if (!index->is_Con()) { |
274 } else if (!index->is_Con()) { |
275 disp = Type::OffsetBot; |
275 disp = Type::OffsetBot; |
276 } else if (disp != Type::OffsetBot) { |
276 } else if (disp != Type::OffsetBot) { |
277 const TypeX* ti = index->bottom_type()->isa_intptr_t(); |
277 const TypeX* ti = t_index->isa_intptr_t(); |
278 if (ti == NULL) { |
278 if (ti == NULL) { |
279 disp = Type::OffsetBot; // a random constant?? |
279 disp = Type::OffsetBot; // a random constant?? |
280 } else { |
280 } else { |
281 disp += ti->get_con() << scale; |
281 disp += ti->get_con() << scale; |
282 } |
282 } |