src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp

changeset 1580
e018e6884bd8
parent 631
d1605aabd0a1
child 1907
c18cbe5936b8
     1.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp	Wed Dec 16 15:12:51 2009 -0800
     1.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp	Wed Dec 23 09:23:54 2009 -0800
     1.3 @@ -35,18 +35,26 @@
     1.4  // for that implementation.
     1.5  
     1.6  class Mutex;
     1.7 +class TreeList;
     1.8  
     1.9  class FreeList VALUE_OBJ_CLASS_SPEC {
    1.10    friend class CompactibleFreeListSpace;
    1.11    friend class VMStructs;
    1.12 -  friend class printTreeCensusClosure;
    1.13 -  FreeChunk*    _head;          // List of free chunks
    1.14 +  friend class PrintTreeCensusClosure;
    1.15 +
    1.16 + protected:
    1.17 +  TreeList* _parent;
    1.18 +  TreeList* _left;
    1.19 +  TreeList* _right;
    1.20 +
    1.21 + private:
    1.22 +  FreeChunk*    _head;          // Head of list of free chunks
    1.23    FreeChunk*    _tail;          // Tail of list of free chunks
    1.24 -  size_t        _size;          // Size in Heap words of each chunks
    1.25 +  size_t        _size;          // Size in Heap words of each chunk
    1.26    ssize_t       _count;         // Number of entries in list
    1.27    size_t        _hint;          // next larger size list with a positive surplus
    1.28  
    1.29 -  AllocationStats _allocation_stats;            // statistics for smart allocation
    1.30 +  AllocationStats _allocation_stats; // allocation-related statistics
    1.31  
    1.32  #ifdef ASSERT
    1.33    Mutex*        _protecting_lock;
    1.34 @@ -63,9 +71,12 @@
    1.35  
    1.36    // Initialize the allocation statistics.
    1.37   protected:
    1.38 -  void init_statistics();
    1.39 +  void init_statistics(bool split_birth = false);
    1.40    void set_count(ssize_t v) { _count = v;}
    1.41 -  void increment_count()    { _count++; }
    1.42 +  void increment_count()    {
    1.43 +    _count++;
    1.44 +  }
    1.45 +
    1.46    void decrement_count() {
    1.47      _count--;
    1.48      assert(_count >= 0, "Count should not be negative");
    1.49 @@ -167,11 +178,13 @@
    1.50      _allocation_stats.set_desired(v);
    1.51    }
    1.52    void compute_desired(float inter_sweep_current,
    1.53 -                       float inter_sweep_estimate) {
    1.54 +                       float inter_sweep_estimate,
    1.55 +                       float intra_sweep_estimate) {
    1.56      assert_proper_lock_protection();
    1.57      _allocation_stats.compute_desired(_count,
    1.58                                        inter_sweep_current,
    1.59 -                                      inter_sweep_estimate);
    1.60 +                                      inter_sweep_estimate,
    1.61 +                                      intra_sweep_estimate);
    1.62    }
    1.63    ssize_t coalDesired() const {
    1.64      return _allocation_stats.coalDesired();
    1.65 @@ -306,6 +319,9 @@
    1.66    // found.  Return NULL if "fc" is not found.
    1.67    bool verifyChunkInFreeLists(FreeChunk* fc) const;
    1.68  
    1.69 +  // Stats verification
    1.70 +  void verify_stats() const PRODUCT_RETURN;
    1.71 +
    1.72    // Printing support
    1.73    static void print_labels_on(outputStream* st, const char* c);
    1.74    void print_on(outputStream* st, const char* c = NULL) const;

mercurial