diff --git a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp index 063918ee20b7b..a6aab24349a1f 100644 --- a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp @@ -91,10 +91,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre // exception pending => remove activation and forward to exception handler // make sure that the vm_results are cleared if (oop_result1->is_valid()) { - str(zr, Address(rthread, JavaThread::vm_result_offset())); + str(zr, Address(rthread, JavaThread::vm_result_oop_offset())); } if (metadata_result->is_valid()) { - str(zr, Address(rthread, JavaThread::vm_result_2_offset())); + str(zr, Address(rthread, JavaThread::vm_result_metadata_offset())); } if (frame_size() == no_frame_size) { leave(); @@ -108,10 +108,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre } // get oop results if there are any and reset the values in the thread if (oop_result1->is_valid()) { - get_vm_result(oop_result1, rthread); + get_vm_result_oop(oop_result1, rthread); } if (metadata_result->is_valid()) { - get_vm_result_2(metadata_result, rthread); + get_vm_result_metadata(metadata_result, rthread); } return call_offset; } @@ -406,8 +406,8 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm) __ authenticate_return_address(exception_pc); // make sure that the vm_results are cleared (may be unnecessary) - __ str(zr, Address(rthread, JavaThread::vm_result_offset())); - __ str(zr, Address(rthread, JavaThread::vm_result_2_offset())); + __ str(zr, Address(rthread, JavaThread::vm_result_oop_offset())); + __ str(zr, Address(rthread, JavaThread::vm_result_metadata_offset())); break; case C1StubId::handle_exception_nofpu_id: case C1StubId::handle_exception_id: diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index b6472b1b94812..1e226c70420de 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -849,7 +849,7 @@ void MacroAssembler::call_VM_base(Register oop_result, // get oop result if there is one and reset the value in the thread if (oop_result->is_valid()) { - get_vm_result(oop_result, java_thread); + get_vm_result_oop(oop_result, java_thread); } } @@ -1145,15 +1145,15 @@ void MacroAssembler::call_VM(Register oop_result, } -void MacroAssembler::get_vm_result(Register oop_result, Register java_thread) { - ldr(oop_result, Address(java_thread, JavaThread::vm_result_offset())); - str(zr, Address(java_thread, JavaThread::vm_result_offset())); +void MacroAssembler::get_vm_result_oop(Register oop_result, Register java_thread) { + ldr(oop_result, Address(java_thread, JavaThread::vm_result_oop_offset())); + str(zr, Address(java_thread, JavaThread::vm_result_oop_offset())); verify_oop_msg(oop_result, "broken oop in call_VM_base"); } -void MacroAssembler::get_vm_result_2(Register metadata_result, Register java_thread) { - ldr(metadata_result, Address(java_thread, JavaThread::vm_result_2_offset())); - str(zr, Address(java_thread, JavaThread::vm_result_2_offset())); +void MacroAssembler::get_vm_result_metadata(Register metadata_result, Register java_thread) { + ldr(metadata_result, Address(java_thread, JavaThread::vm_result_metadata_offset())); + str(zr, Address(java_thread, JavaThread::vm_result_metadata_offset())); } void MacroAssembler::align(int modulus) { diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp index bd537af59e471..11d1985e50bf4 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp @@ -823,8 +823,8 @@ class MacroAssembler: public Assembler { Register arg_1, Register arg_2, Register arg_3, bool check_exceptions = true); - void get_vm_result (Register oop_result, Register thread); - void get_vm_result_2(Register metadata_result, Register thread); + void get_vm_result_oop(Register oop_result, Register thread); + void get_vm_result_metadata(Register metadata_result, Register thread); // These always tightly bind to MacroAssembler::call_VM_base // bypassing the virtual implementation diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp index b0b299876018a..967984b882166 100644 --- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp @@ -2783,7 +2783,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti __ cbnz(rscratch1, pending); // get the returned Method* - __ get_vm_result_2(rmethod, rthread); + __ get_vm_result_metadata(rmethod, rthread); __ str(rmethod, Address(sp, reg_save.reg_offset_in_bytes(rmethod))); // r0 is where we want to jump, overwrite rscratch1 which is saved and scratch @@ -2802,7 +2802,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti // exception pending => remove activation and forward to exception handler - __ str(zr, Address(rthread, JavaThread::vm_result_offset())); + __ str(zr, Address(rthread, JavaThread::vm_result_oop_offset())); __ ldr(r0, Address(rthread, Thread::pending_exception_offset())); __ far_jump(RuntimeAddress(StubRoutines::forward_exception_entry())); diff --git a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp index 80c9437de6b7a..2db3b435abbc9 100644 --- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp @@ -1978,11 +1978,11 @@ void TemplateInterpreterGenerator::generate_throw_exception() { // preserve exception over this code sequence __ pop_ptr(r0); - __ str(r0, Address(rthread, JavaThread::vm_result_offset())); + __ str(r0, Address(rthread, JavaThread::vm_result_oop_offset())); // remove the activation (without doing throws on illegalMonitorExceptions) __ remove_activation(vtos, false, true, false); // restore exception - __ get_vm_result(r0, rthread); + __ get_vm_result_oop(r0, rthread); // In between activations - previous activation type unknown yet // compute continuation point - the continuation point expects the diff --git a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp index e50810486c80d..2cc9b39983ac1 100644 --- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp @@ -484,7 +484,7 @@ void TemplateTable::condy_helper(Label& Done) __ mov(rarg, (int) bytecode()); __ call_VM(obj, entry, rarg); - __ get_vm_result_2(flags, rthread); + __ get_vm_result_metadata(flags, rthread); // VMr = obj = base address to find primitive value to push // VMr2 = flags = (tos, off) using format of CPCE::_flags @@ -3723,8 +3723,7 @@ void TemplateTable::checkcast() __ push(atos); // save receiver for result, and for GC call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - // vm_result_2 has metadata result - __ get_vm_result_2(r0, rthread); + __ get_vm_result_metadata(r0, rthread); __ pop(r3); // restore receiver __ b(resolved); @@ -3777,8 +3776,7 @@ void TemplateTable::instanceof() { __ push(atos); // save receiver for result, and for GC call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - // vm_result_2 has metadata result - __ get_vm_result_2(r0, rthread); + __ get_vm_result_metadata(r0, rthread); __ pop(r3); // restore receiver __ verify_oop(r3); __ load_klass(r3, r3); diff --git a/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp b/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp index 949e985ab1eea..021b47148fa8c 100644 --- a/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp +++ b/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp @@ -70,11 +70,11 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre if (oop_result1->is_valid()) { assert_different_registers(oop_result1, R3, Rtemp); - get_vm_result(oop_result1, Rtemp); + get_vm_result_oop(oop_result1, Rtemp); } if (metadata_result->is_valid()) { assert_different_registers(metadata_result, R3, Rtemp); - get_vm_result_2(metadata_result, Rtemp); + get_vm_result_metadata(metadata_result, Rtemp); } // Check for pending exception diff --git a/src/hotspot/cpu/arm/macroAssembler_arm.cpp b/src/hotspot/cpu/arm/macroAssembler_arm.cpp index 638b3a5404c25..3dcde7d898d08 100644 --- a/src/hotspot/cpu/arm/macroAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/macroAssembler_arm.cpp @@ -424,7 +424,7 @@ void MacroAssembler::call_VM_helper(Register oop_result, address entry_point, in // get oop result if there is one and reset the value in the thread if (oop_result->is_valid()) { - get_vm_result(oop_result, tmp); + get_vm_result_oop(oop_result, tmp); } } @@ -528,17 +528,17 @@ void MacroAssembler::call_VM_leaf(address entry_point, Register arg_1, Register call_VM_leaf_helper(entry_point, 4); } -void MacroAssembler::get_vm_result(Register oop_result, Register tmp) { +void MacroAssembler::get_vm_result_oop(Register oop_result, Register tmp) { assert_different_registers(oop_result, tmp); - ldr(oop_result, Address(Rthread, JavaThread::vm_result_offset())); - str(zero_register(tmp), Address(Rthread, JavaThread::vm_result_offset())); + ldr(oop_result, Address(Rthread, JavaThread::vm_result_oop_offset())); + str(zero_register(tmp), Address(Rthread, JavaThread::vm_result_oop_offset())); verify_oop(oop_result); } -void MacroAssembler::get_vm_result_2(Register metadata_result, Register tmp) { +void MacroAssembler::get_vm_result_metadata(Register metadata_result, Register tmp) { assert_different_registers(metadata_result, tmp); - ldr(metadata_result, Address(Rthread, JavaThread::vm_result_2_offset())); - str(zero_register(tmp), Address(Rthread, JavaThread::vm_result_2_offset())); + ldr(metadata_result, Address(Rthread, JavaThread::vm_result_metadata_offset())); + str(zero_register(tmp), Address(Rthread, JavaThread::vm_result_metadata_offset())); } void MacroAssembler::add_rc(Register dst, Register arg1, RegisterOrConstant arg2) { diff --git a/src/hotspot/cpu/arm/macroAssembler_arm.hpp b/src/hotspot/cpu/arm/macroAssembler_arm.hpp index 621f0101432e7..d60b38e42dbea 100644 --- a/src/hotspot/cpu/arm/macroAssembler_arm.hpp +++ b/src/hotspot/cpu/arm/macroAssembler_arm.hpp @@ -257,8 +257,8 @@ class MacroAssembler: public Assembler { void call_VM_leaf(address entry_point, Register arg_1, Register arg_2, Register arg_3); void call_VM_leaf(address entry_point, Register arg_1, Register arg_2, Register arg_3, Register arg_4); - void get_vm_result(Register oop_result, Register tmp); - void get_vm_result_2(Register metadata_result, Register tmp); + void get_vm_result_oop(Register oop_result, Register tmp); + void get_vm_result_metadata(Register metadata_result, Register tmp); // Always sets/resets sp, which default to SP if (last_sp == noreg) // Optionally sets/resets fp (use noreg to avoid setting it) diff --git a/src/hotspot/cpu/arm/sharedRuntime_arm.cpp b/src/hotspot/cpu/arm/sharedRuntime_arm.cpp index c63d72920a5b6..6dde82daaf975 100644 --- a/src/hotspot/cpu/arm/sharedRuntime_arm.cpp +++ b/src/hotspot/cpu/arm/sharedRuntime_arm.cpp @@ -1717,7 +1717,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti // Overwrite saved register values // Place metadata result of VM call into Rmethod - __ get_vm_result_2(R1, Rtemp); + __ get_vm_result_metadata(R1, Rtemp); __ str(R1, Address(SP, RegisterSaver::Rmethod_offset * wordSize)); // Place target address (VM call result) into Rtemp @@ -1730,7 +1730,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti RegisterSaver::restore_live_registers(masm); const Register Rzero = __ zero_register(Rtemp); - __ str(Rzero, Address(Rthread, JavaThread::vm_result_2_offset())); + __ str(Rzero, Address(Rthread, JavaThread::vm_result_metadata_offset())); __ mov(Rexception_pc, LR); __ jump(StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type, Rtemp); diff --git a/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp b/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp index da226c09f3cd6..30d88a4db91fd 100644 --- a/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp +++ b/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp @@ -1467,11 +1467,11 @@ void TemplateInterpreterGenerator::generate_throw_exception() { // preserve exception over this code sequence __ pop_ptr(R0_tos); - __ str(R0_tos, Address(Rthread, JavaThread::vm_result_offset())); + __ str(R0_tos, Address(Rthread, JavaThread::vm_result_oop_offset())); // remove the activation (without doing throws on illegalMonitorExceptions) __ remove_activation(vtos, Rexception_pc, false, true, false); // restore exception - __ get_vm_result(Rexception_obj, Rtemp); + __ get_vm_result_oop(Rexception_obj, Rtemp); // In between activations - previous activation type unknown yet // compute continuation point - the continuation point expects diff --git a/src/hotspot/cpu/arm/templateTable_arm.cpp b/src/hotspot/cpu/arm/templateTable_arm.cpp index bbe5713090af5..50e3761dcb917 100644 --- a/src/hotspot/cpu/arm/templateTable_arm.cpp +++ b/src/hotspot/cpu/arm/templateTable_arm.cpp @@ -538,7 +538,7 @@ void TemplateTable::condy_helper(Label& Done) __ mov(rtmp, (int) bytecode()); __ call_VM(obj, CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc), rtmp); - __ get_vm_result_2(flags, rtmp); + __ get_vm_result_metadata(flags, rtmp); // VMr = obj = base address to find primitive value to push // VMr2 = flags = (tos, off) using format of CPCE::_flags @@ -4143,8 +4143,7 @@ void TemplateTable::checkcast() { __ push(atos); call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - // vm_result_2 has metadata result - __ get_vm_result_2(Rsuper, Robj); + __ get_vm_result_metadata(Rsuper, Robj); __ pop_ptr(Robj); __ b(resolved); @@ -4214,8 +4213,7 @@ void TemplateTable::instanceof() { __ push(atos); call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - // vm_result_2 has metadata result - __ get_vm_result_2(Rsuper, Robj); + __ get_vm_result_metadata(Rsuper, Robj); __ pop_ptr(Robj); __ b(resolved); diff --git a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp index 11c01dcdc60e6..79b129c08ae22 100644 --- a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp @@ -82,10 +82,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, if (oop_result1->is_valid() || metadata_result->is_valid()) { li(R0, 0); if (oop_result1->is_valid()) { - std(R0, in_bytes(JavaThread::vm_result_offset()), R16_thread); + std(R0, in_bytes(JavaThread::vm_result_oop_offset()), R16_thread); } if (metadata_result->is_valid()) { - std(R0, in_bytes(JavaThread::vm_result_2_offset()), R16_thread); + std(R0, in_bytes(JavaThread::vm_result_metadata_offset()), R16_thread); } } @@ -112,10 +112,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, // Get oop results if there are any and reset the values in the thread. if (oop_result1->is_valid()) { - get_vm_result(oop_result1); + get_vm_result_oop(oop_result1); } if (metadata_result->is_valid()) { - get_vm_result_2(metadata_result); + get_vm_result_metadata(metadata_result); } return (int)(return_pc - code_section()->start()); diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp index 40019ef9f4bb3..f82395b14fb35 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp @@ -1337,7 +1337,7 @@ void MacroAssembler::call_VM_base(Register oop_result, // Get oop result if there is one and reset the value in the thread. if (oop_result->is_valid()) { - get_vm_result(oop_result); + get_vm_result_oop(oop_result); } _last_calls_return_pc = return_pc; @@ -3425,34 +3425,34 @@ void MacroAssembler::set_top_ijava_frame_at_SP_as_last_Java_frame(Register sp, R set_last_Java_frame(/*sp=*/sp, /*pc=*/tmp1); } -void MacroAssembler::get_vm_result(Register oop_result) { +void MacroAssembler::get_vm_result_oop(Register oop_result) { // Read: // R16_thread - // R16_thread->in_bytes(JavaThread::vm_result_offset()) + // R16_thread->in_bytes(JavaThread::vm_result_oop_offset()) // // Updated: // oop_result - // R16_thread->in_bytes(JavaThread::vm_result_offset()) + // R16_thread->in_bytes(JavaThread::vm_result_oop_offset()) - ld(oop_result, in_bytes(JavaThread::vm_result_offset()), R16_thread); + ld(oop_result, in_bytes(JavaThread::vm_result_oop_offset()), R16_thread); li(R0, 0); - std(R0, in_bytes(JavaThread::vm_result_offset()), R16_thread); + std(R0, in_bytes(JavaThread::vm_result_oop_offset()), R16_thread); verify_oop(oop_result, FILE_AND_LINE); } -void MacroAssembler::get_vm_result_2(Register metadata_result) { +void MacroAssembler::get_vm_result_metadata(Register metadata_result) { // Read: // R16_thread - // R16_thread->in_bytes(JavaThread::vm_result_2_offset()) + // R16_thread->in_bytes(JavaThread::vm_result_metadata_offset()) // // Updated: // metadata_result - // R16_thread->in_bytes(JavaThread::vm_result_2_offset()) + // R16_thread->in_bytes(JavaThread::vm_result_metadata_offset()) - ld(metadata_result, in_bytes(JavaThread::vm_result_2_offset()), R16_thread); + ld(metadata_result, in_bytes(JavaThread::vm_result_metadata_offset()), R16_thread); li(R0, 0); - std(R0, in_bytes(JavaThread::vm_result_2_offset()), R16_thread); + std(R0, in_bytes(JavaThread::vm_result_metadata_offset()), R16_thread); } Register MacroAssembler::encode_klass_not_null(Register dst, Register src) { diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp index b709cf16713b0..7e2925ace26c8 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp @@ -745,8 +745,8 @@ class MacroAssembler: public Assembler { void set_top_ijava_frame_at_SP_as_last_Java_frame(Register sp, Register tmp1, Label* jpc = nullptr); // Read vm result from thread: oop_result = R16_thread->result; - void get_vm_result (Register oop_result); - void get_vm_result_2(Register metadata_result); + void get_vm_result_oop(Register oop_result); + void get_vm_result_metadata(Register metadata_result); static bool needs_explicit_null_check(intptr_t offset); static bool uses_implicit_null_check(void* address); diff --git a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp index 0d0e004c92383..5a94d46943425 100644 --- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp +++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp @@ -3404,7 +3404,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti RegisterSaver::restore_live_registers_and_pop_frame(masm, frame_size_in_bytes, /*restore_ctr*/ false); // Get the returned method. - __ get_vm_result_2(R19_method); + __ get_vm_result_metadata(R19_method); __ bctr(); @@ -3418,7 +3418,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti __ li(R11_scratch1, 0); __ ld(R3_ARG1, thread_(pending_exception)); - __ std(R11_scratch1, in_bytes(JavaThread::vm_result_offset()), R16_thread); + __ std(R11_scratch1, in_bytes(JavaThread::vm_result_oop_offset()), R16_thread); __ b64_patchable(StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type); // ------------- diff --git a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp index b1ad3cd48bcc6..a8f5dbda484d6 100644 --- a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp @@ -2160,12 +2160,12 @@ void TemplateInterpreterGenerator::generate_throw_exception() { { __ pop_ptr(Rexception); __ verify_oop(Rexception); - __ std(Rexception, in_bytes(JavaThread::vm_result_offset()), R16_thread); + __ std(Rexception, in_bytes(JavaThread::vm_result_oop_offset()), R16_thread); __ unlock_if_synchronized_method(vtos, /* throw_monitor_exception */ false, true); __ notify_method_exit(false, vtos, InterpreterMacroAssembler::SkipNotifyJVMTI, false); - __ get_vm_result(Rexception); + __ get_vm_result_oop(Rexception); // We are done with this activation frame; find out where to go next. // The continuation point will be an exception handler, which expects diff --git a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp index 934bb1bd52918..8be6080e3d1c0 100644 --- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp @@ -386,7 +386,7 @@ void TemplateTable::condy_helper(Label& Done) { const Register rarg = R4_ARG2; __ li(rarg, (int)bytecode()); call_VM(obj, CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc), rarg); - __ get_vm_result_2(flags); + __ get_vm_result_metadata(flags); // VMr = obj = base address to find primitive value to push // VMr2 = flags = (tos, off) using format of CPCE::_flags @@ -3964,7 +3964,7 @@ void TemplateTable::checkcast() { // Call into the VM to "quicken" instanceof. __ push_ptr(); // for GC call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - __ get_vm_result_2(RspecifiedKlass); + __ get_vm_result_metadata(RspecifiedKlass); __ pop_ptr(); // Restore receiver. __ b(Lresolved); @@ -4026,7 +4026,7 @@ void TemplateTable::instanceof() { // Call into the VM to "quicken" instanceof. __ push_ptr(); // for GC call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - __ get_vm_result_2(RspecifiedKlass); + __ get_vm_result_metadata(RspecifiedKlass); __ pop_ptr(); // Restore receiver. __ b(Lresolved); diff --git a/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp b/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp index 0f1f1dd891c51..849417725a70d 100644 --- a/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp +++ b/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp @@ -89,10 +89,10 @@ int StubAssembler::call_RT(Register oop_result, Register metadata_result, addres // exception pending => remove activation and forward to exception handler // make sure that the vm_results are cleared if (oop_result->is_valid()) { - sd(zr, Address(xthread, JavaThread::vm_result_offset())); + sd(zr, Address(xthread, JavaThread::vm_result_oop_offset())); } if (metadata_result->is_valid()) { - sd(zr, Address(xthread, JavaThread::vm_result_2_offset())); + sd(zr, Address(xthread, JavaThread::vm_result_metadata_offset())); } if (frame_size() == no_frame_size) { leave(); @@ -106,10 +106,10 @@ int StubAssembler::call_RT(Register oop_result, Register metadata_result, addres } // get oop results if there are any and reset the values in the thread if (oop_result->is_valid()) { - get_vm_result(oop_result, xthread); + get_vm_result_oop(oop_result, xthread); } if (metadata_result->is_valid()) { - get_vm_result_2(metadata_result, xthread); + get_vm_result_metadata(metadata_result, xthread); } return call_offset; } @@ -427,8 +427,8 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm) __ ld(exception_pc, Address(fp, frame::return_addr_offset * BytesPerWord)); // make sure that the vm_results are cleared (may be unnecessary) - __ sd(zr, Address(xthread, JavaThread::vm_result_offset())); - __ sd(zr, Address(xthread, JavaThread::vm_result_2_offset())); + __ sd(zr, Address(xthread, JavaThread::vm_result_oop_offset())); + __ sd(zr, Address(xthread, JavaThread::vm_result_metadata_offset())); break; case C1StubId::handle_exception_nofpu_id: case C1StubId::handle_exception_id: diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index 71481565fc73d..b5c311c341db4 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -498,19 +498,19 @@ void MacroAssembler::call_VM_base(Register oop_result, // get oop result if there is one and reset the value in the thread if (oop_result->is_valid()) { - get_vm_result(oop_result, java_thread); + get_vm_result_oop(oop_result, java_thread); } } -void MacroAssembler::get_vm_result(Register oop_result, Register java_thread) { - ld(oop_result, Address(java_thread, JavaThread::vm_result_offset())); - sd(zr, Address(java_thread, JavaThread::vm_result_offset())); +void MacroAssembler::get_vm_result_oop(Register oop_result, Register java_thread) { + ld(oop_result, Address(java_thread, JavaThread::vm_result_oop_offset())); + sd(zr, Address(java_thread, JavaThread::vm_result_oop_offset())); verify_oop_msg(oop_result, "broken oop in call_VM_base"); } -void MacroAssembler::get_vm_result_2(Register metadata_result, Register java_thread) { - ld(metadata_result, Address(java_thread, JavaThread::vm_result_2_offset())); - sd(zr, Address(java_thread, JavaThread::vm_result_2_offset())); +void MacroAssembler::get_vm_result_metadata(Register metadata_result, Register java_thread) { + ld(metadata_result, Address(java_thread, JavaThread::vm_result_metadata_offset())); + sd(zr, Address(java_thread, JavaThread::vm_result_metadata_offset())); } void MacroAssembler::clinit_barrier(Register klass, Register tmp, Label* L_fast_path, Label* L_slow_path) { diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp index e145639bbe731..b390fb236c273 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp @@ -122,8 +122,8 @@ class MacroAssembler: public Assembler { Register arg_1, Register arg_2, Register arg_3, bool check_exceptions = true); - void get_vm_result(Register oop_result, Register java_thread); - void get_vm_result_2(Register metadata_result, Register java_thread); + void get_vm_result_oop(Register oop_result, Register java_thread); + void get_vm_result_metadata(Register metadata_result, Register java_thread); // These always tightly bind to MacroAssembler::call_VM_leaf_base // bypassing the virtual implementation diff --git a/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp b/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp index 49e630bbfdf91..1079084149042 100644 --- a/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp +++ b/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp @@ -2646,7 +2646,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti __ bnez(t1, pending); // get the returned Method* - __ get_vm_result_2(xmethod, xthread); + __ get_vm_result_metadata(xmethod, xthread); __ sd(xmethod, Address(sp, reg_saver.reg_offset_in_bytes(xmethod))); // x10 is where we want to jump, overwrite t1 which is saved and temporary @@ -2664,7 +2664,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti // exception pending => remove activation and forward to exception handler - __ sd(zr, Address(xthread, JavaThread::vm_result_offset())); + __ sd(zr, Address(xthread, JavaThread::vm_result_oop_offset())); __ ld(x10, Address(xthread, Thread::pending_exception_offset())); __ far_jump(RuntimeAddress(StubRoutines::forward_exception_entry())); diff --git a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp index e96bd2e1f2a73..72e1180164b77 100644 --- a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp @@ -1725,11 +1725,11 @@ void TemplateInterpreterGenerator::generate_throw_exception() { // preserve exception over this code sequence __ pop_ptr(x10); - __ sd(x10, Address(xthread, JavaThread::vm_result_offset())); + __ sd(x10, Address(xthread, JavaThread::vm_result_oop_offset())); // remove the activation (without doing throws on illegalMonitorExceptions) __ remove_activation(vtos, false, true, false); // restore exception - __ get_vm_result(x10, xthread); + __ get_vm_result_oop(x10, xthread); // In between activations - previous activation type unknown yet // compute continuation point - the continuation point expects the diff --git a/src/hotspot/cpu/riscv/templateTable_riscv.cpp b/src/hotspot/cpu/riscv/templateTable_riscv.cpp index 216cfdeed7930..a035326be0130 100644 --- a/src/hotspot/cpu/riscv/templateTable_riscv.cpp +++ b/src/hotspot/cpu/riscv/templateTable_riscv.cpp @@ -460,7 +460,7 @@ void TemplateTable::condy_helper(Label& Done) { __ mv(rarg, (int) bytecode()); __ call_VM(obj, entry, rarg); - __ get_vm_result_2(flags, xthread); + __ get_vm_result_metadata(flags, xthread); // VMr = obj = base address to find primitive value to push // VMr2 = flags = (tos, off) using format of CPCE::_flags @@ -3657,8 +3657,7 @@ void TemplateTable::checkcast() { __ push(atos); // save receiver for result, and for GC call_VM(x10, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - // vm_result_2 has metadata result - __ get_vm_result_2(x10, xthread); + __ get_vm_result_metadata(x10, xthread); __ pop_reg(x13); // restore receiver __ j(resolved); @@ -3712,8 +3711,7 @@ void TemplateTable::instanceof() { __ push(atos); // save receiver for result, and for GC call_VM(x10, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - // vm_result_2 has metadata result - __ get_vm_result_2(x10, xthread); + __ get_vm_result_metadata(x10, xthread); __ pop_reg(x13); // restore receiver __ verify_oop(x13); __ load_klass(x13, x13); diff --git a/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp b/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp index b5d804d283e4f..db04703ceb02e 100644 --- a/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp +++ b/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp @@ -86,10 +86,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre // Make sure that the vm_results are cleared. if (oop_result1->is_valid()) { - clear_mem(Address(Z_thread, JavaThread::vm_result_offset()), sizeof(jlong)); + clear_mem(Address(Z_thread, JavaThread::vm_result_oop_offset()), sizeof(jlong)); } if (metadata_result->is_valid()) { - clear_mem(Address(Z_thread, JavaThread::vm_result_2_offset()), sizeof(jlong)); + clear_mem(Address(Z_thread, JavaThread::vm_result_metadata_offset()), sizeof(jlong)); } if (frame_size() == no_frame_size) { // Pop the stub frame. @@ -109,10 +109,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre // Get oop results if there are any and reset the values in the thread. if (oop_result1->is_valid()) { - get_vm_result(oop_result1); + get_vm_result_oop(oop_result1); } if (metadata_result->is_valid()) { - get_vm_result_2(metadata_result); + get_vm_result_metadata(metadata_result); } return call_offset; @@ -886,8 +886,8 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm) DEBUG_ONLY(__ z_lay(reg_fp, Address(Z_SP, frame_size_in_bytes));) // Make sure that the vm_results are cleared (may be unnecessary). - __ clear_mem(Address(Z_thread, JavaThread::vm_result_offset()), sizeof(oop)); - __ clear_mem(Address(Z_thread, JavaThread::vm_result_2_offset()), sizeof(Metadata*)); + __ clear_mem(Address(Z_thread, JavaThread::vm_result_oop_offset()), sizeof(oop)); + __ clear_mem(Address(Z_thread, JavaThread::vm_result_metadata_offset()), sizeof(Metadata*)); break; } case C1StubId::handle_exception_nofpu_id: diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.cpp b/src/hotspot/cpu/s390/macroAssembler_s390.cpp index 54370a4959b64..88aedd1b5c00f 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp @@ -2304,7 +2304,7 @@ void MacroAssembler::call_VM_base(Register oop_result, // Get oop result if there is one and reset the value in the thread. if (oop_result->is_valid()) { - get_vm_result(oop_result); + get_vm_result_oop(oop_result); } _last_calls_return_pc = return_pc; // Wipe out other (error handling) calls. @@ -4067,22 +4067,22 @@ void MacroAssembler::set_thread_state(JavaThreadState new_state) { store_const(Address(Z_thread, JavaThread::thread_state_offset()), new_state, Z_R0, false); } -void MacroAssembler::get_vm_result(Register oop_result) { - z_lg(oop_result, Address(Z_thread, JavaThread::vm_result_offset())); - clear_mem(Address(Z_thread, JavaThread::vm_result_offset()), sizeof(void*)); +void MacroAssembler::get_vm_result_oop(Register oop_result) { + z_lg(oop_result, Address(Z_thread, JavaThread::vm_result_oop_offset())); + clear_mem(Address(Z_thread, JavaThread::vm_result_oop_offset()), sizeof(void*)); verify_oop(oop_result, FILE_AND_LINE); } -void MacroAssembler::get_vm_result_2(Register result) { - z_lg(result, Address(Z_thread, JavaThread::vm_result_2_offset())); - clear_mem(Address(Z_thread, JavaThread::vm_result_2_offset()), sizeof(void*)); +void MacroAssembler::get_vm_result_metadata(Register result) { + z_lg(result, Address(Z_thread, JavaThread::vm_result_metadata_offset())); + clear_mem(Address(Z_thread, JavaThread::vm_result_metadata_offset()), sizeof(void*)); } // We require that C code which does not return a value in vm_result will // leave it undisturbed. void MacroAssembler::set_vm_result(Register oop_result) { - z_stg(oop_result, Address(Z_thread, JavaThread::vm_result_offset())); + z_stg(oop_result, Address(Z_thread, JavaThread::vm_result_oop_offset())); } // Explicit null checks (used for method handle code). diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.hpp b/src/hotspot/cpu/s390/macroAssembler_s390.hpp index 3f7744588d6ec..4aa7bb56f3ad4 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.hpp @@ -816,8 +816,8 @@ class MacroAssembler: public Assembler { void set_thread_state(JavaThreadState new_state); // Read vm result from thread. - void get_vm_result (Register oop_result); - void get_vm_result_2(Register result); + void get_vm_result_oop (Register oop_result); + void get_vm_result_metadata(Register result); // Vm result is currently getting hijacked to for oop preservation. void set_vm_result(Register oop_result); diff --git a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp index 7b6735eabccc6..f4487ccabec14 100644 --- a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp +++ b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp @@ -3043,7 +3043,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti RegisterSaver::restore_live_registers(masm, RegisterSaver::all_registers); // get the returned method - __ get_vm_result_2(Z_method); + __ get_vm_result_metadata(Z_method); // We are back to the original state on entry and ready to go. __ z_br(Z_R1_scratch); @@ -3057,7 +3057,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti // exception pending => remove activation and forward to exception handler __ z_lgr(Z_R2, Z_R0); // pending_exception - __ clear_mem(Address(Z_thread, JavaThread::vm_result_offset()), sizeof(jlong)); + __ clear_mem(Address(Z_thread, JavaThread::vm_result_oop_offset()), sizeof(jlong)); __ load_const_optimized(Z_R1_scratch, StubRoutines::forward_exception_entry()); __ z_br(Z_R1_scratch); diff --git a/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp b/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp index 841f4f9ca4bd2..a52d20e32a340 100644 --- a/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp +++ b/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp @@ -2228,7 +2228,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() { __ remove_activation(vtos, noreg/*ret.pc already loaded*/, false/*throw exc*/, true/*install exc*/, false/*notify jvmti*/); __ z_lg(Z_fp, _z_abi(callers_sp), Z_SP); // Restore frame pointer. - __ get_vm_result(Z_ARG1); // Restore exception. + __ get_vm_result_oop(Z_ARG1); // Restore exception. __ verify_oop(Z_ARG1); __ z_lgr(Z_ARG2, return_pc); // Restore return address. diff --git a/src/hotspot/cpu/s390/templateTable_s390.cpp b/src/hotspot/cpu/s390/templateTable_s390.cpp index e6c0c7781a3ba..4262c77ecd73c 100644 --- a/src/hotspot/cpu/s390/templateTable_s390.cpp +++ b/src/hotspot/cpu/s390/templateTable_s390.cpp @@ -540,7 +540,7 @@ void TemplateTable::condy_helper(Label& Done) { const Register rarg = Z_ARG2; __ load_const_optimized(rarg, (int)bytecode()); call_VM(obj, CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc), rarg); - __ get_vm_result_2(flags); + __ get_vm_result_metadata(flags); // VMr = obj = base address to find primitive value to push // VMr2 = flags = (tos, off) using format of CPCE::_flags @@ -4063,7 +4063,7 @@ void TemplateTable::checkcast() { __ push(atos); // Save receiver for result, and for GC. call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - __ get_vm_result_2(Z_tos); + __ get_vm_result_metadata(Z_tos); Register receiver = Z_ARG4; Register klass = Z_tos; @@ -4135,7 +4135,7 @@ void TemplateTable::instanceof() { __ push(atos); // Save receiver for result, and for GC. call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - __ get_vm_result_2(Z_tos); + __ get_vm_result_metadata(Z_tos); Register receiver = Z_tmp_2; Register klass = Z_tos; diff --git a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp index db6614686a2a1..726574e69e8e6 100644 --- a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp +++ b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp @@ -103,10 +103,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre movptr(rax, Address(thread, Thread::pending_exception_offset())); // make sure that the vm_results are cleared if (oop_result1->is_valid()) { - movptr(Address(thread, JavaThread::vm_result_offset()), NULL_WORD); + movptr(Address(thread, JavaThread::vm_result_oop_offset()), NULL_WORD); } if (metadata_result->is_valid()) { - movptr(Address(thread, JavaThread::vm_result_2_offset()), NULL_WORD); + movptr(Address(thread, JavaThread::vm_result_metadata_offset()), NULL_WORD); } if (frame_size() == no_frame_size) { leave(); @@ -120,10 +120,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre } // get oop results if there are any and reset the values in the thread if (oop_result1->is_valid()) { - get_vm_result(oop_result1); + get_vm_result_oop(oop_result1); } if (metadata_result->is_valid()) { - get_vm_result_2(metadata_result); + get_vm_result_metadata(metadata_result); } assert(call_offset >= 0, "Should be set"); @@ -532,8 +532,8 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm) __ movptr(exception_pc, Address(rbp, 1*BytesPerWord)); // make sure that the vm_results are cleared (may be unnecessary) - __ movptr(Address(thread, JavaThread::vm_result_offset()), NULL_WORD); - __ movptr(Address(thread, JavaThread::vm_result_2_offset()), NULL_WORD); + __ movptr(Address(thread, JavaThread::vm_result_oop_offset()), NULL_WORD); + __ movptr(Address(thread, JavaThread::vm_result_metadata_offset()), NULL_WORD); break; case C1StubId::handle_exception_nofpu_id: case C1StubId::handle_exception_id: diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index e5aa7d213e137..bc2d9d047a020 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -1613,7 +1613,7 @@ void MacroAssembler::call_VM_base(Register oop_result, // get oop result if there is one and reset the value in the thread if (oop_result->is_valid()) { - get_vm_result(oop_result); + get_vm_result_oop(oop_result); } } @@ -1703,15 +1703,15 @@ void MacroAssembler::super_call_VM_leaf(address entry_point, Register arg_0, Reg MacroAssembler::call_VM_leaf_base(entry_point, 4); } -void MacroAssembler::get_vm_result(Register oop_result) { - movptr(oop_result, Address(r15_thread, JavaThread::vm_result_offset())); - movptr(Address(r15_thread, JavaThread::vm_result_offset()), NULL_WORD); +void MacroAssembler::get_vm_result_oop(Register oop_result) { + movptr(oop_result, Address(r15_thread, JavaThread::vm_result_oop_offset())); + movptr(Address(r15_thread, JavaThread::vm_result_oop_offset()), NULL_WORD); verify_oop_msg(oop_result, "broken oop in call_VM_base"); } -void MacroAssembler::get_vm_result_2(Register metadata_result) { - movptr(metadata_result, Address(r15_thread, JavaThread::vm_result_2_offset())); - movptr(Address(r15_thread, JavaThread::vm_result_2_offset()), NULL_WORD); +void MacroAssembler::get_vm_result_metadata(Register metadata_result) { + movptr(metadata_result, Address(r15_thread, JavaThread::vm_result_metadata_offset())); + movptr(Address(r15_thread, JavaThread::vm_result_metadata_offset()), NULL_WORD); } void MacroAssembler::check_and_handle_earlyret() { diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.hpp b/src/hotspot/cpu/x86/macroAssembler_x86.hpp index 5e26b79e8ae3f..bb2d089287217 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp @@ -284,8 +284,8 @@ class MacroAssembler: public Assembler { Register arg_1, Register arg_2, Register arg_3, bool check_exceptions = true); - void get_vm_result (Register oop_result); - void get_vm_result_2(Register metadata_result); + void get_vm_result_oop(Register oop_result); + void get_vm_result_metadata(Register metadata_result); // These always tightly bind to MacroAssembler::call_VM_base // bypassing the virtual implementation diff --git a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp index 09c102aa5d16a..621340964ac4b 100644 --- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp +++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp @@ -3233,7 +3233,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti __ jcc(Assembler::notEqual, pending); // get the returned Method* - __ get_vm_result_2(rbx); + __ get_vm_result_metadata(rbx); __ movptr(Address(rsp, RegisterSaver::rbx_offset_in_bytes()), rbx); __ movptr(Address(rsp, RegisterSaver::rax_offset_in_bytes()), rax); @@ -3252,7 +3252,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti // exception pending => remove activation and forward to exception handler - __ movptr(Address(r15_thread, JavaThread::vm_result_offset()), NULL_WORD); + __ movptr(Address(r15_thread, JavaThread::vm_result_oop_offset()), NULL_WORD); __ movptr(rax, Address(r15_thread, Thread::pending_exception_offset())); __ jump(RuntimeAddress(StubRoutines::forward_exception_entry())); diff --git a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp index bdc2ca908bd41..45e30a8b4fb52 100644 --- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp +++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp @@ -1543,11 +1543,11 @@ void TemplateInterpreterGenerator::generate_throw_exception() { // preserve exception over this code sequence __ pop_ptr(rax); - __ movptr(Address(thread, JavaThread::vm_result_offset()), rax); + __ movptr(Address(thread, JavaThread::vm_result_oop_offset()), rax); // remove the activation (without doing throws on illegalMonitorExceptions) __ remove_activation(vtos, rdx, false, true, false); // restore exception - __ get_vm_result(rax); + __ get_vm_result_oop(rax); // In between activations - previous activation type unknown yet // compute continuation point - the continuation point expects the diff --git a/src/hotspot/cpu/x86/templateTable_x86.cpp b/src/hotspot/cpu/x86/templateTable_x86.cpp index 226b8b1c65597..43da80f408261 100644 --- a/src/hotspot/cpu/x86/templateTable_x86.cpp +++ b/src/hotspot/cpu/x86/templateTable_x86.cpp @@ -470,7 +470,7 @@ void TemplateTable::condy_helper(Label& Done) { const Register rarg = c_rarg1; __ movl(rarg, (int)bytecode()); call_VM(obj, CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc), rarg); - __ get_vm_result_2(flags); + __ get_vm_result_metadata(flags); // VMr = obj = base address to find primitive value to push // VMr2 = flags = (tos, off) using format of CPCE::_flags __ movl(off, flags); @@ -3680,8 +3680,7 @@ void TemplateTable::checkcast() { __ push(atos); // save receiver for result, and for GC call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - // vm_result_2 has metadata result - __ get_vm_result_2(rax); + __ get_vm_result_metadata(rax); __ pop_ptr(rdx); // restore receiver __ jmpb(resolved); @@ -3737,8 +3736,7 @@ void TemplateTable::instanceof() { __ push(atos); // save receiver for result, and for GC call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - // vm_result_2 has metadata result - __ get_vm_result_2(rax); + __ get_vm_result_metadata(rax); __ pop_ptr(rdx); // restore receiver __ verify_oop(rdx); diff --git a/src/hotspot/share/c1/c1_Runtime1.cpp b/src/hotspot/share/c1/c1_Runtime1.cpp index d7a9c8d56d430..9d4b35024ed05 100644 --- a/src/hotspot/share/c1/c1_Runtime1.cpp +++ b/src/hotspot/share/c1/c1_Runtime1.cpp @@ -370,7 +370,7 @@ JRT_ENTRY(void, Runtime1::new_instance(JavaThread* current, Klass* klass)) h->initialize(CHECK); // allocate instance and return via TLS oop obj = h->allocate_instance(CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END @@ -386,7 +386,7 @@ JRT_ENTRY(void, Runtime1::new_type_array(JavaThread* current, Klass* klass, jint assert(klass->is_klass(), "not a class"); BasicType elt_type = TypeArrayKlass::cast(klass)->element_type(); oop obj = oopFactory::new_typeArray(elt_type, length, CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); // This is pretty rare but this runtime patch is stressful to deoptimization // if we deoptimize here so force a deopt to stress the path. if (DeoptimizeALot) { @@ -409,7 +409,7 @@ JRT_ENTRY(void, Runtime1::new_object_array(JavaThread* current, Klass* array_kla Handle holder(current, array_klass->klass_holder()); // keep the klass alive Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass(); objArrayOop obj = oopFactory::new_objArray(elem_klass, length, CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); // This is pretty rare but this runtime patch is stressful to deoptimization // if we deoptimize here so force a deopt to stress the path. if (DeoptimizeALot) { @@ -428,7 +428,7 @@ JRT_ENTRY(void, Runtime1::new_multi_array(JavaThread* current, Klass* klass, int assert(rank >= 1, "rank must be nonzero"); Handle holder(current, klass->klass_holder()); // keep the klass alive oop obj = ArrayKlass::cast(klass)->multi_allocate(rank, dims, CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END @@ -642,7 +642,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* c } } - current->set_vm_result(exception()); + current->set_vm_result_oop(exception()); // Set flag if return address is a method handle call site. current->set_is_method_handle_return(nm->is_method_handle_return(pc)); diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp index 52eab4f796e6b..0f16b17e99e00 100644 --- a/src/hotspot/share/interpreter/interpreterRuntime.cpp +++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp @@ -150,7 +150,7 @@ JRT_ENTRY(void, InterpreterRuntime::ldc(JavaThread* current, bool wide)) assert (tag.is_unresolved_klass() || tag.is_klass(), "wrong ldc call"); Klass* klass = pool->klass_at(cp_index, CHECK); oop java_class = klass->java_mirror(); - current->set_vm_result(java_class); + current->set_vm_result_oop(java_class); JRT_END JRT_ENTRY(void, InterpreterRuntime::resolve_ldc(JavaThread* current, Bytecodes::Code bytecode)) { @@ -193,14 +193,14 @@ JRT_ENTRY(void, InterpreterRuntime::resolve_ldc(JavaThread* current, Bytecodes:: } } #endif - current->set_vm_result(result); + current->set_vm_result_oop(result); if (!is_fast_aldc) { // Tell the interpreter how to unbox the primitive. guarantee(java_lang_boxing_object::is_instance(result, type), ""); int offset = java_lang_boxing_object::value_offset(type); intptr_t flags = ((as_TosState(type) << ConstantPoolCache::tos_state_shift) | (offset & ConstantPoolCache::field_index_mask)); - current->set_vm_result_2((Metadata*)flags); + current->set_vm_result_metadata((Metadata*)flags); } } JRT_END @@ -220,20 +220,20 @@ JRT_ENTRY(void, InterpreterRuntime::_new(JavaThread* current, ConstantPool* pool klass->initialize(CHECK); oop obj = klass->allocate_instance(CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END JRT_ENTRY(void, InterpreterRuntime::newarray(JavaThread* current, BasicType type, jint size)) oop obj = oopFactory::new_typeArray(type, size, CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END JRT_ENTRY(void, InterpreterRuntime::anewarray(JavaThread* current, ConstantPool* pool, int index, jint size)) Klass* klass = pool->klass_at(index, CHECK); objArrayOop obj = oopFactory::new_objArray(klass, size, CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END @@ -261,7 +261,7 @@ JRT_ENTRY(void, InterpreterRuntime::multianewarray(JavaThread* current, jint* fi dims[index] = first_size_address[n]; } oop obj = ArrayKlass::cast(klass)->multi_allocate(nof_dims, dims, CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END @@ -283,7 +283,7 @@ JRT_ENTRY(void, InterpreterRuntime::quicken_io_cc(JavaThread* current)) // thread quicken the bytecode before we get here. // assert( cpool->tag_at(which).is_unresolved_klass(), "should only come here to quicken bytecodes" ); Klass* klass = cpool->klass_at(which, CHECK); - current->set_vm_result_2(klass); + current->set_vm_result_metadata(klass); JRT_END @@ -383,7 +383,7 @@ JRT_ENTRY(void, InterpreterRuntime::create_exception(JavaThread* current, char* } // create exception Handle exception = Exceptions::new_exception(current, s, message); - current->set_vm_result(exception()); + current->set_vm_result_oop(exception()); JRT_END @@ -402,7 +402,7 @@ JRT_ENTRY(void, InterpreterRuntime::create_klass_exception(JavaThread* current, } // create exception, with klass name as detail message Handle exception = Exceptions::new_exception(current, s, klass_name); - current->set_vm_result(exception()); + current->set_vm_result_oop(exception()); JRT_END JRT_ENTRY(void, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException(JavaThread* current, arrayOopDesc* a, jint index)) @@ -461,7 +461,7 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea // Allocation of scalar replaced object used in this frame // failed. Unconditionally pop the frame. current->dec_frames_to_pop_failed_realloc(); - current->set_vm_result(h_exception()); + current->set_vm_result_oop(h_exception()); // If the method is synchronized we already unlocked the monitor // during deoptimization so the interpreter needs to skip it when // the frame is popped. @@ -476,7 +476,7 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea if (current->do_not_unlock_if_synchronized()) { ResourceMark rm; assert(current_bci == 0, "bci isn't zero for do_not_unlock_if_synchronized"); - current->set_vm_result(exception); + current->set_vm_result_oop(exception); return Interpreter::remove_activation_entry(); } @@ -577,7 +577,7 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea JvmtiExport::notice_unwind_due_to_exception(current, h_method(), handler_pc, h_exception(), (handler_pc != nullptr)); } - current->set_vm_result(h_exception()); + current->set_vm_result_oop(h_exception()); return continuation; JRT_END @@ -765,11 +765,11 @@ JRT_ENTRY(void, InterpreterRuntime::new_illegal_monitor_state_exception(JavaThre // method will be called during an exception unwind. assert(!HAS_PENDING_EXCEPTION, "no pending exception"); - Handle exception(current, current->vm_result()); + Handle exception(current, current->vm_result_oop()); assert(exception() != nullptr, "vm result should be set"); - current->set_vm_result(nullptr); // clear vm result before continuing (may cause memory leaks and assert failures) + current->set_vm_result_oop(nullptr); // clear vm result before continuing (may cause memory leaks and assert failures) exception = get_preinitialized_exception(vmClasses::IllegalMonitorStateException_klass(), CATCH); - current->set_vm_result(exception()); + current->set_vm_result_oop(exception()); JRT_END @@ -1474,7 +1474,7 @@ JRT_END #if INCLUDE_JVMTI // This is a support of the JVMTI PopFrame interface. // Make sure it is an invokestatic of a polymorphic intrinsic that has a member_name argument -// and return it as a vm_result so that it can be reloaded in the list of invokestatic parameters. +// and return it as a vm_result_oop so that it can be reloaded in the list of invokestatic parameters. // The member_name argument is a saved reference (in local#0) to the member_name. // For backward compatibility with some JDK versions (7, 8) it can also be a direct method handle. // FIXME: remove DMH case after j.l.i.InvokerBytecodeGenerator code shape is updated. @@ -1495,9 +1495,9 @@ JRT_ENTRY(void, InterpreterRuntime::member_name_arg_or_null(JavaThread* current, // FIXME: remove after j.l.i.InvokerBytecodeGenerator code shape is updated. member_name_oop = java_lang_invoke_DirectMethodHandle::member(member_name_oop); } - current->set_vm_result(member_name_oop); + current->set_vm_result_oop(member_name_oop); } else { - current->set_vm_result(nullptr); + current->set_vm_result_oop(nullptr); } JRT_END #endif // INCLUDE_JVMTI diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp index 43b618dcc1e13..401953a170f77 100644 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp +++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp @@ -2033,8 +2033,8 @@ void BytecodeInterpreter::run(interpreterState istate) { // Must prevent reordering of stores for object initialization // with stores that publish the new object. OrderAccess::storestore(); - SET_STACK_OBJECT(THREAD->vm_result(), 0); - THREAD->set_vm_result(nullptr); + SET_STACK_OBJECT(THREAD->vm_result_oop(), 0); + THREAD->set_vm_result_oop(nullptr); UPDATE_PC_AND_TOS_AND_CONTINUE(3, 1); } CASE(_anewarray): { @@ -2045,8 +2045,8 @@ void BytecodeInterpreter::run(interpreterState istate) { // Must prevent reordering of stores for object initialization // with stores that publish the new object. OrderAccess::storestore(); - SET_STACK_OBJECT(THREAD->vm_result(), -1); - THREAD->set_vm_result(nullptr); + SET_STACK_OBJECT(THREAD->vm_result_oop(), -1); + THREAD->set_vm_result_oop(nullptr); UPDATE_PC_AND_CONTINUE(3); } CASE(_multianewarray): { @@ -2062,8 +2062,8 @@ void BytecodeInterpreter::run(interpreterState istate) { // Must prevent reordering of stores for object initialization // with stores that publish the new object. OrderAccess::storestore(); - SET_STACK_OBJECT(THREAD->vm_result(), -dims); - THREAD->set_vm_result(nullptr); + SET_STACK_OBJECT(THREAD->vm_result_oop(), -dims); + THREAD->set_vm_result_oop(nullptr); UPDATE_PC_AND_TOS_AND_CONTINUE(4, -(dims-1)); } CASE(_checkcast): @@ -2144,8 +2144,8 @@ void BytecodeInterpreter::run(interpreterState istate) { oop result = constants->resolved_reference_at(index); if (result == nullptr) { CALL_VM(InterpreterRuntime::resolve_ldc(THREAD, (Bytecodes::Code) opcode), handle_exception); - SET_STACK_OBJECT(THREAD->vm_result(), 0); - THREAD->set_vm_result(nullptr); + SET_STACK_OBJECT(THREAD->vm_result_oop(), 0); + THREAD->set_vm_result_oop(nullptr); } else { VERIFY_OOP(result); SET_STACK_OBJECT(result, 0); @@ -2161,15 +2161,15 @@ void BytecodeInterpreter::run(interpreterState istate) { case JVM_CONSTANT_UnresolvedClass: case JVM_CONSTANT_UnresolvedClassInError: CALL_VM(InterpreterRuntime::ldc(THREAD, wide), handle_exception); - SET_STACK_OBJECT(THREAD->vm_result(), 0); - THREAD->set_vm_result(nullptr); + SET_STACK_OBJECT(THREAD->vm_result_oop(), 0); + THREAD->set_vm_result_oop(nullptr); break; case JVM_CONSTANT_Dynamic: case JVM_CONSTANT_DynamicInError: { CALL_VM(InterpreterRuntime::resolve_ldc(THREAD, (Bytecodes::Code) opcode), handle_exception); - oop result = THREAD->vm_result(); + oop result = THREAD->vm_result_oop(); VERIFY_OOP(result); jvalue value; @@ -2211,7 +2211,7 @@ void BytecodeInterpreter::run(interpreterState istate) { case JVM_CONSTANT_DynamicInError: { CALL_VM(InterpreterRuntime::resolve_ldc(THREAD, (Bytecodes::Code) opcode), handle_exception); - oop result = THREAD->vm_result(); + oop result = THREAD->vm_result_oop(); VERIFY_OOP(result); jvalue value; @@ -2250,7 +2250,7 @@ void BytecodeInterpreter::run(interpreterState istate) { if (result == nullptr) { CALL_VM(InterpreterRuntime::resolve_ldc(THREAD, (Bytecodes::Code) opcode), handle_exception); - result = THREAD->vm_result(); + result = THREAD->vm_result_oop(); } if (result == Universe::the_null_sentinel()) result = nullptr; @@ -2518,8 +2518,8 @@ void BytecodeInterpreter::run(interpreterState istate) { // Must prevent reordering of stores for object initialization // with stores that publish the new object. OrderAccess::storestore(); - SET_STACK_OBJECT(THREAD->vm_result(), -1); - THREAD->set_vm_result(nullptr); + SET_STACK_OBJECT(THREAD->vm_result_oop(), -1); + THREAD->set_vm_result_oop(nullptr); UPDATE_PC_AND_CONTINUE(2); } @@ -2959,8 +2959,8 @@ void BytecodeInterpreter::run(interpreterState istate) { CALL_VM(continuation_bci = (intptr_t)InterpreterRuntime::exception_handler_for_exception(THREAD, except_oop()), handle_exception); - except_oop = Handle(THREAD, THREAD->vm_result()); - THREAD->set_vm_result(nullptr); + except_oop = Handle(THREAD, THREAD->vm_result_oop()); + THREAD->set_vm_result_oop(nullptr); if (continuation_bci >= 0) { // Place exception on top of stack SET_STACK_OBJECT(except_oop(), 0); diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp index d1ae48e4a75c9..cf94293f0a31d 100644 --- a/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp +++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp @@ -277,7 +277,7 @@ bool ReferenceToThreadRootClosure::do_thread_stack_detailed(JavaThread* jt) { // around using this function /* * // can't reach these oop* from the outside - f->do_oop((oop*) &_vm_result); + f->do_oop((oop*) &_vm_result_oop); f->do_oop((oop*) &_exception_oop); f->do_oop((oop*) &_pending_async_exception); */ diff --git a/src/hotspot/share/jvmci/jvmciRuntime.cpp b/src/hotspot/share/jvmci/jvmciRuntime.cpp index 8e885e5f7f9bf..6f1fa52576e41 100644 --- a/src/hotspot/share/jvmci/jvmciRuntime.cpp +++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp @@ -96,7 +96,7 @@ static void deopt_caller() { // call is of the variety where allocation failure returns null without an // exception, the following action is taken: // 1. The pending OutOfMemoryError is cleared -// 2. null is written to JavaThread::_vm_result +// 2. null is written to JavaThread::_vm_result_oop class RetryableAllocationMark { private: InternalOOMEMark _iom; @@ -107,7 +107,7 @@ class RetryableAllocationMark { if (THREAD != nullptr) { if (HAS_PENDING_EXCEPTION) { oop ex = PENDING_EXCEPTION; - THREAD->set_vm_result(nullptr); + THREAD->set_vm_result_oop(nullptr); if (ex->is_a(vmClasses::OutOfMemoryError_klass())) { CLEAR_PENDING_EXCEPTION; } @@ -127,12 +127,12 @@ JRT_BLOCK_ENTRY(void, JVMCIRuntime::new_instance_or_null(JavaThread* current, Kl if (!h->is_initialized()) { // Cannot re-execute class initialization without side effects // so return without attempting the initialization - current->set_vm_result(nullptr); + current->set_vm_result_oop(nullptr); return; } // allocate instance and return via TLS oop obj = h->allocate_instance(CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); } JRT_BLOCK_END; SharedRuntime::on_slowpath_allocation_exit(current); @@ -166,7 +166,7 @@ JRT_BLOCK_ENTRY(void, JVMCIRuntime::new_array_or_null(JavaThread* current, Klass deopt_caller(); } } - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_BLOCK_END; SharedRuntime::on_slowpath_allocation_exit(current); JRT_END @@ -177,13 +177,13 @@ JRT_ENTRY(void, JVMCIRuntime::new_multi_array_or_null(JavaThread* current, Klass Handle holder(current, klass->klass_holder()); // keep the klass alive RetryableAllocationMark ram(current); oop obj = ArrayKlass::cast(klass)->multi_allocate(rank, dims, CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END JRT_ENTRY(void, JVMCIRuntime::dynamic_new_array_or_null(JavaThread* current, oopDesc* element_mirror, jint length)) RetryableAllocationMark ram(current); oop obj = Reflection::reflect_new_array(element_mirror, length, CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END JRT_ENTRY(void, JVMCIRuntime::dynamic_new_instance_or_null(JavaThread* current, oopDesc* type_mirror)) @@ -201,12 +201,12 @@ JRT_ENTRY(void, JVMCIRuntime::dynamic_new_instance_or_null(JavaThread* current, if (!klass->is_initialized()) { // Cannot re-execute class initialization without side effects // so return without attempting the initialization - current->set_vm_result(nullptr); + current->set_vm_result_oop(nullptr); return; } oop obj = klass->allocate_instance(CHECK); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END extern void vm_exit(int code); @@ -533,7 +533,7 @@ JRT_ENTRY(jlong, JVMCIRuntime::invoke_static_method_one_arg(JavaThread* current, if (return_type == T_VOID) { return 0; } else if (return_type == T_OBJECT || return_type == T_ARRAY) { - current->set_vm_result(result.get_oop()); + current->set_vm_result_oop(result.get_oop()); return 0; } else { jvalue *value = (jvalue *) result.get_value_addr(); diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp index 3cbb1512cd06a..5347827bb1beb 100644 --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp @@ -227,7 +227,7 @@ nonstatic_field(JavaThread, _scopedValueCache, OopHandle) \ nonstatic_field(JavaThread, _anchor, JavaFrameAnchor) \ nonstatic_field(JavaThread, _monitor_owner_id, int64_t) \ - nonstatic_field(JavaThread, _vm_result, oop) \ + nonstatic_field(JavaThread, _vm_result_oop, oop) \ nonstatic_field(JavaThread, _stack_overflow_state._stack_overflow_limit, address) \ volatile_nonstatic_field(JavaThread, _exception_oop, oop) \ volatile_nonstatic_field(JavaThread, _exception_pc, address) \ diff --git a/src/hotspot/share/opto/generateOptoStub.cpp b/src/hotspot/share/opto/generateOptoStub.cpp index b13504ab10e56..77633857cdf87 100644 --- a/src/hotspot/share/opto/generateOptoStub.cpp +++ b/src/hotspot/share/opto/generateOptoStub.cpp @@ -228,7 +228,7 @@ void GraphKit::gen_stub(address C_function, Node* target = map()->in(TypeFunc::Parms); // Runtime call returning oop in TLS? Fetch it out if( pass_tls ) { - Node* adr = basic_plus_adr(top(), thread, in_bytes(JavaThread::vm_result_offset())); + Node* adr = basic_plus_adr(top(), thread, in_bytes(JavaThread::vm_result_oop_offset())); Node* vm_result = make_load(nullptr, adr, TypeOopPtr::BOTTOM, T_OBJECT, MemNode::unordered); map()->set_req(TypeFunc::Parms, vm_result); // vm_result passed as result // clear thread-local-storage(tls) diff --git a/src/hotspot/share/opto/runtime.cpp b/src/hotspot/share/opto/runtime.cpp index e32cedf6cee15..62d6e933564f1 100644 --- a/src/hotspot/share/opto/runtime.cpp +++ b/src/hotspot/share/opto/runtime.cpp @@ -342,7 +342,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(Klass* klass, JavaThread* curr // Scavenge and allocate an instance. Handle holder(current, klass->klass_holder()); // keep the klass alive oop result = InstanceKlass::cast(klass)->allocate_instance(THREAD); - current->set_vm_result(result); + current->set_vm_result_oop(result); // Pass oops back through thread local storage. Our apparent type to Java // is that we return an oop, but we can block on exit from this routine and @@ -388,7 +388,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(Klass* array_type, int len, JavaT // a GC can trash the oop in C's return register. The generated stub will // fetch the oop from TLS after any possible GC. deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION); - current->set_vm_result(result); + current->set_vm_result_oop(result); JRT_BLOCK_END; // inform GC that we won't do card marks for initializing writes. @@ -416,14 +416,14 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_nozero_C(Klass* array_type, int len // a GC can trash the oop in C's return register. The generated stub will // fetch the oop from TLS after any possible GC. deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION); - current->set_vm_result(result); + current->set_vm_result_oop(result); JRT_BLOCK_END; // inform GC that we won't do card marks for initializing writes. SharedRuntime::on_slowpath_allocation_exit(current); - oop result = current->vm_result(); + oop result = current->vm_result_oop(); if ((len > 0) && (result != nullptr) && is_deoptimized_caller_frame(current)) { // Zero array here if the caller is deoptimized. @@ -460,7 +460,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray2_C(Klass* elem_type, int len1, int l Handle holder(current, elem_type->klass_holder()); // keep the klass alive oop obj = ArrayKlass::cast(elem_type)->multi_allocate(2, dims, THREAD); deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END // multianewarray for 3 dimensions @@ -477,7 +477,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray3_C(Klass* elem_type, int len1, int l Handle holder(current, elem_type->klass_holder()); // keep the klass alive oop obj = ArrayKlass::cast(elem_type)->multi_allocate(3, dims, THREAD); deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END // multianewarray for 4 dimensions @@ -495,7 +495,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray4_C(Klass* elem_type, int len1, int l Handle holder(current, elem_type->klass_holder()); // keep the klass alive oop obj = ArrayKlass::cast(elem_type)->multi_allocate(4, dims, THREAD); deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END // multianewarray for 5 dimensions @@ -514,7 +514,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray5_C(Klass* elem_type, int len1, int l Handle holder(current, elem_type->klass_holder()); // keep the klass alive oop obj = ArrayKlass::cast(elem_type)->multi_allocate(5, dims, THREAD); deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(Klass* elem_type, arrayOopDesc* dims, JavaThread* current)) @@ -532,7 +532,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(Klass* elem_type, arrayOopDesc* d Handle holder(current, elem_type->klass_holder()); // keep the klass alive oop obj = ArrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD); deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION); - current->set_vm_result(obj); + current->set_vm_result_oop(obj); JRT_END JRT_BLOCK_ENTRY(void, OptoRuntime::monitor_notify_C(oopDesc* obj, JavaThread* current)) @@ -1867,7 +1867,7 @@ address OptoRuntime::rethrow_C(oopDesc* exception, JavaThread* thread, address r } #endif - thread->set_vm_result(exception); + thread->set_vm_result_oop(exception); // Frame not compiled (handles deoptimization blob) return SharedRuntime::raw_exception_handler_for_return_address(thread, ret_pc); } diff --git a/src/hotspot/share/runtime/javaCalls.cpp b/src/hotspot/share/runtime/javaCalls.cpp index e9b0a11917aaa..012cea19bb0f4 100644 --- a/src/hotspot/share/runtime/javaCalls.cpp +++ b/src/hotspot/share/runtime/javaCalls.cpp @@ -427,7 +427,7 @@ void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaC result = link.result(); // circumvent MS C++ 5.0 compiler bug (result is clobbered across call) // Preserve oop return value across possible gc points if (oop_result_flag) { - thread->set_vm_result(result->get_oop()); + thread->set_vm_result_oop(result->get_oop()); } } } // Exit JavaCallWrapper (can block - potential return oop must be preserved) @@ -438,8 +438,8 @@ void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaC // Restore possible oop return if (oop_result_flag) { - result->set_oop(thread->vm_result()); - thread->set_vm_result(nullptr); + result->set_oop(thread->vm_result_oop()); + thread->set_vm_result_oop(nullptr); } } diff --git a/src/hotspot/share/runtime/javaThread.cpp b/src/hotspot/share/runtime/javaThread.cpp index b5c7709ac88f1..e4f377a121799 100644 --- a/src/hotspot/share/runtime/javaThread.cpp +++ b/src/hotspot/share/runtime/javaThread.cpp @@ -423,8 +423,8 @@ JavaThread::JavaThread(MemTag mem_tag) : _vframe_array_last(nullptr), _jvmti_deferred_updates(nullptr), _callee_target(nullptr), - _vm_result(nullptr), - _vm_result_2(nullptr), + _vm_result_oop(nullptr), + _vm_result_metadata(nullptr), _current_pending_monitor(nullptr), _current_pending_monitor_is_from_java(true), @@ -1412,7 +1412,7 @@ void JavaThread::oops_do_no_frames(OopClosure* f, NMethodClosure* cf) { // Traverse instance variables at the end since the GC may be moving things // around using this function - f->do_oop((oop*) &_vm_result); + f->do_oop((oop*) &_vm_result_oop); f->do_oop((oop*) &_exception_oop); #if INCLUDE_JVMCI f->do_oop((oop*) &_jvmci_reserved_oop0); diff --git a/src/hotspot/share/runtime/javaThread.hpp b/src/hotspot/share/runtime/javaThread.hpp index 25d3b7906e69b..01da26a97e841 100644 --- a/src/hotspot/share/runtime/javaThread.hpp +++ b/src/hotspot/share/runtime/javaThread.hpp @@ -145,8 +145,8 @@ class JavaThread: public Thread { Method* _callee_target; // Used to pass back results to the interpreter or generated code running Java code. - oop _vm_result; // oop result is GC-preserved - Metadata* _vm_result_2; // non-oop result + oop _vm_result_oop; // oop result is GC-preserved + Metadata* _vm_result_metadata; // non-oop result // See ReduceInitialCardMarks: this holds the precise space interval of // the most recent slow path allocation for which compiled code has @@ -784,10 +784,10 @@ class JavaThread: public Thread { void set_callee_target (Method* x) { _callee_target = x; } // Oop results of vm runtime calls - oop vm_result() const { return _vm_result; } - void set_vm_result (oop x) { _vm_result = x; } + oop vm_result_oop() const { return _vm_result_oop; } + void set_vm_result_oop(oop x) { _vm_result_oop = x; } - void set_vm_result_2 (Metadata* x) { _vm_result_2 = x; } + void set_vm_result_metadata(Metadata* x) { _vm_result_metadata = x; } MemRegion deferred_card_mark() const { return _deferred_card_mark; } void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; } @@ -853,8 +853,8 @@ class JavaThread: public Thread { return byte_offset_of(JavaThread, _anchor); } static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); } - static ByteSize vm_result_offset() { return byte_offset_of(JavaThread, _vm_result); } - static ByteSize vm_result_2_offset() { return byte_offset_of(JavaThread, _vm_result_2); } + static ByteSize vm_result_oop_offset() { return byte_offset_of(JavaThread, _vm_result_oop); } + static ByteSize vm_result_metadata_offset() { return byte_offset_of(JavaThread, _vm_result_metadata); } static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); } static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); } static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); } diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index 2f29ce9b1fc6d..3695d9dfe76dc 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -1439,7 +1439,7 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::handle_wrong_method_ic_miss(JavaThread* JRT_BLOCK callee_method = SharedRuntime::handle_ic_miss_helper(CHECK_NULL); // Return Method* through TLS - current->set_vm_result_2(callee_method()); + current->set_vm_result_metadata(callee_method()); JRT_BLOCK_END // return compiled code entry point after potential safepoints return get_resolved_entry(current, callee_method); @@ -1470,7 +1470,7 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::handle_wrong_method(JavaThread* current) caller_frame.is_upcall_stub_frame()) { Method* callee = current->callee_target(); guarantee(callee != nullptr && callee->is_method(), "bad handshake"); - current->set_vm_result_2(callee); + current->set_vm_result_metadata(callee); current->set_callee_target(nullptr); if (caller_frame.is_entry_frame() && VM_Version::supports_fast_class_init_checks()) { // Bypass class initialization checks in c2i when caller is in native. @@ -1492,7 +1492,7 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::handle_wrong_method(JavaThread* current) JRT_BLOCK // Force resolving of caller (if we called from compiled frame) callee_method = SharedRuntime::reresolve_call_site(CHECK_NULL); - current->set_vm_result_2(callee_method()); + current->set_vm_result_metadata(callee_method()); JRT_BLOCK_END // return compiled code entry point after potential safepoints return get_resolved_entry(current, callee_method); @@ -1550,7 +1550,7 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::resolve_static_call_C(JavaThread* curren bool enter_special = false; JRT_BLOCK callee_method = SharedRuntime::resolve_helper(false, false, CHECK_NULL); - current->set_vm_result_2(callee_method()); + current->set_vm_result_metadata(callee_method()); JRT_BLOCK_END // return compiled code entry point after potential safepoints return get_resolved_entry(current, callee_method); @@ -1561,7 +1561,7 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::resolve_virtual_call_C(JavaThread* curre methodHandle callee_method; JRT_BLOCK callee_method = SharedRuntime::resolve_helper(true, false, CHECK_NULL); - current->set_vm_result_2(callee_method()); + current->set_vm_result_metadata(callee_method()); JRT_BLOCK_END // return compiled code entry point after potential safepoints return get_resolved_entry(current, callee_method); @@ -1574,7 +1574,7 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::resolve_opt_virtual_call_C(JavaThread* c methodHandle callee_method; JRT_BLOCK callee_method = SharedRuntime::resolve_helper(true, true, CHECK_NULL); - current->set_vm_result_2(callee_method()); + current->set_vm_result_metadata(callee_method()); JRT_BLOCK_END // return compiled code entry point after potential safepoints return get_resolved_entry(current, callee_method); @@ -3168,7 +3168,7 @@ void SharedRuntime::on_slowpath_allocation_exit(JavaThread* current) { // this object in the future without emitting card-marks, so // GC may take any compensating steps. - oop new_obj = current->vm_result(); + oop new_obj = current->vm_result_oop(); if (new_obj == nullptr) return; BarrierSet *bs = BarrierSet::barrier_set(); diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index c95dd709c844e..f865380fdb7de 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -604,10 +604,8 @@ nonstatic_field(JavaThread, _threadObj, OopHandle) \ nonstatic_field(JavaThread, _vthread, OopHandle) \ nonstatic_field(JavaThread, _jvmti_vthread, OopHandle) \ - nonstatic_field(JavaThread, _scopedValueCache, OopHandle) \ + nonstatic_field(JavaThread, _scopedValueCache, OopHandle) \ nonstatic_field(JavaThread, _anchor, JavaFrameAnchor) \ - nonstatic_field(JavaThread, _vm_result, oop) \ - nonstatic_field(JavaThread, _vm_result_2, Metadata*) \ volatile_nonstatic_field(JavaThread, _current_pending_monitor, ObjectMonitor*) \ nonstatic_field(JavaThread, _current_pending_monitor_is_from_java, bool) \ volatile_nonstatic_field(JavaThread, _current_waiting_monitor, ObjectMonitor*) \