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