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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 } | 262 } |
263 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { | 263 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { |
264 args->SetReturnUnsafe(Integer::New(retval)); | 264 args->SetReturnUnsafe(Integer::New(retval)); |
265 } | 265 } |
266 static void SetDoubleReturnValue(NativeArguments* args, double retval) { | 266 static void SetDoubleReturnValue(NativeArguments* args, double retval) { |
267 args->SetReturnUnsafe(Double::New(retval)); | 267 args->SetReturnUnsafe(Double::New(retval)); |
268 } | 268 } |
269 static void SetWeakHandleReturnValue(NativeArguments* args, | 269 static void SetWeakHandleReturnValue(NativeArguments* args, |
270 Dart_WeakPersistentHandle retval); | 270 Dart_WeakPersistentHandle retval); |
271 | 271 |
272 static RawString* CallEnvironmentCallback(Isolate* isolate, | 272 static RawString* CallEnvironmentCallback(Thread* thread, |
273 const String& name); | 273 const String& name); |
274 | 274 |
275 private: | 275 private: |
276 static Dart_Handle InitNewHandle(Isolate* isolate, RawObject* raw); | 276 static Dart_Handle InitNewHandle(Isolate* isolate, RawObject* raw); |
277 | 277 |
278 // Thread local key used by the API. Currently holds the current | 278 // Thread local key used by the API. Currently holds the current |
279 // ApiNativeScope if any. | 279 // ApiNativeScope if any. |
280 static ThreadLocalKey api_native_key_; | 280 static ThreadLocalKey api_native_key_; |
281 static Dart_Handle true_handle_; | 281 static Dart_Handle true_handle_; |
282 static Dart_Handle false_handle_; | 282 static Dart_Handle false_handle_; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 return Api::NewError("%s: Cannot load after Dart_Precompile", \ | 322 return Api::NewError("%s: Cannot load after Dart_Precompile", \ |
323 CURRENT_FUNC); \ | 323 CURRENT_FUNC); \ |
324 } \ | 324 } \ |
325 | 325 |
326 #define ASSERT_CALLBACK_STATE(thread) \ | 326 #define ASSERT_CALLBACK_STATE(thread) \ |
327 ASSERT(thread->no_callback_scope_depth() == 0) | 327 ASSERT(thread->no_callback_scope_depth() == 0) |
328 | 328 |
329 } // namespace dart. | 329 } // namespace dart. |
330 | 330 |
331 #endif // VM_DART_API_IMPL_H_ | 331 #endif // VM_DART_API_IMPL_H_ |
OLD | NEW |