< prev index next >

src/hotspot/share/code/aotCodeCache.cpp

Print this page

 171 // It is called from AOTMetaspace::initialize_shared_spaces()
 172 // which is called from universe_init().
 173 // At this point all AOT class linking seetings are finilized
 174 // and AOT cache is open so we can map AOT code region.
 175 void AOTCodeCache::initialize() {
 176 #if defined(ZERO) || !(defined(AMD64) || defined(AARCH64))
 177   log_info(aot, codecache, init)("AOT Code Cache is not supported on this platform.");
 178   disable_caching();
 179   return;
 180 #else
 181   if (FLAG_IS_DEFAULT(AOTCache)) {
 182     log_info(aot, codecache, init)("AOT Code Cache is not used: AOTCache is not specified.");
 183     disable_caching();
 184     return; // AOTCache must be specified to dump and use AOT code
 185   }
 186 
 187   // Disable stubs caching until JDK-8357398 is fixed.
 188   FLAG_SET_ERGO(AOTStubCaching, false);
 189 
 190   if (VerifyOops) {
 191     // Disable AOT stubs caching when VerifyOops flag is on.
 192     // Verify oops code generated a lot of C strings which overflow
 193     // AOT C string table (which has fixed size).
 194     // AOT C string table will be reworked later to handle such cases.
 195     //
 196     // Note: AOT adapters are not affected - they don't have oop operations.
 197     log_info(aot, codecache, init)("AOT Stubs Caching is not supported with VerifyOops.");
 198     FLAG_SET_ERGO(AOTStubCaching, false);




 199   }
 200 
 201   bool is_dumping = false;
 202   bool is_using   = false;
 203   if (CDSConfig::is_dumping_final_static_archive() && CDSConfig::is_dumping_aot_linked_classes()) {
 204     is_dumping = true;
 205     enable_caching();
 206     is_dumping = is_caching_enabled();
 207   } else if (CDSConfig::is_using_archive() && CDSConfig::is_using_aot_linked_classes()) {
 208     enable_caching();
 209     is_using = is_caching_enabled();
 210   } else {
 211     log_info(aot, codecache, init)("AOT Code Cache is not used: AOT Class Linking is not used.");
 212     disable_caching();
 213     return; // nothing to do
 214   }
 215   if (!(is_dumping || is_using)) {
 216     disable_caching();
 217     return; // AOT code caching disabled on command line
 218   }

 730   // change to UseLSE may affect validity of stubs and nmethods
 731   CHECK_FLAG(aarch64_, aarch64_useLSE, UseLSE);
 732 
 733   // check aarch64-specific intrinsic use settings are compatible
 734 
 735   CHECK_FLAG(aarch64_use_, aarch64_useBlockZeroing, UseBlockZeroing);
 736   CHECK_FLAG(aarch64_use_, aarch64_useSIMDForBigIntegerShift, UseSIMDForBigIntegerShiftIntrinsics);
 737   CHECK_FLAG(aarch64_use_, aarch64_useSimpleArrayEquals, UseSimpleArrayEquals);
 738   CHECK_FLAG(aarch64_use_, aarch64_useSecondarySupersCache, UseSecondarySupersCache);
 739 #endif // defined(AARCH64) && !defined(ZERO)
 740 
 741 #if INCLUDE_JVMCI
 742   // change to EnableJVMCI will affect validity of adapters and
 743   // nmethods
 744   if (_enableJVMCI != (uint)EnableJVMCI) {
 745     log_debug(aot, codecache, init)("AOT Code Cache disabled: it was created with EnableJVMCI = %s vs current %s", (_enableJVMCI ? "true" : "false"), (EnableJVMCI ? "true" : "false"));
 746     return false;
 747   }
 748 #endif // INCLUDE_JVMCI
 749 
 750   // The following checks do not affect AOT adapters caching


 751 
 752   if (test_flag(compressedOops) != UseCompressedOops) {
 753     log_debug(aot, codecache, init)("AOT Code Cache disabled: it was created with UseCompressedOops = %s", UseCompressedOops ? "false" : "true");
 754     AOTStubCaching = false;



 755   }
 756   if (_compressedOopShift != (uint)CompressedOops::shift()) {
 757     log_debug(aot, codecache, init)("AOT Code Cache disabled: it was created with different CompressedOops::shift(): %d vs current %d", _compressedOopShift, CompressedOops::shift());
 758     AOTStubCaching = false;



 759   }
 760 
 761   // This should be the last check as it only disables AOTStubCaching
 762   if ((_compressedOopBase == nullptr || CompressedOops::base() == nullptr) && (_compressedOopBase != CompressedOops::base())) {
 763     log_debug(aot, codecache, init)("AOTStubCaching is disabled: incompatible CompressedOops::base(): %p vs current %p", _compressedOopBase, CompressedOops::base());
 764     AOTStubCaching = false;



 765   }
 766 
 767   return true;
 768 }
 769 
 770 #undef TEST_FLAG
 771 
 772 bool AOTCodeCache::Header::verify(uint load_size) const {
 773   if (_version != AOT_CODE_VERSION) {
 774     log_debug(aot, codecache, init)("AOT Code Cache disabled: different AOT Code version %d vs %d recorded in AOT Code header", AOT_CODE_VERSION, _version);
 775     return false;
 776   }
 777   if (load_size < _cache_size) {
 778     log_debug(aot, codecache, init)("AOT Code Cache disabled: AOT Code Cache size %d < %d recorded in AOT Code header", load_size, _cache_size);
 779     return false;
 780   }
 781   return true;
 782 }
 783 
 784 AOTCodeCache* AOTCodeCache::open_for_use() {

1578     assert(type##_length <= type##_max, "increase size"); \
1579   }
1580 
1581 static bool initializing_extrs = false;
1582 
1583 void AOTCodeAddressTable::init_extrs() {
1584   if (_extrs_complete || initializing_extrs) return; // Done already
1585 
1586   assert(_blobs_end <= _all_max, "AOTCodeAddress table ranges need adjusting");
1587 
1588   initializing_extrs = true;
1589   _extrs_addr = NEW_C_HEAP_ARRAY(address, _extrs_max, mtCode);
1590 
1591   _extrs_length = 0;
1592 
1593   // Record addresses of VM runtime methods
1594   SET_ADDRESS(_extrs, SharedRuntime::fixup_callers_callsite);
1595   SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method);
1596   SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_abstract);
1597   SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_ic_miss);

1598 #if defined(AARCH64) && !defined(ZERO)
1599   SET_ADDRESS(_extrs, JavaThread::aarch64_get_thread_helper);
1600 #endif
1601   {
1602     // Required by Shared blobs
1603     SET_ADDRESS(_extrs, Deoptimization::fetch_unroll_info);
1604     SET_ADDRESS(_extrs, Deoptimization::unpack_frames);
1605     SET_ADDRESS(_extrs, SafepointSynchronize::handle_polling_page_exception);
1606     SET_ADDRESS(_extrs, SharedRuntime::resolve_opt_virtual_call_C);
1607     SET_ADDRESS(_extrs, SharedRuntime::resolve_virtual_call_C);
1608     SET_ADDRESS(_extrs, SharedRuntime::resolve_static_call_C);
1609     SET_ADDRESS(_extrs, SharedRuntime::throw_StackOverflowError);
1610     SET_ADDRESS(_extrs, SharedRuntime::throw_delayed_StackOverflowError);
1611     SET_ADDRESS(_extrs, SharedRuntime::throw_AbstractMethodError);
1612     SET_ADDRESS(_extrs, SharedRuntime::throw_IncompatibleClassChangeError);
1613     SET_ADDRESS(_extrs, SharedRuntime::throw_NullPointerException_at_call);
1614   }
1615 
1616 #ifdef COMPILER1
1617   {

1627     SET_ADDRESS(_extrs, Runtime1::new_type_array);
1628     SET_ADDRESS(_extrs, Runtime1::new_object_array);
1629     SET_ADDRESS(_extrs, Runtime1::new_multi_array);
1630     SET_ADDRESS(_extrs, Runtime1::throw_range_check_exception);
1631     SET_ADDRESS(_extrs, Runtime1::throw_index_exception);
1632     SET_ADDRESS(_extrs, Runtime1::throw_div0_exception);
1633     SET_ADDRESS(_extrs, Runtime1::throw_null_pointer_exception);
1634     SET_ADDRESS(_extrs, Runtime1::throw_array_store_exception);
1635     SET_ADDRESS(_extrs, Runtime1::throw_class_cast_exception);
1636     SET_ADDRESS(_extrs, Runtime1::throw_incompatible_class_change_error);
1637     SET_ADDRESS(_extrs, Runtime1::is_instance_of);
1638     SET_ADDRESS(_extrs, Runtime1::monitorenter);
1639     SET_ADDRESS(_extrs, Runtime1::monitorexit);
1640     SET_ADDRESS(_extrs, Runtime1::deoptimize);
1641     SET_ADDRESS(_extrs, Runtime1::access_field_patching);
1642     SET_ADDRESS(_extrs, Runtime1::move_klass_patching);
1643     SET_ADDRESS(_extrs, Runtime1::move_mirror_patching);
1644     SET_ADDRESS(_extrs, Runtime1::move_appendix_patching);
1645     SET_ADDRESS(_extrs, Runtime1::predicate_failed_trap);
1646     SET_ADDRESS(_extrs, Runtime1::unimplemented_entry);








1647     SET_ADDRESS(_extrs, Thread::current);
1648     SET_ADDRESS(_extrs, CompressedKlassPointers::base_addr());
1649 #ifndef PRODUCT
1650     SET_ADDRESS(_extrs, os::breakpoint);
1651 #endif
1652   }
1653 #endif
1654 
1655 #ifdef COMPILER2
1656   {
1657     // Required by C2 blobs
1658     SET_ADDRESS(_extrs, Deoptimization::uncommon_trap);
1659     SET_ADDRESS(_extrs, OptoRuntime::handle_exception_C);
1660     SET_ADDRESS(_extrs, OptoRuntime::new_instance_C);
1661     SET_ADDRESS(_extrs, OptoRuntime::new_array_C);
1662     SET_ADDRESS(_extrs, OptoRuntime::new_array_nozero_C);
1663     SET_ADDRESS(_extrs, OptoRuntime::multianewarray2_C);
1664     SET_ADDRESS(_extrs, OptoRuntime::multianewarray3_C);
1665     SET_ADDRESS(_extrs, OptoRuntime::multianewarray4_C);
1666     SET_ADDRESS(_extrs, OptoRuntime::multianewarray5_C);
1667     SET_ADDRESS(_extrs, OptoRuntime::multianewarrayN_C);
1668     SET_ADDRESS(_extrs, OptoRuntime::complete_monitor_locking_C);
1669     SET_ADDRESS(_extrs, OptoRuntime::monitor_notify_C);
1670     SET_ADDRESS(_extrs, OptoRuntime::monitor_notifyAll_C);
1671     SET_ADDRESS(_extrs, OptoRuntime::rethrow_C);
1672     SET_ADDRESS(_extrs, OptoRuntime::slow_arraycopy_C);
1673     SET_ADDRESS(_extrs, OptoRuntime::register_finalizer_C);


1674     SET_ADDRESS(_extrs, OptoRuntime::vthread_end_first_transition_C);
1675     SET_ADDRESS(_extrs, OptoRuntime::vthread_start_final_transition_C);
1676     SET_ADDRESS(_extrs, OptoRuntime::vthread_start_transition_C);
1677     SET_ADDRESS(_extrs, OptoRuntime::vthread_end_transition_C);
1678 #if defined(AARCH64)
1679     SET_ADDRESS(_extrs, JavaThread::verify_cross_modify_fence_failure);
1680 #endif // AARCH64
1681   }
1682 #endif // COMPILER2
1683 
1684 #if INCLUDE_G1GC
1685   SET_ADDRESS(_extrs, G1BarrierSetRuntime::write_ref_field_pre_entry);
1686 #endif
1687 #if INCLUDE_SHENANDOAHGC
1688   SET_ADDRESS(_extrs, ShenandoahRuntime::write_barrier_pre);
1689   SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom);
1690   SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom_narrow);
1691 #endif
1692 #if INCLUDE_ZGC
1693   SET_ADDRESS(_extrs, ZBarrierSetRuntime::load_barrier_on_oop_field_preloaded_addr());
1694   SET_ADDRESS(_extrs, ZBarrierSetRuntime::load_barrier_on_phantom_oop_field_preloaded_addr());
1695 #if defined(AMD64)
1696   SET_ADDRESS(_extrs, &ZPointerLoadShift);
1697 #endif
1698 #endif
1699 #ifndef ZERO
1700 #if defined(AMD64) || defined(AARCH64) || defined(RISCV64)
1701   SET_ADDRESS(_extrs, MacroAssembler::debug64);
1702 #endif
1703 #endif // ZERO
1704 




