| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // Retrieves the top ApiLocalScope. | 184 // Retrieves the top ApiLocalScope. |
| 185 static ApiLocalScope* TopScope(Isolate* isolate); | 185 static ApiLocalScope* TopScope(Isolate* isolate); |
| 186 | 186 |
| 187 // Performs one-time initialization needed by the API. | 187 // Performs one-time initialization needed by the API. |
| 188 static void InitOnce(); | 188 static void InitOnce(); |
| 189 | 189 |
| 190 // Allocates handles for objects in the VM isolate. | 190 // Allocates handles for objects in the VM isolate. |
| 191 static void InitHandles(); | 191 static void InitHandles(); |
| 192 | 192 |
| 193 // Helper function to get the peer value of an external string object. | 193 // Helper function to get the peer value of an external string object. |
| 194 static bool ExternalStringGetPeerHelper(Dart_NativeArguments args, | 194 static bool StringGetPeerHelper(Dart_NativeArguments args, |
| 195 int arg_index, | 195 int arg_index, |
| 196 void** peer); | 196 void** peer); |
| 197 static bool ExternalStringGetPeerHelper(Dart_Handle object, void** peer); | |
| 198 | 197 |
| 199 // Helper function to set the return value of native functions. | 198 // Helper function to set the return value of native functions. |
| 200 static void SetReturnValue(NativeArguments* args, Dart_Handle retval) { | 199 static void SetReturnValue(NativeArguments* args, Dart_Handle retval) { |
| 201 args->SetReturnUnsafe(UnwrapHandle(retval)); | 200 args->SetReturnUnsafe(UnwrapHandle(retval)); |
| 202 } | 201 } |
| 203 static void SetSmiReturnValue(NativeArguments* args, intptr_t retval) { | 202 static void SetSmiReturnValue(NativeArguments* args, intptr_t retval) { |
| 204 args->SetReturnUnsafe(Smi::New(retval)); | 203 args->SetReturnUnsafe(Smi::New(retval)); |
| 205 } | 204 } |
| 206 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { | 205 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { |
| 207 args->SetReturnUnsafe(Integer::New(retval)); | 206 args->SetReturnUnsafe(Integer::New(retval)); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 if (isolate->no_callback_scope_depth() != 0) { \ | 248 if (isolate->no_callback_scope_depth() != 0) { \ |
| 250 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ | 249 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ |
| 251 } \ | 250 } \ |
| 252 | 251 |
| 253 #define ASSERT_CALLBACK_STATE(isolate) \ | 252 #define ASSERT_CALLBACK_STATE(isolate) \ |
| 254 ASSERT(isolate->no_callback_scope_depth() == 0) | 253 ASSERT(isolate->no_callback_scope_depth() == 0) |
| 255 | 254 |
| 256 } // namespace dart. | 255 } // namespace dart. |
| 257 | 256 |
| 258 #endif // VM_DART_API_IMPL_H_ | 257 #endif // VM_DART_API_IMPL_H_ |
| OLD | NEW |