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