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