| 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 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/os.h" | 10 #include "vm/os.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // Allocates a handle in 'zone', which must be the current zone. This handle | 276 // Allocates a handle in 'zone', which must be the current zone. This handle |
| 277 // will be destroyed when the current zone is destroyed. | 277 // will be destroyed when the current zone is destroyed. |
| 278 static uword AllocateZoneHandle(Zone* zone); | 278 static uword AllocateZoneHandle(Zone* zone); |
| 279 | 279 |
| 280 // Returns true if specified handle is a zone handle. | 280 // Returns true if specified handle is a zone handle. |
| 281 static bool IsZoneHandle(uword handle); | 281 static bool IsZoneHandle(uword handle); |
| 282 | 282 |
| 283 // Returns number of handles, these functions are used for testing purposes. | 283 // Returns number of handles, these functions are used for testing purposes. |
| 284 static int ScopedHandleCount(); | 284 static int ScopedHandleCount(); |
| 285 static int ZoneHandleCount(); | 285 static int ZoneHandleCount(); |
| 286 |
| 287 friend class ApiZone; |
| 288 friend class ApiNativeScope; |
| 286 }; | 289 }; |
| 287 | 290 |
| 288 | 291 |
| 289 // The class HandleScope is used to start a new handles scope in the code. | 292 // The class HandleScope is used to start a new handles scope in the code. |
| 290 // It is used as follows: | 293 // It is used as follows: |
| 291 // { | 294 // { |
| 292 // HANDLESCOPE(isolate); | 295 // HANDLESCOPE(isolate); |
| 293 // .... | 296 // .... |
| 294 // ..... | 297 // ..... |
| 295 // code that creates some scoped handles. | 298 // code that creates some scoped handles. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 }; | 351 }; |
| 349 #endif // defined(DEBUG) | 352 #endif // defined(DEBUG) |
| 350 | 353 |
| 351 // Macro to start a no handles scope in the code. | 354 // Macro to start a no handles scope in the code. |
| 352 #define NOHANDLESCOPE(isolate) \ | 355 #define NOHANDLESCOPE(isolate) \ |
| 353 dart::NoHandleScope no_vm_internal_handles_scope_(isolate); | 356 dart::NoHandleScope no_vm_internal_handles_scope_(isolate); |
| 354 | 357 |
| 355 } // namespace dart | 358 } // namespace dart |
| 356 | 359 |
| 357 #endif // VM_HANDLES_H_ | 360 #endif // VM_HANDLES_H_ |
| OLD | NEW |