mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
Merge
This commit is contained in:
commit
78662d3b17
45 changed files with 2562 additions and 1057 deletions
|
@ -26,14 +26,10 @@
|
|||
#include "gc_implementation/shared/generationCounters.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
|
||||
|
||||
GenerationCounters::GenerationCounters(const char* name,
|
||||
int ordinal, int spaces,
|
||||
VirtualSpace* v):
|
||||
_virtual_space(v) {
|
||||
|
||||
void GenerationCounters::initialize(const char* name, int ordinal, int spaces,
|
||||
size_t min_capacity, size_t max_capacity,
|
||||
size_t curr_capacity) {
|
||||
if (UsePerfData) {
|
||||
|
||||
EXCEPTION_MARK;
|
||||
ResourceMark rm;
|
||||
|
||||
|
@ -51,18 +47,37 @@ GenerationCounters::GenerationCounters(const char* name,
|
|||
|
||||
cname = PerfDataManager::counter_name(_name_space, "minCapacity");
|
||||
PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_Bytes,
|
||||
_virtual_space == NULL ? 0 :
|
||||
_virtual_space->committed_size(), CHECK);
|
||||
min_capacity, CHECK);
|
||||
|
||||
cname = PerfDataManager::counter_name(_name_space, "maxCapacity");
|
||||
PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_Bytes,
|
||||
_virtual_space == NULL ? 0 :
|
||||
_virtual_space->reserved_size(), CHECK);
|
||||
max_capacity, CHECK);
|
||||
|
||||
cname = PerfDataManager::counter_name(_name_space, "capacity");
|
||||
_current_size = PerfDataManager::create_variable(SUN_GC, cname,
|
||||
PerfData::U_Bytes,
|
||||
_virtual_space == NULL ? 0 :
|
||||
_virtual_space->committed_size(), CHECK);
|
||||
_current_size =
|
||||
PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
|
||||
curr_capacity, CHECK);
|
||||
}
|
||||
}
|
||||
|
||||
GenerationCounters::GenerationCounters(const char* name,
|
||||
int ordinal, int spaces,
|
||||
VirtualSpace* v)
|
||||
: _virtual_space(v) {
|
||||
assert(v != NULL, "don't call this constructor if v == NULL");
|
||||
initialize(name, ordinal, spaces,
|
||||
v->committed_size(), v->reserved_size(), v->committed_size());
|
||||
}
|
||||
|
||||
GenerationCounters::GenerationCounters(const char* name,
|
||||
int ordinal, int spaces,
|
||||
size_t min_capacity, size_t max_capacity,
|
||||
size_t curr_capacity)
|
||||
: _virtual_space(NULL) {
|
||||
initialize(name, ordinal, spaces, min_capacity, max_capacity, curr_capacity);
|
||||
}
|
||||
|
||||
void GenerationCounters::update_all() {
|
||||
assert(_virtual_space != NULL, "otherwise, override this method");
|
||||
_current_size->set_value(_virtual_space->committed_size());
|
||||
}
|
||||
|
|
|
@ -34,6 +34,11 @@
|
|||
class GenerationCounters: public CHeapObj {
|
||||
friend class VMStructs;
|
||||
|
||||
private:
|
||||
void initialize(const char* name, int ordinal, int spaces,
|
||||
size_t min_capacity, size_t max_capacity,
|
||||
size_t curr_capacity);
|
||||
|
||||
protected:
|
||||
PerfVariable* _current_size;
|
||||
VirtualSpace* _virtual_space;
|
||||
|
@ -48,11 +53,18 @@ class GenerationCounters: public CHeapObj {
|
|||
char* _name_space;
|
||||
|
||||
// This constructor is only meant for use with the PSGenerationCounters
|
||||
// constructor. The need for such an constructor should be eliminated
|
||||
// constructor. The need for such an constructor should be eliminated
|
||||
// when VirtualSpace and PSVirtualSpace are unified.
|
||||
GenerationCounters() : _name_space(NULL), _current_size(NULL), _virtual_space(NULL) {}
|
||||
public:
|
||||
GenerationCounters()
|
||||
: _name_space(NULL), _current_size(NULL), _virtual_space(NULL) {}
|
||||
|
||||
// This constructor is used for subclasses that do not have a space
|
||||
// associated with them (e.g, in G1).
|
||||
GenerationCounters(const char* name, int ordinal, int spaces,
|
||||
size_t min_capacity, size_t max_capacity,
|
||||
size_t curr_capacity);
|
||||
|
||||
public:
|
||||
GenerationCounters(const char* name, int ordinal, int spaces,
|
||||
VirtualSpace* v);
|
||||
|
||||
|
@ -60,10 +72,7 @@ class GenerationCounters: public CHeapObj {
|
|||
if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
|
||||
}
|
||||
|
||||
virtual void update_all() {
|
||||
_current_size->set_value(_virtual_space == NULL ? 0 :
|
||||
_virtual_space->committed_size());
|
||||
}
|
||||
virtual void update_all();
|
||||
|
||||
const char* name_space() const { return _name_space; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue