1323 assert(type##_length <= type##_max, "increase size"); \
1324 }
1325
1326 static bool initializing_extrs = false;
1327
1328 void AOTCodeAddressTable::init_extrs() {
1329 if (_extrs_complete || initializing_extrs) return; // Done already
1330
1331 assert(_blobs_end <= _all_max, "AOTCodeAddress table ranges need adjusting");
1332
1333 initializing_extrs = true;
1334 _extrs_addr = NEW_C_HEAP_ARRAY(address, _extrs_max, mtCode);
1335
1336 _extrs_length = 0;
1337
1338 // Record addresses of VM runtime methods
1339 SET_ADDRESS(_extrs, SharedRuntime::fixup_callers_callsite);
1340 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method);
1341 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_abstract);
1342 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_ic_miss);
1343 #if defined(AARCH64) && !defined(ZERO)
1344 SET_ADDRESS(_extrs, JavaThread::aarch64_get_thread_helper);
1345 #endif
1346 {
1347 // Required by Shared blobs
1348 SET_ADDRESS(_extrs, Deoptimization::fetch_unroll_info);
1349 SET_ADDRESS(_extrs, Deoptimization::unpack_frames);
1350 SET_ADDRESS(_extrs, SafepointSynchronize::handle_polling_page_exception);
1351 SET_ADDRESS(_extrs, SharedRuntime::resolve_opt_virtual_call_C);
1352 SET_ADDRESS(_extrs, SharedRuntime::resolve_virtual_call_C);
1353 SET_ADDRESS(_extrs, SharedRuntime::resolve_static_call_C);
1354 SET_ADDRESS(_extrs, SharedRuntime::throw_StackOverflowError);
1355 SET_ADDRESS(_extrs, SharedRuntime::throw_delayed_StackOverflowError);
1356 SET_ADDRESS(_extrs, SharedRuntime::throw_AbstractMethodError);
1357 SET_ADDRESS(_extrs, SharedRuntime::throw_IncompatibleClassChangeError);
1358 SET_ADDRESS(_extrs, SharedRuntime::throw_NullPointerException_at_call);
1359 }
1360
1361 #ifdef COMPILER1
1362 {
1372 SET_ADDRESS(_extrs, Runtime1::new_type_array);
1373 SET_ADDRESS(_extrs, Runtime1::new_object_array);
1374 SET_ADDRESS(_extrs, Runtime1::new_multi_array);
1375 SET_ADDRESS(_extrs, Runtime1::throw_range_check_exception);
1376 SET_ADDRESS(_extrs, Runtime1::throw_index_exception);
1377 SET_ADDRESS(_extrs, Runtime1::throw_div0_exception);
1378 SET_ADDRESS(_extrs, Runtime1::throw_null_pointer_exception);
1379 SET_ADDRESS(_extrs, Runtime1::throw_array_store_exception);
1380 SET_ADDRESS(_extrs, Runtime1::throw_class_cast_exception);
1381 SET_ADDRESS(_extrs, Runtime1::throw_incompatible_class_change_error);
1382 SET_ADDRESS(_extrs, Runtime1::is_instance_of);
1383 SET_ADDRESS(_extrs, Runtime1::monitorenter);
1384 SET_ADDRESS(_extrs, Runtime1::monitorexit);
1385 SET_ADDRESS(_extrs, Runtime1::deoptimize);
1386 SET_ADDRESS(_extrs, Runtime1::access_field_patching);
1387 SET_ADDRESS(_extrs, Runtime1::move_klass_patching);
1388 SET_ADDRESS(_extrs, Runtime1::move_mirror_patching);
1389 SET_ADDRESS(_extrs, Runtime1::move_appendix_patching);
1390 SET_ADDRESS(_extrs, Runtime1::predicate_failed_trap);
1391 SET_ADDRESS(_extrs, Runtime1::unimplemented_entry);
1392 SET_ADDRESS(_extrs, Thread::current);
1393 SET_ADDRESS(_extrs, CompressedKlassPointers::base_addr());
1394 #ifndef PRODUCT
1395 SET_ADDRESS(_extrs, os::breakpoint);
1396 #endif
1397 }
1398 #endif
1399
1400 #ifdef COMPILER2
1401 {
1402 // Required by C2 blobs
1403 SET_ADDRESS(_extrs, Deoptimization::uncommon_trap);
1404 SET_ADDRESS(_extrs, OptoRuntime::handle_exception_C);
1405 SET_ADDRESS(_extrs, OptoRuntime::new_instance_C);
1406 SET_ADDRESS(_extrs, OptoRuntime::new_array_C);
1407 SET_ADDRESS(_extrs, OptoRuntime::new_array_nozero_C);
1408 SET_ADDRESS(_extrs, OptoRuntime::multianewarray2_C);
1409 SET_ADDRESS(_extrs, OptoRuntime::multianewarray3_C);
1410 SET_ADDRESS(_extrs, OptoRuntime::multianewarray4_C);
1411 SET_ADDRESS(_extrs, OptoRuntime::multianewarray5_C);
1412 SET_ADDRESS(_extrs, OptoRuntime::multianewarrayN_C);
1413 SET_ADDRESS(_extrs, OptoRuntime::complete_monitor_locking_C);
1414 SET_ADDRESS(_extrs, OptoRuntime::monitor_notify_C);
1415 SET_ADDRESS(_extrs, OptoRuntime::monitor_notifyAll_C);
1416 SET_ADDRESS(_extrs, OptoRuntime::rethrow_C);
1417 SET_ADDRESS(_extrs, OptoRuntime::slow_arraycopy_C);
1418 SET_ADDRESS(_extrs, OptoRuntime::register_finalizer_C);
1419 SET_ADDRESS(_extrs, OptoRuntime::vthread_end_first_transition_C);
1420 SET_ADDRESS(_extrs, OptoRuntime::vthread_start_final_transition_C);
1421 SET_ADDRESS(_extrs, OptoRuntime::vthread_start_transition_C);
1422 SET_ADDRESS(_extrs, OptoRuntime::vthread_end_transition_C);
1423 #if defined(AARCH64)
1424 SET_ADDRESS(_extrs, JavaThread::verify_cross_modify_fence_failure);
1425 #endif // AARCH64
1426 }
1427 #endif // COMPILER2
1428
1429 #if INCLUDE_G1GC
1430 SET_ADDRESS(_extrs, G1BarrierSetRuntime::write_ref_field_pre_entry);
1431 #endif
1432 #if INCLUDE_SHENANDOAHGC
1433 SET_ADDRESS(_extrs, ShenandoahRuntime::write_barrier_pre);
1434 SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom);
1435 SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom_narrow);
1436 #endif
1437 #if INCLUDE_ZGC
1438 SET_ADDRESS(_extrs, ZBarrierSetRuntime::load_barrier_on_oop_field_preloaded_addr());
1439 SET_ADDRESS(_extrs, ZBarrierSetRuntime::load_barrier_on_phantom_oop_field_preloaded_addr());
1440 #if defined(AMD64)
1441 SET_ADDRESS(_extrs, &ZPointerLoadShift);
1442 #endif
1443 #endif
1444 #ifndef ZERO
1445 #if defined(AMD64) || defined(AARCH64) || defined(RISCV64)
1446 SET_ADDRESS(_extrs, MacroAssembler::debug64);
1447 #endif
1448 #endif // ZERO
1449
1450 _extrs_complete = true;
1451 log_debug(aot, codecache, init)("External addresses recorded");
1452 }
1453
1454 static bool initializing_early_stubs = false;
1455
1456 void AOTCodeAddressTable::init_early_stubs() {
1457 if (_complete || initializing_early_stubs) return; // Done already
1458 initializing_early_stubs = true;
1459 _stubs_addr = NEW_C_HEAP_ARRAY(address, _stubs_max, mtCode);
1460 _stubs_length = 0;
1461 SET_ADDRESS(_stubs, StubRoutines::forward_exception_entry());
1462
1463 {
1464 // Required by C1 blobs
1465 #if defined(AMD64) && !defined(ZERO)
1466 SET_ADDRESS(_stubs, StubRoutines::x86::double_sign_flip());
1467 SET_ADDRESS(_stubs, StubRoutines::x86::d2l_fixup());
1468 #endif // AMD64
1469 }
|
1323 assert(type##_length <= type##_max, "increase size"); \
1324 }
1325
1326 static bool initializing_extrs = false;
1327
1328 void AOTCodeAddressTable::init_extrs() {
1329 if (_extrs_complete || initializing_extrs) return; // Done already
1330
1331 assert(_blobs_end <= _all_max, "AOTCodeAddress table ranges need adjusting");
1332
1333 initializing_extrs = true;
1334 _extrs_addr = NEW_C_HEAP_ARRAY(address, _extrs_max, mtCode);
1335
1336 _extrs_length = 0;
1337
1338 // Record addresses of VM runtime methods
1339 SET_ADDRESS(_extrs, SharedRuntime::fixup_callers_callsite);
1340 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method);
1341 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_abstract);
1342 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_ic_miss);
1343 SET_ADDRESS(_extrs, SharedRuntime::allocate_inline_types);
1344 #if defined(AARCH64) && !defined(ZERO)
1345 SET_ADDRESS(_extrs, JavaThread::aarch64_get_thread_helper);
1346 #endif
1347 {
1348 // Required by Shared blobs
1349 SET_ADDRESS(_extrs, Deoptimization::fetch_unroll_info);
1350 SET_ADDRESS(_extrs, Deoptimization::unpack_frames);
1351 SET_ADDRESS(_extrs, SafepointSynchronize::handle_polling_page_exception);
1352 SET_ADDRESS(_extrs, SharedRuntime::resolve_opt_virtual_call_C);
1353 SET_ADDRESS(_extrs, SharedRuntime::resolve_virtual_call_C);
1354 SET_ADDRESS(_extrs, SharedRuntime::resolve_static_call_C);
1355 SET_ADDRESS(_extrs, SharedRuntime::throw_StackOverflowError);
1356 SET_ADDRESS(_extrs, SharedRuntime::throw_delayed_StackOverflowError);
1357 SET_ADDRESS(_extrs, SharedRuntime::throw_AbstractMethodError);
1358 SET_ADDRESS(_extrs, SharedRuntime::throw_IncompatibleClassChangeError);
1359 SET_ADDRESS(_extrs, SharedRuntime::throw_NullPointerException_at_call);
1360 }
1361
1362 #ifdef COMPILER1
1363 {
1373 SET_ADDRESS(_extrs, Runtime1::new_type_array);
1374 SET_ADDRESS(_extrs, Runtime1::new_object_array);
1375 SET_ADDRESS(_extrs, Runtime1::new_multi_array);
1376 SET_ADDRESS(_extrs, Runtime1::throw_range_check_exception);
1377 SET_ADDRESS(_extrs, Runtime1::throw_index_exception);
1378 SET_ADDRESS(_extrs, Runtime1::throw_div0_exception);
1379 SET_ADDRESS(_extrs, Runtime1::throw_null_pointer_exception);
1380 SET_ADDRESS(_extrs, Runtime1::throw_array_store_exception);
1381 SET_ADDRESS(_extrs, Runtime1::throw_class_cast_exception);
1382 SET_ADDRESS(_extrs, Runtime1::throw_incompatible_class_change_error);
1383 SET_ADDRESS(_extrs, Runtime1::is_instance_of);
1384 SET_ADDRESS(_extrs, Runtime1::monitorenter);
1385 SET_ADDRESS(_extrs, Runtime1::monitorexit);
1386 SET_ADDRESS(_extrs, Runtime1::deoptimize);
1387 SET_ADDRESS(_extrs, Runtime1::access_field_patching);
1388 SET_ADDRESS(_extrs, Runtime1::move_klass_patching);
1389 SET_ADDRESS(_extrs, Runtime1::move_mirror_patching);
1390 SET_ADDRESS(_extrs, Runtime1::move_appendix_patching);
1391 SET_ADDRESS(_extrs, Runtime1::predicate_failed_trap);
1392 SET_ADDRESS(_extrs, Runtime1::unimplemented_entry);
1393 SET_ADDRESS(_extrs, Runtime1::new_null_free_array);
1394 SET_ADDRESS(_extrs, Runtime1::load_flat_array);
1395 SET_ADDRESS(_extrs, Runtime1::store_flat_array);
1396 SET_ADDRESS(_extrs, Runtime1::substitutability_check);
1397 SET_ADDRESS(_extrs, Runtime1::buffer_inline_args);
1398 SET_ADDRESS(_extrs, Runtime1::buffer_inline_args_no_receiver);
1399 SET_ADDRESS(_extrs, Runtime1::throw_identity_exception);
1400 SET_ADDRESS(_extrs, Runtime1::throw_illegal_monitor_state_exception);
1401 SET_ADDRESS(_extrs, Thread::current);
1402 SET_ADDRESS(_extrs, CompressedKlassPointers::base_addr());
1403 #ifndef PRODUCT
1404 SET_ADDRESS(_extrs, os::breakpoint);
1405 #endif
1406 }
1407 #endif
1408
1409 #ifdef COMPILER2
1410 {
1411 // Required by C2 blobs
1412 SET_ADDRESS(_extrs, Deoptimization::uncommon_trap);
1413 SET_ADDRESS(_extrs, OptoRuntime::handle_exception_C);
1414 SET_ADDRESS(_extrs, OptoRuntime::new_instance_C);
1415 SET_ADDRESS(_extrs, OptoRuntime::new_array_C);
1416 SET_ADDRESS(_extrs, OptoRuntime::new_array_nozero_C);
1417 SET_ADDRESS(_extrs, OptoRuntime::multianewarray2_C);
1418 SET_ADDRESS(_extrs, OptoRuntime::multianewarray3_C);
1419 SET_ADDRESS(_extrs, OptoRuntime::multianewarray4_C);
1420 SET_ADDRESS(_extrs, OptoRuntime::multianewarray5_C);
1421 SET_ADDRESS(_extrs, OptoRuntime::multianewarrayN_C);
1422 SET_ADDRESS(_extrs, OptoRuntime::complete_monitor_locking_C);
1423 SET_ADDRESS(_extrs, OptoRuntime::monitor_notify_C);
1424 SET_ADDRESS(_extrs, OptoRuntime::monitor_notifyAll_C);
1425 SET_ADDRESS(_extrs, OptoRuntime::rethrow_C);
1426 SET_ADDRESS(_extrs, OptoRuntime::slow_arraycopy_C);
1427 SET_ADDRESS(_extrs, OptoRuntime::register_finalizer_C);
1428 SET_ADDRESS(_extrs, OptoRuntime::load_unknown_inline_C);
1429 SET_ADDRESS(_extrs, OptoRuntime::store_unknown_inline_C);
1430 SET_ADDRESS(_extrs, OptoRuntime::vthread_end_first_transition_C);
1431 SET_ADDRESS(_extrs, OptoRuntime::vthread_start_final_transition_C);
1432 SET_ADDRESS(_extrs, OptoRuntime::vthread_start_transition_C);
1433 SET_ADDRESS(_extrs, OptoRuntime::vthread_end_transition_C);
1434 #if defined(AARCH64)
1435 SET_ADDRESS(_extrs, JavaThread::verify_cross_modify_fence_failure);
1436 #endif // AARCH64
1437 }
1438 #endif // COMPILER2
1439
1440 #if INCLUDE_G1GC
1441 SET_ADDRESS(_extrs, G1BarrierSetRuntime::write_ref_field_pre_entry);
1442 #endif
1443 #if INCLUDE_SHENANDOAHGC
1444 SET_ADDRESS(_extrs, ShenandoahRuntime::write_barrier_pre);
1445 SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom);
1446 SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom_narrow);
1447 #endif
1448 #if INCLUDE_ZGC
1449 SET_ADDRESS(_extrs, ZBarrierSetRuntime::load_barrier_on_oop_field_preloaded_addr());
1450 SET_ADDRESS(_extrs, ZBarrierSetRuntime::load_barrier_on_phantom_oop_field_preloaded_addr());
1451 #if defined(AMD64)
1452 SET_ADDRESS(_extrs, &ZPointerLoadShift);
1453 #endif
1454 #endif
1455 #ifndef ZERO
1456 #if defined(AMD64) || defined(AARCH64) || defined(RISCV64)
1457 SET_ADDRESS(_extrs, MacroAssembler::debug64);
1458 #endif
1459 #endif // ZERO
1460
1461 if (UseCompressedOops) {
1462 SET_ADDRESS(_extrs, CompressedOops::base_addr());
1463 }
1464
1465 _extrs_complete = true;
1466 log_debug(aot, codecache, init)("External addresses recorded");
1467 }
1468
1469 static bool initializing_early_stubs = false;
1470
1471 void AOTCodeAddressTable::init_early_stubs() {
1472 if (_complete || initializing_early_stubs) return; // Done already
1473 initializing_early_stubs = true;
1474 _stubs_addr = NEW_C_HEAP_ARRAY(address, _stubs_max, mtCode);
1475 _stubs_length = 0;
1476 SET_ADDRESS(_stubs, StubRoutines::forward_exception_entry());
1477
1478 {
1479 // Required by C1 blobs
1480 #if defined(AMD64) && !defined(ZERO)
1481 SET_ADDRESS(_stubs, StubRoutines::x86::double_sign_flip());
1482 SET_ADDRESS(_stubs, StubRoutines::x86::d2l_fixup());
1483 #endif // AMD64
1484 }
|