| 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);
|
| }
|
|
|