Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Unified Diff: src/handles.h

Issue 10640012: Add a second kind of HandleScope that ties the lifetime of Handles created in its scope to the life… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/handles.h
diff --git a/src/handles.h b/src/handles.h
index 960696b5fb81f705f2128b5586fef44ca0c8e7fb..68889c7633808eadd8ffd1290dfff330757a48d0 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,30 @@ 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 CompilationInfo;
+
+// Like a regular stack-allocated HandleScope, but does not delete the
+// handles allocated in its scope on destruction. Instead, it ties
+// the Handles created in its scope with the CompilatationInfo passed
+// to its constructor. The Handles are reclaimed when the
+// CompilationInfo destructs.
+class GatheringHandleScope {
danno 2012/06/24 11:07:03 Why not just call this CompilationHandleScope?
danno 2012/06/24 11:07:03 This guy should be responsible for creating the "P
+ public:
+ explicit GatheringHandleScope(CompilationInfo* info);
+ ~GatheringHandleScope();
+
+ private:
+ CompilationInfo* info_;
+ Object** prev_next_;
+ Object** prev_limit_;
+};
+
+
// ----------------------------------------------------------------------------
// Handle operations.
// They might invoke garbage collection. The result is an handle to

Powered by Google App Engine
This is Rietveld 408576698