Commit f073a20b authored by kschimpf's avatar kschimpf Committed by Commit Bot

Localize counter class member functions.

This CL takes advantage of the fact that StatsCounter is now local to
the Counters class. This includes:

1) Method StatsTable::SetCreateHistogramFunction() was only called in
one spot (in api.cc), which also called Counters::ResetHistograms()
and Counters::InitializeHistorgram(). InitializeHistogram can be
folded into Histogram.Reset().

2) Since Histogram::Reset() now regenerats the histogram, we no longer
need the field lookup_done_. Therefore there is no longer a race
between updating ptr_ and lookup_done_, making the Histogram class
thread safe.

3) Made the constructors of several classes private (except for class
Counters), minimizing the scope that they are used. When the couldn't
be moved, add comment that they were public only for test cases.

4) Removed the need for a mutex lock on StatsCounter::Reset(), since
it is now guaranteed to only be called when
StatsTable::SetCounterFunction() is called.

BUG=v8:6361
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_rel_ng

Review-Url: https://codereview.chromium.org/2918703002
Cr-Commit-Position: refs/heads/master@{#45791}
parent fe048410
...@@ -8730,23 +8730,20 @@ void Isolate::SetUseCounterCallback(UseCounterCallback callback) { ...@@ -8730,23 +8730,20 @@ void Isolate::SetUseCounterCallback(UseCounterCallback callback) {
void Isolate::SetCounterFunction(CounterLookupCallback callback) { void Isolate::SetCounterFunction(CounterLookupCallback callback) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
isolate->stats_table()->SetCounterFunction(callback); isolate->counters()->ResetCounterFunction(callback);
} }
void Isolate::SetCreateHistogramFunction(CreateHistogramCallback callback) { void Isolate::SetCreateHistogramFunction(CreateHistogramCallback callback) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
isolate->stats_table()->SetCreateHistogramFunction(callback); isolate->counters()->ResetCreateHistogramFunction(callback);
isolate->InitializeLoggingAndCounters();
isolate->counters()->ResetHistograms();
isolate->counters()->InitializeHistograms();
} }
void Isolate::SetAddHistogramSampleFunction( void Isolate::SetAddHistogramSampleFunction(
AddHistogramSampleCallback callback) { AddHistogramSampleCallback callback) {
reinterpret_cast<i::Isolate*>(this) reinterpret_cast<i::Isolate*>(this)
->stats_table() ->counters()
->SetAddHistogramSampleFunction(callback); ->SetAddHistogramSampleFunction(callback);
} }
......
...@@ -16,25 +16,21 @@ namespace v8 { ...@@ -16,25 +16,21 @@ namespace v8 {
namespace internal { namespace internal {
StatsTable::StatsTable(Counters* counters) StatsTable::StatsTable(Counters* counters)
: counters_(counters), : lookup_function_(NULL),
lookup_function_(NULL),
create_histogram_function_(NULL), create_histogram_function_(NULL),
add_histogram_sample_function_(NULL) {} add_histogram_sample_function_(NULL) {}
void StatsTable::SetCounterFunction(CounterLookupCallback f) { void StatsTable::SetCounterFunction(CounterLookupCallback f) {
lookup_function_ = f; lookup_function_ = f;
counters_->ResetCounters();
} }
int* StatsCounterBase::FindLocationInStatsTable() const { int* StatsCounterBase::FindLocationInStatsTable() const {
return counters_->stats_table()->FindLocation(name_); return counters_->FindLocation(name_);
} }
StatsCounterThreadSafe::StatsCounterThreadSafe(Counters* counters, StatsCounterThreadSafe::StatsCounterThreadSafe(Counters* counters,
const char* name) const char* name)
: StatsCounterBase(counters, name) { : StatsCounterBase(counters, name) {}
GetPtr();
}
void StatsCounterThreadSafe::Set(int Value) { void StatsCounterThreadSafe::Set(int Value) {
if (ptr_) { if (ptr_) {
...@@ -71,21 +67,14 @@ void StatsCounterThreadSafe::Decrement(int value) { ...@@ -71,21 +67,14 @@ void StatsCounterThreadSafe::Decrement(int value) {
} }
} }
int* StatsCounterThreadSafe::GetPtr() {
base::LockGuard<base::Mutex> Guard(&mutex_);
ptr_ = FindLocationInStatsTable();
return ptr_;
}
void Histogram::AddSample(int sample) { void Histogram::AddSample(int sample) {
if (Enabled()) { if (Enabled()) {
counters_->stats_table()->AddHistogramSample(histogram_, sample); counters_->AddHistogramSample(histogram_, sample);
} }
} }
void* Histogram::CreateHistogram() const { void* Histogram::CreateHistogram() const {
return counters_->stats_table()->CreateHistogram(name_, min_, max_, return counters_->CreateHistogram(name_, min_, max_, num_buckets_);
num_buckets_);
} }
...@@ -257,7 +246,9 @@ Counters::Counters(Isolate* isolate) ...@@ -257,7 +246,9 @@ Counters::Counters(Isolate* isolate)
} }
} }
void Counters::ResetCounters() { void Counters::ResetCounterFunction(CounterLookupCallback f) {
stats_table_.SetCounterFunction(f);
#define SC(name, caption) name##_.Reset(); #define SC(name, caption) name##_.Reset();
STATS_COUNTER_LIST_1(SC) STATS_COUNTER_LIST_1(SC)
STATS_COUNTER_LIST_2(SC) STATS_COUNTER_LIST_2(SC)
...@@ -292,8 +283,9 @@ void Counters::ResetCounters() { ...@@ -292,8 +283,9 @@ void Counters::ResetCounters() {
#undef SC #undef SC
} }
void Counters::ResetCreateHistogramFunction(CreateHistogramCallback f) {
stats_table_.SetCreateHistogramFunction(f);
void Counters::ResetHistograms() {
#define HR(name, caption, min, max, num_buckets) name##_.Reset(); #define HR(name, caption, min, max, num_buckets) name##_.Reset();
HISTOGRAM_RANGE_LIST(HR) HISTOGRAM_RANGE_LIST(HR)
#undef HR #undef HR
...@@ -316,29 +308,6 @@ void Counters::ResetHistograms() { ...@@ -316,29 +308,6 @@ void Counters::ResetHistograms() {
#undef HM #undef HM
} }
void Counters::InitializeHistograms() {
#define HR(name, caption, min, max, num_buckets) name##_.Enabled();
HISTOGRAM_RANGE_LIST(HR)
#undef HR
#define HT(name, caption, max, res) name##_.Enabled();
HISTOGRAM_TIMER_LIST(HT)
#undef HT
#define AHT(name, caption) name##_.Enabled();
AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT)
#undef AHT
#define HP(name, caption) name##_.Enabled();
HISTOGRAM_PERCENTAGE_LIST(HP)
#undef HP
#define HM(name, caption) name##_.Enabled();
HISTOGRAM_LEGACY_MEMORY_LIST(HM)
HISTOGRAM_MEMORY_LIST(HM)
#undef HM
}
class RuntimeCallStatEntries { class RuntimeCallStatEntries {
public: public:
void Print(std::ostream& os) { void Print(std::ostream& os) {
......
...@@ -29,19 +29,18 @@ class Counters; ...@@ -29,19 +29,18 @@ class Counters;
class StatsTable { class StatsTable {
public: public:
// Register an application-defined function where // Register an application-defined function for recording
// counters can be looked up. Note: Must be called on main thread, // subsequent counter statistics.
// so that threaded stats counters can be created now.
void SetCounterFunction(CounterLookupCallback f); void SetCounterFunction(CounterLookupCallback f);
// Register an application-defined function to create // Register an application-defined function to create histograms for
// a histogram for passing to the AddHistogramSample function // recording subsequent histogram samples.
void SetCreateHistogramFunction(CreateHistogramCallback f) { void SetCreateHistogramFunction(CreateHistogramCallback f) {
create_histogram_function_ = f; create_histogram_function_ = f;
} }
// Register an application-defined function to add a sample // Register an application-defined function to add a sample
// to a histogram created with CreateHistogram function // to a histogram created with CreateHistogram function.
void SetAddHistogramSampleFunction(AddHistogramSampleCallback f) { void SetAddHistogramSampleFunction(AddHistogramSampleCallback f) {
add_histogram_sample_function_ = f; add_histogram_sample_function_ = f;
} }
...@@ -82,15 +81,14 @@ class StatsTable { ...@@ -82,15 +81,14 @@ class StatsTable {
} }
private: private:
friend class Counters;
explicit StatsTable(Counters* counters); explicit StatsTable(Counters* counters);
Counters* counters_;
CounterLookupCallback lookup_function_; CounterLookupCallback lookup_function_;
CreateHistogramCallback create_histogram_function_; CreateHistogramCallback create_histogram_function_;
AddHistogramSampleCallback add_histogram_sample_function_; AddHistogramSampleCallback add_histogram_sample_function_;
friend class Counters;
DISALLOW_COPY_AND_ASSIGN(StatsTable); DISALLOW_COPY_AND_ASSIGN(StatsTable);
}; };
...@@ -121,13 +119,10 @@ class StatsCounterBase { ...@@ -121,13 +119,10 @@ class StatsCounterBase {
// Internally, a counter represents a value in a row of a StatsTable. // Internally, a counter represents a value in a row of a StatsTable.
// The row has a 32bit value for each process/thread in the table and also // The row has a 32bit value for each process/thread in the table and also
// a name (stored in the table metadata). Since the storage location can be // a name (stored in the table metadata). Since the storage location can be
// thread-specific, this class cannot be shared across threads. // thread-specific, this class cannot be shared across threads. Note: This
// class is not thread safe.
class StatsCounter : public StatsCounterBase { class StatsCounter : public StatsCounterBase {
public: public:
StatsCounter() { }
StatsCounter(Counters* counters, const char* name)
: StatsCounterBase(counters, name), lookup_done_(false) {}
// Sets the counter to a specific value. // Sets the counter to a specific value.
void Set(int value) { void Set(int value) {
if (int* loc = GetPtr()) SetLoc(loc, value); if (int* loc = GetPtr()) SetLoc(loc, value);
...@@ -166,10 +161,16 @@ class StatsCounter : public StatsCounterBase { ...@@ -166,10 +161,16 @@ class StatsCounter : public StatsCounterBase {
return loc; return loc;
} }
private:
friend class Counters;
StatsCounter() {}
StatsCounter(Counters* counters, const char* name)
: StatsCounterBase(counters, name), lookup_done_(false) {}
// Reset the cached internal pointer. // Reset the cached internal pointer.
void Reset() { lookup_done_ = false; } void Reset() { lookup_done_ = false; }
private:
// Returns the cached address of this counter location. // Returns the cached address of this counter location.
int* GetPtr() { int* GetPtr() {
if (lookup_done_) return ptr_; if (lookup_done_) return ptr_;
...@@ -181,14 +182,9 @@ class StatsCounter : public StatsCounterBase { ...@@ -181,14 +182,9 @@ class StatsCounter : public StatsCounterBase {
bool lookup_done_; bool lookup_done_;
}; };
// Thread safe version of StatsCounter. WARNING: Unlike StatsCounter, // Thread safe version of StatsCounter.
// StatsCounterThreadSafe's constructor and method Reset() actually do
// the table lookup, and should be called from the main thread
// (i.e. not workers).
class StatsCounterThreadSafe : public StatsCounterBase { class StatsCounterThreadSafe : public StatsCounterBase {
public: public:
StatsCounterThreadSafe(Counters* counters, const char* name);
void Set(int Value); void Set(int Value);
void Increment(); void Increment();
void Increment(int value); void Increment(int value);
...@@ -199,60 +195,49 @@ class StatsCounterThreadSafe : public StatsCounterBase { ...@@ -199,60 +195,49 @@ class StatsCounterThreadSafe : public StatsCounterBase {
DCHECK(ptr_ != NULL); DCHECK(ptr_ != NULL);
return ptr_; return ptr_;
} }
void Reset() { GetPtr(); }
private: private:
int* GetPtr(); friend class Counters;
StatsCounterThreadSafe(Counters* counters, const char* name);
void Reset() { ptr_ = FindLocationInStatsTable(); }
base::Mutex mutex_; base::Mutex mutex_;
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(StatsCounterThreadSafe); DISALLOW_IMPLICIT_CONSTRUCTORS(StatsCounterThreadSafe);
}; };
// A Histogram represents a dynamically created histogram in the StatsTable. // A Histogram represents a dynamically created histogram in the
// It will be registered with the histogram system on first use. // StatsTable. Note: This class is thread safe.
class Histogram { class Histogram {
public: public:
Histogram() { }
Histogram(const char* name, int min, int max, int num_buckets,
Counters* counters)
: name_(name),
min_(min),
max_(max),
num_buckets_(num_buckets),
histogram_(NULL),
lookup_done_(false),
counters_(counters) {}
// Add a single sample to this histogram. // Add a single sample to this histogram.
void AddSample(int sample); void AddSample(int sample);
// Returns true if this histogram is enabled. // Returns true if this histogram is enabled.
bool Enabled() { bool Enabled() { return histogram_ != nullptr; }
return GetHistogram() != NULL;
}
// Reset the cached internal pointer.
void Reset() {
lookup_done_ = false;
}
const char* name() { return name_; } const char* name() { return name_; }
protected: protected:
// Returns the handle to the histogram. Histogram() {}
void* GetHistogram() { Histogram(const char* name, int min, int max, int num_buckets,
if (!lookup_done_) { Counters* counters)
lookup_done_ = true; : name_(name),
histogram_ = CreateHistogram(); min_(min),
} max_(max),
return histogram_; num_buckets_(num_buckets),
} histogram_(nullptr),
counters_(counters) {}
Counters* counters() const { return counters_; } Counters* counters() const { return counters_; }
// Reset the cached internal pointer.
void Reset() { histogram_ = CreateHistogram(); }
private: private:
friend class Counters;
void* CreateHistogram() const; void* CreateHistogram() const;
const char* name_; const char* name_;
...@@ -260,7 +245,6 @@ class Histogram { ...@@ -260,7 +245,6 @@ class Histogram {
int max_; int max_;
int num_buckets_; int num_buckets_;
void* histogram_; void* histogram_;
bool lookup_done_;
Counters* counters_; Counters* counters_;
}; };
...@@ -272,7 +256,7 @@ class HistogramTimer : public Histogram { ...@@ -272,7 +256,7 @@ class HistogramTimer : public Histogram {
MICROSECOND MICROSECOND
}; };
HistogramTimer() {} // Note: public for testing purposes only.
HistogramTimer(const char* name, int min, int max, Resolution resolution, HistogramTimer(const char* name, int min, int max, Resolution resolution,
int num_buckets, Counters* counters) int num_buckets, Counters* counters)
: Histogram(name, min, max, num_buckets, counters), : Histogram(name, min, max, num_buckets, counters),
...@@ -295,8 +279,12 @@ class HistogramTimer : public Histogram { ...@@ -295,8 +279,12 @@ class HistogramTimer : public Histogram {
#endif #endif
private: private:
friend class Counters;
base::ElapsedTimer timer_; base::ElapsedTimer timer_;
Resolution resolution_; Resolution resolution_;
HistogramTimer() {}
}; };
// Helper class for scoping a HistogramTimer. // Helper class for scoping a HistogramTimer.
...@@ -355,11 +343,6 @@ class HistogramTimerScope BASE_EMBEDDED { ...@@ -355,11 +343,6 @@ class HistogramTimerScope BASE_EMBEDDED {
// events to be timed. // events to be timed.
class AggregatableHistogramTimer : public Histogram { class AggregatableHistogramTimer : public Histogram {
public: public:
AggregatableHistogramTimer() {}
AggregatableHistogramTimer(const char* name, int min, int max,
int num_buckets, Counters* counters)
: Histogram(name, min, max, num_buckets, counters) {}
// Start/stop the "outer" scope. // Start/stop the "outer" scope.
void Start() { time_ = base::TimeDelta(); } void Start() { time_ = base::TimeDelta(); }
void Stop() { AddSample(static_cast<int>(time_.InMicroseconds())); } void Stop() { AddSample(static_cast<int>(time_.InMicroseconds())); }
...@@ -368,6 +351,13 @@ class AggregatableHistogramTimer : public Histogram { ...@@ -368,6 +351,13 @@ class AggregatableHistogramTimer : public Histogram {
void Add(base::TimeDelta other) { time_ += other; } void Add(base::TimeDelta other) { time_ += other; }
private: private:
friend class Counters;
AggregatableHistogramTimer() {}
AggregatableHistogramTimer(const char* name, int min, int max,
int num_buckets, Counters* counters)
: Histogram(name, min, max, num_buckets, counters) {}
base::TimeDelta time_; base::TimeDelta time_;
}; };
...@@ -414,14 +404,7 @@ class AggregatedHistogramTimerScope { ...@@ -414,14 +404,7 @@ class AggregatedHistogramTimerScope {
template <typename Histogram> template <typename Histogram>
class AggregatedMemoryHistogram { class AggregatedMemoryHistogram {
public: public:
AggregatedMemoryHistogram() // Note: public for testing purposes only.
: is_initialized_(false),
start_ms_(0.0),
last_ms_(0.0),
aggregate_value_(0.0),
last_value_(0.0),
backing_histogram_(NULL) {}
explicit AggregatedMemoryHistogram(Histogram* backing_histogram) explicit AggregatedMemoryHistogram(Histogram* backing_histogram)
: AggregatedMemoryHistogram() { : AggregatedMemoryHistogram() {
backing_histogram_ = backing_histogram; backing_histogram_ = backing_histogram;
...@@ -439,7 +422,17 @@ class AggregatedMemoryHistogram { ...@@ -439,7 +422,17 @@ class AggregatedMemoryHistogram {
void AddSample(double current_ms, double current_value); void AddSample(double current_ms, double current_value);
private: private:
friend class Counters;
AggregatedMemoryHistogram()
: is_initialized_(false),
start_ms_(0.0),
last_ms_(0.0),
aggregate_value_(0.0),
last_value_(0.0),
backing_histogram_(NULL) {}
double Aggregate(double current_ms, double current_value); double Aggregate(double current_ms, double current_value);
bool is_initialized_; bool is_initialized_;
double start_ms_; double start_ms_;
double last_ms_; double last_ms_;
...@@ -536,14 +529,14 @@ class RuntimeCallCounter final { ...@@ -536,14 +529,14 @@ class RuntimeCallCounter final {
void Add(base::TimeDelta delta) { time_ += delta.InMicroseconds(); } void Add(base::TimeDelta delta) { time_ += delta.InMicroseconds(); }
private: private:
friend class RuntimeCallStats;
RuntimeCallCounter() {} RuntimeCallCounter() {}
const char* name_; const char* name_;
int64_t count_; int64_t count_;
// Stored as int64_t so that its initialization can be deferred. // Stored as int64_t so that its initialization can be deferred.
int64_t time_; int64_t time_;
friend class RuntimeCallStats;
}; };
// RuntimeCallTimer is used to keep track of the stack of currently active // RuntimeCallTimer is used to keep track of the stack of currently active
...@@ -1217,6 +1210,23 @@ class Counters : public std::enable_shared_from_this<Counters> { ...@@ -1217,6 +1210,23 @@ class Counters : public std::enable_shared_from_this<Counters> {
public: public:
explicit Counters(Isolate* isolate); explicit Counters(Isolate* isolate);
// Register an application-defined function for recording
// subsequent counter statistics. Note: Must be called on the main
// thread.
void ResetCounterFunction(CounterLookupCallback f);
// Register an application-defined function to create histograms for
// recording subsequent histogram samples. Note: Must be called on
// the main thread.
void ResetCreateHistogramFunction(CreateHistogramCallback f);
// Register an application-defined function to add a sample
// to a histogram. Will be used in all subsequent sample additions.
// Note: Must be called on the main thread.
void SetAddHistogramSampleFunction(AddHistogramSampleCallback f) {
stats_table_.SetAddHistogramSampleFunction(f);
}
#define HR(name, caption, min, max, num_buckets) \ #define HR(name, caption, min, max, num_buckets) \
Histogram* name() { return &name##_; } Histogram* name() { return &name##_; }
HISTOGRAM_RANGE_LIST(HR) HISTOGRAM_RANGE_LIST(HR)
...@@ -1330,20 +1340,31 @@ class Counters : public std::enable_shared_from_this<Counters> { ...@@ -1330,20 +1340,31 @@ class Counters : public std::enable_shared_from_this<Counters> {
}; };
// clang-format on // clang-format on
void ResetCounters();
void ResetHistograms();
void InitializeHistograms();
RuntimeCallStats* runtime_call_stats() { return &runtime_call_stats_; } RuntimeCallStats* runtime_call_stats() { return &runtime_call_stats_; }
StatsTable* stats_table() { return &stats_table_; }
Isolate* isolate() { return isolate_; }
private: private:
friend class StatsTable;
friend class StatsCounterBase;
friend class Histogram;
friend class HistogramTimer;
Isolate* isolate_; Isolate* isolate_;
StatsTable stats_table_; StatsTable stats_table_;
int* FindLocation(const char* name) {
return stats_table_.FindLocation(name);
}
void* CreateHistogram(const char* name, int min, int max, size_t buckets) {
return stats_table_.CreateHistogram(name, min, max, buckets);
}
void AddHistogramSample(void* histogram, int sample) {
stats_table_.AddHistogramSample(histogram, sample);
}
Isolate* isolate() { return isolate_; }
#define HR(name, caption, min, max, num_buckets) Histogram name##_; #define HR(name, caption, min, max, num_buckets) Histogram name##_;
HISTOGRAM_RANGE_LIST(HR) HISTOGRAM_RANGE_LIST(HR)
#undef HR #undef HR
......
...@@ -2290,7 +2290,6 @@ Isolate::Isolate(bool enable_serializer) ...@@ -2290,7 +2290,6 @@ Isolate::Isolate(bool enable_serializer)
runtime_profiler_(NULL), runtime_profiler_(NULL),
compilation_cache_(NULL), compilation_cache_(NULL),
logger_(NULL), logger_(NULL),
stats_table_(NULL),
load_stub_cache_(NULL), load_stub_cache_(NULL),
store_stub_cache_(NULL), store_stub_cache_(NULL),
code_aging_helper_(NULL), code_aging_helper_(NULL),
...@@ -2544,7 +2543,6 @@ Isolate::~Isolate() { ...@@ -2544,7 +2543,6 @@ Isolate::~Isolate() {
store_stub_cache_ = NULL; store_stub_cache_ = NULL;
delete code_aging_helper_; delete code_aging_helper_;
code_aging_helper_ = NULL; code_aging_helper_ = NULL;
stats_table_ = NULL;
delete materialized_object_store_; delete materialized_object_store_;
materialized_object_store_ = NULL; materialized_object_store_ = NULL;
...@@ -2852,16 +2850,6 @@ bool Isolate::Init(Deserializer* des) { ...@@ -2852,16 +2850,6 @@ bool Isolate::Init(Deserializer* des) {
} }
// Initialized lazily to allow early
// v8::V8::SetAddHistogramSampleFunction calls.
StatsTable* Isolate::stats_table() {
if (stats_table_ != nullptr) return stats_table_;
InitializeCounters();
stats_table_ = counters_shared_->stats_table();
return stats_table_;
}
void Isolate::Enter() { void Isolate::Enter() {
Isolate* current_isolate = NULL; Isolate* current_isolate = NULL;
PerIsolateThreadData* current_data = CurrentPerIsolateThreadData(); PerIsolateThreadData* current_data = CurrentPerIsolateThreadData();
......
...@@ -883,7 +883,6 @@ class Isolate { ...@@ -883,7 +883,6 @@ class Isolate {
} }
StackGuard* stack_guard() { return &stack_guard_; } StackGuard* stack_guard() { return &stack_guard_; }
Heap* heap() { return &heap_; } Heap* heap() { return &heap_; }
StatsTable* stats_table();
StubCache* load_stub_cache() { return load_stub_cache_; } StubCache* load_stub_cache() { return load_stub_cache_; }
StubCache* store_stub_cache() { return store_stub_cache_; } StubCache* store_stub_cache() { return store_stub_cache_; }
CodeAgingHelper* code_aging_helper() { return code_aging_helper_; } CodeAgingHelper* code_aging_helper() { return code_aging_helper_; }
...@@ -1436,7 +1435,6 @@ class Isolate { ...@@ -1436,7 +1435,6 @@ class Isolate {
base::RecursiveMutex break_access_; base::RecursiveMutex break_access_;
Logger* logger_; Logger* logger_;
StackGuard stack_guard_; StackGuard stack_guard_;
StatsTable* stats_table_;
StubCache* load_stub_cache_; StubCache* load_stub_cache_;
StubCache* store_stub_cache_; StubCache* store_stub_cache_;
CodeAgingHelper* code_aging_helper_; CodeAgingHelper* code_aging_helper_;
......
...@@ -28,9 +28,7 @@ class MockHistogram : public Histogram { ...@@ -28,9 +28,7 @@ class MockHistogram : public Histogram {
class AggregatedMemoryHistogramTest : public ::testing::Test { class AggregatedMemoryHistogramTest : public ::testing::Test {
public: public:
AggregatedMemoryHistogramTest() { AggregatedMemoryHistogramTest() : aggregated_(&mock_) {}
aggregated_ = AggregatedMemoryHistogram<MockHistogram>(&mock_);
}
virtual ~AggregatedMemoryHistogramTest() {} virtual ~AggregatedMemoryHistogramTest() {}
void AddSample(double current_ms, double current_value) { void AddSample(double current_ms, double current_value) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment