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

Unified Diff: runtime/vm/class_table.h

Issue 2143153002: Don't track allocations in product mode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 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
Index: runtime/vm/class_table.h
diff --git a/runtime/vm/class_table.h b/runtime/vm/class_table.h
index 9a12fc3ee351e684f9cc8f830f405e3576a18b38..1d305ad1b5f657e398109443b3c02308d2dcf84f 100644
--- a/runtime/vm/class_table.h
+++ b/runtime/vm/class_table.h
@@ -20,6 +20,7 @@ template<typename T> class MallocGrowableArray;
class ObjectPointerVisitor;
class RawClass;
+#ifndef PRODUCT
template<typename T>
class AllocStats {
public:
@@ -142,7 +143,7 @@ class ClassHeapStats {
intptr_t old_pre_new_gc_size_;
intptr_t state_;
};
-
+#endif // !PRODUCT
class ClassTable {
public:
@@ -194,15 +195,16 @@ class ClassTable {
void Validate();
void Print();
-#ifndef PRODUCT
- void PrintToJSONObject(JSONObject* object);
-#endif
// Used by the generated code.
static intptr_t table_offset() {
return OFFSET_OF(ClassTable, table_);
}
+ // Used by the generated code.
+ static intptr_t ClassOffsetFor(intptr_t cid);
+
+#ifndef PRODUCT
// Called whenever a class is allocated in the runtime.
void UpdateAllocatedNew(intptr_t cid, intptr_t size);
void UpdateAllocatedOld(intptr_t cid, intptr_t size);
@@ -215,9 +217,6 @@ class ClassTable {
void UpdatePromoted();
// Used by the generated code.
- static intptr_t ClassOffsetFor(intptr_t cid);
-
- // Used by the generated code.
ClassHeapStats** TableAddressFor(intptr_t cid);
static intptr_t TableOffsetFor(intptr_t cid);
@@ -235,6 +234,9 @@ class ClassTable {
void AllocationProfilePrintJSON(JSONStream* stream);
void ResetAllocationAccumulators();
+ void PrintToJSONObject(JSONObject* object);
+#endif // !PRODUCT
+
// Deallocates table copies. Do not call during concurrent access to table.
void FreeOldTables();
@@ -257,14 +259,15 @@ class ClassTable {
RawClass** table_;
MallocGrowableArray<RawClass**>* old_tables_;
+#ifndef PRODUCT
ClassHeapStats* class_heap_stats_table_;
-
ClassHeapStats* predefined_class_heap_stats_table_;
// May not have updated size for variable size classes.
ClassHeapStats* PreliminaryStatsAt(intptr_t cid);
void UpdateLiveOld(intptr_t cid, intptr_t size, intptr_t count = 1);
void UpdateLiveNew(intptr_t cid, intptr_t size);
+#endif // !PRODUCT
DISALLOW_COPY_AND_ASSIGN(ClassTable);
};

Powered by Google App Engine
This is Rietveld 408576698