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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 static void InitOnce(); | 202 static void InitOnce(); |
203 | 203 |
204 // Allocates handles for objects in the VM isolate. | 204 // Allocates handles for objects in the VM isolate. |
205 static void InitHandles(); | 205 static void InitHandles(); |
206 | 206 |
207 // Helper function to get the peer value of an external string object. | 207 // Helper function to get the peer value of an external string object. |
208 static bool StringGetPeerHelper(Dart_NativeArguments args, | 208 static bool StringGetPeerHelper(Dart_NativeArguments args, |
209 int arg_index, | 209 int arg_index, |
210 void** peer); | 210 void** peer); |
211 | 211 |
| 212 // Helper function to get the native field from a native receiver argument. |
| 213 static bool GetNativeReceiver(Dart_NativeArguments args, intptr_t* value); |
| 214 |
212 // Helper function to get the boolean value of a Bool native argument. | 215 // Helper function to get the boolean value of a Bool native argument. |
213 static bool GetNativeBooleanArgument(Dart_NativeArguments args, | 216 static bool GetNativeBooleanArgument(Dart_NativeArguments args, |
214 int arg_index, | 217 int arg_index, |
215 bool* value); | 218 bool* value); |
216 | 219 |
217 // Helper function to set the return value of native functions. | 220 // Helper function to set the return value of native functions. |
218 static void SetReturnValue(NativeArguments* args, Dart_Handle retval) { | 221 static void SetReturnValue(NativeArguments* args, Dart_Handle retval) { |
219 args->SetReturnUnsafe(UnwrapHandle(retval)); | 222 args->SetReturnUnsafe(UnwrapHandle(retval)); |
220 } | 223 } |
221 static void SetSmiReturnValue(NativeArguments* args, intptr_t retval) { | 224 static void SetSmiReturnValue(NativeArguments* args, intptr_t retval) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 if (isolate->no_callback_scope_depth() != 0) { \ | 272 if (isolate->no_callback_scope_depth() != 0) { \ |
270 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ | 273 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ |
271 } \ | 274 } \ |
272 | 275 |
273 #define ASSERT_CALLBACK_STATE(isolate) \ | 276 #define ASSERT_CALLBACK_STATE(isolate) \ |
274 ASSERT(isolate->no_callback_scope_depth() == 0) | 277 ASSERT(isolate->no_callback_scope_depth() == 0) |
275 | 278 |
276 } // namespace dart. | 279 } // namespace dart. |
277 | 280 |
278 #endif // VM_DART_API_IMPL_H_ | 281 #endif // VM_DART_API_IMPL_H_ |
OLD | NEW |