8159730: compiler/jvmci/compilerToVM/IsMatureTest failed with "Multiple times invoked method should have method data (assert failed: 0 != 0)"
authordpochepk
Thu, 23 Jun 2016 17:40:20 +0300
changeset 39447 6de9e469842e
parent 39446 690677aa4a48
child 39448 7ba3b2a8e48e
8159730: compiler/jvmci/compilerToVM/IsMatureTest failed with "Multiple times invoked method should have method data (assert failed: 0 != 0)" Reviewed-by: kvn
hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java
--- a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java	Thu Jun 23 17:39:49 2016 +0300
+++ b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java	Thu Jun 23 17:40:20 2016 +0300
@@ -74,11 +74,16 @@
         }
         methodData = WB.getMethodData(method);
         isMature = CompilerToVMHelper.isMature(methodData);
-        Asserts.assertNE(methodData, 0L,
-                "Multiple times invoked method should have method data");
-        /* a method is not mature for -Xcomp and -Tiered,
-           see NonTieredCompPolicy::is_mature */
-        Asserts.assertEQ(isMature, !(IS_XCOMP && !TIERED),
-                "Unexpected isMature state for multiple times invoked method");
+        int compLevel = WB.getMethodCompilationLevel(method);
+        // methodData doesn't necessarily exist for interpreter and compilation level 1
+        if (compLevel != CompilerWhiteBoxTest.COMP_LEVEL_NONE
+                && compLevel != CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE) {
+            Asserts.assertNE(methodData, 0L,
+                    "Multiple times invoked method should have method data");
+            /* a method is not mature in Xcomp mode with tiered compilation disabled,
+               see NonTieredCompPolicy::is_mature */
+            Asserts.assertEQ(isMature, !(IS_XCOMP && !TIERED),
+                    "Unexpected isMature state for multiple times invoked method");
+        }
     }
 }