8157438: JVMCI: MaterializeVirtualObjectTest fails w/ "CASE: invalidate=true: has no virtual object before"
authordpochepk
Mon, 23 May 2016 17:33:39 +0300
changeset 38700 6aa6444c1b48
parent 38699 f8bec5f6b09c
child 38701 5f0770ab49d9
child 38710 899abf16bb60
8157438: JVMCI: MaterializeVirtualObjectTest fails w/ "CASE: invalidate=true: has no virtual object before" Reviewed-by: kvn
hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java
--- a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java	Fri May 20 14:17:55 2016 -0700
+++ b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java	Mon May 23 17:33:39 2016 +0300
@@ -75,6 +75,7 @@
     private static final Method METHOD;
     private static final ResolvedJavaMethod RESOLVED_METHOD;
     private static final boolean INVALIDATE;
+    private static final int COMPILE_THRESHOLD;
 
     static {
         WB = WhiteBox.getWhiteBox();
@@ -86,7 +87,10 @@
         }
         RESOLVED_METHOD = CTVMUtilities.getResolvedMethod(METHOD);
         INVALIDATE = Boolean.getBoolean(
-            "compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate");
+                "compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate");
+        COMPILE_THRESHOLD = WB.getBooleanVMFlag("TieredCompilation")
+                ? CompilerWhiteBoxTest.THRESHOLD
+                : CompilerWhiteBoxTest.THRESHOLD * 2;
     }
 
     public static void main(String[] args) {
@@ -110,15 +114,12 @@
                 + " : method unexpectedly compiled");
         /* need to trigger compilation by multiple method invocations
            in order to have method profile data to be gathered */
-        boolean isTiered = WB.getBooleanVMFlag("TieredCompilation");
-        int COMPILE_THRESHOLD = isTiered ? CompilerWhiteBoxTest.THRESHOLD
-                : CompilerWhiteBoxTest.THRESHOLD * 2;
         for (int i = 0; i < COMPILE_THRESHOLD; i++) {
             testFrame("someString", i);
         }
         Asserts.assertTrue(WB.isMethodCompiled(METHOD), getName()
                 + "Method unexpectedly not compiled");
-        testFrame("someString", CompilerWhiteBoxTest.THRESHOLD);
+        testFrame("someString", COMPILE_THRESHOLD);
     }
 
     private void testFrame(String str, int iteration) {
@@ -130,7 +131,7 @@
 
     private void check(int iteration) {
         // Materialize virtual objects on last invocation
-        if (iteration == CompilerWhiteBoxTest.THRESHOLD) {
+        if (iteration == COMPILE_THRESHOLD) {
             HotSpotStackFrameReference hsFrame = CompilerToVMHelper
                     .getNextStackFrame(/* topmost frame */ null,
                             new ResolvedJavaMethod[]{