< prev index next >

src/hotspot/share/opto/lcm.cpp

Print this page

 251     if (ctrl != nullptr && !(ctrl == not_null_block->head() ||
 252         get_block_for_node(ctrl)->dominates(not_null_block))) {
 253       continue;
 254     }
 255 
 256     // check if the offset is not too high for implicit exception
 257     {
 258       intptr_t offset = 0;
 259       const TypePtr *adr_type = nullptr;  // Do not need this return value here
 260       const Node* base = mach->get_base_and_disp(offset, adr_type);
 261       if (base == nullptr || base == NodeSentinel) {
 262         // Narrow oop address doesn't have base, only index.
 263         // Give up if offset is beyond page size or if heap base is not protected.
 264         if (val->bottom_type()->isa_narrowoop() &&
 265             (MacroAssembler::needs_explicit_null_check(offset) ||
 266              !CompressedOops::use_implicit_null_checks()))
 267           continue;
 268         // cannot reason about it; is probably not implicit null exception
 269       } else {
 270         const TypePtr* tptr;
 271         if ((UseCompressedOops || UseCompressedClassPointers) &&
 272             (CompressedOops::shift() == 0 || CompressedKlassPointers::shift() == 0)) {
 273           // 32-bits narrow oop can be the base of address expressions
 274           tptr = base->get_ptr_type();
 275         } else {
 276           // only regular oops are expected here
 277           tptr = base->bottom_type()->is_ptr();
 278         }
 279         // Give up if offset is not a compile-time constant.
 280         if (offset == Type::OffsetBot || tptr->_offset == Type::OffsetBot)
 281           continue;
 282         offset += tptr->_offset; // correct if base is offsetted
 283         // Give up if reference is beyond page size.
 284         if (MacroAssembler::needs_explicit_null_check(offset))
 285           continue;
 286         // Give up if base is a decode node and the heap base is not protected.
 287         if (base->is_Mach() && base->as_Mach()->ideal_Opcode() == Op_DecodeN &&
 288             !CompressedOops::use_implicit_null_checks())
 289           continue;
 290       }
 291     }
 292 

 251     if (ctrl != nullptr && !(ctrl == not_null_block->head() ||
 252         get_block_for_node(ctrl)->dominates(not_null_block))) {
 253       continue;
 254     }
 255 
 256     // check if the offset is not too high for implicit exception
 257     {
 258       intptr_t offset = 0;
 259       const TypePtr *adr_type = nullptr;  // Do not need this return value here
 260       const Node* base = mach->get_base_and_disp(offset, adr_type);
 261       if (base == nullptr || base == NodeSentinel) {
 262         // Narrow oop address doesn't have base, only index.
 263         // Give up if offset is beyond page size or if heap base is not protected.
 264         if (val->bottom_type()->isa_narrowoop() &&
 265             (MacroAssembler::needs_explicit_null_check(offset) ||
 266              !CompressedOops::use_implicit_null_checks()))
 267           continue;
 268         // cannot reason about it; is probably not implicit null exception
 269       } else {
 270         const TypePtr* tptr;
 271         if ((UseCompressedOops && CompressedOops::shift() == 0) ||
 272             (UseCompressedClassPointers && CompressedKlassPointers::shift() == 0)) {
 273           // 32-bits narrow oop can be the base of address expressions
 274           tptr = base->get_ptr_type();
 275         } else {
 276           // only regular oops are expected here
 277           tptr = base->bottom_type()->is_ptr();
 278         }
 279         // Give up if offset is not a compile-time constant.
 280         if (offset == Type::OffsetBot || tptr->_offset == Type::OffsetBot)
 281           continue;
 282         offset += tptr->_offset; // correct if base is offsetted
 283         // Give up if reference is beyond page size.
 284         if (MacroAssembler::needs_explicit_null_check(offset))
 285           continue;
 286         // Give up if base is a decode node and the heap base is not protected.
 287         if (base->is_Mach() && base->as_Mach()->ideal_Opcode() == Op_DecodeN &&
 288             !CompressedOops::use_implicit_null_checks())
 289           continue;
 290       }
 291     }
 292 
< prev index next >