Index: src/handles.h |
diff --git a/src/handles.h b/src/handles.h |
index 960696b5fb81f705f2128b5586fef44ca0c8e7fb..aca869026e6ff5b651efd61f0aaeb1441714ad6a 100644 |
--- a/src/handles.h |
+++ b/src/handles.h |
@@ -95,6 +95,9 @@ class Handle { |
}; |
+class HandleScopeImplementer; |
+ |
+ |
// A stack-allocated class that governs a number of local handles. |
// After a handle scope has been created, all local handles will be |
// allocated within that handle scope until either the handle scope is |
@@ -157,10 +160,37 @@ class HandleScope { |
static void ZapRange(internal::Object** start, internal::Object** end); |
friend class v8::HandleScope; |
+ friend class v8::internal::HandleScopeImplementer; |
friend class v8::ImplementationUtilities; |
}; |
+class DeferredHandles; |
+ |
+ |
+class DeferredHandleScope { |
+ public: |
+ explicit DeferredHandleScope(Isolate* isolate); |
+ // The DeferredHandles object returned stores the Handles created |
+ // since the creation of this DeferredHandleScope. The Handles are |
+ // alive as long as the DeferredHandles object is alive. |
+ DeferredHandles* Detach(); |
+ ~DeferredHandleScope(); |
+ |
+ private: |
+ Object** prev_limit_; |
+ Object** prev_next_; |
+ HandleScopeImplementer* impl_; |
+ |
+#ifdef DEBUG |
+ bool handles_detached_; |
+ int prev_level_; |
+#endif |
+ |
+ friend class HandleScopeImplementer; |
+}; |
+ |
+ |
// ---------------------------------------------------------------------------- |
// Handle operations. |
// They might invoke garbage collection. The result is an handle to |