OSDN Git Service

Disable stack assertions in non-compiled code.
authorNicolas Geoffray <ngeoffray@google.com>
Fri, 27 May 2016 09:38:14 +0000 (10:38 +0100)
committerNicolas Geoffray <ngeoffray@google.com>
Fri, 27 May 2016 09:39:32 +0000 (10:39 +0100)
bug:28769520

Change-Id: Ib9e8a1ae1e7c8a4a9e49173cec80466c40b9f472

test/602-deoptimizeable/src/Main.java

index 8032ce9..743a579 100644 (file)
@@ -50,6 +50,9 @@ public class Main {
     public static native void assertIsManaged();
     public static native void assertCallerIsInterpreted();
     public static native void assertCallerIsManaged();
+    public static native void disableStackFrameAsserts();
+    public static native boolean hasOatFile();
+    public static native boolean isInterpreted();
 
     public static void execute(Runnable runnable) throws Exception {
       Thread t = new Thread(runnable);
@@ -59,6 +62,10 @@ public class Main {
 
     public static void main(String[] args) throws Exception {
         System.loadLibrary(args[0]);
+        // Only test stack frames in compiled mode.
+        if (!hasOatFile() || isInterpreted()) {
+          disableStackFrameAsserts();
+        }
         final HashMap<DummyObject, Long> map = new HashMap<DummyObject, Long>();
 
         // Single-frame deoptimization that covers partial fragment.