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 #include "vm/native_arguments.h" | 9 #include "vm/native_arguments.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 static const Instance& UnwrapInstanceHandle( | 142 static const Instance& UnwrapInstanceHandle( |
143 const ReusableObjectHandleScope& reused, Dart_Handle object); | 143 const ReusableObjectHandleScope& reused, Dart_Handle object); |
144 | 144 |
145 // Returns an Error handle if isolate is in an inconsistent state | 145 // Returns an Error handle if isolate is in an inconsistent state |
146 // or there was an error while finalizing classes. | 146 // or there was an error while finalizing classes. |
147 // Returns a Success handle when no error condition exists. | 147 // Returns a Success handle when no error condition exists. |
148 static Dart_Handle CheckAndFinalizePendingClasses(Isolate *isolate); | 148 static Dart_Handle CheckAndFinalizePendingClasses(Isolate *isolate); |
149 | 149 |
150 // Casts the internal Isolate* type to the external Dart_Isolate type. | 150 // Casts the internal Isolate* type to the external Dart_Isolate type. |
151 static Dart_Isolate CastIsolate(Isolate* isolate); | 151 static Dart_Isolate CastIsolate(Isolate* isolate); |
| 152 // Casts the external Dart_Isolate type to the internal Isolate* type. |
| 153 static Isolate* CastIsolate(Dart_Isolate); |
152 | 154 |
153 // Gets the handle used to designate successful return. | 155 // Gets the handle used to designate successful return. |
154 static Dart_Handle Success() { return Api::True(); } | 156 static Dart_Handle Success() { return Api::True(); } |
155 | 157 |
156 // Sets up the acquired error object after initializing an Isolate. This | 158 // Sets up the acquired error object after initializing an Isolate. This |
157 // object is pre-created because we will not be able to allocate this | 159 // object is pre-created because we will not be able to allocate this |
158 // object when the error actually occurs. When the error occurs there will | 160 // object when the error actually occurs. When the error occurs there will |
159 // be outstanding acquires to internal data pointers making it unsafe to | 161 // be outstanding acquires to internal data pointers making it unsafe to |
160 // allocate objects on the dart heap. | 162 // allocate objects on the dart heap. |
161 static void SetupAcquiredError(Isolate* isolate); | 163 static void SetupAcquiredError(Isolate* isolate); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 if (isolate->no_callback_scope_depth() != 0) { \ | 316 if (isolate->no_callback_scope_depth() != 0) { \ |
315 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ | 317 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ |
316 } \ | 318 } \ |
317 | 319 |
318 #define ASSERT_CALLBACK_STATE(isolate) \ | 320 #define ASSERT_CALLBACK_STATE(isolate) \ |
319 ASSERT(isolate->no_callback_scope_depth() == 0) | 321 ASSERT(isolate->no_callback_scope_depth() == 0) |
320 | 322 |
321 } // namespace dart. | 323 } // namespace dart. |
322 | 324 |
323 #endif // VM_DART_API_IMPL_H_ | 325 #endif // VM_DART_API_IMPL_H_ |
OLD | NEW |