< prev index next >
src/hotspot/share/gc/g1/g1EdenRegions.hpp
Print this page
rev 56834 : imported patch 8220312.stat.2
rev 56835 : imported patch 8220312.stat.3
rev 56836 : imported patch 8220312.stat.4
rev 56838 : [mq]: 8220312.stat.5
*** 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/g1RegionsOnNodes.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;
+ G1RegionsOnNodes _regions_on_node;
public:
! G1EdenRegions() : _length(0), _used_bytes(0), _regions_on_node() { }
! virtual uint add(HeapRegion* hr) {
assert(!hr->is_eden(), "should not already be set");
_length++;
+ return _regions_on_node.add(hr);
}
! void clear() {
! _length = 0;
! _used_bytes = 0;
! _regions_on_node.clear();
! }
uint length() const { return _length; }
+ uint regions_on_node(uint node_index) const { return _regions_on_node.count(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 >