Index: src/global-handles.cc |
diff --git a/src/global-handles.cc b/src/global-handles.cc |
index ba19fe1679a2e1e6f8bf21a0e715db4fadf61b19..a5ae2d5626f3701f8c953676ebc2a3e1932736fb 100644 |
--- a/src/global-handles.cc |
+++ b/src/global-handles.cc |
@@ -611,21 +611,21 @@ bool GlobalHandles::IterateObjectGroups(ObjectVisitor* v, |
} |
-bool GlobalHandles::PostGarbageCollectionProcessing( |
+int GlobalHandles::PostGarbageCollectionProcessing( |
GarbageCollector collector, GCTracer* tracer) { |
// Process weak global handle callbacks. This must be done after the |
// GC is completely done, because the callbacks may invoke arbitrary |
// API functions. |
ASSERT(isolate_->heap()->gc_state() == Heap::NOT_IN_GC); |
const int initial_post_gc_processing_count = ++post_gc_processing_count_; |
- bool next_gc_likely_to_collect_more = false; |
+ int freed_nodes = 0; |
if (collector == SCAVENGER) { |
for (int i = 0; i < new_space_nodes_.length(); ++i) { |
Node* node = new_space_nodes_[i]; |
ASSERT(node->is_in_new_space_list()); |
if (!node->IsRetainer()) { |
// Free nodes do not have weak callbacks. Do not use them to compute |
- // the next_gc_likely_to_collect_more. |
+ // the freed_nodes. |
continue; |
} |
// Skip dependent handles. Their weak callbacks might expect to be |
@@ -641,29 +641,29 @@ bool GlobalHandles::PostGarbageCollectionProcessing( |
// PostGarbageCollection processing. The current node might |
// have been deleted in that round, so we need to bail out (or |
// restart the processing). |
- return next_gc_likely_to_collect_more; |
+ return freed_nodes; |
} |
} |
if (!node->IsRetainer()) { |
- next_gc_likely_to_collect_more = true; |
+ freed_nodes++; |
} |
} |
} else { |
for (NodeIterator it(this); !it.done(); it.Advance()) { |
if (!it.node()->IsRetainer()) { |
// Free nodes do not have weak callbacks. Do not use them to compute |
- // the next_gc_likely_to_collect_more. |
+ // the freed_nodes. |
continue; |
} |
it.node()->clear_partially_dependent(); |
if (it.node()->PostGarbageCollectionProcessing(isolate_)) { |
if (initial_post_gc_processing_count != post_gc_processing_count_) { |
// See the comment above. |
- return next_gc_likely_to_collect_more; |
+ return freed_nodes; |
} |
} |
if (!it.node()->IsRetainer()) { |
- next_gc_likely_to_collect_more = true; |
+ freed_nodes++; |
} |
} |
} |
@@ -686,7 +686,7 @@ bool GlobalHandles::PostGarbageCollectionProcessing( |
} |
} |
new_space_nodes_.Rewind(last); |
- return next_gc_likely_to_collect_more; |
+ return freed_nodes; |
} |