src/share/vm/gc_implementation/g1/heapRegion.hpp

changeset 2715
abdfc822206f
parent 2643
1216415d8e35
child 2717
371bbc844bf1
     1.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.hpp	Tue Mar 29 22:36:16 2011 -0400
     1.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp	Wed Mar 30 10:26:59 2011 -0400
     1.3 @@ -149,6 +149,13 @@
     1.4    G1BlockOffsetArrayContigSpace _offsets;
     1.5    Mutex _par_alloc_lock;
     1.6    volatile unsigned _gc_time_stamp;
     1.7 +  // When we need to retire an allocation region, while other threads
     1.8 +  // are also concurrently trying to allocate into it, we typically
     1.9 +  // allocate a dummy object at the end of the region to ensure that
    1.10 +  // no more allocations can take place in it. However, sometimes we
    1.11 +  // want to know where the end of the last "real" object we allocated
    1.12 +  // into the region was and this is what this keeps track.
    1.13 +  HeapWord* _pre_dummy_top;
    1.14  
    1.15   public:
    1.16    // Constructor.  If "is_zeroed" is true, the MemRegion "mr" may be
    1.17 @@ -163,6 +170,17 @@
    1.18    virtual void set_saved_mark();
    1.19    void reset_gc_time_stamp() { _gc_time_stamp = 0; }
    1.20  
    1.21 +  // See the comment above in the declaration of _pre_dummy_top for an
    1.22 +  // explanation of what it is.
    1.23 +  void set_pre_dummy_top(HeapWord* pre_dummy_top) {
    1.24 +    assert(is_in(pre_dummy_top) && pre_dummy_top <= top(), "pre-condition");
    1.25 +    _pre_dummy_top = pre_dummy_top;
    1.26 +  }
    1.27 +  HeapWord* pre_dummy_top() {
    1.28 +    return (_pre_dummy_top == NULL) ? top() : _pre_dummy_top;
    1.29 +  }
    1.30 +  void reset_pre_dummy_top() { _pre_dummy_top = NULL; }
    1.31 +
    1.32    virtual void initialize(MemRegion mr, bool clear_space, bool mangle_space);
    1.33    virtual void clear(bool mangle_space);
    1.34  

mercurial