diff src/share/vm/jvmci/jvmciRuntime.cpp @ 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 ab84ba890aa4
line wrap: on
line diff
--- a/src/share/vm/jvmci/jvmciRuntime.cpp	Thu Nov 12 12:12:38 2015 +0100
+++ b/src/share/vm/jvmci/jvmciRuntime.cpp	Thu Nov 12 20:03:43 2015 +0100
@@ -1046,6 +1046,19 @@
   vm_abort(dump_core);
 }
 
+void JVMCIRuntime::fthrow_error(Thread* thread, const char* file, int line, const char* format, ...) {
+  const int max_msg_size = 1024;
+  va_list ap;
+  va_start(ap, format);
+  char msg[max_msg_size];
+  vsnprintf(msg, max_msg_size, format, ap);
+  msg[max_msg_size-1] = '\0';
+  va_end(ap);
+  Handle h_loader = Handle(thread, SystemDictionary::jvmci_loader());
+  Handle h_protection_domain = Handle();
+  Exceptions::_throw_msg(thread, file, line, vmSymbols::jdk_vm_ci_common_JVMCIError(), msg, h_loader, h_protection_domain);
+}
+
 Klass* JVMCIRuntime::resolve_or_null(Symbol* name, TRAPS) {
   return SystemDictionary::resolve_or_null(name, SystemDictionary::jvmci_loader(), Handle(), CHECK_NULL);
 }