< prev index next >

src/hotspot/share/opto/compile.cpp

Print this page

1677     idx = _num_alias_types++;
1678     _alias_types[idx]->Init(idx, flat);
1679     if (flat == TypeInstPtr::KLASS)  alias_type(idx)->set_rewritable(false);
1680     if (flat == TypeAryPtr::RANGE)   alias_type(idx)->set_rewritable(false);
1681     if (flat->isa_instptr()) {
1682       if (flat->offset() == java_lang_Class::klass_offset()
1683           && flat->is_instptr()->instance_klass() == env()->Class_klass())
1684         alias_type(idx)->set_rewritable(false);
1685     }
1686     if (flat->isa_aryptr()) {
1687 #ifdef ASSERT
1688       const int header_size_min  = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1689       // (T_BYTE has the weakest alignment and size restrictions...)
1690       assert(flat->offset() < header_size_min, "array body reference must be OffsetBot");
1691 #endif
1692       if (flat->offset() == TypePtr::OffsetBot) {
1693         alias_type(idx)->set_element(flat->is_aryptr()->elem());
1694       }
1695     }
1696     if (flat->isa_klassptr()) {




1697       if (flat->offset() == in_bytes(Klass::super_check_offset_offset()))
1698         alias_type(idx)->set_rewritable(false);
1699       if (flat->offset() == in_bytes(Klass::modifier_flags_offset()))
1700         alias_type(idx)->set_rewritable(false);
1701       if (flat->offset() == in_bytes(Klass::access_flags_offset()))
1702         alias_type(idx)->set_rewritable(false);
1703       if (flat->offset() == in_bytes(Klass::java_mirror_offset()))
1704         alias_type(idx)->set_rewritable(false);
1705       if (flat->offset() == in_bytes(Klass::secondary_super_cache_offset()))
1706         alias_type(idx)->set_rewritable(false);
1707     }
1708     // %%% (We would like to finalize JavaThread::threadObj_offset(),
1709     // but the base pointer type is not distinctive enough to identify
1710     // references into JavaThread.)
1711 
1712     // Check for final fields.
1713     const TypeInstPtr* tinst = flat->isa_instptr();
1714     if (tinst && tinst->offset() >= instanceOopDesc::base_offset_in_bytes()) {
1715       ciField* field;
1716       if (tinst->const_oop() != nullptr &&

1677     idx = _num_alias_types++;
1678     _alias_types[idx]->Init(idx, flat);
1679     if (flat == TypeInstPtr::KLASS)  alias_type(idx)->set_rewritable(false);
1680     if (flat == TypeAryPtr::RANGE)   alias_type(idx)->set_rewritable(false);
1681     if (flat->isa_instptr()) {
1682       if (flat->offset() == java_lang_Class::klass_offset()
1683           && flat->is_instptr()->instance_klass() == env()->Class_klass())
1684         alias_type(idx)->set_rewritable(false);
1685     }
1686     if (flat->isa_aryptr()) {
1687 #ifdef ASSERT
1688       const int header_size_min  = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1689       // (T_BYTE has the weakest alignment and size restrictions...)
1690       assert(flat->offset() < header_size_min, "array body reference must be OffsetBot");
1691 #endif
1692       if (flat->offset() == TypePtr::OffsetBot) {
1693         alias_type(idx)->set_element(flat->is_aryptr()->elem());
1694       }
1695     }
1696     if (flat->isa_klassptr()) {
1697       if (UseCompactObjectHeaders) {
1698         if (flat->offset() == in_bytes(Klass::prototype_header_offset()))
1699           alias_type(idx)->set_rewritable(false);
1700       }
1701       if (flat->offset() == in_bytes(Klass::super_check_offset_offset()))
1702         alias_type(idx)->set_rewritable(false);
1703       if (flat->offset() == in_bytes(Klass::modifier_flags_offset()))
1704         alias_type(idx)->set_rewritable(false);
1705       if (flat->offset() == in_bytes(Klass::access_flags_offset()))
1706         alias_type(idx)->set_rewritable(false);
1707       if (flat->offset() == in_bytes(Klass::java_mirror_offset()))
1708         alias_type(idx)->set_rewritable(false);
1709       if (flat->offset() == in_bytes(Klass::secondary_super_cache_offset()))
1710         alias_type(idx)->set_rewritable(false);
1711     }
1712     // %%% (We would like to finalize JavaThread::threadObj_offset(),
1713     // but the base pointer type is not distinctive enough to identify
1714     // references into JavaThread.)
1715 
1716     // Check for final fields.
1717     const TypeInstPtr* tinst = flat->isa_instptr();
1718     if (tinst && tinst->offset() >= instanceOopDesc::base_offset_in_bytes()) {
1719       ciField* field;
1720       if (tinst->const_oop() != nullptr &&
< prev index next >