3266 StubGenStubId stub_id = StubGenStubId::upcall_stub_load_target_id;
3267 StubCodeMark mark(this, stub_id);
3268 address start = __ pc();
3269
3270 __ resolve_global_jobject(Z_ARG1, Z_tmp_1, Z_tmp_2);
3271 // Load target method from receiver
3272 __ load_heap_oop(Z_method, Address(Z_ARG1, java_lang_invoke_MethodHandle::form_offset()),
3273 noreg, noreg, IS_NOT_NULL);
3274 __ load_heap_oop(Z_method, Address(Z_method, java_lang_invoke_LambdaForm::vmentry_offset()),
3275 noreg, noreg, IS_NOT_NULL);
3276 __ load_heap_oop(Z_method, Address(Z_method, java_lang_invoke_MemberName::method_offset()),
3277 noreg, noreg, IS_NOT_NULL);
3278 __ z_lg(Z_method, Address(Z_method, java_lang_invoke_ResolvedMethodName::vmtarget_offset()));
3279 __ z_stg(Z_method, Address(Z_thread, JavaThread::callee_target_offset())); // just in case callee is deoptimized
3280
3281 __ z_br(Z_R14);
3282
3283 return start;
3284 }
3285
3286 void generate_initial_stubs() {
3287 // Generates all stubs and initializes the entry points.
3288
3289 // Entry points that exist in all platforms.
3290 // Note: This is code that could be shared among different
3291 // platforms - however the benefit seems to be smaller than the
3292 // disadvantage of having a much more complicated generator
3293 // structure. See also comment in stubRoutines.hpp.
3294 StubRoutines::_forward_exception_entry = generate_forward_exception();
3295
3296 StubRoutines::_call_stub_entry = generate_call_stub(StubRoutines::_call_stub_return_address);
3297 StubRoutines::_catch_exception_entry = generate_catch_exception();
3298
3299 //----------------------------------------------------------------------
3300 // Entry points that are platform specific.
3301
3302 if (UnsafeMemoryAccess::_table == nullptr) {
3303 UnsafeMemoryAccess::create_table(4); // 4 for setMemory
3304 }
3305
3306 if (UseCRC32Intrinsics) {
3307 StubRoutines::_crc_table_adr = (address)StubRoutines::zarch::_crc_table;
3308 StubRoutines::_updateBytesCRC32 = generate_CRC32_updateBytes();
3309 }
3310
3311 if (UseCRC32CIntrinsics) {
3312 StubRoutines::_crc32c_table_addr = (address)StubRoutines::zarch::_crc32c_table;
3313 StubRoutines::_updateBytesCRC32C = generate_CRC32C_updateBytes();
3314 }
3315
3316 // Comapct string intrinsics: Translate table for string inflate intrinsic. Used by trot instruction.
3317 StubRoutines::zarch::_trot_table_addr = (address)StubRoutines::zarch::_trot_table;
3318 }
3319
3320 void generate_continuation_stubs() {
3321 if (!Continuations::enabled()) return;
3322
3323 // Continuation stubs:
3324 StubRoutines::_cont_thaw = generate_cont_thaw();
3325 StubRoutines::_cont_returnBarrier = generate_cont_returnBarrier();
3326 StubRoutines::_cont_returnBarrierExc = generate_cont_returnBarrier_exception();
3327 }
3328
3329 void generate_final_stubs() {
3330 // Generates all stubs and initializes the entry points.
3331
3332 // Support for verify_oop (must happen after universe_init).
3401
3402 #ifdef COMPILER2
3403 if (UseMultiplyToLenIntrinsic) {
3404 StubRoutines::_multiplyToLen = generate_multiplyToLen();
3405 }
3406 if (UseMontgomeryMultiplyIntrinsic) {
3407 StubRoutines::_montgomeryMultiply
3408 = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_multiply);
3409 }
3410 if (UseMontgomerySquareIntrinsic) {
3411 StubRoutines::_montgomerySquare
3412 = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square);
3413 }
3414 #endif
3415 #endif // COMPILER2_OR_JVMCI
3416 }
3417
3418 public:
3419 StubGenerator(CodeBuffer* code, StubGenBlobId blob_id) : StubCodeGenerator(code, blob_id) {
3420 switch(blob_id) {
3421 case initial_id:
3422 generate_initial_stubs();
3423 break;
3424 case continuation_id:
3425 generate_continuation_stubs();
3426 break;
3427 case compiler_id:
3428 generate_compiler_stubs();
3429 break;
3430 case final_id:
3431 generate_final_stubs();
3432 break;
3433 default:
3434 fatal("unexpected blob id: %d", blob_id);
3435 break;
3436 };
3437 }
3438
3439 private:
3440 int _stub_count;
|
3266 StubGenStubId stub_id = StubGenStubId::upcall_stub_load_target_id;
3267 StubCodeMark mark(this, stub_id);
3268 address start = __ pc();
3269
3270 __ resolve_global_jobject(Z_ARG1, Z_tmp_1, Z_tmp_2);
3271 // Load target method from receiver
3272 __ load_heap_oop(Z_method, Address(Z_ARG1, java_lang_invoke_MethodHandle::form_offset()),
3273 noreg, noreg, IS_NOT_NULL);
3274 __ load_heap_oop(Z_method, Address(Z_method, java_lang_invoke_LambdaForm::vmentry_offset()),
3275 noreg, noreg, IS_NOT_NULL);
3276 __ load_heap_oop(Z_method, Address(Z_method, java_lang_invoke_MemberName::method_offset()),
3277 noreg, noreg, IS_NOT_NULL);
3278 __ z_lg(Z_method, Address(Z_method, java_lang_invoke_ResolvedMethodName::vmtarget_offset()));
3279 __ z_stg(Z_method, Address(Z_thread, JavaThread::callee_target_offset())); // just in case callee is deoptimized
3280
3281 __ z_br(Z_R14);
3282
3283 return start;
3284 }
3285
3286 void generate_preuniverse_stubs() {
3287 // preuniverse stubs are not needed for s390
3288 }
3289
3290 void generate_initial_stubs() {
3291 // Generates all stubs and initializes the entry points.
3292
3293 // Entry points that exist in all platforms.
3294 // Note: This is code that could be shared among different
3295 // platforms - however the benefit seems to be smaller than the
3296 // disadvantage of having a much more complicated generator
3297 // structure. See also comment in stubRoutines.hpp.
3298 StubRoutines::_forward_exception_entry = generate_forward_exception();
3299
3300 StubRoutines::_call_stub_entry = generate_call_stub(StubRoutines::_call_stub_return_address);
3301 StubRoutines::_catch_exception_entry = generate_catch_exception();
3302
3303 //----------------------------------------------------------------------
3304 // Entry points that are platform specific.
3305
3306 if (UnsafeMemoryAccess::_table == nullptr) {
3307 UnsafeMemoryAccess::create_table(4); // 4 for setMemory
3308 }
3309
3310 if (UseCRC32Intrinsics) {
3311 StubRoutines::_updateBytesCRC32 = generate_CRC32_updateBytes();
3312 }
3313
3314 if (UseCRC32CIntrinsics) {
3315 StubRoutines::_updateBytesCRC32C = generate_CRC32C_updateBytes();
3316 }
3317
3318 // Comapct string intrinsics: Translate table for string inflate intrinsic. Used by trot instruction.
3319 StubRoutines::zarch::_trot_table_addr = (address)StubRoutines::zarch::_trot_table;
3320 }
3321
3322 void generate_continuation_stubs() {
3323 if (!Continuations::enabled()) return;
3324
3325 // Continuation stubs:
3326 StubRoutines::_cont_thaw = generate_cont_thaw();
3327 StubRoutines::_cont_returnBarrier = generate_cont_returnBarrier();
3328 StubRoutines::_cont_returnBarrierExc = generate_cont_returnBarrier_exception();
3329 }
3330
3331 void generate_final_stubs() {
3332 // Generates all stubs and initializes the entry points.
3333
3334 // Support for verify_oop (must happen after universe_init).
3403
3404 #ifdef COMPILER2
3405 if (UseMultiplyToLenIntrinsic) {
3406 StubRoutines::_multiplyToLen = generate_multiplyToLen();
3407 }
3408 if (UseMontgomeryMultiplyIntrinsic) {
3409 StubRoutines::_montgomeryMultiply
3410 = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_multiply);
3411 }
3412 if (UseMontgomerySquareIntrinsic) {
3413 StubRoutines::_montgomerySquare
3414 = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square);
3415 }
3416 #endif
3417 #endif // COMPILER2_OR_JVMCI
3418 }
3419
3420 public:
3421 StubGenerator(CodeBuffer* code, StubGenBlobId blob_id) : StubCodeGenerator(code, blob_id) {
3422 switch(blob_id) {
3423 case preuniverse_id:
3424 generate_preuniverse_stubs();
3425 break;
3426 case initial_id:
3427 generate_initial_stubs();
3428 break;
3429 case continuation_id:
3430 generate_continuation_stubs();
3431 break;
3432 case compiler_id:
3433 generate_compiler_stubs();
3434 break;
3435 case final_id:
3436 generate_final_stubs();
3437 break;
3438 default:
3439 fatal("unexpected blob id: %d", blob_id);
3440 break;
3441 };
3442 }
3443
3444 private:
3445 int _stub_count;
|