< prev index next >

src/hotspot/share/gc/shared/collectedHeap.hpp

Print this page




  56 class ThreadClosure;
  57 class VirtualSpaceSummary;
  58 class WorkGang;
  59 class nmethod;
  60 
  61 class GCMessage : public FormatBuffer<1024> {
  62  public:
  63   bool is_before;
  64 
  65  public:
  66   GCMessage() {}
  67 };
  68 
  69 class CollectedHeap;
  70 
  71 class GCHeapLog : public EventLogBase<GCMessage> {
  72  private:
  73   void log_heap(CollectedHeap* heap, bool before);
  74 
  75  public:
  76   GCHeapLog() : EventLogBase<GCMessage>("GC Heap History", "gc") {}
  77 
  78   void log_heap_before(CollectedHeap* heap) {
  79     log_heap(heap, true);
  80   }
  81   void log_heap_after(CollectedHeap* heap) {
  82     log_heap(heap, false);
  83   }
  84 };
  85 
  86 //
  87 // CollectedHeap
  88 //   GenCollectedHeap
  89 //     SerialHeap
  90 //     CMSHeap
  91 //   G1CollectedHeap
  92 //   ParallelScavengeHeap
  93 //   ShenandoahHeap
  94 //   ZCollectedHeap
  95 //
  96 class CollectedHeap : public CHeapObj<mtInternal> {


 516   // it for use during safepoint cleanup. This is only possible
 517   // if the GC can pause and resume concurrent work (e.g. G1
 518   // concurrent marking) for an intermittent non-GC safepoint.
 519   // If this method returns NULL, SafepointSynchronize will
 520   // perform cleanup tasks serially in the VMThread.
 521   virtual WorkGang* get_safepoint_workers() { return NULL; }
 522 
 523   // Support for object pinning. This is used by JNI Get*Critical()
 524   // and Release*Critical() family of functions. If supported, the GC
 525   // must guarantee that pinned objects never move.
 526   virtual bool supports_object_pinning() const;
 527   virtual oop pin_object(JavaThread* thread, oop obj);
 528   virtual void unpin_object(JavaThread* thread, oop obj);
 529 
 530   // Deduplicate the string, iff the GC supports string deduplication.
 531   virtual void deduplicate_string(oop str);
 532 
 533   virtual bool is_oop(oop object) const;
 534 
 535   virtual size_t obj_size(oop obj) const;





 536 
 537   // Non product verification and debugging.
 538 #ifndef PRODUCT
 539   // Support for PromotionFailureALot.  Return true if it's time to cause a
 540   // promotion failure.  The no-argument version uses
 541   // this->_promotion_failure_alot_count as the counter.
 542   bool promotion_should_fail(volatile size_t* count);
 543   bool promotion_should_fail();
 544 
 545   // Reset the PromotionFailureALot counters.  Should be called at the end of a
 546   // GC in which promotion failure occurred.
 547   void reset_promotion_should_fail(volatile size_t* count);
 548   void reset_promotion_should_fail();
 549 #endif  // #ifndef PRODUCT
 550 };
 551 
 552 // Class to set and reset the GC cause for a CollectedHeap.
 553 
 554 class GCCauseSetter : StackObj {
 555   CollectedHeap* _heap;


  56 class ThreadClosure;
  57 class VirtualSpaceSummary;
  58 class WorkGang;
  59 class nmethod;
  60 
  61 class GCMessage : public FormatBuffer<1024> {
  62  public:
  63   bool is_before;
  64 
  65  public:
  66   GCMessage() {}
  67 };
  68 
  69 class CollectedHeap;
  70 
  71 class GCHeapLog : public EventLogBase<GCMessage> {
  72  private:
  73   void log_heap(CollectedHeap* heap, bool before);
  74 
  75  public:
  76   GCHeapLog() : EventLogBase<GCMessage>("GC Heap History") {}
  77 
  78   void log_heap_before(CollectedHeap* heap) {
  79     log_heap(heap, true);
  80   }
  81   void log_heap_after(CollectedHeap* heap) {
  82     log_heap(heap, false);
  83   }
  84 };
  85 
  86 //
  87 // CollectedHeap
  88 //   GenCollectedHeap
  89 //     SerialHeap
  90 //     CMSHeap
  91 //   G1CollectedHeap
  92 //   ParallelScavengeHeap
  93 //   ShenandoahHeap
  94 //   ZCollectedHeap
  95 //
  96 class CollectedHeap : public CHeapObj<mtInternal> {


 516   // it for use during safepoint cleanup. This is only possible
 517   // if the GC can pause and resume concurrent work (e.g. G1
 518   // concurrent marking) for an intermittent non-GC safepoint.
 519   // If this method returns NULL, SafepointSynchronize will
 520   // perform cleanup tasks serially in the VMThread.
 521   virtual WorkGang* get_safepoint_workers() { return NULL; }
 522 
 523   // Support for object pinning. This is used by JNI Get*Critical()
 524   // and Release*Critical() family of functions. If supported, the GC
 525   // must guarantee that pinned objects never move.
 526   virtual bool supports_object_pinning() const;
 527   virtual oop pin_object(JavaThread* thread, oop obj);
 528   virtual void unpin_object(JavaThread* thread, oop obj);
 529 
 530   // Deduplicate the string, iff the GC supports string deduplication.
 531   virtual void deduplicate_string(oop str);
 532 
 533   virtual bool is_oop(oop object) const;
 534 
 535   virtual size_t obj_size(oop obj) const;
 536 
 537   // Cells are memory slices allocated by the allocator. Objects are initialized
 538   // in cells. The cell itself may have a header, found at a negative offset of
 539   // oops. Usually, the size of the cell header is 0, but it may be larger.
 540   virtual ptrdiff_t cell_header_size() const { return 0; }
 541 
 542   // Non product verification and debugging.
 543 #ifndef PRODUCT
 544   // Support for PromotionFailureALot.  Return true if it's time to cause a
 545   // promotion failure.  The no-argument version uses
 546   // this->_promotion_failure_alot_count as the counter.
 547   bool promotion_should_fail(volatile size_t* count);
 548   bool promotion_should_fail();
 549 
 550   // Reset the PromotionFailureALot counters.  Should be called at the end of a
 551   // GC in which promotion failure occurred.
 552   void reset_promotion_should_fail(volatile size_t* count);
 553   void reset_promotion_should_fail();
 554 #endif  // #ifndef PRODUCT
 555 };
 556 
 557 // Class to set and reset the GC cause for a CollectedHeap.
 558 
 559 class GCCauseSetter : StackObj {
 560   CollectedHeap* _heap;
< prev index next >