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 virtual size_t obj_header_size() const;
581 virtual size_t array_header_size(BasicType element_type) const;
582
583 // Non product verification and debugging.
584 #ifndef PRODUCT
585 // Support for PromotionFailureALot. Return true if it's time to cause a
586 // promotion failure. The no-argument version uses
587 // this->_promotion_failure_alot_count as the counter.
588 bool promotion_should_fail(volatile size_t* count);
589 bool promotion_should_fail();
590
591 // Reset the PromotionFailureALot counters. Should be called at the end of a
592 // GC in which promotion failure occurred.
593 void reset_promotion_should_fail(volatile size_t* count);
594 void reset_promotion_should_fail();
595 #endif // #ifndef PRODUCT
596
597 #ifdef ASSERT
598 static int fired_fake_oom() {
599 return (CIFireOOMAt > 1 && _fire_out_of_memory_count >= CIFireOOMAt);
600 }
601 #endif
602 };
|