Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1170)

Unified Diff: src/spaces.h

Issue 159504: Introduce first approximation of constructor heap profile for JS objects. (Closed)
Patch Set: Soeren's comments applied Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log.cc ('k') | src/zone.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index 94f7a914e3b624936816070659bfc04d253601b6..9841a5fddfbab1d00e389537c0f320efa7069d82 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -931,34 +931,41 @@ class PagedSpace : public Space {
#if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
-// HistogramInfo class for recording a single "bar" of a histogram. This
-// class is used for collecting statistics to print to stdout (when compiled
-// with DEBUG) or to the log file (when compiled with
-// ENABLE_LOGGING_AND_PROFILING).
-class HistogramInfo BASE_EMBEDDED {
+class NumberAndSizeInfo BASE_EMBEDDED {
public:
- HistogramInfo() : number_(0), bytes_(0) {}
+ NumberAndSizeInfo() : number_(0), bytes_(0) {}
- const char* name() { return name_; }
- void set_name(const char* name) { name_ = name; }
-
- int number() { return number_; }
+ int number() const { return number_; }
void increment_number(int num) { number_ += num; }
- int bytes() { return bytes_; }
+ int bytes() const { return bytes_; }
void increment_bytes(int size) { bytes_ += size; }
- // Clear the number of objects and size fields, but not the name.
void clear() {
number_ = 0;
bytes_ = 0;
}
private:
- const char* name_;
int number_;
int bytes_;
};
+
+
+// HistogramInfo class for recording a single "bar" of a histogram. This
+// class is used for collecting statistics to print to stdout (when compiled
+// with DEBUG) or to the log file (when compiled with
+// ENABLE_LOGGING_AND_PROFILING).
+class HistogramInfo: public NumberAndSizeInfo {
+ public:
+ HistogramInfo() : NumberAndSizeInfo() {}
+
+ const char* name() { return name_; }
+ void set_name(const char* name) { name_ = name; }
+
+ private:
+ const char* name_;
+};
#endif
« no previous file with comments | « src/log.cc ('k') | src/zone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698