[aarch64-port-dev ] RFR(M): 8233743: AArch64: Make r27 conditionally allocatable

Nick Gasson nick.gasson at arm.com
Tue Nov 26 10:34:32 UTC 2019


(Not related to the original RFR.)

> 
> The itable stub calls MacroAssembler::load_klass() twice which then
> calls the above decode_klass_not_null() with dst==src if
> UseCompressedClassPointers is true. So we do the saving/restoring
> rheapbase dance twice which blows up the size of the itable stub beyond
> the estimated 152B max size.
> 

Actually I don't think we need to call load_klass twice on AArch64? The
compiled code doesn't use callee save registers so we should have plenty
spare to use as temporaries. I.e. could we do the following?

--- a/src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp
@@ -175,6 +175,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
   const Register holder_klass_reg   = r16; // declaring interface klass (DECC)
   const Register resolved_klass_reg = rmethod; // resolved interface klass (REFC)
   const Register temp_reg           = r11;
+  const Register temp_reg2          = r15;
   const Register icholder_reg       = rscratch2;

   Label L_no_such_interface;
@@ -193,7 +194,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
   __ lookup_interface_method(// inputs: rec. class, interface
                              recv_klass_reg, resolved_klass_reg, noreg,
                              // outputs:  scan temp. reg1, scan temp. reg2
-                             recv_klass_reg, temp_reg,
+                             temp_reg2, temp_reg,
                              L_no_such_interface,
                              /*return_method=*/false);

@@ -201,7 +202,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
   start_pc = __ pc();

   // Get selected method from declaring class and itable index
-  __ load_klass(recv_klass_reg, j_rarg0);   // restore recv_klass_reg
+  //__ load_klass(recv_klass_reg, j_rarg0);   // restore recv_klass_reg
   __ lookup_interface_method(// inputs: rec. class, interface, itable index
                              recv_klass_reg, holder_klass_reg, itable_index,
                              // outputs: method, scan temp. reg


Thanks,
Nick


More information about the aarch64-port-dev mailing list