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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 199 } |
200 static void SetSmiReturnValue(NativeArguments* args, intptr_t retval) { | 200 static void SetSmiReturnValue(NativeArguments* args, intptr_t retval) { |
201 args->SetReturnUnsafe(Smi::New(retval)); | 201 args->SetReturnUnsafe(Smi::New(retval)); |
202 } | 202 } |
203 static void SetIntegerReturnValue(NativeArguments* args, intptr_t retval) { | 203 static void SetIntegerReturnValue(NativeArguments* args, intptr_t retval) { |
204 args->SetReturnUnsafe(Integer::New(retval)); | 204 args->SetReturnUnsafe(Integer::New(retval)); |
205 } | 205 } |
206 static void SetDoubleReturnValue(NativeArguments* args, double retval) { | 206 static void SetDoubleReturnValue(NativeArguments* args, double retval) { |
207 args->SetReturnUnsafe(Double::New(retval)); | 207 args->SetReturnUnsafe(Double::New(retval)); |
208 } | 208 } |
| 209 static void SetWeakHandleReturnValue(NativeArguments* args, |
| 210 Dart_WeakPersistentHandle retval); |
209 | 211 |
210 private: | 212 private: |
211 // Thread local key used by the API. Currently holds the current | 213 // Thread local key used by the API. Currently holds the current |
212 // ApiNativeScope if any. | 214 // ApiNativeScope if any. |
213 static ThreadLocalKey api_native_key_; | 215 static ThreadLocalKey api_native_key_; |
214 static Dart_Handle true_handle_; | 216 static Dart_Handle true_handle_; |
215 static Dart_Handle false_handle_; | 217 static Dart_Handle false_handle_; |
216 static Dart_Handle null_handle_; | 218 static Dart_Handle null_handle_; |
217 | 219 |
218 friend class ApiNativeScope; | 220 friend class ApiNativeScope; |
(...skipping 25 matching lines...) Expand all Loading... |
244 if (isolate->no_callback_scope_depth() != 0) { \ | 246 if (isolate->no_callback_scope_depth() != 0) { \ |
245 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ | 247 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ |
246 } \ | 248 } \ |
247 | 249 |
248 #define ASSERT_CALLBACK_STATE(isolate) \ | 250 #define ASSERT_CALLBACK_STATE(isolate) \ |
249 ASSERT(isolate->no_callback_scope_depth() == 0) | 251 ASSERT(isolate->no_callback_scope_depth() == 0) |
250 | 252 |
251 } // namespace dart. | 253 } // namespace dart. |
252 | 254 |
253 #endif // VM_DART_API_IMPL_H_ | 255 #endif // VM_DART_API_IMPL_H_ |
OLD | NEW |