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

Side by Side Diff: vm/handles.h

Issue 10008030: Inline the StackResource constructor/destructor. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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
« no previous file with comments | « vm/base_isolate.h ('k') | vm/handles.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #ifndef VM_HANDLES_H_ 5 #ifndef VM_HANDLES_H_
6 #define VM_HANDLES_H_ 6 #define VM_HANDLES_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // It is used as follows: 259 // It is used as follows:
260 // { 260 // {
261 // HANDLESCOPE(isolate); 261 // HANDLESCOPE(isolate);
262 // .... 262 // ....
263 // ..... 263 // .....
264 // code that creates some scoped handles. 264 // code that creates some scoped handles.
265 // .... 265 // ....
266 // } 266 // }
267 class HandleScope : public StackResource { 267 class HandleScope : public StackResource {
268 public: 268 public:
269 explicit HandleScope(Isolate* isolate); 269 explicit HandleScope(BaseIsolate* isolate);
270 ~HandleScope(); 270 ~HandleScope();
271 271
272 private: 272 private:
273 VMHandles::HandlesBlock* saved_handle_block_; // Handle block at prev scope. 273 VMHandles::HandlesBlock* saved_handle_block_; // Handle block at prev scope.
274 uword saved_handle_slot_; // Next available handle slot at previous scope. 274 uword saved_handle_slot_; // Next available handle slot at previous scope.
275 #if defined(DEBUG) 275 #if defined(DEBUG)
276 HandleScope* link_; // Link to previous scope. 276 HandleScope* link_; // Link to previous scope.
277 #endif 277 #endif
278 DISALLOW_IMPLICIT_CONSTRUCTORS(HandleScope); 278 DISALLOW_IMPLICIT_CONSTRUCTORS(HandleScope);
279 }; 279 };
(...skipping 11 matching lines...) Expand all
291 // { 291 // {
292 // NOHANDLESCOPE(isolate); 292 // NOHANDLESCOPE(isolate);
293 // .... 293 // ....
294 // ..... 294 // .....
295 // critical code that manipulates dart objects directly. 295 // critical code that manipulates dart objects directly.
296 // .... 296 // ....
297 // } 297 // }
298 #if defined(DEBUG) 298 #if defined(DEBUG)
299 class NoHandleScope : public StackResource { 299 class NoHandleScope : public StackResource {
300 public: 300 public:
301 explicit NoHandleScope(Isolate* isolate); 301 explicit NoHandleScope(BaseIsolate* isolate);
302 ~NoHandleScope(); 302 ~NoHandleScope();
303 303
304 private: 304 private:
305 DISALLOW_IMPLICIT_CONSTRUCTORS(NoHandleScope); 305 DISALLOW_IMPLICIT_CONSTRUCTORS(NoHandleScope);
306 }; 306 };
307 #else // defined(DEBUG) 307 #else // defined(DEBUG)
308 class NoHandleScope : public ValueObject { 308 class NoHandleScope : public ValueObject {
309 public: 309 public:
310 explicit NoHandleScope(Isolate* isolate) { } 310 explicit NoHandleScope(BaseIsolate* isolate) { }
311 ~NoHandleScope() { } 311 ~NoHandleScope() { }
312 312
313 private: 313 private:
314 DISALLOW_IMPLICIT_CONSTRUCTORS(NoHandleScope); 314 DISALLOW_IMPLICIT_CONSTRUCTORS(NoHandleScope);
315 }; 315 };
316 #endif // defined(DEBUG) 316 #endif // defined(DEBUG)
317 317
318 // Macro to start a no handles scope in the code. 318 // Macro to start a no handles scope in the code.
319 #define NOHANDLESCOPE(isolate) \ 319 #define NOHANDLESCOPE(isolate) \
320 dart::NoHandleScope no_vm_internal_handles_scope_(isolate); 320 dart::NoHandleScope no_vm_internal_handles_scope_(isolate);
321 321
322 } // namespace dart 322 } // namespace dart
323 323
324 #endif // VM_HANDLES_H_ 324 #endif // VM_HANDLES_H_
OLDNEW
« no previous file with comments | « vm/base_isolate.h ('k') | vm/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698