< prev index next >

src/share/vm/opto/machnode.cpp

Print this page
rev 11777 : [mq]: gcinterface.patch


 328   const Node *base = get_base_and_disp(offset, adr_type);
 329   if( adr_type != TYPE_PTR_SENTINAL ) {
 330     return adr_type;      // get_base_and_disp has the answer
 331   }
 332 
 333   // Direct addressing modes have no base node, simply an indirect
 334   // offset, which is always to raw memory.
 335   // %%%%% Someday we'd like to allow constant oop offsets which
 336   // would let Intel load from static globals in 1 instruction.
 337   // Currently Intel requires 2 instructions and a register temp.
 338   if (base == NULL) {
 339     // NULL base, zero offset means no memory at all (a null pointer!)
 340     if (offset == 0) {
 341       return NULL;
 342     }
 343     // NULL base, any offset means any pointer whatever
 344     if (offset == Type::OffsetBot) {
 345       return TypePtr::BOTTOM;
 346     }
 347     // %%% make offset be intptr_t
 348     assert(!Universe::heap()->is_in_reserved(cast_to_oop(offset)), "must be a raw ptr");
 349     return TypeRawPtr::BOTTOM;
 350   }
 351 
 352   // base of -1 with no particular offset means all of memory
 353   if (base == NodeSentinel)  return TypePtr::BOTTOM;
 354 
 355   const Type* t = base->bottom_type();
 356   if (t->isa_narrowoop() && Universe::narrow_oop_shift() == 0) {
 357     // 32-bit unscaled narrow oop can be the base of any address expression
 358     t = t->make_ptr();
 359   }
 360   if (t->isa_narrowklass() && Universe::narrow_klass_shift() == 0) {
 361     // 32-bit unscaled narrow oop can be the base of any address expression
 362     t = t->make_ptr();
 363   }
 364   if (t->isa_intptr_t() && offset != 0 && offset != Type::OffsetBot) {
 365     // We cannot assert that the offset does not look oop-ish here.
 366     // Depending on the heap layout the cardmark base could land
 367     // inside some oopish region.  It definitely does for Win2K.
 368     // The sum of cardmark-base plus shift-by-9-oop lands outside




 328   const Node *base = get_base_and_disp(offset, adr_type);
 329   if( adr_type != TYPE_PTR_SENTINAL ) {
 330     return adr_type;      // get_base_and_disp has the answer
 331   }
 332 
 333   // Direct addressing modes have no base node, simply an indirect
 334   // offset, which is always to raw memory.
 335   // %%%%% Someday we'd like to allow constant oop offsets which
 336   // would let Intel load from static globals in 1 instruction.
 337   // Currently Intel requires 2 instructions and a register temp.
 338   if (base == NULL) {
 339     // NULL base, zero offset means no memory at all (a null pointer!)
 340     if (offset == 0) {
 341       return NULL;
 342     }
 343     // NULL base, any offset means any pointer whatever
 344     if (offset == Type::OffsetBot) {
 345       return TypePtr::BOTTOM;
 346     }
 347     // %%% make offset be intptr_t
 348     assert(!GC::gc()->heap()->is_in_reserved(cast_to_oop(offset)), "must be a raw ptr");
 349     return TypeRawPtr::BOTTOM;
 350   }
 351 
 352   // base of -1 with no particular offset means all of memory
 353   if (base == NodeSentinel)  return TypePtr::BOTTOM;
 354 
 355   const Type* t = base->bottom_type();
 356   if (t->isa_narrowoop() && Universe::narrow_oop_shift() == 0) {
 357     // 32-bit unscaled narrow oop can be the base of any address expression
 358     t = t->make_ptr();
 359   }
 360   if (t->isa_narrowklass() && Universe::narrow_klass_shift() == 0) {
 361     // 32-bit unscaled narrow oop can be the base of any address expression
 362     t = t->make_ptr();
 363   }
 364   if (t->isa_intptr_t() && offset != 0 && offset != Type::OffsetBot) {
 365     // We cannot assert that the offset does not look oop-ish here.
 366     // Depending on the heap layout the cardmark base could land
 367     // inside some oopish region.  It definitely does for Win2K.
 368     // The sum of cardmark-base plus shift-by-9-oop lands outside


< prev index next >