changeset 11967:715302110892

8157956: OverflowCodeCacheTest.java fails with Out of space in CodeCache for method handle intrinsic Reviewed-by: kvn
author dpochepk
date Thu, 01 Sep 2016 21:12:07 +0300
parents 882e8cda60b3
children f50719b7f652
files test/compiler/codecache/OverflowCodeCacheTest.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/compiler/codecache/OverflowCodeCacheTest.java	Wed Aug 31 12:10:40 2016 -0700
+++ b/test/compiler/codecache/OverflowCodeCacheTest.java	Thu Sep 01 21:12:07 2016 +0300
@@ -75,6 +75,7 @@
         System.out.printf("type %s%n", type);
         System.out.println("allocating till possible...");
         ArrayList<Long> blobs = new ArrayList<>();
+        int compilationActivityMode = -1;
         try {
             long addr;
             int size = (int) (getHeapSize() >> 7);
@@ -88,13 +89,16 @@
                             type + " doesn't allow using " + actualType + " when overflow");
                 }
             }
-            Asserts.assertNotEquals(WHITE_BOX.getCompilationActivityMode(), 1 /* run_compilation*/,
-                    "Compilation must be disabled when CodeCache(CodeHeap) overflows");
+            /* now, remember compilationActivityMode to check it later, after freeing, since we
+               possibly have no free cache for futher work */
+            compilationActivityMode = WHITE_BOX.getCompilationActivityMode();
         } finally {
             for (Long blob : blobs) {
                 WHITE_BOX.freeCodeBlob(blob);
             }
         }
+        Asserts.assertNotEquals(compilationActivityMode, 1 /* run_compilation*/,
+                "Compilation must be disabled when CodeCache(CodeHeap) overflows");
     }
 
     private long getHeapSize() {