src/share/vm/opto/machnode.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6714694 Sdiff src/share/vm/opto

src/share/vm/opto/machnode.cpp

Print this page




 245   // Find the memory inputs using our helper function
 246   Node* base;
 247   Node* index;
 248   const MachOper* oper = memory_inputs(base, index);
 249 
 250   if (oper == NULL) {
 251     // Base has been set to NULL
 252     offset = 0;
 253   } else if (oper == (MachOper*)-1) {
 254     // Base has been set to NodeSentinel
 255     // There is not a unique memory use here.  We will fall to AliasIdxBot.
 256     offset = Type::OffsetBot;
 257   } else {
 258     // Base may be NULL, even if offset turns out to be != 0
 259 
 260     intptr_t disp = oper->constant_disp();
 261     int scale = oper->scale();
 262     // Now we have collected every part of the ADLC MEMORY_INTER.
 263     // See if it adds up to a base + offset.
 264     if (index != NULL) {
 265       if (!index->is_Con()) {
 266         const TypeNarrowOop* narrowoop = index->bottom_type()->isa_narrowoop();
 267         if (narrowoop != NULL) {
 268           // Memory references through narrow oops have a
 269           // funny base so grab the type from the index.
 270           adr_type = narrowoop->make_oopptr();



 271           return NULL;
 272         }
 273         disp = Type::OffsetBot;
 274       } else if (disp != Type::OffsetBot) {
 275         const TypeX* ti = index->bottom_type()->isa_intptr_t();
 276         if (ti == NULL) {
 277           disp = Type::OffsetBot;  // a random constant??
 278         } else {
 279           disp += ti->get_con() << scale;
 280         }
 281       }
 282     }
 283     offset = disp;
 284 
 285     // In i486.ad, indOffset32X uses base==RegI and disp==RegP,
 286     // this will prevent alias analysis without the following support:
 287     // Lookup the TypePtr used by indOffset32X, a compile-time constant oop,
 288     // Add the offset determined by the "base", or use Type::OffsetBot.
 289     if( adr_type == TYPE_PTR_SENTINAL ) {
 290       const TypePtr *t_disp = oper->disp_as_type();  // only !NULL for indOffset32X
 291       if (t_disp != NULL) {
 292         offset = Type::OffsetBot;




 245   // Find the memory inputs using our helper function
 246   Node* base;
 247   Node* index;
 248   const MachOper* oper = memory_inputs(base, index);
 249 
 250   if (oper == NULL) {
 251     // Base has been set to NULL
 252     offset = 0;
 253   } else if (oper == (MachOper*)-1) {
 254     // Base has been set to NodeSentinel
 255     // There is not a unique memory use here.  We will fall to AliasIdxBot.
 256     offset = Type::OffsetBot;
 257   } else {
 258     // Base may be NULL, even if offset turns out to be != 0
 259 
 260     intptr_t disp = oper->constant_disp();
 261     int scale = oper->scale();
 262     // Now we have collected every part of the ADLC MEMORY_INTER.
 263     // See if it adds up to a base + offset.
 264     if (index != NULL) {

 265       const TypeNarrowOop* narrowoop = index->bottom_type()->isa_narrowoop();
 266       if (narrowoop != NULL) { // EncodeN, LoadN, LoadConN, LoadNKlass.
 267         // Memory references through narrow oops have a
 268         // funny base so grab the type from the index:
 269         // [R12 + narrow_oop_reg<<3 + offset]
 270         assert(base == NULL, "Memory references through narrow oops have no base");
 271         offset = disp;
 272         adr_type = narrowoop->make_oopptr()->add_offset(offset);
 273         return NULL;
 274       } else if (!index->is_Con()) {
 275         disp = Type::OffsetBot;
 276       } else if (disp != Type::OffsetBot) {
 277         const TypeX* ti = index->bottom_type()->isa_intptr_t();
 278         if (ti == NULL) {
 279           disp = Type::OffsetBot;  // a random constant??
 280         } else {
 281           disp += ti->get_con() << scale;
 282         }
 283       }
 284     }
 285     offset = disp;
 286 
 287     // In i486.ad, indOffset32X uses base==RegI and disp==RegP,
 288     // this will prevent alias analysis without the following support:
 289     // Lookup the TypePtr used by indOffset32X, a compile-time constant oop,
 290     // Add the offset determined by the "base", or use Type::OffsetBot.
 291     if( adr_type == TYPE_PTR_SENTINAL ) {
 292       const TypePtr *t_disp = oper->disp_as_type();  // only !NULL for indOffset32X
 293       if (t_disp != NULL) {
 294         offset = Type::OffsetBot;


src/share/vm/opto/machnode.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File