< prev index next >

test/jdk/com/sun/jdi/EATests.java

Print this page
rev 60137 : 8227745: Enable Escape Analysis for Better Performance in the Presence of JVMTI Agents
Reviewed-by: mdoerr, goetz
rev 60138 : 8227745: delta webrev.5 -> webrev.6

@@ -30,11 +30,10 @@
  * @requires ((vm.compMode == "Xmixed") & vm.compiler2.enabled)
  * @library /test/lib /test/hotspot/jtreg
  *
  * @run build TestScaffold VMConnection TargetListener TargetAdapter sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run compile -g EATests.java
  * @run driver EATests
  *                 -XX:+UnlockDiagnosticVMOptions
  *                 -Xms256m -Xmx256m
  *                 -Xbootclasspath/a:.

@@ -89,34 +88,34 @@
  *                 -XX:CompileCommand=dontinline,*::dontinline_*
  *                 -XX:+WhiteBoxAPI
  *                 -Xbatch
  *                 -XX:-DoEscapeAnalysis -XX:-EliminateAllocations -XX:+EliminateLocks -XX:+EliminateNestedLocks -XX:-UseBiasedLocking
  *
- * @comment Excercise -XX:DeoptimizeObjectsALot. Mostly to prevent bit-rot, because the option is meant to stress object deoptimization
+ * @comment Excercise -XX:+DeoptimizeObjectsALot. Mostly to prevent bit-rot, because the option is meant to stress object deoptimization
  *          with non-synthetic workloads.
  * @run driver EATests
  *                 -XX:+UnlockDiagnosticVMOptions
  *                 -Xms256m -Xmx256m
  *                 -Xbootclasspath/a:.
  *                 -XX:CompileCommand=dontinline,*::dontinline_*
  *                 -XX:+WhiteBoxAPI
  *                 -Xbatch
  *                 -XX:-DoEscapeAnalysis -XX:-EliminateAllocations -XX:+EliminateLocks -XX:+EliminateNestedLocks -XX:-UseBiasedLocking
- *                 -XX:+IgnoreUnrecognizedVMOptions -XX:DeoptimizeObjectsALot=2 -XX:DeoptimizeObjectsALotThreadCount=2
+ *                 -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeObjectsALot
  */
 
+import com.sun.jdi.*;
+import com.sun.jdi.event.*;
+import compiler.testlibrary.CompilerUtils;
+import compiler.whitebox.CompilerWhiteBoxTest;
+
 import java.lang.reflect.Array;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.function.Function;
 
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-
-import compiler.testlibrary.CompilerUtils;
-import compiler.whitebox.CompilerWhiteBoxTest;
 import jdk.test.lib.Asserts;
 import sun.hotspot.WhiteBox;
 
 
 /////////////////////////////////////////////////////////////////////////////

@@ -245,17 +244,17 @@
 
     public static class TargetVMOptions {
 
         public final boolean UseJVMCICompiler;
         public final boolean EliminateAllocations;
-        public final int DeoptimizeObjectsALot;
+        public final boolean DeoptimizeObjectsALot;
 
         public TargetVMOptions(EATests env, ClassType testCaseBaseTargetClass) {
             Value val = testCaseBaseTargetClass.getValue(testCaseBaseTargetClass.fieldByName("EliminateAllocations"));
             EliminateAllocations = ((PrimitiveValue) val).booleanValue();
             val = testCaseBaseTargetClass.getValue(testCaseBaseTargetClass.fieldByName("DeoptimizeObjectsALot"));
-            DeoptimizeObjectsALot = ((PrimitiveValue) val).intValue();
+            DeoptimizeObjectsALot = ((PrimitiveValue) val).booleanValue();
             val = testCaseBaseTargetClass.getValue(testCaseBaseTargetClass.fieldByName("UseJVMCICompiler"));
             UseJVMCICompiler = ((PrimitiveValue) val).booleanValue();
         }
 
     }

@@ -722,11 +721,11 @@
     }
 
     public static final boolean UseJVMCICompiler     = unbox(WB.getBooleanVMFlag("UseJVMCICompiler"), false); // read by debugger
     public static final boolean DoEscapeAnalysis     = unbox(WB.getBooleanVMFlag("DoEscapeAnalysis"), UseJVMCICompiler);
     public static final boolean EliminateAllocations = unbox(WB.getBooleanVMFlag("EliminateAllocations"), UseJVMCICompiler); // read by debugger
-    public static final long DeoptimizeObjectsALot   = WB.getIntVMFlag("DeoptimizeObjectsALot");              // read by debugger
+    public static final boolean DeoptimizeObjectsALot   = WB.getBooleanVMFlag("DeoptimizeObjectsALot");                      // read by debugger
     public static final long BiasedLockingBulkRebiasThreshold = WB.getIntxVMFlag("BiasedLockingBulkRebiasThreshold");
     public static final long BiasedLockingBulkRevokeThreshold = WB.getIntxVMFlag("BiasedLockingBulkRevokeThreshold");
 
     public String testMethodName;
     public int testMethodDepth;

@@ -848,11 +847,11 @@
             StackTraceElement[] frames = Thread.currentThread().getStackTrace();
             int stackTraceDepth = testMethodDepth + 1; // ignore java.lang.Thread.getStackTrace()
             Asserts.assertEQ(testMethodName, frames[stackTraceDepth].getMethodName(),
                     testCaseName + ": test method not found at depth " + testMethodDepth);
             // check if the frame is (not) deoptimized as expected
