RFR: JDK-8158386: fix jlong value returned from method being deoptimized

Andrey Petushkov andrey.petushkov at gmail.com
Wed Jun 1 15:03:59 UTC 2016


Dear Ed, All,

Please consider the following patch to fix the problem of corruption of the high part of the jlong value returned by the compiled method being deoptimized at the time of return (provoked by ForceEarlyReturn mechanism). Naturally not only r0 and d0 but r1 as well should have been saved across the native method call

diff -r 79bf1547b28d src/cpu/aarch32/vm/sharedRuntime_aarch32.cpp
--- a/src/cpu/aarch32/vm/sharedRuntime_aarch32.cpp	Sat May 14 17:34:57 2016 +0100
+++ b/src/cpu/aarch32/vm/sharedRuntime_aarch32.cpp	Wed Jun 01 17:51:22 2016 +0300
@@ -2363,7 +2363,7 @@
 
   // Restore frame locals after moving the frame
   __ vstr_f64(d0, Address(sp, RegisterSaver::offset_in_bytes(RegisterSaver::fpu_state_off)));
-  __ str(r0, Address(sp, RegisterSaver::offset_in_bytes(RegisterSaver::r0_off)));
+  __ strd(r0, Address(sp, RegisterSaver::offset_in_bytes(RegisterSaver::r0_off)));
 
   // Call C code.  Need thread but NOT official VM entry
   // crud.  We cannot block on this call, no GC can happen.  Call should
@@ -2391,7 +2391,7 @@
 
   // Collect return values
   __ vldr_f64(d0, Address(sp, RegisterSaver::offset_in_bytes(RegisterSaver::fpu_state_off)));
-  __ ldr(r0, Address(sp, RegisterSaver::offset_in_bytes(RegisterSaver::r0_off)));
+  __ ldrd(r0, Address(sp, RegisterSaver::offset_in_bytes(RegisterSaver::r0_off)));
   // I think this is useless (throwing pc?)
   // __ ldr(r3, Address(sp, RegisterSaver::r3_offset_in_bytes()));

Regards,
Andrey


More information about the aarch32-port-dev mailing list