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

Unified Diff: runtime/vm/heap.cc

Issue 2984883002: Remove fields from Isolate in Product mode (Closed)
Patch Set: Address comments 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
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/heap_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 334e90364f5d6e16e70ef2a084ad47a76d0a5d78..ad1f24deadd339df802c63bc1e38e44f711af771 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,17 @@ void Heap::Init(Isolate* isolate,
}
void Heap::RegionName(Heap* heap, Space space, char* name, intptr_t name_size) {
+#if defined(PRODUCT)
+ const bool no_isolate_name = (heap == NULL) || (heap->isolate() == NULL) ||
+ (heap->isolate()->name() == NULL);
+ const char* isolate_name =
+ no_isolate_name ? "<unknown>" : heap->isolate()->name();
+#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 +711,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 +775,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698