< prev index next >

src/hotspot/share/gc/g1/g1EdenRegions.hpp

Print this page
rev 56461 : imported patch 8220312.stat.2
rev 56462 : imported patch 8220312.stat.3
rev 56463 : [mq]: 8220312.stat.4

*** 23,54 **** */ #ifndef SHARE_GC_G1_G1EDENREGIONS_HPP #define SHARE_GC_G1_G1EDENREGIONS_HPP #include "gc/g1/heapRegion.hpp" #include "runtime/globals.hpp" #include "utilities/debug.hpp" class G1EdenRegions { private: int _length; // Sum of used bytes from all retired eden regions. // I.e. updated when mutator regions are retired. volatile size_t _used_bytes; public: ! G1EdenRegions() : _length(0), _used_bytes(0) { } ! void add(HeapRegion* hr) { assert(!hr->is_eden(), "should not already be set"); _length++; } ! void clear() { _length = 0; _used_bytes = 0; } uint length() const { return _length; } size_t used_bytes() const { return _used_bytes; } void add_used_bytes(size_t used_bytes) { _used_bytes += used_bytes; --- 23,62 ---- */ #ifndef SHARE_GC_G1_G1EDENREGIONS_HPP #define SHARE_GC_G1_G1EDENREGIONS_HPP + #include "gc/g1/g1RegionCounts.hpp" #include "gc/g1/heapRegion.hpp" #include "runtime/globals.hpp" #include "utilities/debug.hpp" class G1EdenRegions { private: int _length; // Sum of used bytes from all retired eden regions. // I.e. updated when mutator regions are retired. volatile size_t _used_bytes; + G1RegionCounts _region_counts; public: ! G1EdenRegions() : _length(0), _used_bytes(0), _region_counts() { } ! virtual uint add(HeapRegion* hr) { assert(!hr->is_eden(), "should not already be set"); _length++; + return _region_counts.add(hr); } ! void clear() { ! _length = 0; ! _used_bytes = 0; ! _region_counts.clear(); ! } uint length() const { return _length; } + uint length(uint node_index) const { return _region_counts.length(node_index); } size_t used_bytes() const { return _used_bytes; } void add_used_bytes(size_t used_bytes) { _used_bytes += used_bytes;
< prev index next >