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

Unified Diff: src/isolate.cc

Issue 890663005: Introduce a flag for tracing retaining path in GC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
« src/heap/heap.cc ('K') | « src/heap/objects-visiting.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 37020da1559b70828dfceedf5eb75cb32391817b..16f5466aef2dc3ee7ec649cb382e84e8462adbee 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2597,8 +2597,8 @@ void Isolate::CheckDetachedContextsAfterGC() {
new_length += 2;
}
}
- PrintF("%d detached contexts are collected out of %d\n", length - new_length,
- length);
+ PrintF("%d detached contexts are collected out of %d\n",
+ (length - new_length) / 2, length / 2);
for (int i = 0; i < new_length; i += 2) {
int mark_sweeps = Smi::cast(detached_contexts->get(i))->value();
WeakCell* cell = WeakCell::cast(detached_contexts->get(i + 1));
@@ -2607,9 +2607,9 @@ void Isolate::CheckDetachedContextsAfterGC() {
static_cast<void*>(cell->value()), mark_sweeps);
}
}
- if (length == new_length) {
+ if (new_length == 0) {
heap()->set_detached_contexts(heap()->empty_fixed_array());
- } else {
+ } else if (new_length < length) {
heap()->RightTrimFixedArray<Heap::FROM_GC>(*detached_contexts,
length - new_length);
}
« src/heap/heap.cc ('K') | « src/heap/objects-visiting.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698