Print this page


Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp
          +++ new/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp
↓ open down ↓ 30 lines elided ↑ open up ↑
  31   31  // used to make decisions about coalescing FreeChunk's when they
  32   32  // are swept during collection.
  33   33  //
  34   34  // See the corresponding .cpp file for a description of the specifics
  35   35  // for that implementation.
  36   36  
  37   37  class Mutex;
  38   38  
  39   39  class FreeList VALUE_OBJ_CLASS_SPEC {
  40   40    friend class CompactibleFreeListSpace;
       41 +  friend class printTreeCensusClosure;
  41   42    FreeChunk*    _head;          // List of free chunks
  42   43    FreeChunk*    _tail;          // Tail of list of free chunks
  43   44    size_t        _size;          // Size in Heap words of each chunks
  44   45    ssize_t       _count;         // Number of entries in list
  45   46    size_t        _hint;          // next larger size list with a positive surplus
  46   47  
  47   48    AllocationStats _allocation_stats;            // statistics for smart allocation
  48   49  
  49   50  #ifdef ASSERT
  50   51    Mutex*        _protecting_lock;
↓ open down ↓ 5 lines elided ↑ open up ↑
  56   57  #ifdef ASSERT
  57   58      if (_protecting_lock != NULL)
  58   59        assert_proper_lock_protection_work();
  59   60  #endif
  60   61    }
  61   62  
  62   63    // Initialize the allocation statistics.
  63   64   protected:
  64   65    void init_statistics();
  65   66    void set_count(ssize_t v) { _count = v;}
  66      -  void increment_count() { _count++; }
       67 +  void increment_count()    { _count++; }
  67   68    void decrement_count() {
  68   69      _count--;
  69      -    assert(_count >= 0, "Count should not be negative"); }
       70 +    assert(_count >= 0, "Count should not be negative");
       71 +  }
  70   72  
  71   73   public:
  72   74    // Constructor
  73   75    // Construct a list without any entries.
  74   76    FreeList();
  75   77    // Construct a list with "fc" as the first (and lone) entry in the list.
  76   78    FreeList(FreeChunk* fc);
  77   79    // Construct a list which will have a FreeChunk at address "addr" and
  78   80    // of size "size" as the first (and lone) entry in the list.
  79   81    FreeList(HeapWord* addr, size_t size);
↓ open down ↓ 72 lines elided ↑ open up ↑
 152  154  
 153  155    // Accessors for statistics
 154  156    AllocationStats* allocation_stats() {
 155  157      assert_proper_lock_protection();
 156  158      return &_allocation_stats;
 157  159    }
 158  160  
 159  161    ssize_t desired() const {
 160  162      return _allocation_stats.desired();
 161  163    }
      164 +  void set_desired(ssize_t v) {
      165 +    assert_proper_lock_protection();
      166 +    _allocation_stats.set_desired(v);
      167 +  }
 162  168    void compute_desired(float inter_sweep_current,
 163  169                         float inter_sweep_estimate) {
 164  170      assert_proper_lock_protection();
 165  171      _allocation_stats.compute_desired(_count,
 166  172                                        inter_sweep_current,
 167  173                                        inter_sweep_estimate);
 168  174    }
 169  175    ssize_t coalDesired() const {
 170  176      return _allocation_stats.coalDesired();
 171  177    }
↓ open down ↓ 119 lines elided ↑ open up ↑
 291  297    void returnChunkAtHead(FreeChunk* fc, bool record_return);
 292  298    void returnChunkAtTail(FreeChunk* fc, bool record_return);
 293  299  
 294  300    // Prepend "fl" (whose size is required to be the same as that of "this")
 295  301    // to the front of "this" list.
 296  302    void prepend(FreeList* fl);
 297  303  
 298  304    // Verify that the chunk is in the list.
 299  305    // found.  Return NULL if "fc" is not found.
 300  306    bool verifyChunkInFreeLists(FreeChunk* fc) const;
      307 +
      308 +  // Printing support
      309 +  static void print_labels_on(outputStream* st, const char* c);
      310 +  void print_on(outputStream* st, const char* c = NULL) const;
 301  311  };
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX