1270 assert(type##_length <= type##_max, "increase size"); \
1271 }
1272
1273 static bool initializing_extrs = false;
1274
1275 void AOTCodeAddressTable::init_extrs() {
1276 if (_extrs_complete || initializing_extrs) return; // Done already
1277
1278 assert(_blobs_end <= _all_max, "AOTCodeAddress table ranges need adjusting");
1279
1280 initializing_extrs = true;
1281 _extrs_addr = NEW_C_HEAP_ARRAY(address, _extrs_max, mtCode);
1282
1283 _extrs_length = 0;
1284
1285 // Record addresses of VM runtime methods
1286 SET_ADDRESS(_extrs, SharedRuntime::fixup_callers_callsite);
1287 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method);
1288 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_abstract);
1289 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_ic_miss);
1290 #if defined(AARCH64) && !defined(ZERO)
1291 SET_ADDRESS(_extrs, JavaThread::aarch64_get_thread_helper);
1292 #endif
1293 {
1294 // Required by Shared blobs
1295 SET_ADDRESS(_extrs, Deoptimization::fetch_unroll_info);
1296 SET_ADDRESS(_extrs, Deoptimization::unpack_frames);
1297 SET_ADDRESS(_extrs, SafepointSynchronize::handle_polling_page_exception);
1298 SET_ADDRESS(_extrs, SharedRuntime::resolve_opt_virtual_call_C);
1299 SET_ADDRESS(_extrs, SharedRuntime::resolve_virtual_call_C);
1300 SET_ADDRESS(_extrs, SharedRuntime::resolve_static_call_C);
1301 SET_ADDRESS(_extrs, SharedRuntime::throw_delayed_StackOverflowError);
1302 SET_ADDRESS(_extrs, SharedRuntime::throw_AbstractMethodError);
1303 SET_ADDRESS(_extrs, SharedRuntime::throw_IncompatibleClassChangeError);
1304 SET_ADDRESS(_extrs, SharedRuntime::throw_NullPointerException_at_call);
1305 }
1306
1307 #ifdef COMPILER1
1308 {
1309 // Required by C1 blobs
1318 SET_ADDRESS(_extrs, Runtime1::new_type_array);
1319 SET_ADDRESS(_extrs, Runtime1::new_object_array);
1320 SET_ADDRESS(_extrs, Runtime1::new_multi_array);
1321 SET_ADDRESS(_extrs, Runtime1::throw_range_check_exception);
1322 SET_ADDRESS(_extrs, Runtime1::throw_index_exception);
1323 SET_ADDRESS(_extrs, Runtime1::throw_div0_exception);
1324 SET_ADDRESS(_extrs, Runtime1::throw_null_pointer_exception);
1325 SET_ADDRESS(_extrs, Runtime1::throw_array_store_exception);
1326 SET_ADDRESS(_extrs, Runtime1::throw_class_cast_exception);
1327 SET_ADDRESS(_extrs, Runtime1::throw_incompatible_class_change_error);
1328 SET_ADDRESS(_extrs, Runtime1::is_instance_of);
1329 SET_ADDRESS(_extrs, Runtime1::monitorenter);
1330 SET_ADDRESS(_extrs, Runtime1::monitorexit);
1331 SET_ADDRESS(_extrs, Runtime1::deoptimize);
1332 SET_ADDRESS(_extrs, Runtime1::access_field_patching);
1333 SET_ADDRESS(_extrs, Runtime1::move_klass_patching);
1334 SET_ADDRESS(_extrs, Runtime1::move_mirror_patching);
1335 SET_ADDRESS(_extrs, Runtime1::move_appendix_patching);
1336 SET_ADDRESS(_extrs, Runtime1::predicate_failed_trap);
1337 SET_ADDRESS(_extrs, Runtime1::unimplemented_entry);
1338 SET_ADDRESS(_extrs, Thread::current);
1339 SET_ADDRESS(_extrs, CompressedKlassPointers::base_addr());
1340 #ifndef PRODUCT
1341 SET_ADDRESS(_extrs, os::breakpoint);
1342 #endif
1343 }
1344 #endif
1345
1346 #ifdef COMPILER2
1347 {
1348 // Required by C2 blobs
1349 SET_ADDRESS(_extrs, Deoptimization::uncommon_trap);
1350 SET_ADDRESS(_extrs, OptoRuntime::handle_exception_C);
1351 SET_ADDRESS(_extrs, OptoRuntime::new_instance_C);
1352 SET_ADDRESS(_extrs, OptoRuntime::new_array_C);
1353 SET_ADDRESS(_extrs, OptoRuntime::new_array_nozero_C);
1354 SET_ADDRESS(_extrs, OptoRuntime::multianewarray2_C);
1355 SET_ADDRESS(_extrs, OptoRuntime::multianewarray3_C);
1356 SET_ADDRESS(_extrs, OptoRuntime::multianewarray4_C);
1357 SET_ADDRESS(_extrs, OptoRuntime::multianewarray5_C);
1358 SET_ADDRESS(_extrs, OptoRuntime::multianewarrayN_C);
1359 #if INCLUDE_JVMTI
1360 SET_ADDRESS(_extrs, SharedRuntime::notify_jvmti_vthread_start);
1361 SET_ADDRESS(_extrs, SharedRuntime::notify_jvmti_vthread_end);
1362 SET_ADDRESS(_extrs, SharedRuntime::notify_jvmti_vthread_mount);
1363 SET_ADDRESS(_extrs, SharedRuntime::notify_jvmti_vthread_unmount);
1364 #endif
1365 SET_ADDRESS(_extrs, OptoRuntime::complete_monitor_locking_C);
1366 SET_ADDRESS(_extrs, OptoRuntime::monitor_notify_C);
1367 SET_ADDRESS(_extrs, OptoRuntime::monitor_notifyAll_C);
1368 SET_ADDRESS(_extrs, OptoRuntime::rethrow_C);
1369 SET_ADDRESS(_extrs, OptoRuntime::slow_arraycopy_C);
1370 SET_ADDRESS(_extrs, OptoRuntime::register_finalizer_C);
1371 #if defined(AARCH64)
1372 SET_ADDRESS(_extrs, JavaThread::verify_cross_modify_fence_failure);
1373 #endif // AARCH64
1374 }
1375 #endif // COMPILER2
1376
1377 #if INCLUDE_G1GC
1378 SET_ADDRESS(_extrs, G1BarrierSetRuntime::write_ref_field_post_entry);
1379 SET_ADDRESS(_extrs, G1BarrierSetRuntime::write_ref_field_pre_entry);
1380 #endif
1381 #if INCLUDE_SHENANDOAHGC
1382 SET_ADDRESS(_extrs, ShenandoahRuntime::write_ref_field_pre);
1383 SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom);
1384 SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom_narrow);
1385 #endif
1386 #if INCLUDE_ZGC
1387 SET_ADDRESS(_extrs, ZBarrierSetRuntime::load_barrier_on_phantom_oop_field_preloaded_addr());
1388 #if defined(AMD64)
1389 SET_ADDRESS(_extrs, &ZPointerLoadShift);
1390 #endif
1391 #endif
1392 #ifndef ZERO
1393 #if defined(AMD64) || defined(AARCH64) || defined(RISCV64)
1394 SET_ADDRESS(_extrs, MacroAssembler::debug64);
1395 #endif
1396 #endif // ZERO
1397
1398 _extrs_complete = true;
1399 log_debug(aot, codecache, init)("External addresses recorded");
1400 }
1401
1402 static bool initializing_early_stubs = false;
1403
1404 void AOTCodeAddressTable::init_early_stubs() {
1405 if (_complete || initializing_early_stubs) return; // Done already
1406 initializing_early_stubs = true;
1407 _stubs_addr = NEW_C_HEAP_ARRAY(address, _stubs_max, mtCode);
1408 _stubs_length = 0;
1409 SET_ADDRESS(_stubs, StubRoutines::forward_exception_entry());
1410
1411 {
1412 // Required by C1 blobs
1413 #if defined(AMD64) && !defined(ZERO)
1414 SET_ADDRESS(_stubs, StubRoutines::x86::double_sign_flip());
1415 SET_ADDRESS(_stubs, StubRoutines::x86::d2l_fixup());
1416 #endif // AMD64
1417 }
|
1270 assert(type##_length <= type##_max, "increase size"); \
1271 }
1272
1273 static bool initializing_extrs = false;
1274
1275 void AOTCodeAddressTable::init_extrs() {
1276 if (_extrs_complete || initializing_extrs) return; // Done already
1277
1278 assert(_blobs_end <= _all_max, "AOTCodeAddress table ranges need adjusting");
1279
1280 initializing_extrs = true;
1281 _extrs_addr = NEW_C_HEAP_ARRAY(address, _extrs_max, mtCode);
1282
1283 _extrs_length = 0;
1284
1285 // Record addresses of VM runtime methods
1286 SET_ADDRESS(_extrs, SharedRuntime::fixup_callers_callsite);
1287 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method);
1288 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_abstract);
1289 SET_ADDRESS(_extrs, SharedRuntime::handle_wrong_method_ic_miss);
1290 SET_ADDRESS(_extrs, SharedRuntime::allocate_inline_types);
1291 #if defined(AARCH64) && !defined(ZERO)
1292 SET_ADDRESS(_extrs, JavaThread::aarch64_get_thread_helper);
1293 #endif
1294 {
1295 // Required by Shared blobs
1296 SET_ADDRESS(_extrs, Deoptimization::fetch_unroll_info);
1297 SET_ADDRESS(_extrs, Deoptimization::unpack_frames);
1298 SET_ADDRESS(_extrs, SafepointSynchronize::handle_polling_page_exception);
1299 SET_ADDRESS(_extrs, SharedRuntime::resolve_opt_virtual_call_C);
1300 SET_ADDRESS(_extrs, SharedRuntime::resolve_virtual_call_C);
1301 SET_ADDRESS(_extrs, SharedRuntime::resolve_static_call_C);
1302 SET_ADDRESS(_extrs, SharedRuntime::throw_delayed_StackOverflowError);
1303 SET_ADDRESS(_extrs, SharedRuntime::throw_AbstractMethodError);
1304 SET_ADDRESS(_extrs, SharedRuntime::throw_IncompatibleClassChangeError);
1305 SET_ADDRESS(_extrs, SharedRuntime::throw_NullPointerException_at_call);
1306 }
1307
1308 #ifdef COMPILER1
1309 {
1310 // Required by C1 blobs
1319 SET_ADDRESS(_extrs, Runtime1::new_type_array);
1320 SET_ADDRESS(_extrs, Runtime1::new_object_array);
1321 SET_ADDRESS(_extrs, Runtime1::new_multi_array);
1322 SET_ADDRESS(_extrs, Runtime1::throw_range_check_exception);
1323 SET_ADDRESS(_extrs, Runtime1::throw_index_exception);
1324 SET_ADDRESS(_extrs, Runtime1::throw_div0_exception);
1325 SET_ADDRESS(_extrs, Runtime1::throw_null_pointer_exception);
1326 SET_ADDRESS(_extrs, Runtime1::throw_array_store_exception);
1327 SET_ADDRESS(_extrs, Runtime1::throw_class_cast_exception);
1328 SET_ADDRESS(_extrs, Runtime1::throw_incompatible_class_change_error);
1329 SET_ADDRESS(_extrs, Runtime1::is_instance_of);
1330 SET_ADDRESS(_extrs, Runtime1::monitorenter);
1331 SET_ADDRESS(_extrs, Runtime1::monitorexit);
1332 SET_ADDRESS(_extrs, Runtime1::deoptimize);
1333 SET_ADDRESS(_extrs, Runtime1::access_field_patching);
1334 SET_ADDRESS(_extrs, Runtime1::move_klass_patching);
1335 SET_ADDRESS(_extrs, Runtime1::move_mirror_patching);
1336 SET_ADDRESS(_extrs, Runtime1::move_appendix_patching);
1337 SET_ADDRESS(_extrs, Runtime1::predicate_failed_trap);
1338 SET_ADDRESS(_extrs, Runtime1::unimplemented_entry);
1339 SET_ADDRESS(_extrs, Runtime1::new_null_free_array);
1340 SET_ADDRESS(_extrs, Runtime1::load_flat_array);
1341 SET_ADDRESS(_extrs, Runtime1::store_flat_array);
1342 SET_ADDRESS(_extrs, Runtime1::substitutability_check);
1343 SET_ADDRESS(_extrs, Runtime1::buffer_inline_args);
1344 SET_ADDRESS(_extrs, Runtime1::buffer_inline_args_no_receiver);
1345 SET_ADDRESS(_extrs, Runtime1::throw_identity_exception);
1346 SET_ADDRESS(_extrs, Runtime1::throw_illegal_monitor_state_exception);
1347 SET_ADDRESS(_extrs, Thread::current);
1348 SET_ADDRESS(_extrs, CompressedKlassPointers::base_addr());
1349 #ifndef PRODUCT
1350 SET_ADDRESS(_extrs, os::breakpoint);
1351 #endif
1352 }
1353 #endif
1354
1355 #ifdef COMPILER2
1356 {
1357 // Required by C2 blobs
1358 SET_ADDRESS(_extrs, Deoptimization::uncommon_trap);
1359 SET_ADDRESS(_extrs, OptoRuntime::handle_exception_C);
1360 SET_ADDRESS(_extrs, OptoRuntime::new_instance_C);
1361 SET_ADDRESS(_extrs, OptoRuntime::new_array_C);
1362 SET_ADDRESS(_extrs, OptoRuntime::new_array_nozero_C);
1363 SET_ADDRESS(_extrs, OptoRuntime::multianewarray2_C);
1364 SET_ADDRESS(_extrs, OptoRuntime::multianewarray3_C);
1365 SET_ADDRESS(_extrs, OptoRuntime::multianewarray4_C);
1366 SET_ADDRESS(_extrs, OptoRuntime::multianewarray5_C);
1367 SET_ADDRESS(_extrs, OptoRuntime::multianewarrayN_C);
1368 #if INCLUDE_JVMTI
1369 SET_ADDRESS(_extrs, SharedRuntime::notify_jvmti_vthread_start);
1370 SET_ADDRESS(_extrs, SharedRuntime::notify_jvmti_vthread_end);
1371 SET_ADDRESS(_extrs, SharedRuntime::notify_jvmti_vthread_mount);
1372 SET_ADDRESS(_extrs, SharedRuntime::notify_jvmti_vthread_unmount);
1373 #endif
1374 SET_ADDRESS(_extrs, OptoRuntime::complete_monitor_locking_C);
1375 SET_ADDRESS(_extrs, OptoRuntime::monitor_notify_C);
1376 SET_ADDRESS(_extrs, OptoRuntime::monitor_notifyAll_C);
1377 SET_ADDRESS(_extrs, OptoRuntime::rethrow_C);
1378 SET_ADDRESS(_extrs, OptoRuntime::slow_arraycopy_C);
1379 SET_ADDRESS(_extrs, OptoRuntime::register_finalizer_C);
1380 SET_ADDRESS(_extrs, OptoRuntime::load_unknown_inline_C);
1381 SET_ADDRESS(_extrs, OptoRuntime::store_unknown_inline_C);
1382 #if defined(AARCH64)
1383 SET_ADDRESS(_extrs, JavaThread::verify_cross_modify_fence_failure);
1384 #endif // AARCH64
1385 }
1386 #endif // COMPILER2
1387
1388 #if INCLUDE_G1GC
1389 SET_ADDRESS(_extrs, G1BarrierSetRuntime::write_ref_field_post_entry);
1390 SET_ADDRESS(_extrs, G1BarrierSetRuntime::write_ref_field_pre_entry);
1391 #endif
1392 #if INCLUDE_SHENANDOAHGC
1393 SET_ADDRESS(_extrs, ShenandoahRuntime::write_ref_field_pre);
1394 SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom);
1395 SET_ADDRESS(_extrs, ShenandoahRuntime::load_reference_barrier_phantom_narrow);
1396 #endif
1397 #if INCLUDE_ZGC
1398 SET_ADDRESS(_extrs, ZBarrierSetRuntime::load_barrier_on_phantom_oop_field_preloaded_addr());
1399 #if defined(AMD64)
1400 SET_ADDRESS(_extrs, &ZPointerLoadShift);
1401 #endif
1402 #endif
1403 #ifndef ZERO
1404 #if defined(AMD64) || defined(AARCH64) || defined(RISCV64)
1405 SET_ADDRESS(_extrs, MacroAssembler::debug64);
1406 #endif
1407 #endif // ZERO
1408
1409 if (UseCompressedOops) {
1410 SET_ADDRESS(_extrs, CompressedOops::base_addr());
1411 }
1412
1413 _extrs_complete = true;
1414 log_debug(aot, codecache, init)("External addresses recorded");
1415 }
1416
1417 static bool initializing_early_stubs = false;
1418
1419 void AOTCodeAddressTable::init_early_stubs() {
1420 if (_complete || initializing_early_stubs) return; // Done already
1421 initializing_early_stubs = true;
1422 _stubs_addr = NEW_C_HEAP_ARRAY(address, _stubs_max, mtCode);
1423 _stubs_length = 0;
1424 SET_ADDRESS(_stubs, StubRoutines::forward_exception_entry());
1425
1426 {
1427 // Required by C1 blobs
1428 #if defined(AMD64) && !defined(ZERO)
1429 SET_ADDRESS(_stubs, StubRoutines::x86::double_sign_flip());
1430 SET_ADDRESS(_stubs, StubRoutines::x86::d2l_fixup());
1431 #endif // AMD64
1432 }
|