| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 3838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3849 | 3849 |
| 3850 | 3850 |
| 3851 DART_EXPORT void Dart_SetBooleanReturnValue(Dart_NativeArguments args, | 3851 DART_EXPORT void Dart_SetBooleanReturnValue(Dart_NativeArguments args, |
| 3852 bool retval) { | 3852 bool retval) { |
| 3853 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 3853 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 3854 arguments->SetReturn(retval ? Bool::True() : Bool::False()); | 3854 arguments->SetReturn(retval ? Bool::True() : Bool::False()); |
| 3855 } | 3855 } |
| 3856 | 3856 |
| 3857 | 3857 |
| 3858 DART_EXPORT void Dart_SetIntegerReturnValue(Dart_NativeArguments args, | 3858 DART_EXPORT void Dart_SetIntegerReturnValue(Dart_NativeArguments args, |
| 3859 intptr_t retval) { | 3859 int64_t retval) { |
| 3860 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 3860 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 3861 Isolate* isolate = arguments->isolate(); | 3861 Isolate* isolate = arguments->isolate(); |
| 3862 CHECK_ISOLATE(isolate); | 3862 CHECK_ISOLATE(isolate); |
| 3863 if (Smi::IsValid64(retval)) { | 3863 if (Smi::IsValid64(retval)) { |
| 3864 Api::SetSmiReturnValue(arguments, retval); | 3864 Api::SetSmiReturnValue(arguments, retval); |
| 3865 } else { | 3865 } else { |
| 3866 // Slow path for Mints and Bigints. | 3866 // Slow path for Mints and Bigints. |
| 3867 ASSERT_CALLBACK_STATE(isolate); | 3867 ASSERT_CALLBACK_STATE(isolate); |
| 3868 Api::SetIntegerReturnValue(arguments, retval); | 3868 Api::SetIntegerReturnValue(arguments, retval); |
| 3869 } | 3869 } |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4351 } | 4351 } |
| 4352 { | 4352 { |
| 4353 NoGCScope no_gc; | 4353 NoGCScope no_gc; |
| 4354 RawObject* raw_obj = obj.raw(); | 4354 RawObject* raw_obj = obj.raw(); |
| 4355 isolate->heap()->SetPeer(raw_obj, peer); | 4355 isolate->heap()->SetPeer(raw_obj, peer); |
| 4356 } | 4356 } |
| 4357 return Api::Success(); | 4357 return Api::Success(); |
| 4358 } | 4358 } |
| 4359 | 4359 |
| 4360 } // namespace dart | 4360 } // namespace dart |
| OLD | NEW |