changeset 11333:6054182379a7

8157438: JVMCI: MaterializeVirtualObjectTest fails w/ "CASE: invalidate=true: has no virtual object before" Reviewed-by: kvn
author dpochepk
date Mon, 23 May 2016 17:33:39 +0300
parents 11150243df6c
children 4676adf31b08 a5c726354bf2
files test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java	Fri May 20 14:17:55 2016 -0700
+++ b/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[]{