diff src/share/vm/jvmci/jvmciRuntime.hpp @ 22733:732763293625

must use JVMCI class loader when trying to throw a JVMCIError from native VM code
author Doug Simon <doug.simon@oracle.com>
date Thu, 12 Nov 2015 20:03:43 +0100
parents 0229a2ca608b
children a130b51efb07
line wrap: on
line diff
--- a/src/share/vm/jvmci/jvmciRuntime.hpp	Thu Nov 12 12:12:38 2015 +0100
+++ b/src/share/vm/jvmci/jvmciRuntime.hpp	Thu Nov 12 20:03:43 2015 +0100
@@ -29,11 +29,13 @@
 #include "runtime/arguments.hpp"
 #include "runtime/deoptimization.hpp"
 
+
+
 #define JVMCI_ERROR(...)       \
-  { Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::jdk_vm_ci_common_JVMCIError(), __VA_ARGS__); return; }
+  { JVMCIRuntime::fthrow_error(THREAD_AND_LOCATION, __VA_ARGS__); return; }
 
 #define JVMCI_ERROR_(ret, ...) \
-  { Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::jdk_vm_ci_common_JVMCIError(), __VA_ARGS__); return ret; }
+  { JVMCIRuntime::fthrow_error(THREAD_AND_LOCATION, __VA_ARGS__); return ret; }
 
 #define JVMCI_ERROR_0(...)    JVMCI_ERROR_(0, __VA_ARGS__)
 #define JVMCI_ERROR_NULL(...) JVMCI_ERROR_(NULL, __VA_ARGS__)
@@ -165,6 +167,13 @@
   static void parse_lines(char* path, ParseClosure* closure, bool warnStatFailure);
 
   /**
+   * Throws a JVMCIError with a formatted error message. Ideally we would use
+   * a variation of Exceptions::fthrow that takes a class loader argument but alas,
+   * no such variation exists.
+   */
+  static void fthrow_error(Thread* thread, const char* file, int line, const char* format, ...) ATTRIBUTE_PRINTF(4, 5);
+
+  /**
    * Aborts the VM due to an unexpected exception.
    */
   static void abort_on_pending_exception(Handle exception, const char* message, bool dump_core = false);