[aarch64-port-dev ] RFR: Fix Issue with turning off UseOnStackReplacement with TieredCompilation

Edward Nevill edward.nevill at linaro.org
Mon Feb 17 09:15:25 PST 2014


> On 11 February 2014 11:12, Edward Nevill <edward.nevill at linaro.org> wrote:
> 
> > On Tue, 2014-02-11 at 09:49 -0500, Andy Johnson wrote:
> > > (gdb) x/20i $pc-40
> > >    0x7fa1098c50:    add    x0, x0, #0x8
> > >    0x7fa1098c54:    str    x0, [x1,#112]
> > >    0x7fa1098c58:    ands    x0, x0, #0x1ff8
> > >    0x7fa1098c5c:    b.eq    0x7fa1098c5c
> > >    0x7fa1098c60:    b    0x7fa1098c7c
> > >    0x7fa1098c64:    ldr    x8, [x12,#32]
> > >    0x7fa1098c68:    ldr    x0, [x8,#12]
> > >    0x7fa1098c6c:    add    x0, x0, #0x8
> > >    0x7fa1098c70:    str    x0, [x8,#12]
> > >    0x7fa1098c74:    ands    x0, x0, #0x1ff8
> > > => 0x7fa1098c78:    b.eq    0x7fa1098c78
> >
> > Andy,
> >
> > I think you will find the above instruction to be the source of the
> > problem.
> >

Hi,

The following patch fixes this problem. Basically the label 'backedge_counter_overflow' was not being bound with the combination of +TieredCompilation and -UseOnStackReplacement.

OK to push?
Ed.

--- CUT HERE ---
exporting patch:
# HG changeset patch
# User Edward Nevill edward.nevill at linaro.org
# Date 1392484801 0
#      Sat Feb 15 17:20:01 2014 +0000
# Node ID 18e5cbbe8abf64a043e2482c625e04acde33a3f8
# Parent  a69fcb4e97f6098c2f0b712a9306664a0fe74368
Fix infinite loop with +TieredCompilation and -UseOnStackReplacement

diff -r a69fcb4e97f6 -r 18e5cbbe8abf src/cpu/aarch64/vm/templateTable_aarch64.cpp
--- a/src/cpu/aarch64/vm/templateTable_aarch64.cpp      Tue Feb 11 15:36:54 2014 +0000
+++ b/src/cpu/aarch64/vm/templateTable_aarch64.cpp      Sat Feb 15 17:20:01 2014 +0000
@@ -1711,8 +1711,8 @@
         }
       }
     }
-    __ bind(dispatch);
   }
+  __ bind(dispatch);
 
   // Pre-load the next target bytecode into rscratch1
   __ load_unsigned_byte(rscratch1, Address(rbcp, 0));
@@ -1732,7 +1732,7 @@
       __ b(dispatch);
     }
 
-    if (UseOnStackReplacement) {
+    if (TieredCompilation || UseOnStackReplacement) {
       // invocation counter overflow
       __ bind(backedge_counter_overflow);
       __ neg(r2, r2);
@@ -1742,6 +1742,11 @@
                  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)
--- CUT HERE ---




More information about the aarch64-port-dev mailing list