< prev index next >

src/hotspot/share/opto/compile.cpp

Print this page

1352       tj = ta = ta->
1353               remove_speculative()->
1354               cast_to_ptr_type(ptr)->
1355               with_offset(offset);
1356     }
1357   } else if (ta) {
1358     // For arrays indexed by constant indices, we flatten the alias
1359     // space to include all of the array body.  Only the header, klass
1360     // and array length can be accessed un-aliased.
1361     if( offset != Type::OffsetBot ) {
1362       if( ta->const_oop() ) { // MethodData* or Method*
1363         offset = Type::OffsetBot;   // Flatten constant access into array body
1364         tj = ta = ta->
1365                 remove_speculative()->
1366                 cast_to_ptr_type(ptr)->
1367                 cast_to_exactness(false)->
1368                 with_offset(offset);
1369       } else if( offset == arrayOopDesc::length_offset_in_bytes() ) {
1370         // range is OK as-is.
1371         tj = ta = TypeAryPtr::RANGE;
1372       } else if( offset == oopDesc::klass_offset_in_bytes() ) {
1373         tj = TypeInstPtr::KLASS; // all klass loads look alike
1374         ta = TypeAryPtr::RANGE; // generic ignored junk
1375         ptr = TypePtr::BotPTR;
1376       } else if( offset == oopDesc::mark_offset_in_bytes() ) {
1377         tj = TypeInstPtr::MARK;
1378         ta = TypeAryPtr::RANGE; // generic ignored junk
1379         ptr = TypePtr::BotPTR;
1380       } else {                  // Random constant offset into array body
1381         offset = Type::OffsetBot;   // Flatten constant access into array body
1382         tj = ta = ta->
1383                 remove_speculative()->
1384                 cast_to_ptr_type(ptr)->
1385                 cast_to_exactness(false)->
1386                 with_offset(offset);
1387       }
1388     }
1389     // Arrays of fixed size alias with arrays of unknown size.
1390     if (ta->size() != TypeInt::POS) {
1391       const TypeAry *tary = TypeAry::make(ta->elem(), TypeInt::POS);
1392       tj = ta = ta->

1525       offset = in_bytes(Klass::secondary_super_cache_offset());
1526       tj = tk = tk->with_offset(offset);
1527     }
1528   }
1529 
1530   // Flatten all Raw pointers together.
1531   if (tj->base() == Type::RawPtr)
1532     tj = TypeRawPtr::BOTTOM;
1533 
1534   if (tj->base() == Type::AnyPtr)
1535     tj = TypePtr::BOTTOM;      // An error, which the caller must check for.
1536 
1537   offset = tj->offset();
1538   assert( offset != Type::OffsetTop, "Offset has fallen from constant" );
1539 
1540   assert( (offset != Type::OffsetBot && tj->base() != Type::AryPtr) ||
1541           (offset == Type::OffsetBot && tj->base() == Type::AryPtr) ||
1542           (offset == Type::OffsetBot && tj == TypeOopPtr::BOTTOM) ||
1543           (offset == Type::OffsetBot && tj == TypePtr::BOTTOM) ||
1544           (offset == oopDesc::mark_offset_in_bytes() && tj->base() == Type::AryPtr) ||
1545           (offset == oopDesc::klass_offset_in_bytes() && tj->base() == Type::AryPtr) ||
1546           (offset == arrayOopDesc::length_offset_in_bytes() && tj->base() == Type::AryPtr),
1547           "For oops, klasses, raw offset must be constant; for arrays the offset is never known" );
1548   assert( tj->ptr() != TypePtr::TopPTR &&
1549           tj->ptr() != TypePtr::AnyNull &&
1550           tj->ptr() != TypePtr::Null, "No imprecise addresses" );
1551 //    assert( tj->ptr() != TypePtr::Constant ||
1552 //            tj->base() == Type::RawPtr ||
1553 //            tj->base() == Type::KlassPtr, "No constant oop addresses" );
1554 
1555   return tj;
1556 }
1557 
1558 void Compile::AliasType::Init(int i, const TypePtr* at) {
1559   assert(AliasIdxTop <= i && i < Compile::current()->_max_alias_types, "Invalid alias index");
1560   _index = i;
1561   _adr_type = at;
1562   _field = nullptr;
1563   _element = nullptr;
1564   _is_rewritable = true; // default
1565   const TypeOopPtr *atoop = (at != nullptr) ? at->isa_oopptr() : nullptr;

1352       tj = ta = ta->
1353               remove_speculative()->
1354               cast_to_ptr_type(ptr)->
1355               with_offset(offset);
1356     }
1357   } else if (ta) {
1358     // For arrays indexed by constant indices, we flatten the alias
1359     // space to include all of the array body.  Only the header, klass
1360     // and array length can be accessed un-aliased.
1361     if( offset != Type::OffsetBot ) {
1362       if( ta->const_oop() ) { // MethodData* or Method*
1363         offset = Type::OffsetBot;   // Flatten constant access into array body
1364         tj = ta = ta->
1365                 remove_speculative()->
1366                 cast_to_ptr_type(ptr)->
1367                 cast_to_exactness(false)->
1368                 with_offset(offset);
1369       } else if( offset == arrayOopDesc::length_offset_in_bytes() ) {
1370         // range is OK as-is.
1371         tj = ta = TypeAryPtr::RANGE;
1372       } else if( offset == Type::klass_offset() ) {
1373         tj = TypeInstPtr::KLASS; // all klass loads look alike
1374         ta = TypeAryPtr::RANGE; // generic ignored junk
1375         ptr = TypePtr::BotPTR;
1376       } else if( offset == oopDesc::mark_offset_in_bytes() ) {
1377         tj = TypeInstPtr::MARK;
1378         ta = TypeAryPtr::RANGE; // generic ignored junk
1379         ptr = TypePtr::BotPTR;
1380       } else {                  // Random constant offset into array body
1381         offset = Type::OffsetBot;   // Flatten constant access into array body
1382         tj = ta = ta->
1383                 remove_speculative()->
1384                 cast_to_ptr_type(ptr)->
1385                 cast_to_exactness(false)->
1386                 with_offset(offset);
1387       }
1388     }
1389     // Arrays of fixed size alias with arrays of unknown size.
1390     if (ta->size() != TypeInt::POS) {
1391       const TypeAry *tary = TypeAry::make(ta->elem(), TypeInt::POS);
1392       tj = ta = ta->

1525       offset = in_bytes(Klass::secondary_super_cache_offset());
1526       tj = tk = tk->with_offset(offset);
1527     }
1528   }
1529 
1530   // Flatten all Raw pointers together.
1531   if (tj->base() == Type::RawPtr)
1532     tj = TypeRawPtr::BOTTOM;
1533 
1534   if (tj->base() == Type::AnyPtr)
1535     tj = TypePtr::BOTTOM;      // An error, which the caller must check for.
1536 
1537   offset = tj->offset();
1538   assert( offset != Type::OffsetTop, "Offset has fallen from constant" );
1539 
1540   assert( (offset != Type::OffsetBot && tj->base() != Type::AryPtr) ||
1541           (offset == Type::OffsetBot && tj->base() == Type::AryPtr) ||
1542           (offset == Type::OffsetBot && tj == TypeOopPtr::BOTTOM) ||
1543           (offset == Type::OffsetBot && tj == TypePtr::BOTTOM) ||
1544           (offset == oopDesc::mark_offset_in_bytes() && tj->base() == Type::AryPtr) ||
1545           (offset == Type::klass_offset() && tj->base() == Type::AryPtr) ||
1546           (offset == arrayOopDesc::length_offset_in_bytes() && tj->base() == Type::AryPtr),
1547           "For oops, klasses, raw offset must be constant; for arrays the offset is never known" );
1548   assert( tj->ptr() != TypePtr::TopPTR &&
1549           tj->ptr() != TypePtr::AnyNull &&
1550           tj->ptr() != TypePtr::Null, "No imprecise addresses" );
1551 //    assert( tj->ptr() != TypePtr::Constant ||
1552 //            tj->base() == Type::RawPtr ||
1553 //            tj->base() == Type::KlassPtr, "No constant oop addresses" );
1554 
1555   return tj;
1556 }
1557 
1558 void Compile::AliasType::Init(int i, const TypePtr* at) {
1559   assert(AliasIdxTop <= i && i < Compile::current()->_max_alias_types, "Invalid alias index");
1560   _index = i;
1561   _adr_type = at;
1562   _field = nullptr;
1563   _element = nullptr;
1564   _is_rewritable = true; // default
1565   const TypeOopPtr *atoop = (at != nullptr) ? at->isa_oopptr() : nullptr;
< prev index next >