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