src/hotspot/share/jvmci/jvmciRuntime.cpp
changeset 59252 623722a6aeb9
parent 59056 15936b142f86
child 59260 b0a649295f25
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp	Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp	Mon Nov 25 12:33:15 2019 +0100
@@ -917,7 +917,7 @@
   JavaThread* THREAD = JavaThread::current();
 
   static volatile int report_error = 0;
-  if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) {
+  if (!report_error && Atomic::cmpxchg(&report_error, 0, 1) == 0) {
     // Only report an error once
     tty->print_raw_cr(message);
     if (JVMCIENV != NULL) {
@@ -1295,7 +1295,7 @@
 static void fatal_exception_in_compile(JVMCIEnv* JVMCIENV, JavaThread* thread, const char* msg) {
   // Only report a fatal JVMCI compilation exception once
   static volatile int report_init_failure = 0;
-  if (!report_init_failure && Atomic::cmpxchg(1, &report_init_failure, 0) == 0) {
+  if (!report_init_failure && Atomic::cmpxchg(&report_init_failure, 0, 1) == 0) {
       tty->print_cr("%s:", msg);
       JVMCIENV->describe_pending_exception(true);
   }