equal
deleted
inserted
replaced
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); |