56 void set_end(HeapWord* value) { _end = value; }
57
58 // The shared initialize code invokes this.
59 debug_only(virtual bool lab_is_valid(MemRegion lab) { return false; });
60
61 PSPromotionLAB() : _top(NULL), _bottom(NULL), _end(NULL) { }
62
63 public:
64 // Filling and flushing.
65 void initialize(MemRegion lab);
66
67 virtual void flush();
68
69 // Accessors
70 HeapWord* bottom() const { return _bottom; }
71 HeapWord* end() const { return _end; }
72 HeapWord* top() const { return _top; }
73
74 bool is_flushed() { return _state == flushed; }
75
76 bool unallocate_object(oop obj);
77
78 // Returns a subregion containing all objects in this space.
79 MemRegion used_region() { return MemRegion(bottom(), top()); }
80
81 // Boolean querries.
82 bool is_empty() const { return used() == 0; }
83 bool not_empty() const { return used() > 0; }
84 bool contains(const void* p) const { return _bottom <= p && p < _end; }
85
86 // Size computations. Sizes are in bytes.
87 size_t capacity() const { return byte_size(bottom(), end()); }
88 size_t used() const { return byte_size(bottom(), top()); }
89 size_t free() const { return byte_size(top(), end()); }
90 };
91
92 class PSYoungPromotionLAB : public PSPromotionLAB {
93 public:
94 PSYoungPromotionLAB() { }
95
96 // Not MT safe
|
56 void set_end(HeapWord* value) { _end = value; }
57
58 // The shared initialize code invokes this.
59 debug_only(virtual bool lab_is_valid(MemRegion lab) { return false; });
60
61 PSPromotionLAB() : _top(NULL), _bottom(NULL), _end(NULL) { }
62
63 public:
64 // Filling and flushing.
65 void initialize(MemRegion lab);
66
67 virtual void flush();
68
69 // Accessors
70 HeapWord* bottom() const { return _bottom; }
71 HeapWord* end() const { return _end; }
72 HeapWord* top() const { return _top; }
73
74 bool is_flushed() { return _state == flushed; }
75
76 bool unallocate_object(HeapWord* obj, size_t obj_size);
77
78 // Returns a subregion containing all objects in this space.
79 MemRegion used_region() { return MemRegion(bottom(), top()); }
80
81 // Boolean querries.
82 bool is_empty() const { return used() == 0; }
83 bool not_empty() const { return used() > 0; }
84 bool contains(const void* p) const { return _bottom <= p && p < _end; }
85
86 // Size computations. Sizes are in bytes.
87 size_t capacity() const { return byte_size(bottom(), end()); }
88 size_t used() const { return byte_size(bottom(), top()); }
89 size_t free() const { return byte_size(top(), end()); }
90 };
91
92 class PSYoungPromotionLAB : public PSPromotionLAB {
93 public:
94 PSYoungPromotionLAB() { }
95
96 // Not MT safe
|