8196136: AArch64: Correct register use in patch for JDK-8195685
authoradinn
Thu, 25 Jan 2018 11:56:32 +0000
changeset 48707 a5736067e82a
parent 48706 69d1a1590485
child 48708 46a2e41ebe59
8196136: AArch64: Correct register use in patch for JDK-8195685 Summary: itable stubs must not use java argument registers as scratch registers Reviewed-by: aph
src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp
--- a/src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp	Mon Jan 22 15:19:02 2018 +0000
+++ b/src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp	Thu Jan 25 11:56:32 2018 +0000
@@ -63,8 +63,8 @@
 
 #ifndef PRODUCT
   if (CountCompiledCalls) {
-    __ lea(r19, ExternalAddress((address) SharedRuntime::nof_megamorphic_calls_addr()));
-    __ incrementw(Address(r19));
+    __ lea(r16, ExternalAddress((address) SharedRuntime::nof_megamorphic_calls_addr()));
+    __ incrementw(Address(r16));
   }
 #endif
 
@@ -73,13 +73,13 @@
 
   // get receiver klass
   address npe_addr = __ pc();
-  __ load_klass(r19, j_rarg0);
+  __ load_klass(r16, j_rarg0);
 
 #ifndef PRODUCT
   if (DebugVtables) {
     Label L;
     // check offset vs vtable length
-    __ ldrw(rscratch1, Address(r19, Klass::vtable_length_offset()));
+    __ ldrw(rscratch1, Address(r16, Klass::vtable_length_offset()));
     __ cmpw(rscratch1, vtable_index * vtableEntry::size());
     __ br(Assembler::GT, L);
     __ enter();
@@ -91,7 +91,7 @@
   }
 #endif // PRODUCT
 
-  __ lookup_virtual_method(r19, vtable_index, rmethod);
+  __ lookup_virtual_method(r16, vtable_index, rmethod);
 
   if (DebugVtables) {
     Label L;
@@ -145,9 +145,9 @@
   //  j_rarg0: Receiver
 
 
-  // Most registers are in use; we'll use r0, rmethod, r10, r11
+  // Most registers are in use; we'll use r16, rmethod, r10, r11
   const Register recv_klass_reg     = r10;
-  const Register holder_klass_reg   = r0; // declaring interface klass (DECC)
+  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 icholder_reg       = rscratch2;