src/hotspot/share/jvmci/jvmciRuntime.cpp
changeset 59252 623722a6aeb9
parent 59056 15936b142f86
child 59260 b0a649295f25
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
   915 
   915 
   916 void JVMCIRuntime::exit_on_pending_exception(JVMCIEnv* JVMCIENV, const char* message) {
   916 void JVMCIRuntime::exit_on_pending_exception(JVMCIEnv* JVMCIENV, const char* message) {
   917   JavaThread* THREAD = JavaThread::current();
   917   JavaThread* THREAD = JavaThread::current();
   918 
   918 
   919   static volatile int report_error = 0;
   919   static volatile int report_error = 0;
   920   if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) {
   920   if (!report_error && Atomic::cmpxchg(&report_error, 0, 1) == 0) {
   921     // Only report an error once
   921     // Only report an error once
   922     tty->print_raw_cr(message);
   922     tty->print_raw_cr(message);
   923     if (JVMCIENV != NULL) {
   923     if (JVMCIENV != NULL) {
   924       JVMCIENV->describe_pending_exception(true);
   924       JVMCIENV->describe_pending_exception(true);
   925     } else {
   925     } else {
  1293 
  1293 
  1294 // Reports a pending exception and exits the VM.
  1294 // Reports a pending exception and exits the VM.
  1295 static void fatal_exception_in_compile(JVMCIEnv* JVMCIENV, JavaThread* thread, const char* msg) {
  1295 static void fatal_exception_in_compile(JVMCIEnv* JVMCIENV, JavaThread* thread, const char* msg) {
  1296   // Only report a fatal JVMCI compilation exception once
  1296   // Only report a fatal JVMCI compilation exception once
  1297   static volatile int report_init_failure = 0;
  1297   static volatile int report_init_failure = 0;
  1298   if (!report_init_failure && Atomic::cmpxchg(1, &report_init_failure, 0) == 0) {
  1298   if (!report_init_failure && Atomic::cmpxchg(&report_init_failure, 0, 1) == 0) {
  1299       tty->print_cr("%s:", msg);
  1299       tty->print_cr("%s:", msg);
  1300       JVMCIENV->describe_pending_exception(true);
  1300       JVMCIENV->describe_pending_exception(true);
  1301   }
  1301   }
  1302   JVMCIENV->clear_pending_exception();
  1302   JVMCIENV->clear_pending_exception();
  1303   before_exit(thread);
  1303   before_exit(thread);