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