< prev index next >

src/hotspot/share/opto/compile.cpp

Print this page

1697     idx = _num_alias_types++;
1698     _alias_types[idx]->Init(idx, flat);
1699     if (flat == TypeInstPtr::KLASS)  alias_type(idx)->set_rewritable(false);
1700     if (flat == TypeAryPtr::RANGE)   alias_type(idx)->set_rewritable(false);
1701     if (flat->isa_instptr()) {
1702       if (flat->offset() == java_lang_Class::klass_offset()
1703           && flat->is_instptr()->instance_klass() == env()->Class_klass())
1704         alias_type(idx)->set_rewritable(false);
1705     }
1706     if (flat->isa_aryptr()) {
1707 #ifdef ASSERT
1708       const int header_size_min  = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1709       // (T_BYTE has the weakest alignment and size restrictions...)
1710       assert(flat->offset() < header_size_min, "array body reference must be OffsetBot");
1711 #endif
1712       if (flat->offset() == TypePtr::OffsetBot) {
1713         alias_type(idx)->set_element(flat->is_aryptr()->elem());
1714       }
1715     }
1716     if (flat->isa_klassptr()) {




1717       if (flat->offset() == in_bytes(Klass::super_check_offset_offset()))
1718         alias_type(idx)->set_rewritable(false);
1719       if (flat->offset() == in_bytes(Klass::modifier_flags_offset()))
1720         alias_type(idx)->set_rewritable(false);
1721       if (flat->offset() == in_bytes(Klass::access_flags_offset()))
1722         alias_type(idx)->set_rewritable(false);
1723       if (flat->offset() == in_bytes(Klass::java_mirror_offset()))
1724         alias_type(idx)->set_rewritable(false);
1725       if (flat->offset() == in_bytes(Klass::secondary_super_cache_offset()))
1726         alias_type(idx)->set_rewritable(false);
1727     }
1728     // %%% (We would like to finalize JavaThread::threadObj_offset(),
1729     // but the base pointer type is not distinctive enough to identify
1730     // references into JavaThread.)
1731 
1732     // Check for final fields.
1733     const TypeInstPtr* tinst = flat->isa_instptr();
1734     if (tinst && tinst->offset() >= instanceOopDesc::base_offset_in_bytes()) {
1735       ciField* field;
1736       if (tinst->const_oop() != nullptr &&

1697     idx = _num_alias_types++;
1698     _alias_types[idx]->Init(idx, flat);
1699     if (flat == TypeInstPtr::KLASS)  alias_type(idx)->set_rewritable(false);
1700     if (flat == TypeAryPtr::RANGE)   alias_type(idx)->set_rewritable(false);
1701     if (flat->isa_instptr()) {
1702       if (flat->offset() == java_lang_Class::klass_offset()
1703           && flat->is_instptr()->instance_klass() == env()->Class_klass())
1704         alias_type(idx)->set_rewritable(false);
1705     }
1706     if (flat->isa_aryptr()) {
1707 #ifdef ASSERT
1708       const int header_size_min  = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1709       // (T_BYTE has the weakest alignment and size restrictions...)
1710       assert(flat->offset() < header_size_min, "array body reference must be OffsetBot");
1711 #endif
1712       if (flat->offset() == TypePtr::OffsetBot) {
1713         alias_type(idx)->set_element(flat->is_aryptr()->elem());
1714       }
1715     }
1716     if (flat->isa_klassptr()) {
1717       if (UseCompactObjectHeaders) {
1718         if (flat->offset() == in_bytes(Klass::prototype_header_offset()))
1719           alias_type(idx)->set_rewritable(false);
1720       }
1721       if (flat->offset() == in_bytes(Klass::super_check_offset_offset()))
1722         alias_type(idx)->set_rewritable(false);
1723       if (flat->offset() == in_bytes(Klass::modifier_flags_offset()))
1724         alias_type(idx)->set_rewritable(false);
1725       if (flat->offset() == in_bytes(Klass::access_flags_offset()))
1726         alias_type(idx)->set_rewritable(false);
1727       if (flat->offset() == in_bytes(Klass::java_mirror_offset()))
1728         alias_type(idx)->set_rewritable(false);
1729       if (flat->offset() == in_bytes(Klass::secondary_super_cache_offset()))
1730         alias_type(idx)->set_rewritable(false);
1731     }
1732     // %%% (We would like to finalize JavaThread::threadObj_offset(),
1733     // but the base pointer type is not distinctive enough to identify
1734     // references into JavaThread.)
1735 
1736     // Check for final fields.
1737     const TypeInstPtr* tinst = flat->isa_instptr();
1738     if (tinst && tinst->offset() >= instanceOopDesc::base_offset_in_bytes()) {
1739       ciField* field;
1740       if (tinst->const_oop() != nullptr &&
< prev index next >