src/share/vm/gc_implementation/g1/heapRegion.hpp
Print this page
rev 6592 : [mq]: 8047818.reviews
@@ -125,12 +125,10 @@
// evacuation pauses between two cleanups, which is _highly_ unlikely.
class G1OffsetTableContigSpace: public CompactibleSpace {
friend class VMStructs;
HeapWord* _top;
protected:
- inline HeapWord* cas_allocate_inner(size_t size);
- inline HeapWord* allocate_inner(size_t size);
G1BlockOffsetArrayContigSpace _offsets;
Mutex _par_alloc_lock;
volatile unsigned _gc_time_stamp;
// When we need to retire an allocation region, while other threads
// are also concurrently trying to allocate into it, we typically
@@ -142,12 +140,20 @@
public:
G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray,
MemRegion mr);
- inline void set_top(HeapWord* value) { _top = value; }
+ void set_top(HeapWord* value) { _top = value; }
HeapWord* top() const { return _top; }
+
+ protected:
+ HeapWord** top_addr() { return &_top; }
+ // Allocation helpers (return NULL if full).
+ inline HeapWord* allocate_impl(size_t word_size, HeapWord* end_value);
+ inline HeapWord* par_allocate_impl(size_t word_size, HeapWord* end_value);
+
+ public:
void reset_after_compaction() { set_top(compaction_top()); }
size_t used() const { return byte_size(bottom(), top()); }
size_t free() const { return byte_size(top(), end()); }
bool is_free_block(const HeapWord* p) const { return p >= top(); }
@@ -362,11 +368,15 @@
AggregateCountClaimValue = 7,
VerifyCountClaimValue = 8,
ParMarkRootClaimValue = 9
};
+ // All allocated blocks are occupied by objects in a HeapRegion
bool block_is_obj(const HeapWord* p) const;
+
+ // Returns the object size for all valid block starts
+ // and the amount of unallocated words if called on top()
size_t block_size(const HeapWord* p) const;
inline HeapWord* par_allocate_no_bot_updates(size_t word_size);
inline HeapWord* allocate_no_bot_updates(size_t word_size);