1705   // addresses of fields in AOT runtime constants area
1706   address* p = AOTRuntimeConstants::field_addresses_list();
1707   while (*p != nullptr) {
1708     SET_ADDRESS(_extrs, *p++);
1709   }
1710 
1711   _extrs_complete = true;
1712   log_debug(aot, codecache, init)("External addresses recorded");
1713 }
1714 
1715 static bool initializing_early_stubs = false;
1716 
1717 void AOTCodeAddressTable::init_early_stubs() {
1718   if (_complete || initializing_early_stubs) return; // Done already
1719   initializing_early_stubs = true;
1720   _stubs_addr = NEW_C_HEAP_ARRAY(address, _stubs_max, mtCode);
1721   _stubs_length = 0;
1722   SET_ADDRESS(_stubs, StubRoutines::forward_exception_entry());
1723 
1724   {

 171 // It is called from AOTMetaspace::initialize_shared_spaces()
 172 // which is called from universe_init().
 173 // At this point all AOT class linking seetings are finilized
 174 // and AOT cache is open so we can map AOT code region.
 175 void AOTCodeCache::initialize() {
 176 #if defined(ZERO) || !(defined(AMD64) || defined(AARCH64))
 177   log_info(aot, codecache, init)("AOT Code Cache is not supported on this platform.");
 178   disable_caching();
 179   return;
 180 #else
 181   if (FLAG_IS_DEFAULT(AOTCache)) {
 182     log_info(aot, codecache, init)("AOT Code Cache is not used: AOTCache is not specified.");
 183     disable_caching();
 184     return; // AOTCache must be specified to dump and use AOT code
 185   }
 186 
 187   // Disable stubs caching until JDK-8357398 is fixed.
 188   FLAG_SET_ERGO(AOTStubCaching, false);
 189 
 190   if (VerifyOops) {
 191     // Disable AOT stub caching when VerifyOops flag is on.
 192     // Verify oops code generated a lot of C strings which overflow
 193     // AOT C string table (which has fixed size).
 194     // AOT C string table will be reworked later to handle such cases.
 195     log_info(aot, codecache, init)("AOT Stub Caching is not supported with VerifyOops.");


 196     FLAG_SET_ERGO(AOTStubCaching, false);
 197     if (InlineTypePassFieldsAsArgs) {
 198       log_info(aot, codecache, init)("AOT Adapter Caching is not supported with VerifyOops + InlineTypePassFieldsAsArgs.");
 199       FLAG_SET_ERGO(AOTAdapterCaching, false);
 200     }
 201   }
 202 
 203   bool is_dumping = false;
 204   bool is_using   = false;
 205   if (CDSConfig::is_dumping_final_static_archive() && CDSConfig::is_dumping_aot_linked_classes()) {
 206     is_dumping = true;
 207     enable_caching();
 208     is_dumping = is_caching_enabled();
 209   } else if (CDSConfig::is_using_archive() && CDSConfig::is_using_aot_linked_classes()) {
 210     enable_caching();
 211     is_using = is_caching_enabled();
 212   } else {
 213     log_info(aot, codecache, init)("AOT Code Cache is not used: AOT Class Linking is not used.");
 214     disable_caching();
 215     return; // nothing to do
 216   }
 217   if (!(is_dumping || is_using)) {
 218     disable_caching();
 219     return; // AOT code caching disabled on command line
 220   }

 732   // change to UseLSE may affect validity of stubs and nmethods
 733   CHECK_FLAG(aarch64_, aarch64_useLSE, UseLSE);
 734 
 735   // check aarch64-specific intrinsic use settings are compatible
 736 
 737   CHECK_FLAG(aarch64_use_, aarch64_useBlockZeroing, UseBlockZeroing);
 738   CHECK_FLAG(aarch64_use_, aarch64_useSIMDForBigIntegerShift, UseSIMDForBigIntegerShiftIntrinsics);
 739   CHECK_FLAG(aarch64_use_, aarch64_useSimpleArrayEquals, UseSimpleArrayEquals);
 740   CHECK_FLAG(aarch64_use_, aarch64_useSecondarySupersCache, UseSecondarySupersCache);
 741 #endif // defined(AARCH64) && !defined(ZERO)
 742 
 743 #if INCLUDE_JVMCI
 744   // change to EnableJVMCI will affect validity of adapters and
 745   // nmethods
 746   if (_enableJVMCI != (uint)EnableJVMCI) {
 747     log_debug(aot, codecache, init)("AOT Code Cache disabled: it was created with EnableJVMCI = %s vs current %s", (_enableJVMCI ? "true" : "false"), (EnableJVMCI ? "true" : "false"));
 748     return false;
 749   }
 750 #endif // INCLUDE_JVMCI
 751 
 752   // The following checks do not affect AOT code, but can disable
 753   // AOT stub/adapters caching if they are incompatible with runtime settings
 754   // (adapters too as they access oops when buffering scalarized value objects).
 755 
 756   if (test_flag(compressedOops) != UseCompressedOops) {
 757     log_debug(aot, codecache, init)("AOT Stub/Adapter Cache disabled: it was created with UseCompressedOops = %s", UseCompressedOops ? "false" : "true");
 758     AOTStubCaching = false;
 759     if (InlineTypePassFieldsAsArgs) {
 760       AOTAdapterCaching = false;
 761     }
 762   }
 763   if (_compressedOopShift != (uint)CompressedOops::shift()) {
 764     log_debug(aot, codecache, init)("AOT Stub/Adapter Cache disabled: it was created with different CompressedOops::shift(): %d vs current %d", _compressedOopShift, CompressedOops::shift());
 765     AOTStubCaching = false;
 766     if (InlineTypePassFieldsAsArgs) {
 767       AOTAdapterCaching = false;
 768     }
 769   }
 770 
 771   // This should be the last check as it only disables AOTStub/AdapterCaching
 772   if ((_compressedOopBase == nullptr || CompressedOops::base() == nullptr) && (_compressedOopBase != CompressedOops::base())) {
 773     log_debug(aot, codecache, init)("AOT Stub/Adapter Cache disabled: incompatible CompressedOops::base(): %p vs current %p", _compressedOopBase, CompressedOops::base());
 774     AOTStubCaching = false;
 775     if (InlineTypePassFieldsAsArgs) {
 776       AOTAdapterCaching = false;
 777     }
 778   }
 779 
 780   return true;
 781 }
 782 
 783 #undef TEST_FLAG
 784 
 785 bool AOTCodeCache::Header::verify(uint load_size) const {
 786   if (_version != AOT_CODE_VERSION) {
 787     log_debug(aot, codecache, init)("AOT Code Cache disabled: different AOT Code version %d vs %d recorded in AOT Code header", AOT_CODE_VERSION, _version);
 788     return false;
 789   }
 790   if (load_size < _cache_size) {
 791     log_debug(aot, codecache, init)("AOT Code Cache disabled: AOT Code Cache size %d < %d recorded in AOT Code header", load_size, _cache_size);
 792     return false;
 793   }
 794   return true;
 795 }
 796 
 797 AOTCodeCache* AOTCodeCache::open_for_use() {

1591     assert(type##_length <= type##_max, "increase size"); \
1592   }
1593 
1594 static bool initializing_extrs = false;
1595 
1596 void AOTCodeAddressTable::init_extrs() {
1597   if (_extrs_complete || initializing_extrs) return; // Done already
1598 
1599   assert(_blobs_end <= _all_max, "AOTCodeAddress table ranges need adjusting");
1600 
1601   initializing_extrs = true;
1602   _extrs_addr = NEW_C_HEAP_ARRAY(address, _extrs_max, mtCode);
1603 
1604   _extrs_length = 0;
1605 
1606   // Record addresses of VM runtime methods
1607   SET_ADDRESS(_extrs, SharedRuntime::fixup_callers_callsite);
1608   SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method);
1609   SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_abstract);
1610   SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_ic_miss);
1611   SET_ADDRESS(_extrs, SharedRuntime::allocate_inline_types);
1612 #if defined(AARCH64) && !defined(ZERO)
1613   SET_ADDRESS(_extrs, JavaThread::aarch64_get_thread_helper);
1614 #endif
1615   {
1616     // Required by Shared blobs
1617     SET_ADDRESS(_extrs, Deoptimization::fetch_unroll_info);
1618     SET_ADDRESS(_extrs, Deoptimization::unpack_frames);
1619     SET_ADDRESS(_extrs, SafepointSynchronize::handle_polling_page_exception);
1620     SET_ADDRESS(_extrs, SharedRuntime::resolve_opt_virtual_call_C);
1621     SET_ADDRESS(_extrs, SharedRuntime::resolve_virtual_call_C);
1622     SET_ADDRESS(_extrs, SharedRuntime::resolve_static_call_C);
1623     SET_ADDRESS(_extrs, SharedRuntime::throw_StackOverflowError);
1624     SET_ADDRESS(_extrs, SharedRuntime::throw_delayed_StackOverflowError);
1625     SET_ADDRESS(_extrs, SharedRuntime::throw_AbstractMethodError);
1626     SET_ADDRESS(_extrs, SharedRuntime::throw_IncompatibleClassChangeError);
1627     SET_ADDRESS(_extrs, SharedRuntime::throw_NullPointerException_at_call);
1628   }
1629 
1630 #ifdef COMPILER1
1631   {

1641     SET_ADDRESS(_extrs, Runtime1::new_type_array);
1642     SET_ADDRESS(_extrs, Runtime1::new_object_array);
1643     SET_ADDRESS(_extrs, Runtime1::new_multi_array);
1644     SET_ADDRESS(_extrs, Runtime1::throw_range_check_exception);
1645     SET_ADDRESS(_extrs, Runtime1::throw_index_exception);
1646     SET_ADDRESS(_extrs, Runtime1::throw_div0_exception);
1647     SET_ADDRESS(_extrs, Runtime1::throw_null_pointer_exception);
1648     SET_ADDRESS(_extrs, Runtime1::throw_array_store_exception);
1649     SET_ADDRESS(_extrs, Runtime1::throw_class_cast_exception);
1650     SET_ADDRESS(_extrs, Runtime1::throw_incompatible_class_change_error);
1651     SET_ADDRESS(_extrs, Runtime1::is_instance_of);
1652     SET_ADDRESS(_extrs, Runtime1::monitorenter);
1653     SET_ADDRESS(_extrs, Runtime1::monitorexit);
1654     SET_ADDRESS(_extrs, Runtime1::deoptimize);
1655     SET_ADDRESS(_extrs, Runtime1::access_field_patching);
1656     SET_ADDRESS(_extrs, Runtime1::move_klass_patching);
1657     SET_ADDRESS(_extrs, Runtime1::move_mirror_patching);
1658     SET_ADDRESS(_extrs, Runtime1::move_appendix_patching);
1659     SET_ADDRESS(_extrs, Runtime1::predicate_failed_trap);
1660     SET_ADDRESS(_extrs, Runtime1::unimplemented_entry);
1661     SET_ADDRESS(_extrs, Runtime1::new_null_free_array);
1662     SET_ADDRESS(_extrs, Runtime1::load_flat_array);
1663     SET_ADDRESS(_extrs, Runtime1::store_flat_array);
1664     SET_ADDRESS(_extrs, Runtime1::substitutability_check);
1665     SET_ADDRESS(_extrs, Runtime1::buffer_inline_args);
1666     SET_ADDRESS(_extrs, Runtime1::buffer_inline_args_no_receiver);
1667     SET_ADDRESS(_extrs, Runtime1::throw_identity_exception);
1668     SET_ADDRESS(_extrs, Runtime1::throw_illegal_monitor_state_exception);
1669     SET_ADDRESS(_extrs, Thread::current);
1670     SET_ADDRESS(_extrs, CompressedKlassPointers::base_addr());
1671 #ifndef PRODUCT
1672     SET_ADDRESS(_extrs, os::breakpoint);
1673 #endif
1674   }
1675 #endif
1676 
1677 #ifdef COMPILER2
1678   {
1679     // Required by C2 blobs
1680     SET_ADDRESS(_extrs, Deoptimization::uncommon_trap);
1681     SET_ADDRESS(_extrs, OptoRuntime::handle_exception_C);
1682     SET_ADDRESS(_extrs, OptoRuntime::new_instance_C);
1683     SET_ADDRESS(_extrs, OptoRuntime::new_array_C);
1684     SET_ADDRESS(_extrs, OptoRuntime::new_array_nozero_C);
1685     SET_ADDRESS(_extrs, OptoRuntime::multianewarray2_C);
1686     SET_ADDRESS(_extrs, OptoRuntime::multianewarray3_C);
1687     SET_ADDRESS(_extrs, OptoRuntime::multianewarray4_C);
1688     SET_ADDRESS(_extrs, OptoRuntime::multianewarray5_C);
1689     SET_ADDRESS(_extrs, OptoRuntime::multianewarrayN_C);
1690     SET_ADDRESS(_extrs, OptoRuntime::complete_monitor_locking_C);
1691     SET_ADDRESS(_extrs, OptoRuntime::monitor_notify_C);
1692     SET_ADDRESS(_extrs, OptoRuntime::monitor_notifyAll_C);
1693     SET_ADDRESS(_extrs, OptoRuntime::rethrow_C);
1694     SET_ADDRESS(_extrs, OptoRuntime::slow_arraycopy_C);
1695     SET_ADDRESS(_extrs, OptoRuntime::register_finalizer_C);
1696     SET_ADDRESS(_extrs, OptoRuntime::load_unknown_inline_C);
1697     SET_ADDRESS(_extrs, OptoRuntime::store_unknown_inline_C);
1698     SET_ADDRESS(_extrs, OptoRuntime::vthread_end_first_transition_C);
1699     SET_ADDRESS(_extrs, OptoRuntime::vthread_start_final_transition_C);
1700     SET_ADDRESS(_extrs, OptoRuntime::vthread_start_transition_C);
1701     SET_ADDRESS(_extrs, OptoRuntime::vthread_end_transition_C);
1702 #if defined(AARCH64)
1703     SET_ADDRESS(_extrs, JavaThread::verify_cross_modify_fence_failure);
1704 #endif // AARCH64
1705   }
1706 #endif // COMPILER2
1707 
1708 #if INCLUDE_G1GC
1709   SET_ADDRESS(_extrs, G1BarrierSetRuntime::write_ref_field_pre_entry);
1710 #endif
1711 #if INCLUDE_SHENANDOAHGC
1712   SET_ADDRESS(_extrs, ShenandoahRuntime::write_barrier_pre);
1713   SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom);
1714   SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom_narrow);
1715 #endif
1716 #if INCLUDE_ZGC
1717   SET_ADDRESS(_extrs, ZBarrierSetRuntime::load_barrier_on_oop_field_preloaded_addr());
1718   SET_ADDRESS(_extrs, ZBarrierSetRuntime::load_barrier_on_phantom_oop_field_preloaded_addr());
1719 #if defined(AMD64)
1720   SET_ADDRESS(_extrs, &ZPointerLoadShift);
1721 #endif
1722 #endif
1723 #ifndef ZERO
1724 #if defined(AMD64) || defined(AARCH64) || defined(RISCV64)
1725   SET_ADDRESS(_extrs, MacroAssembler::debug64);
1726 #endif
1727 #endif // ZERO
1728 
1729   if (UseCompressedOops) {
1730     SET_ADDRESS(_extrs, CompressedOops::base_addr());
1731   }
1732 
1733   // addresses of fields in AOT runtime constants area
1734   address* p = AOTRuntimeConstants::field_addresses_list();
1735   while (*p != nullptr) {
1736     SET_ADDRESS(_extrs, *p++);
1737   }
1738 
1739   _extrs_complete = true;
1740   log_debug(aot, codecache, init)("External addresses recorded");
1741 }
1742 
1743 static bool initializing_early_stubs = false;
1744 
1745 void AOTCodeAddressTable::init_early_stubs() {
1746   if (_complete || initializing_early_stubs) return; // Done already
1747   initializing_early_stubs = true;
1748   _stubs_addr = NEW_C_HEAP_ARRAY(address, _stubs_max, mtCode);
1749   _stubs_length = 0;
1750   SET_ADDRESS(_stubs, StubRoutines::forward_exception_entry());
1751 
1752   {
< prev index next >