| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { | 219 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { |
| 220 args->SetReturnUnsafe(Integer::New(retval)); | 220 args->SetReturnUnsafe(Integer::New(retval)); |
| 221 } | 221 } |
| 222 static void SetDoubleReturnValue(NativeArguments* args, double retval) { | 222 static void SetDoubleReturnValue(NativeArguments* args, double retval) { |
| 223 args->SetReturnUnsafe(Double::New(retval)); | 223 args->SetReturnUnsafe(Double::New(retval)); |
| 224 } | 224 } |
| 225 static void SetWeakHandleReturnValue(NativeArguments* args, | 225 static void SetWeakHandleReturnValue(NativeArguments* args, |
| 226 Dart_WeakPersistentHandle retval); | 226 Dart_WeakPersistentHandle retval); |
| 227 | 227 |
| 228 private: | 228 private: |
| 229 static Dart_Handle InitNewHandle(Isolate* isolate, RawObject* raw); |
| 230 |
| 229 // Thread local key used by the API. Currently holds the current | 231 // Thread local key used by the API. Currently holds the current |
| 230 // ApiNativeScope if any. | 232 // ApiNativeScope if any. |
| 231 static ThreadLocalKey api_native_key_; | 233 static ThreadLocalKey api_native_key_; |
| 232 static Dart_Handle true_handle_; | 234 static Dart_Handle true_handle_; |
| 233 static Dart_Handle false_handle_; | 235 static Dart_Handle false_handle_; |
| 234 static Dart_Handle null_handle_; | 236 static Dart_Handle null_handle_; |
| 235 | 237 |
| 236 friend class ApiNativeScope; | 238 friend class ApiNativeScope; |
| 237 }; | 239 }; |
| 238 | 240 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 262 if (isolate->no_callback_scope_depth() != 0) { \ | 264 if (isolate->no_callback_scope_depth() != 0) { \ |
| 263 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ | 265 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ |
| 264 } \ | 266 } \ |
| 265 | 267 |
| 266 #define ASSERT_CALLBACK_STATE(isolate) \ | 268 #define ASSERT_CALLBACK_STATE(isolate) \ |
| 267 ASSERT(isolate->no_callback_scope_depth() == 0) | 269 ASSERT(isolate->no_callback_scope_depth() == 0) |
| 268 | 270 |
| 269 } // namespace dart. | 271 } // namespace dart. |
| 270 | 272 |
| 271 #endif // VM_DART_API_IMPL_H_ | 273 #endif // VM_DART_API_IMPL_H_ |
| OLD | NEW |