< prev index next >
test/hotspot/jtreg/serviceability/jvmti/Heap/IterateHeapWithEscapeAnalysisEnabled.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
*** 27,37 ****
* @summary JVMTI agents can obtain references to not escaping objects using JVMTI Heap functions.
* Therefore optimizations based on escape analysis have to be reverted,
* i.e. scalar replaced objects need to be reallocated on the heap and objects with eliminated locking
* need to be relocked.
* @requires ((vm.compMode == "Xmixed") & vm.compiler2.enabled)
! * @library /test/lib
* @compile IterateHeapWithEscapeAnalysisEnabled.java
*
* @comment BLOCK BEGIN EXCLUSIVE TESTCASES {
*
* The following test cases are executed in fresh VMs, because they require that the
--- 27,39 ----
* @summary JVMTI agents can obtain references to not escaping objects using JVMTI Heap functions.
* Therefore optimizations based on escape analysis have to be reverted,
* i.e. scalar replaced objects need to be reallocated on the heap and objects with eliminated locking
* need to be relocked.
* @requires ((vm.compMode == "Xmixed") & vm.compiler2.enabled)
! * @library /test/lib /test/hotspot/jtreg
! * @build sun.hotspot.WhiteBox
! * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* @compile IterateHeapWithEscapeAnalysisEnabled.java
*
* @comment BLOCK BEGIN EXCLUSIVE TESTCASES {
*
* The following test cases are executed in fresh VMs, because they require that the
*** 47,92 ****
--- 49,99 ----
* @run main/othervm/native
* -agentlib:IterateHeapWithEscapeAnalysisEnabled
* -XX:+UnlockDiagnosticVMOptions
* -Xms256m -Xmx256m
* -XX:+PrintCompilation -XX:+PrintInlining
+ * -XX:+WhiteBoxAPI -Xbootclasspath/a:.
* -Xbatch
* -XX:CompileCommand=dontinline,*::dontinline_*
* -XX:+DoEscapeAnalysis
* IterateHeapWithEscapeAnalysisEnabled IterateOverReachableObjects
* @run main/othervm/native
* -agentlib:IterateHeapWithEscapeAnalysisEnabled
* -XX:+UnlockDiagnosticVMOptions
* -Xms256m -Xmx256m
* -XX:+PrintCompilation -XX:+PrintInlining
+ * -XX:+WhiteBoxAPI -Xbootclasspath/a:.
* -Xbatch
* -XX:CompileCommand=dontinline,*::dontinline_*
* -XX:+DoEscapeAnalysis
* IterateHeapWithEscapeAnalysisEnabled IterateOverHeap
* @run main/othervm/native
* -agentlib:IterateHeapWithEscapeAnalysisEnabled
* -XX:+UnlockDiagnosticVMOptions
* -Xms256m -Xmx256m
* -XX:+PrintCompilation -XX:+PrintInlining
+ * -XX:+WhiteBoxAPI -Xbootclasspath/a:.
* -Xbatch
* -XX:CompileCommand=dontinline,*::dontinline_*
* -XX:+DoEscapeAnalysis
* IterateHeapWithEscapeAnalysisEnabled IterateOverInstancesOfClass
* @run main/othervm/native
* -agentlib:IterateHeapWithEscapeAnalysisEnabled
* -XX:+UnlockDiagnosticVMOptions
* -Xms256m -Xmx256m
* -XX:+PrintCompilation -XX:+PrintInlining
+ * -XX:+WhiteBoxAPI -Xbootclasspath/a:.
* -Xbatch
* -XX:CompileCommand=dontinline,*::dontinline_*
* -XX:+DoEscapeAnalysis
* IterateHeapWithEscapeAnalysisEnabled FollowReferences
* @run main/othervm/native
* -agentlib:IterateHeapWithEscapeAnalysisEnabled
* -XX:+UnlockDiagnosticVMOptions
* -Xms256m -Xmx256m
* -XX:+PrintCompilation -XX:+PrintInlining
+ * -XX:+WhiteBoxAPI -Xbootclasspath/a:.
* -Xbatch
* -XX:CompileCommand=dontinline,*::dontinline_*
* -XX:+DoEscapeAnalysis
* IterateHeapWithEscapeAnalysisEnabled IterateThroughHeap
*
*** 99,140 ****
* -XX:+UnlockDiagnosticVMOptions
* -Xms256m -Xmx256m
* -XX:CompileCommand=dontinline,*::dontinline_*
* -XX:+PrintCompilation
* -XX:+PrintInlining
* -Xbatch
* -XX:+DoEscapeAnalysis -XX:+EliminateAllocations -XX:+EliminateLocks -XX:+EliminateNestedLocks -XX:+UseBiasedLocking
* IterateHeapWithEscapeAnalysisEnabled
* @run main/othervm/native
* -agentlib:IterateHeapWithEscapeAnalysisEnabled
* -XX:+UnlockDiagnosticVMOptions
* -Xms256m -Xmx256m
* -XX:CompileCommand=dontinline,*::dontinline_*
* -XX:+PrintCompilation
* -XX:+PrintInlining
* -Xbatch
* -XX:+DoEscapeAnalysis -XX:-EliminateAllocations -XX:+EliminateLocks -XX:+EliminateNestedLocks -XX:+UseBiasedLocking
* IterateHeapWithEscapeAnalysisEnabled
* @run main/othervm/native
* -agentlib:IterateHeapWithEscapeAnalysisEnabled
* -XX:+UnlockDiagnosticVMOptions
* -Xms256m -Xmx256m
* -XX:CompileCommand=dontinline,*::dontinline_*
* -XX:+PrintCompilation
* -XX:+PrintInlining
* -Xbatch
* -XX:-DoEscapeAnalysis -XX:-EliminateAllocations -XX:+EliminateLocks -XX:+EliminateNestedLocks -XX:+UseBiasedLocking
* IterateHeapWithEscapeAnalysisEnabled
*
* @comment } BLOCK END NON EXCLUSIVE TESTCASES
*/
import jdk.test.lib.Asserts;
public class IterateHeapWithEscapeAnalysisEnabled {
! public static final int COMPILE_THRESHOLD = 20000;
public static native int jvmtiTagClass(Class<?> cls, long tag);
// Methods to tag or count instances of a given class available in JVMTI
public static enum TaggingAndCountingMethods {
--- 106,154 ----
* -XX:+UnlockDiagnosticVMOptions
* -Xms256m -Xmx256m
* -XX:CompileCommand=dontinline,*::dontinline_*
* -XX:+PrintCompilation
* -XX:+PrintInlining
+ * -XX:+WhiteBoxAPI -Xbootclasspath/a:.
* -Xbatch
* -XX:+DoEscapeAnalysis -XX:+EliminateAllocations -XX:+EliminateLocks -XX:+EliminateNestedLocks -XX:+UseBiasedLocking
* IterateHeapWithEscapeAnalysisEnabled
* @run main/othervm/native
* -agentlib:IterateHeapWithEscapeAnalysisEnabled
* -XX:+UnlockDiagnosticVMOptions
* -Xms256m -Xmx256m
* -XX:CompileCommand=dontinline,*::dontinline_*
* -XX:+PrintCompilation
* -XX:+PrintInlining
+ * -XX:+WhiteBoxAPI -Xbootclasspath/a:.
* -Xbatch
* -XX:+DoEscapeAnalysis -XX:-EliminateAllocations -XX:+EliminateLocks -XX:+EliminateNestedLocks -XX:+UseBiasedLocking
* IterateHeapWithEscapeAnalysisEnabled
* @run main/othervm/native
* -agentlib:IterateHeapWithEscapeAnalysisEnabled
* -XX:+UnlockDiagnosticVMOptions
* -Xms256m -Xmx256m
* -XX:CompileCommand=dontinline,*::dontinline_*
* -XX:+PrintCompilation
* -XX:+PrintInlining
+ * -XX:+WhiteBoxAPI -Xbootclasspath/a:.
* -Xbatch
* -XX:-DoEscapeAnalysis -XX:-EliminateAllocations -XX:+EliminateLocks -XX:+EliminateNestedLocks -XX:+UseBiasedLocking
* IterateHeapWithEscapeAnalysisEnabled
*
* @comment } BLOCK END NON EXCLUSIVE TESTCASES
*/
+ import compiler.whitebox.CompilerWhiteBoxTest;
import jdk.test.lib.Asserts;
+ import sun.hotspot.WhiteBox;
public class IterateHeapWithEscapeAnalysisEnabled {
! public static final WhiteBox WB = WhiteBox.getWhiteBox();
!
! public static final int COMPILE_THRESHOLD = CompilerWhiteBoxTest.THRESHOLD;
public static native int jvmtiTagClass(Class<?> cls, long tag);
// Methods to tag or count instances of a given class available in JVMTI
public static enum TaggingAndCountingMethods {
*** 361,371 ****
msgHL(getClass().getName() + ": test if object that may be scalar replaced is found using " + taggingMethod);
msg("The capability can_tag_object is acquired " + (acquireCanTagObjectsCapabilityAfterWarmup ? "AFTER" : "BEFORE")
+ " warmup.");
setUp();
warmUp();
! System.gc(); // get rid of dead instances from previous test cases
runTest(taggingMethod);
} catch (Exception e) {
Asserts.fail("Unexpected Exception", e);
}
}
--- 375,386 ----
msgHL(getClass().getName() + ": test if object that may be scalar replaced is found using " + taggingMethod);
msg("The capability can_tag_object is acquired " + (acquireCanTagObjectsCapabilityAfterWarmup ? "AFTER" : "BEFORE")
+ " warmup.");
setUp();
warmUp();
! WB.deflateIdleMonitors();
! WB.fullGC(); // get rid of dead instances from previous test cases
runTest(taggingMethod);
} catch (Exception e) {
Asserts.fail("Unexpected Exception", e);
}
}
*** 446,456 ****
warmUp();
for (TaggingAndCountingMethods m : TaggingAndCountingMethods.values()) {
msgHL(getClass().getName() + ": Tag and Get of ArgEscapes using " + m.name());
waitingForCheck = false;
checkingNow = false;
! System.gc(); // get rid of dead instances from previous test cases
runTest(m);
}
} catch (Exception e) {
Asserts.fail("Unexpected Exception", e);
}
--- 461,472 ----
warmUp();
for (TaggingAndCountingMethods m : TaggingAndCountingMethods.values()) {
msgHL(getClass().getName() + ": Tag and Get of ArgEscapes using " + m.name());
waitingForCheck = false;
checkingNow = false;
! WB.deflateIdleMonitors();
! WB.fullGC(); // get rid of dead instances from previous test cases
runTest(m);
}
} catch (Exception e) {
Asserts.fail("Unexpected Exception", e);
}
*** 521,531 ****
warmUp();
for (TaggingAndCountingMethods m : TaggingAndCountingMethods.values()) {
msgHL(getClass().getName() + ": Tag and Get of ArgEscapes using " + m.name());
waitingForCheck = false;
checkingNow = false;
! System.gc(); // get rid of dead instances from previous test cases
runTest(m);
}
} catch (Exception e) {
Asserts.fail("Unexpected Exception", e);
}
--- 537,548 ----
warmUp();
for (TaggingAndCountingMethods m : TaggingAndCountingMethods.values()) {
msgHL(getClass().getName() + ": Tag and Get of ArgEscapes using " + m.name());
waitingForCheck = false;
checkingNow = false;
! WB.deflateIdleMonitors();
! WB.fullGC(); // get rid of dead instances from previous test cases
runTest(m);
}
} catch (Exception e) {
Asserts.fail("Unexpected Exception", e);
}
< prev index next >