Version 2.5.5
Added more aggressive GC of external objects in near out-of-memory situations.
Fixed a bug that gave the incorrect result for String.split called on the empty string (issue 924).
git-svn-id: http://v8.googlecode.com/svn/trunk@5780 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/global-handles.cc b/src/global-handles.cc
index 9ede908..5339840 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -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 next_gc_likely_to_collect_more = false;
Node** p = &head_;
while (*p != NULL) {
if ((*p)->PostGarbageCollectionProcessing()) {
@@ -399,6 +400,7 @@
}
node->set_next_free(first_deallocated());
set_first_deallocated(node);
+ next_gc_likely_to_collect_more = true;
} else {
p = (*p)->next_addr();
}
@@ -407,6 +409,8 @@
if (first_deallocated()) {
first_deallocated()->set_next(head());
}
+
+ return next_gc_likely_to_collect_more;
}