< prev index next >

src/hotspot/share/gc/z/zMark.cpp

Print this page
rev 57079 : [mq]: handshake-logs


 418 private:
 419   ZMark* const _mark;
 420   bool         _flushed;
 421 
 422 public:
 423   ZMarkFlushAndFreeStacksClosure(ZMark* mark) :
 424       _mark(mark),
 425       _flushed(false) {}
 426 
 427   void do_thread(Thread* thread) {
 428     if (_mark->flush_and_free(thread)) {
 429       _flushed = true;
 430     }
 431   }
 432 
 433   bool flushed() const {
 434     return _flushed;
 435   }
 436 };
 437 










 438 bool ZMark::flush(bool at_safepoint) {
 439   ZMarkFlushAndFreeStacksClosure cl(this);
 440   if (at_safepoint) {
 441     Threads::threads_do(&cl);
 442   } else {
 443     Handshake::execute(&cl);

 444   }
 445 
 446   // Returns true if more work is available
 447   return cl.flushed() || !_stripes.is_empty();
 448 }
 449 
 450 bool ZMark::try_flush(volatile size_t* nflush) {
 451   // Only flush if handshakes are enabled
 452   if (!ThreadLocalHandshakes) {
 453     return false;
 454   }
 455 
 456   Atomic::inc(nflush);
 457 
 458   ZStatTimer timer(ZSubPhaseConcurrentMarkTryFlush);
 459   return flush(false /* at_safepoint */);
 460 }
 461 
 462 bool ZMark::try_proactive_flush() {
 463   // Only do proactive flushes from worker 0




 418 private:
 419   ZMark* const _mark;
 420   bool         _flushed;
 421 
 422 public:
 423   ZMarkFlushAndFreeStacksClosure(ZMark* mark) :
 424       _mark(mark),
 425       _flushed(false) {}
 426 
 427   void do_thread(Thread* thread) {
 428     if (_mark->flush_and_free(thread)) {
 429       _flushed = true;
 430     }
 431   }
 432 
 433   bool flushed() const {
 434     return _flushed;
 435   }
 436 };
 437 
 438 class ZMarkFlushAndFreeStacksHandshake : public HandshakeOperation {
 439   ZMarkFlushAndFreeStacksClosure* _cl;
 440 public:
 441   ZMarkFlushAndFreeStacksHandshake(ZMarkFlushAndFreeStacksClosure* cl) : _cl(cl) {}
 442   const char* name() { return "ZMarkFlushAndFreeStacks"; }
 443   void do_thread(JavaThread* jt) {
 444     _cl->do_thread(jt);
 445   }
 446 };
 447 
 448 bool ZMark::flush(bool at_safepoint) {
 449   ZMarkFlushAndFreeStacksClosure cl(this);
 450   if (at_safepoint) {
 451     Threads::threads_do(&cl);
 452   } else {
 453     ZMarkFlushAndFreeStacksHandshake zmf_hs(&cl);
 454     Handshake::execute(&zmf_hs);
 455   }
 456 
 457   // Returns true if more work is available
 458   return cl.flushed() || !_stripes.is_empty();
 459 }
 460 
 461 bool ZMark::try_flush(volatile size_t* nflush) {
 462   // Only flush if handshakes are enabled
 463   if (!ThreadLocalHandshakes) {
 464     return false;
 465   }
 466 
 467   Atomic::inc(nflush);
 468 
 469   ZStatTimer timer(ZSubPhaseConcurrentMarkTryFlush);
 470   return flush(false /* at_safepoint */);
 471 }
 472 
 473 bool ZMark::try_proactive_flush() {
 474   // Only do proactive flushes from worker 0


< prev index next >