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

Side by Side Diff: runtime/vm/handles.cc

Issue 16174008: - Create isolate specific resuable handles and use them in the hot lookup paths. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/handles.h" 5 #include "vm/handles.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 115
116 NoHandleScope::NoHandleScope() : StackResource(Isolate::Current()) { 116 NoHandleScope::NoHandleScope() : StackResource(Isolate::Current()) {
117 isolate()->IncrementNoHandleScopeDepth(); 117 isolate()->IncrementNoHandleScopeDepth();
118 } 118 }
119 119
120 120
121 NoHandleScope::~NoHandleScope() { 121 NoHandleScope::~NoHandleScope() {
122 isolate()->DecrementNoHandleScopeDepth(); 122 isolate()->DecrementNoHandleScopeDepth();
123 } 123 }
124
125
126 ReusableHandleScope::ReusableHandleScope(BaseIsolate* isolate)
127 : StackResource(isolate) {
128 ASSERT(!isolate->reusable_handle_scope_active());
129 isolate->set_reusable_handle_scope_active(true);
130 }
131
132
133 ReusableHandleScope::ReusableHandleScope() : StackResource(Isolate::Current()) {
134 ASSERT(!isolate()->reusable_handle_scope_active());
135 isolate()->set_reusable_handle_scope_active(true);
136 }
137
138
139 ReusableHandleScope::~ReusableHandleScope() {
140 ASSERT(isolate()->reusable_handle_scope_active());
141 isolate()->set_reusable_handle_scope_active(false);
142 }
124 #endif // defined(DEBUG) 143 #endif // defined(DEBUG)
125 144
126 } // namespace dart 145 } // namespace dart
OLDNEW
« runtime/vm/handles.h ('K') | « runtime/vm/handles.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698