-            if (DeoptimizeObjectsALot == 0) {
+            if (!DeoptimizeObjectsALot) {
                 if (testFrameShouldBeDeoptimized()) {
                     Asserts.assertTrue(WB.isFrameDeoptimized(testMethodDepth+1),
                             testCaseName + ": expected test method frame at depth " + testMethodDepth + " to be deoptimized");
                 } else {
                     Asserts.assertFalse(WB.isFrameDeoptimized(testMethodDepth+1),

@@ -1736,11 +1735,11 @@
     }
 }
 
 /////////////////////////////////////////////////////////////////////////////
 
-// Object ref l1 is retrieved by the debugger at a location where nested lockes are ommitted. The
+// Object ref l1 is retrieved by the debugger at a location where nested locks are omitted. The
 // accessed object is globally reachable already before the access, therefore no relocking is done.
 class EARelockingNestedInflatedTarget extends EATestCaseBaseTarget {
 
     @Override
     public void setUp() {

@@ -2542,13 +2541,13 @@
         printStack(thread);
     }
 
     @Override
     public boolean shouldSkip() {
-        // OOMEs because of realloc failures with DeoptimizeObjectsALot > 0 are too random.
-        // And graal currently doesn't provide all information about non-escaping objects in debug info
-        return super.shouldSkip() || (env.targetVMOptions.DeoptimizeObjectsALot > 0) || env.targetVMOptions.UseJVMCICompiler;
+        // OOMEs because of realloc failures with DeoptimizeObjectsALot are too random.
+        // And Graal currently doesn't provide all information about non-escaping objects in debug info
+        return super.shouldSkip() || env.targetVMOptions.DeoptimizeObjectsALot || env.targetVMOptions.UseJVMCICompiler;
     }
 }
 
 class EAPopFrameNotInlinedReallocFailureTarget extends EATestCaseBaseTarget {
 

@@ -2582,13 +2581,13 @@
         return 2*n*(n+1)/2;
     }
 
     @Override
     public boolean shouldSkip() {
-        // OOMEs because of realloc failures with DeoptimizeObjectsALot > 0 are too random.
-        // And graal currently doesn't provide all information about non-escaping objects in debug info
-        return super.shouldSkip() || (DeoptimizeObjectsALot > 0) || UseJVMCICompiler;
+        // OOMEs because of realloc failures with DeoptimizeObjectsALot are too random.
+        // And Graal currently doesn't provide all information about non-escaping objects in debug info
+        return super.shouldSkip() || DeoptimizeObjectsALot || UseJVMCICompiler;
     }
 }
 
 /////////////////////////////////////////////////////////////////////////////
 

@@ -2631,13 +2630,13 @@
         Asserts.assertEQ(expectedTopFrame, thread.frame(0).location().method().name());
     }
 
     @Override
     public boolean shouldSkip() {
-        // OOMEs because of realloc failures with DeoptimizeObjectsALot > 0 are too random.
-        // And graal currently doesn't provide all information about non-escaping objects in debug info
-        return super.shouldSkip() || (env.targetVMOptions.DeoptimizeObjectsALot > 0) || env.targetVMOptions.UseJVMCICompiler;
+        // OOMEs because of realloc failures with DeoptimizeObjectsALot are too random.
+        // And Graal currently doesn't provide all information about non-escaping objects in debug info
+        return super.shouldSkip() || env.targetVMOptions.DeoptimizeObjectsALot || env.targetVMOptions.UseJVMCICompiler;
     }
 }
 
 class EAPopInlinedMethodWithScalarReplacedObjectsReallocFailureTarget extends EATestCaseBaseTarget {
 

@@ -2687,13 +2686,13 @@
         loopCount = Long.MAX_VALUE; // endless loop
     }
 
     @Override
     public boolean shouldSkip() {
-        // OOMEs because of realloc failures with DeoptimizeObjectsALot > 0 are too random.
-        // And graal currently doesn't provide all information about non-escaping objects in debug info
-        return super.shouldSkip() || (DeoptimizeObjectsALot > 0) || UseJVMCICompiler;
+        // OOMEs because of realloc failures with DeoptimizeObjectsALot are too random.
+        // And Graal currently doesn't provide all information about non-escaping objects in debug info
+        return super.shouldSkip() || DeoptimizeObjectsALot || UseJVMCICompiler;
     }
 }
 
 /////////////////////////////////////////////////////////////////////////////
 //

@@ -2888,13 +2887,13 @@
         msg("ForceEarlyReturn DONE");
     }
 
     @Override
     public boolean shouldSkip() {
-        // OOMEs because of realloc failures with DeoptimizeObjectsALot > 0 are too random.
+        // OOMEs because of realloc failures with DeoptimizeObjectsALot are too random.
         // And Graal currently doesn't support Force Early Return
-        return super.shouldSkip() || (env.targetVMOptions.DeoptimizeObjectsALot > 0) || env.targetVMOptions.UseJVMCICompiler;
+        return super.shouldSkip() || env.targetVMOptions.DeoptimizeObjectsALot || env.targetVMOptions.UseJVMCICompiler;
     }
 }
 
 class EAForceEarlyReturnOfInlinedMethodWithScalarReplacedObjectsReallocFailureTarget extends EATestCaseBaseTarget {
 

@@ -2945,13 +2944,13 @@
         loopCount = Long.MAX_VALUE; // endless loop
     }
 
     @Override
     public boolean shouldSkip() {
-        // OOMEs because of realloc failures with DeoptimizeObjectsALot > 0 are too random.
+        // OOMEs because of realloc failures with DeoptimizeObjectsALot are too random.
         // And Graal currently doesn't support Force Early Return
-        return super.shouldSkip() || (DeoptimizeObjectsALot > 0) || UseJVMCICompiler;
+        return super.shouldSkip() || DeoptimizeObjectsALot || UseJVMCICompiler;
     }
 }
 
 /////////////////////////////////////////////////////////////////////////////
 //
< prev index next >