summaryrefslogtreecommitdiff
path: root/deps/v8/src/global-handles.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2009-11-18 15:25:58 +0100
committerRyan Dahl <ry@tinyclouds.org>2009-11-18 15:28:54 +0100
commit728d8a37f471afaeaa6af19823f9da8c41f1f65a (patch)
tree21e014089ff0bfb7d493691620ab9eee51176d28 /deps/v8/src/global-handles.cc
parent8195e0f7232fed3d6a3a2cc8464fec5e36f4433c (diff)
downloadnode-new-728d8a37f471afaeaa6af19823f9da8c41f1f65a.tar.gz
Upgrade v8 to 2.0
(With just one change: remove -Werror)
Diffstat (limited to 'deps/v8/src/global-handles.cc')
-rw-r--r--deps/v8/src/global-handles.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/deps/v8/src/global-handles.cc b/deps/v8/src/global-handles.cc
index c6cc288e6a..e519d7077f 100644
--- a/deps/v8/src/global-handles.cc
+++ b/deps/v8/src/global-handles.cc
@@ -165,6 +165,9 @@ class GlobalHandles::Node : public Malloced {
// It's fine though to reuse nodes that were destroyed in weak callback
// as those cannot be deallocated until we are back from the callback.
set_first_free(NULL);
+ if (first_deallocated()) {
+ first_deallocated()->set_next(head());
+ }
// Leaving V8.
VMState state(EXTERNAL);
func(object, par);
@@ -270,6 +273,7 @@ Handle<Object> GlobalHandles::Create(Object* value) {
// Next try deallocated list
result = first_deallocated();
set_first_deallocated(result->next_free());
+ ASSERT(result->next() == head());
set_head(result);
} else {
// Allocate a new node.
@@ -390,8 +394,8 @@ void GlobalHandles::PostGarbageCollectionProcessing() {
}
-void GlobalHandles::IterateRoots(ObjectVisitor* v) {
- // Traversal of global handles marked as NORMAL or NEAR_DEATH.
+void GlobalHandles::IterateStrongRoots(ObjectVisitor* v) {
+ // Traversal of global handles marked as NORMAL.
for (Node* current = head_; current != NULL; current = current->next()) {
if (current->state_ == Node::NORMAL) {
v->VisitPointer(&current->object_);
@@ -399,6 +403,16 @@ void GlobalHandles::IterateRoots(ObjectVisitor* v) {
}
}
+
+void GlobalHandles::IterateAllRoots(ObjectVisitor* v) {
+ for (Node* current = head_; current != NULL; current = current->next()) {
+ if (current->state_ != Node::DESTROYED) {
+ v->VisitPointer(&current->object_);
+ }
+ }
+}
+
+
void GlobalHandles::TearDown() {
// Reset all the lists.
set_head(NULL);