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

Unified Diff: runtime/vm/handles_impl.h

Issue 19974002: Reuse the top ApiLocalScope so that we do not allocate and free an ApiLocalScope (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « runtime/vm/handles.h ('k') | runtime/vm/zone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/handles_impl.h
===================================================================
--- runtime/vm/handles_impl.h (revision 25286)
+++ runtime/vm/handles_impl.h (working copy)
@@ -66,6 +66,25 @@
}
+template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
+void Handles<kHandleSizeInWords,
+ kHandlesPerChunk,
+ kOffsetOfRawPtr>::Reset() {
+ // Delete all the extra zone handle blocks allocated and reinit the first
+ // zone block.
+ if (zone_blocks_ != NULL) {
+ DeleteHandleBlocks(zone_blocks_->next_block());
+ zone_blocks_->ReInit();
+ }
+
+ // Delete all the extra scoped handle blocks allocated and reinit the first
+ // scoped block.
+ DeleteHandleBlocks(first_scoped_block_.next_block());
+ first_scoped_block_.ReInit();
+ scoped_blocks_ = &first_scoped_block_;
+}
+
+
// Figure out the current handle scope using the current Isolate and
// allocate a handle in that scope. The function assumes that a
// current Isolate, current zone and current handle scope exist. It
« no previous file with comments | « runtime/vm/handles.h ('k') | runtime/vm/zone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698