1630 idx = _num_alias_types++;
1631 _alias_types[idx]->Init(idx, flat);
1632 if (flat == TypeInstPtr::KLASS) alias_type(idx)->set_rewritable(false);
1633 if (flat == TypeAryPtr::RANGE) alias_type(idx)->set_rewritable(false);
1634 if (flat->isa_instptr()) {
1635 if (flat->offset() == java_lang_Class::klass_offset()
1636 && flat->is_instptr()->klass() == env()->Class_klass())
1637 alias_type(idx)->set_rewritable(false);
1638 }
1639 if (flat->isa_aryptr()) {
1640 #ifdef ASSERT
1641 const int header_size_min = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1642 // (T_BYTE has the weakest alignment and size restrictions...)
1643 assert(flat->offset() < header_size_min, "array body reference must be OffsetBot");
1644 #endif
1645 if (flat->offset() == TypePtr::OffsetBot) {
1646 alias_type(idx)->set_element(flat->is_aryptr()->elem());
1647 }
1648 }
1649 if (flat->isa_klassptr()) {
1650 if (flat->offset() == in_bytes(Klass::super_check_offset_offset()))
1651 alias_type(idx)->set_rewritable(false);
1652 if (flat->offset() == in_bytes(Klass::modifier_flags_offset()))
1653 alias_type(idx)->set_rewritable(false);
1654 if (flat->offset() == in_bytes(Klass::access_flags_offset()))
1655 alias_type(idx)->set_rewritable(false);
1656 if (flat->offset() == in_bytes(Klass::java_mirror_offset()))
1657 alias_type(idx)->set_rewritable(false);
1658 if (flat->offset() == in_bytes(Klass::secondary_super_cache_offset()))
1659 alias_type(idx)->set_rewritable(false);
1660 }
1661 // %%% (We would like to finalize JavaThread::threadObj_offset(),
1662 // but the base pointer type is not distinctive enough to identify
1663 // references into JavaThread.)
1664
1665 // Check for final fields.
1666 const TypeInstPtr* tinst = flat->isa_instptr();
1667 if (tinst && tinst->offset() >= instanceOopDesc::base_offset_in_bytes()) {
1668 ciField* field;
1669 if (tinst->const_oop() != nullptr &&
|
1630 idx = _num_alias_types++;
1631 _alias_types[idx]->Init(idx, flat);
1632 if (flat == TypeInstPtr::KLASS) alias_type(idx)->set_rewritable(false);
1633 if (flat == TypeAryPtr::RANGE) alias_type(idx)->set_rewritable(false);
1634 if (flat->isa_instptr()) {
1635 if (flat->offset() == java_lang_Class::klass_offset()
1636 && flat->is_instptr()->klass() == env()->Class_klass())
1637 alias_type(idx)->set_rewritable(false);
1638 }
1639 if (flat->isa_aryptr()) {
1640 #ifdef ASSERT
1641 const int header_size_min = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1642 // (T_BYTE has the weakest alignment and size restrictions...)
1643 assert(flat->offset() < header_size_min, "array body reference must be OffsetBot");
1644 #endif
1645 if (flat->offset() == TypePtr::OffsetBot) {
1646 alias_type(idx)->set_element(flat->is_aryptr()->elem());
1647 }
1648 }
1649 if (flat->isa_klassptr()) {
1650 if (UseCompactObjectHeaders) {
1651 if (flat->offset() == in_bytes(Klass::prototype_header_offset()))
1652 alias_type(idx)->set_rewritable(false);
1653 }
1654 if (flat->offset() == in_bytes(Klass::super_check_offset_offset()))
1655 alias_type(idx)->set_rewritable(false);
1656 if (flat->offset() == in_bytes(Klass::modifier_flags_offset()))
1657 alias_type(idx)->set_rewritable(false);
1658 if (flat->offset() == in_bytes(Klass::access_flags_offset()))
1659 alias_type(idx)->set_rewritable(false);
1660 if (flat->offset() == in_bytes(Klass::java_mirror_offset()))
1661 alias_type(idx)->set_rewritable(false);
1662 if (flat->offset() == in_bytes(Klass::secondary_super_cache_offset()))
1663 alias_type(idx)->set_rewritable(false);
1664 }
1665 // %%% (We would like to finalize JavaThread::threadObj_offset(),
1666 // but the base pointer type is not distinctive enough to identify
1667 // references into JavaThread.)
1668
1669 // Check for final fields.
1670 const TypeInstPtr* tinst = flat->isa_instptr();
1671 if (tinst && tinst->offset() >= instanceOopDesc::base_offset_in_bytes()) {
1672 ciField* field;
1673 if (tinst->const_oop() != nullptr &&
|