Reviewers: Michael Starzinger,

Description:
wrap gc callbacks in handlescopes

[email protected]
BUG=

Please review this at https://chromiumcodereview.appspot.com/19845007/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/global-handles.cc
  M src/heap.cc


Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index 5c65635d0f9f3c31f747656dee7ef4ac9bcbf20e..88ebe31647dc954fa21f0f5deca99dbf2ccc819b 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -262,6 +262,7 @@ class GlobalHandles::Node {
              ExternalTwoByteString::cast(object_)->resource() != NULL);
       // Leaving V8.
       VMState<EXTERNAL> state(isolate);
+      HandleScope handle_scope(isolate);
       weak_reference_callback_(reinterpret_cast<v8::Isolate*>(isolate),
reinterpret_cast<Persistent<Value>*>(&object),
                                par);
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 4a7e8f2a9af7372f229bb4828387415d5a12fe08..04aa98b2de6dfe59b3e3bc3404e674e5808d2f67 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -920,6 +920,7 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector,
   {
     GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
     VMState<EXTERNAL> state(isolate_);
+    HandleScope handle_scope(isolate_);
     CallGCPrologueCallbacks(gc_type, kNoGCCallbackFlags);
   }

@@ -1025,6 +1026,7 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector,
   {
     GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
     VMState<EXTERNAL> state(isolate_);
+    HandleScope handle_scope(isolate_);
     CallGCEpilogueCallbacks(gc_type);
   }



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to