< prev index next >

src/hotspot/share/code/nmethod.cpp

Print this page
rev 47408 : [mq]: no_cmpxchg_if_null
rev 47401 : [mq]: cmpxchg_if_null
rev 47400 : [mq]: cmpxchg_ptr
rev 47216 : 8187443: Forest Consolidation: Move files to unified layout
Reviewed-by: darcy, ihse

@@ -1662,11 +1662,11 @@
 bool nmethod::test_set_oops_do_mark() {
   assert(nmethod::oops_do_marking_is_active(), "oops_do_marking_prologue must be called");
   nmethod* observed_mark_link = _oops_do_mark_link;
   if (observed_mark_link == NULL) {
     // Claim this nmethod for this thread to mark.
-    if (Atomic::cmpxchg_if_null(NMETHOD_SENTINEL, &_oops_do_mark_link)) {
+    if (Atomic::cmpxchg(NMETHOD_SENTINEL, &_oops_do_mark_link, (nmethod*)NULL) == NULL) {
       // Atomically append this nmethod (now claimed) to the head of the list:
       nmethod* observed_mark_nmethods = _oops_do_mark_nmethods;
       for (;;) {
         nmethod* required_mark_nmethods = observed_mark_nmethods;
         _oops_do_mark_link = required_mark_nmethods;

@@ -1687,12 +1687,12 @@
 void nmethod::oops_do_marking_prologue() {
   if (TraceScavenge) { tty->print_cr("[oops_do_marking_prologue"); }
   assert(_oops_do_mark_nmethods == NULL, "must not call oops_do_marking_prologue twice in a row");
   // We use cmpxchg instead of regular assignment here because the user
   // may fork a bunch of threads, and we need them all to see the same state.
-  bool observed = Atomic::cmpxchg_if_null(NMETHOD_SENTINEL, &_oops_do_mark_nmethods);
-  guarantee(observed, "no races in this sequential code");
+  nmethod* observed = Atomic::cmpxchg(NMETHOD_SENTINEL, &_oops_do_mark_nmethods, (nmethod*)NULL);
+  guarantee(observed == NULL, "no races in this sequential code");
 }
 
 void nmethod::oops_do_marking_epilogue() {
   assert(_oops_do_mark_nmethods != NULL, "must not call oops_do_marking_epilogue twice in a row");
   nmethod* cur = _oops_do_mark_nmethods;
< prev index next >