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