Skip to content

Commit c3f8cf5

Browse files
author
duke
committedNov 22, 2023
Automatic merge of jdk:master into master
2 parents 39b7e43 + 524da14 commit c3f8cf5

File tree

3 files changed

+22
-33
lines changed

3 files changed

+22
-33
lines changed
 

‎src/hotspot/cpu/ppc/templateTable_ppc.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define CPU_PPC_TEMPLATETABLE_PPC_HPP
2828

2929
static void prepare_invoke(Register Rcache, Register Rret_addr, Register Rrecv, Register Rscratch);
30-
static void invokevfinal_helper(Register Rcache, Register Rscratch1, Register Rscratch2, Register Rscratch3);
30+
static void invokevfinal_helper(Register Rcache, Register Rscratch1, Register Rscratch2, Register Rscratch3, Register Rscratch4);
3131
static void generate_vtable_call(Register Rrecv_klass, Register Rindex, Register Rret, Register Rtemp);
3232
static void invokeinterface_object_method(Register Rrecv_klass, Register Rret, Register Rflags, Register Rcache, Register Rtemp, Register Rtemp2);
3333

‎src/hotspot/cpu/ppc/templateTable_ppc_64.cpp

+20-32
Original file line numberDiff line numberDiff line change
@@ -3487,7 +3487,7 @@ void TemplateTable::invokevirtual(int byte_no) {
34873487
if (RewriteBytecodes && !UseSharedSpaces && !CDSConfig::is_dumping_static_archive()) {
34883488
patch_bytecode(Bytecodes::_fast_invokevfinal, Rnew_bc, R12_scratch2);
34893489
}
3490-
invokevfinal_helper(Rcache, R11_scratch1, R12_scratch2, Rflags /* tmp */);
3490+
invokevfinal_helper(Rcache, R11_scratch1, R12_scratch2, Rflags /* tmp */, Rrecv /* tmp */);
34913491

34923492
__ align(32, 12);
34933493
__ bind(LnotFinal);
@@ -3510,36 +3510,24 @@ void TemplateTable::fast_invokevfinal(int byte_no) {
35103510
assert(byte_no == f2_byte, "use this argument");
35113511
Register Rcache = R31;
35123512
__ load_method_entry(Rcache, R11_scratch1);
3513-
invokevfinal_helper(Rcache, R11_scratch1, R12_scratch2, R22_tmp2);
3513+
invokevfinal_helper(Rcache, R11_scratch1, R12_scratch2, R22_tmp2, R23_tmp3);
35143514
}
35153515

3516-
void TemplateTable::invokevfinal_helper(Register Rcache, Register Rscratch1, Register Rscratch2, Register Rscratch3) {
3516+
void TemplateTable::invokevfinal_helper(Register Rcache,
3517+
Register Rscratch1, Register Rscratch2, Register Rscratch3, Register Rscratch4) {
35173518

3518-
assert_different_registers(Rcache, Rscratch1, Rscratch2, Rscratch3);
3519+
assert_different_registers(Rcache, Rscratch1, Rscratch2, Rscratch3, Rscratch4);
35193520

3520-
// Load receiver from stack slot.
3521-
Register Rmethod = Rscratch3;
3522-
__ ld(Rmethod, in_bytes(ResolvedMethodEntry::method_offset()), Rcache);
3521+
Register Rrecv = Rscratch2,
3522+
Rmethod = Rscratch3,
3523+
Rret_addr = Rscratch4;
3524+
prepare_invoke(Rcache, Rret_addr, Rrecv, Rscratch1);
35233525

3524-
// Get return address.
3525-
Register Rtable_addr = Rscratch2,
3526-
Rret_addr = Rcache,
3527-
Rret_type = Rscratch1;
3528-
// Get return type. It's coded into the upper 4 bits of the lower half of the 64 bit value.
3529-
__ lbz(Rret_type, in_bytes(ResolvedMethodEntry::type_offset()), Rcache);
3530-
__ load_dispatch_table(Rtable_addr, Interpreter::invoke_return_entry_table());
3531-
__ sldi(Rret_type, Rret_type, LogBytesPerWord);
3532-
__ ldx(Rret_addr, Rret_type, Rtable_addr); // kills Rcache
3533-
3534-
Register Rnum_params = Rscratch2,
3535-
Rrecv = Rscratch2;
3536-
__ ld(Rnum_params, in_bytes(Method::const_offset()), Rmethod);
3537-
__ lhz(Rnum_params /* number of params */, in_bytes(ConstMethod::size_of_parameters_offset()), Rnum_params);
3538-
3539-
// Load receiver and receiver null check.
3540-
__ load_receiver(Rnum_params, Rrecv);
3526+
// Receiver null check.
35413527
__ null_check_throw(Rrecv, -1, Rscratch1);
35423528

3529+
__ ld(Rmethod, in_bytes(ResolvedMethodEntry::method_offset()), Rcache);
3530+
35433531
__ profile_final_call(Rrecv, Rscratch1);
35443532
// Argument and return type profiling.
35453533
__ profile_arguments_type(Rmethod, Rscratch1, Rscratch2, true);
@@ -3558,9 +3546,9 @@ void TemplateTable::invokespecial(int byte_no) {
35583546
Rmethod = R31;
35593547

35603548
load_resolved_method_entry_special_or_static(Rcache, // ResolvedMethodEntry*
3561-
Rmethod, // Method* or itable index
3549+
Rmethod, // Method*
35623550
noreg); // flags
3563-
prepare_invoke(Rcache, Rret_addr, Rreceiver, R11_scratch1); // recv
3551+
prepare_invoke(Rcache, Rret_addr, Rreceiver, R11_scratch1);
35643552

35653553
// Receiver null check.
35663554
__ null_check_throw(Rreceiver, -1, R11_scratch1);
@@ -3578,10 +3566,10 @@ void TemplateTable::invokestatic(int byte_no) {
35783566
Register Rcache = R3_ARG1,
35793567
Rret_addr = R4_ARG2;
35803568

3581-
load_resolved_method_entry_special_or_static(Rcache, // ResolvedMethodEntry*
3582-
R19_method, // Method* or itable index
3583-
noreg); // flags
3584-
prepare_invoke(Rcache, Rret_addr, noreg, R11_scratch1); // recv
3569+
load_resolved_method_entry_special_or_static(Rcache, // ResolvedMethodEntry*
3570+
R19_method, // Method*
3571+
noreg); // flags
3572+
prepare_invoke(Rcache, Rret_addr, noreg, R11_scratch1);
35853573

35863574
__ profile_call(R11_scratch1, R12_scratch2);
35873575
// Argument and return type profiling.
@@ -3639,7 +3627,7 @@ void TemplateTable::invokeinterface(int byte_no) {
36393627
Rcache = R31;
36403628

36413629
load_resolved_method_entry_interface(Rcache, noreg, noreg, Rflags);
3642-
prepare_invoke(Rcache, Rret_addr, Rreceiver, Rscratch1); // recv
3630+
prepare_invoke(Rcache, Rret_addr, Rreceiver, Rscratch1);
36433631

36443632
// First check for Object case, then private interface method,
36453633
// then regular interface method.
@@ -3757,7 +3745,7 @@ void TemplateTable::invokehandle(int byte_no) {
37573745
Rcache = R31;
37583746

37593747
load_resolved_method_entry_handle(Rcache, // ResolvedMethodEntry*
3760-
Rmethod, // Method* or itable index
3748+
Rmethod, // Method*
37613749
Rscratch1,
37623750
Rflags);
37633751
prepare_invoke(Rcache, Rret_addr, Rrecv, Rscratch1);

‎src/hotspot/share/interpreter/templateInterpreter.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ address* TemplateInterpreter::invoke_return_entry_table_for(Bytecodes::Code code
244244
case Bytecodes::_invokespecial:
245245
case Bytecodes::_invokevirtual:
246246
case Bytecodes::_invokehandle:
247+
case Bytecodes::_fast_invokevfinal:
247248
return Interpreter::invoke_return_entry_table();
248249
case Bytecodes::_invokeinterface:
249250
return Interpreter::invokeinterface_return_entry_table();

0 commit comments

Comments
 (0)
Failed to load comments.