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); | |
154 | 152 |
155 // Gets the handle used to designate successful return. | 153 // Gets the handle used to designate successful return. |
156 static Dart_Handle Success() { return Api::True(); } | 154 static Dart_Handle Success() { return Api::True(); } |
157 | 155 |
158 // Sets up the acquired error object after initializing an Isolate. This | 156 // Sets up the acquired error object after initializing an Isolate. This |
159 // object is pre-created because we will not be able to allocate this | 157 // object is pre-created because we will not be able to allocate this |
160 // object when the error actually occurs. When the error occurs there will | 158 // object when the error actually occurs. When the error occurs there will |
161 // be outstanding acquires to internal data pointers making it unsafe to | 159 // be outstanding acquires to internal data pointers making it unsafe to |
162 // allocate objects on the dart heap. | 160 // allocate objects on the dart heap. |
163 static void SetupAcquiredError(Isolate* isolate); | 161 static void SetupAcquiredError(Isolate* isolate); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 if (isolate->no_callback_scope_depth() != 0) { \ | 314 if (isolate->no_callback_scope_depth() != 0) { \ |
317 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ | 315 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ |
318 } \ | 316 } \ |
319 | 317 |
320 #define ASSERT_CALLBACK_STATE(isolate) \ | 318 #define ASSERT_CALLBACK_STATE(isolate) \ |
321 ASSERT(isolate->no_callback_scope_depth() == 0) | 319 ASSERT(isolate->no_callback_scope_depth() == 0) |
322 | 320 |
323 } // namespace dart. | 321 } // namespace dart. |
324 | 322 |
325 #endif // VM_DART_API_IMPL_H_ | 323 #endif // VM_DART_API_IMPL_H_ |
OLD | NEW |