| Index: src/global-handles.cc
|
| ===================================================================
|
| --- src/global-handles.cc (revision 5457)
|
| +++ src/global-handles.cc (working copy)
|
| @@ -372,13 +372,14 @@
|
|
|
| int post_gc_processing_count = 0;
|
|
|
| -void GlobalHandles::PostGarbageCollectionProcessing() {
|
| +bool GlobalHandles::PostGarbageCollectionProcessing() {
|
| // Process weak global handle callbacks. This must be done after the
|
| // GC is completely done, because the callbacks may invoke arbitrary
|
| // API functions.
|
| // At the same time deallocate all DESTROYED nodes.
|
| ASSERT(Heap::gc_state() == Heap::NOT_IN_GC);
|
| const int initial_post_gc_processing_count = ++post_gc_processing_count;
|
| + bool weak_callback_invoked = false;
|
| Node** p = &head_;
|
| while (*p != NULL) {
|
| if ((*p)->PostGarbageCollectionProcessing()) {
|
| @@ -389,6 +390,7 @@
|
| // restart the processing).
|
| break;
|
| }
|
| + weak_callback_invoked = true;
|
| }
|
| if ((*p)->state_ == Node::DESTROYED) {
|
| // Delete the link.
|
| @@ -407,6 +409,7 @@
|
| if (first_deallocated()) {
|
| first_deallocated()->set_next(head());
|
| }
|
| + return weak_callback_invoked;
|
| }
|
|
|
|
|
|
|