src/hotspot/share/gc/shared/taskqueue.inline.hpp
changeset 59247 56bf71d64d51
parent 57978 be5865bda5b9
child 59252 623722a6aeb9
equal deleted inserted replaced
59246:fcad92f425c5 59247:56bf71d64d51
    66     // unused, so we cast the volatile away.  We cannot cast directly
    66     // unused, so we cast the volatile away.  We cannot cast directly
    67     // to void, because gcc treats that as not using the result of the
    67     // to void, because gcc treats that as not using the result of the
    68     // assignment.  However, casting to E& means that we trigger an
    68     // assignment.  However, casting to E& means that we trigger an
    69     // unused-value warning.  So, we cast the E& to void.
    69     // unused-value warning.  So, we cast the E& to void.
    70     (void)const_cast<E&>(_elems[localBot] = t);
    70     (void)const_cast<E&>(_elems[localBot] = t);
    71     OrderAccess::release_store(&_bottom, increment_index(localBot));
    71     Atomic::release_store(&_bottom, increment_index(localBot));
    72     TASKQUEUE_STATS_ONLY(stats.record_push());
    72     TASKQUEUE_STATS_ONLY(stats.record_push());
    73     return true;
    73     return true;
    74   }
    74   }
    75   return false;
    75   return false;
    76 }
    76 }
    87     // unused, so we cast the volatile away.  We cannot cast directly
    87     // unused, so we cast the volatile away.  We cannot cast directly
    88     // to void, because gcc treats that as not using the result of the
    88     // to void, because gcc treats that as not using the result of the
    89     // assignment.  However, casting to E& means that we trigger an
    89     // assignment.  However, casting to E& means that we trigger an
    90     // unused-value warning.  So, we cast the E& to void.
    90     // unused-value warning.  So, we cast the E& to void.
    91     (void) const_cast<E&>(_elems[localBot] = t);
    91     (void) const_cast<E&>(_elems[localBot] = t);
    92     OrderAccess::release_store(&_bottom, increment_index(localBot));
    92     Atomic::release_store(&_bottom, increment_index(localBot));
    93     TASKQUEUE_STATS_ONLY(stats.record_push());
    93     TASKQUEUE_STATS_ONLY(stats.record_push());
    94     return true;
    94     return true;
    95   } else {
    95   } else {
    96     return push_slow(t, dirty_n_elems);
    96     return push_slow(t, dirty_n_elems);
    97   }
    97   }
   208   // to guarantee that bottom is not older than age,
   208   // to guarantee that bottom is not older than age,
   209   // which is crucial for the correctness of the algorithm.
   209   // which is crucial for the correctness of the algorithm.
   210 #ifndef CPU_MULTI_COPY_ATOMIC
   210 #ifndef CPU_MULTI_COPY_ATOMIC
   211   OrderAccess::fence();
   211   OrderAccess::fence();
   212 #endif
   212 #endif
   213   uint localBot = OrderAccess::load_acquire(&_bottom);
   213   uint localBot = Atomic::load_acquire(&_bottom);
   214   uint n_elems = size(localBot, oldAge.top());
   214   uint n_elems = size(localBot, oldAge.top());
   215   if (n_elems == 0) {
   215   if (n_elems == 0) {
   216     return false;
   216     return false;
   217   }
   217   }
   218 
   218