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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 void** peer); | 217 void** peer); |
218 | 218 |
219 // Helper function to get the native field from a native receiver argument. | 219 // Helper function to get the native field from a native receiver argument. |
220 static bool GetNativeReceiver(NativeArguments* args, intptr_t* value); | 220 static bool GetNativeReceiver(NativeArguments* args, intptr_t* value); |
221 | 221 |
222 // Helper function to get the boolean value of a Bool native argument. | 222 // Helper function to get the boolean value of a Bool native argument. |
223 static bool GetNativeBooleanArgument(NativeArguments* args, | 223 static bool GetNativeBooleanArgument(NativeArguments* args, |
224 int arg_index, | 224 int arg_index, |
225 bool* value); | 225 bool* value); |
226 | 226 |
| 227 // Helper function to get the integer value of a Integer native argument. |
| 228 static bool GetNativeIntegerArgument(NativeArguments* args, |
| 229 int arg_index, |
| 230 int64_t* value); |
| 231 |
| 232 // Helper function to get the double value of a Double native argument. |
| 233 static bool GetNativeDoubleArgument(NativeArguments* args, |
| 234 int arg_index, |
| 235 double* value); |
| 236 |
| 237 // Helper function to get the native fields of an Instance native argument. |
| 238 static bool GetNativeFieldsOfArgument(NativeArguments* args, |
| 239 int arg_index, |
| 240 int num_fields, |
| 241 intptr_t* field_values); |
| 242 |
227 // Helper function to set the return value of native functions. | 243 // Helper function to set the return value of native functions. |
228 static void SetReturnValue(NativeArguments* args, Dart_Handle retval) { | 244 static void SetReturnValue(NativeArguments* args, Dart_Handle retval) { |
229 args->SetReturnUnsafe(UnwrapHandle(retval)); | 245 args->SetReturnUnsafe(UnwrapHandle(retval)); |
230 } | 246 } |
231 static void SetSmiReturnValue(NativeArguments* args, intptr_t retval) { | 247 static void SetSmiReturnValue(NativeArguments* args, intptr_t retval) { |
232 args->SetReturnUnsafe(Smi::New(retval)); | 248 args->SetReturnUnsafe(Smi::New(retval)); |
233 } | 249 } |
234 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { | 250 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { |
235 args->SetReturnUnsafe(Integer::New(retval)); | 251 args->SetReturnUnsafe(Integer::New(retval)); |
236 } | 252 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 if (isolate->no_callback_scope_depth() != 0) { \ | 295 if (isolate->no_callback_scope_depth() != 0) { \ |
280 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ | 296 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ |
281 } \ | 297 } \ |
282 | 298 |
283 #define ASSERT_CALLBACK_STATE(isolate) \ | 299 #define ASSERT_CALLBACK_STATE(isolate) \ |
284 ASSERT(isolate->no_callback_scope_depth() == 0) | 300 ASSERT(isolate->no_callback_scope_depth() == 0) |
285 | 301 |
286 } // namespace dart. | 302 } // namespace dart. |
287 | 303 |
288 #endif // VM_DART_API_IMPL_H_ | 304 #endif // VM_DART_API_IMPL_H_ |
OLD | NEW |