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
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
3405
3406 #ifdef COMPILER2
3407 if (UseMultiplyToLenIntrinsic) {
3408 StubRoutines::_multiplyToLen = generate_multiplyToLen();
3409 }
3410 if (UseMontgomeryMultiplyIntrinsic) {
3411 StubRoutines::_montgomeryMultiply
3412 = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_multiply);
3413 }
3414 if (UseMontgomerySquareIntrinsic) {
3415 StubRoutines::_montgomerySquare
3416 = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square);
3417 }
3418 #endif
3419 #endif // COMPILER2_OR_JVMCI
3420 }
3421
3422 public:
3423 StubGenerator(CodeBuffer* code, StubGenBlobId blob_id) : StubCodeGenerator(code, blob_id) {
3424 switch(blob_id) {
3425 case preuniverse_id:
3426 generate_preuniverse_stubs();
3427 break;
3428 case initial_id:
3429 generate_initial_stubs();
3430 break;
3431 case continuation_id:
3432 generate_continuation_stubs();
3433 break;
3434 case compiler_id:
3435 generate_compiler_stubs();
3436 break;
3437 case final_id:
3438 generate_final_stubs();
3439 break;
3440 default:
3441 fatal("unexpected blob id: %d", blob_id);
3442 break;
3443 };
3444 }
3445
3446 private:
3447 int _stub_count;
|