OLD | NEW |
---|---|
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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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(BaseIsolate* 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) | |
308 class NoHandleScope : public ValueObject { | |
309 public: | |
310 explicit NoHandleScope(BaseIsolate* isolate) { } | |
311 ~NoHandleScope() { } | |
312 | |
313 private: | |
314 DISALLOW_IMPLICIT_CONSTRUCTORS(NoHandleScope); | |
315 }; | |
316 #endif // defined(DEBUG) | |
317 | 307 |
318 // Macro to start a no handles scope in the code. | 308 // Macro to start a no handles scope in the code. |
319 #define NOHANDLESCOPE(isolate) \ | 309 #define NOHANDLESCOPE(isolate) \ |
320 dart::NoHandleScope no_vm_internal_handles_scope_(isolate); | 310 dart::NoHandleScope no_vm_internal_handles_scope_(isolate); |
311 #else // defined(DEBUG) | |
312 #define NOHANDLESCOPE(isolate) | |
313 #endif // defined(DEBUG) | |
siva
2012/04/12 02:18:13
Does this make a big difference in the numbers?
S
turnidge
2012/04/16 20:07:24
I had seen a difference before but was unable to r
| |
321 | 314 |
322 } // namespace dart | 315 } // namespace dart |
323 | 316 |
324 #endif // VM_HANDLES_H_ | 317 #endif // VM_HANDLES_H_ |
OLD | NEW |