Chromium Code Reviews| Index: runtime/vm/heap.cc |
| diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc |
| index 334e90364f5d6e16e70ef2a084ad47a76d0a5d78..82d529572a173c84ec014dd610d3cf2a01321292 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>"; |
|
rmacnak
2017/07/24 19:10:36
Maybe use the regular name field?
zra
2017/07/24 20:21:53
Done.
|
| +#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 // !defined(PRODUCT) |
| 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) { |