8130006: java/lang/invoke/MethodHandles/CatchExceptionTest Fails

Reviewed-by: psandoz
diff --git a/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java b/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java
index ecfca10..408cf99 100644
--- a/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java
+++ b/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java
@@ -168,6 +168,11 @@
         try {
             returned = target.invokeWithArguments(args);
         } catch (Throwable ex) {
+            if (CodeCacheOverflowProcessor.isThrowableCausedByVME(ex)) {
+                // This error will be treated by CodeCacheOverflowProcessor
+                // to prevent the test from failing because of code cache overflow.
+                throw new Error(ex);
+            }
             testCase.assertCatch(ex);
             returned = ex;
         }