559 // GCs that use a GC worker thread pool may want to share
560 // it for use during safepoint cleanup. This is only possible
561 // if the GC can pause and resume concurrent work (e.g. G1
562 // concurrent marking) for an intermittent non-GC safepoint.
563 // If this method returns NULL, SafepointSynchronize will
564 // perform cleanup tasks serially in the VMThread.
565 virtual WorkGang* get_safepoint_workers() { return NULL; }
566
567 // Support for object pinning. This is used by JNI Get*Critical()
568 // and Release*Critical() family of functions. If supported, the GC
569 // must guarantee that pinned objects never move.
570 virtual bool supports_object_pinning() const;
571 virtual oop pin_object(JavaThread* thread, oop obj);
572 virtual void unpin_object(JavaThread* thread, oop obj);
573
574 // Deduplicate the string, iff the GC supports string deduplication.
575 virtual void deduplicate_string(oop str);
576
577 virtual bool is_oop(oop object) const;
578
579 // Non product verification and debugging.
580 #ifndef PRODUCT
581 // Support for PromotionFailureALot. Return true if it's time to cause a
582 // promotion failure. The no-argument version uses
583 // this->_promotion_failure_alot_count as the counter.
584 bool promotion_should_fail(volatile size_t* count);
585 bool promotion_should_fail();
586
587 // Reset the PromotionFailureALot counters. Should be called at the end of a
588 // GC in which promotion failure occurred.
589 void reset_promotion_should_fail(volatile size_t* count);
590 void reset_promotion_should_fail();
591 #endif // #ifndef PRODUCT
592
593 #ifdef ASSERT
594 static int fired_fake_oom() {
595 return (CIFireOOMAt > 1 && _fire_out_of_memory_count >= CIFireOOMAt);
596 }
597 #endif
598 };
|
559 // GCs that use a GC worker thread pool may want to share
560 // it for use during safepoint cleanup. This is only possible
561 // if the GC can pause and resume concurrent work (e.g. G1
562 // concurrent marking) for an intermittent non-GC safepoint.
563 // If this method returns NULL, SafepointSynchronize will
564 // perform cleanup tasks serially in the VMThread.
565 virtual WorkGang* get_safepoint_workers() { return NULL; }
566
567 // Support for object pinning. This is used by JNI Get*Critical()
568 // and Release*Critical() family of functions. If supported, the GC
569 // must guarantee that pinned objects never move.
570 virtual bool supports_object_pinning() const;
571 virtual oop pin_object(JavaThread* thread, oop obj);
572 virtual void unpin_object(JavaThread* thread, oop obj);
573
574 // Deduplicate the string, iff the GC supports string deduplication.
575 virtual void deduplicate_string(oop str);
576
577 virtual bool is_oop(oop object) const;
578
579 virtual size_t obj_size(oop obj) const;
580
581 // Non product verification and debugging.
582 #ifndef PRODUCT
583 // Support for PromotionFailureALot. Return true if it's time to cause a
584 // promotion failure. The no-argument version uses
585 // this->_promotion_failure_alot_count as the counter.
586 bool promotion_should_fail(volatile size_t* count);
587 bool promotion_should_fail();
588
589 // Reset the PromotionFailureALot counters. Should be called at the end of a
590 // GC in which promotion failure occurred.
591 void reset_promotion_should_fail(volatile size_t* count);
592 void reset_promotion_should_fail();
593 #endif // #ifndef PRODUCT
594
595 #ifdef ASSERT
596 static int fired_fake_oom() {
597 return (CIFireOOMAt > 1 && _fire_out_of_memory_count >= CIFireOOMAt);
598 }
599 #endif
600 };
|