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