< 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,40 **** * @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:. --- 30,39 ----
*** 89,122 **** * -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 * 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 */ 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; ///////////////////////////////////////////////////////////////////////////// --- 88,121 ---- * -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 * 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 */ + 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 jdk.test.lib.Asserts; import sun.hotspot.WhiteBox; /////////////////////////////////////////////////////////////////////////////
*** 245,261 **** public static class TargetVMOptions { public final boolean UseJVMCICompiler; public final boolean EliminateAllocations; ! public final int 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(); val = testCaseBaseTargetClass.getValue(testCaseBaseTargetClass.fieldByName("UseJVMCICompiler")); UseJVMCICompiler = ((PrimitiveValue) val).booleanValue(); } } --- 244,260 ---- public static class TargetVMOptions { public final boolean UseJVMCICompiler; public final boolean EliminateAllocations; ! 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).booleanValue(); val = testCaseBaseTargetClass.getValue(testCaseBaseTargetClass.fieldByName("UseJVMCICompiler")); UseJVMCICompiler = ((PrimitiveValue) val).booleanValue(); } }
*** 722,732 **** } 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 long BiasedLockingBulkRebiasThreshold = WB.getIntxVMFlag("BiasedLockingBulkRebiasThreshold"); public static final long BiasedLockingBulkRevokeThreshold = WB.getIntxVMFlag("BiasedLockingBulkRevokeThreshold"); public String testMethodName; public int testMethodDepth; --- 721,731 ---- } 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 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,858 **** 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 (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), --- 847,857 ---- 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) { 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,1746 **** } } ///////////////////////////////////////////////////////////////////////////// ! // Object ref l1 is retrieved by the debugger at a location where nested lockes are ommitted. The // accessed object is globally reachable already before the access, therefore no relocking is done. class EARelockingNestedInflatedTarget extends EATestCaseBaseTarget { @Override public void setUp() { --- 1735,1745 ---- } } ///////////////////////////////////////////////////////////////////////////// ! // 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,2554 **** 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; } } class EAPopFrameNotInlinedReallocFailureTarget extends EATestCaseBaseTarget { --- 2541,2553 ---- printStack(thread); } @Override public boolean shouldSkip() { ! // 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,2594 **** 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; } } ///////////////////////////////////////////////////////////////////////////// --- 2581,2593 ---- return 2*n*(n+1)/2; } @Override public boolean shouldSkip() { ! // 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,2643 **** 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; } } class EAPopInlinedMethodWithScalarReplacedObjectsReallocFailureTarget extends EATestCaseBaseTarget { --- 2630,2642 ---- Asserts.assertEQ(expectedTopFrame, thread.frame(0).location().method().name()); } @Override public boolean shouldSkip() { ! // 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,2699 **** 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; } } ///////////////////////////////////////////////////////////////////////////// // --- 2686,2698 ---- loopCount = Long.MAX_VALUE; // endless loop } @Override public boolean shouldSkip() { ! // 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,2900 **** msg("ForceEarlyReturn DONE"); } @Override public boolean shouldSkip() { ! // OOMEs because of realloc failures with DeoptimizeObjectsALot > 0 are too random. // And Graal currently doesn't support Force Early Return ! return super.shouldSkip() || (env.targetVMOptions.DeoptimizeObjectsALot > 0) || env.targetVMOptions.UseJVMCICompiler; } } class EAForceEarlyReturnOfInlinedMethodWithScalarReplacedObjectsReallocFailureTarget extends EATestCaseBaseTarget { --- 2887,2899 ---- msg("ForceEarlyReturn DONE"); } @Override public boolean shouldSkip() { ! // 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 || env.targetVMOptions.UseJVMCICompiler; } } class EAForceEarlyReturnOfInlinedMethodWithScalarReplacedObjectsReallocFailureTarget extends EATestCaseBaseTarget {
*** 2945,2957 **** 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 support Force Early Return ! return super.shouldSkip() || (DeoptimizeObjectsALot > 0) || UseJVMCICompiler; } } ///////////////////////////////////////////////////////////////////////////// // --- 2944,2956 ---- loopCount = Long.MAX_VALUE; // endless loop } @Override public boolean shouldSkip() { ! // OOMEs because of realloc failures with DeoptimizeObjectsALot are too random. // And Graal currently doesn't support Force Early Return ! return super.shouldSkip() || DeoptimizeObjectsALot || UseJVMCICompiler; } } ///////////////////////////////////////////////////////////////////////////// //
< prev index next >