8173100: AArch64: -XX:-UseOnStackReplacement does not work together with -XX:+TieredCompilation
authornjian
Thu, 15 Mar 2018 14:05:48 +0800
changeset 49457 fa30cdd2d3b8
parent 49456 647d7631fb9d
child 49458 ddf9c5044e16
8173100: AArch64: -XX:-UseOnStackReplacement does not work together with -XX:+TieredCompilation Summary: Fix hotspot jtreg test compiler/interpreter/DisableOSRTest.java failure on AArch64. Reviewed-by: aph, fyang
src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
--- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Mon Mar 19 08:31:57 2018 -0400
+++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Thu Mar 15 14:05:48 2018 +0800
@@ -1904,7 +1904,8 @@
                                            in_bytes(InvocationCounter::counter_offset()));
         const Address mask(r1, in_bytes(MethodData::backedge_mask_offset()));
         __ increment_mask_and_jump(mdo_backedge_counter, increment, mask,
-                                   r0, rscratch1, false, Assembler::EQ, &backedge_counter_overflow);
+                                   r0, rscratch1, false, Assembler::EQ,
+                                   UseOnStackReplacement ? &backedge_counter_overflow : &dispatch);
         __ b(dispatch);
       }
       __ bind(no_mdo);
@@ -1912,7 +1913,8 @@
       __ ldr(rscratch1, Address(rmethod, Method::method_counters_offset()));
       const Address mask(rscratch1, in_bytes(MethodCounters::backedge_mask_offset()));
       __ increment_mask_and_jump(Address(rscratch1, be_offset), increment, mask,
-                                 r0, rscratch2, false, Assembler::EQ, &backedge_counter_overflow);
+                                 r0, rscratch2, false, Assembler::EQ,
+                                 UseOnStackReplacement ? &backedge_counter_overflow : &dispatch);
     } else { // not TieredCompilation
       // increment counter
       __ ldr(rscratch2, Address(rmethod, Method::method_counters_offset()));
@@ -1960,8 +1962,8 @@
         }
       }
     }
+    __ bind(dispatch);
   }
-  __ bind(dispatch);
 
   // Pre-load the next target bytecode into rscratch1
   __ load_unsigned_byte(rscratch1, Address(rbcp, 0));
@@ -1981,7 +1983,7 @@
       __ b(dispatch);
     }
 
-    if (TieredCompilation || UseOnStackReplacement) {
+    if (UseOnStackReplacement) {
       // invocation counter overflow
       __ bind(backedge_counter_overflow);
       __ neg(r2, r2);
@@ -1991,11 +1993,6 @@
                  CAST_FROM_FN_PTR(address,
                                   InterpreterRuntime::frequency_counter_overflow),
                  r2);
-      if (!UseOnStackReplacement)
-        __ b(dispatch);
-    }
-
-    if (UseOnStackReplacement) {
       __ load_unsigned_byte(r1, Address(rbcp, 0));  // restore target bytecode
 
       // r0: osr nmethod (osr ok) or NULL (osr not possible)