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_DART_API_IMPL_H_ | 5 #ifndef VM_DART_API_IMPL_H_ |
6 #define VM_DART_API_IMPL_H_ | 6 #define VM_DART_API_IMPL_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
11 | 11 |
12 class ApiState; | 12 class ApiState; |
13 class LocalHandle; | 13 class LocalHandle; |
14 class Object; | 14 class Object; |
15 class PersistentHandle; | 15 class PersistentHandle; |
16 class RawObject; | 16 class RawObject; |
17 | 17 |
| 18 |
| 19 #define DARTSCOPE(isolate) \ |
| 20 ASSERT(isolate != NULL); \ |
| 21 Zone zone(isolate); \ |
| 22 HANDLESCOPE(isolate); \ |
| 23 |
18 class Api : AllStatic { | 24 class Api : AllStatic { |
19 public: | 25 public: |
20 // Creates a new local handle. | 26 // Creates a new local handle. |
21 static Dart_Handle NewLocalHandle(const Object& object); | 27 static Dart_Handle NewLocalHandle(const Object& object); |
22 | 28 |
23 // Unwraps the raw object from the handle. | 29 // Unwraps the raw object from the handle. |
24 static RawObject* UnwrapHandle(Dart_Handle object); | 30 static RawObject* UnwrapHandle(Dart_Handle object); |
25 | 31 |
26 // Validates and converts the passed in handle as a local handle. | 32 // Validates and converts the passed in handle as a local handle. |
27 static LocalHandle* UnwrapAsLocalHandle(const ApiState& state, | 33 static LocalHandle* UnwrapAsLocalHandle(const ApiState& state, |
(...skipping 24 matching lines...) Expand all Loading... |
52 // Allocates space in the local zone. | 58 // Allocates space in the local zone. |
53 static uword Allocate(intptr_t size); | 59 static uword Allocate(intptr_t size); |
54 | 60 |
55 // Reallocates space in the local zone. | 61 // Reallocates space in the local zone. |
56 static uword Reallocate(uword ptr, intptr_t old_size, intptr_t new_size); | 62 static uword Reallocate(uword ptr, intptr_t old_size, intptr_t new_size); |
57 }; | 63 }; |
58 | 64 |
59 } // namespace dart. | 65 } // namespace dart. |
60 | 66 |
61 #endif // VM_DART_API_IMPL_H_ | 67 #endif // VM_DART_API_IMPL_H_ |
OLD | NEW |