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

Unified Diff: runtime/vm/heap.cc

Issue 2984883002: Remove fields from Isolate in Product mode (Closed)
Patch Set: Created 3 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/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 334e90364f5d6e16e70ef2a084ad47a76d0a5d78..8423b82511875da2b3be5cda3309a7701e3bf502 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -445,12 +445,14 @@ void Heap::WaitForSweeperTasks(Thread* thread) {
}
void Heap::UpdateGlobalMaxUsed() {
+#if !defined(PRODUCT)
ASSERT(isolate_ != NULL);
// We are accessing the used in words count for both new and old space
// without synchronizing. The value of this metric is approximate.
isolate_->GetHeapGlobalUsedMaxMetric()->SetValue(
(UsedInWords(Heap::kNew) * kWordSize) +
(UsedInWords(Heap::kOld) * kWordSize));
+#endif // !defined(PRODUCT)
}
void Heap::InitGrowthControl() {
@@ -482,10 +484,14 @@ void Heap::Init(Isolate* isolate,
}
void Heap::RegionName(Heap* heap, Space space, char* name, intptr_t name_size) {
+#if defined(PRODUCT)
+ const char* isolate_name = "<unknown>";
+#else
const bool no_isolate_name = (heap == NULL) || (heap->isolate() == NULL) ||
(heap->isolate()->debugger_name() == NULL);
const char* isolate_name =
no_isolate_name ? "<unknown>" : heap->isolate()->debugger_name();
+#endif
const char* space_name = NULL;
switch (space) {
case kNew:
@@ -702,6 +708,7 @@ void Heap::RecordAfterGC(Space space) {
}
void Heap::PrintStats() {
+#if !defined(PRODUCT)
if (!FLAG_verbose_gc) return;
if ((FLAG_verbose_gc_hdr != 0) &&
@@ -765,6 +772,7 @@ void Heap::PrintStats() {
stats_.data_[2],
stats_.data_[3]);
// clang-format on
+#endif // !defined(PRODUCT)
}
void Heap::PrintStatsToTimeline(TimelineEventScope* event) {
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/heap_test.cc » ('j') | runtime/vm/pages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698