| 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 3803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3814 ASSERT(isolate->api_state() != NULL && | 3814 ASSERT(isolate->api_state() != NULL && |
| 3815 (isolate->api_state()->IsValidWeakPersistentHandle(rval) || | 3815 (isolate->api_state()->IsValidWeakPersistentHandle(rval) || |
| 3816 isolate->api_state()->IsValidPrologueWeakPersistentHandle(rval))); | 3816 isolate->api_state()->IsValidPrologueWeakPersistentHandle(rval))); |
| 3817 Api::SetWeakHandleReturnValue(arguments, rval); | 3817 Api::SetWeakHandleReturnValue(arguments, rval); |
| 3818 } | 3818 } |
| 3819 | 3819 |
| 3820 | 3820 |
| 3821 DART_EXPORT void Dart_SetBooleanReturnValue(Dart_NativeArguments args, | 3821 DART_EXPORT void Dart_SetBooleanReturnValue(Dart_NativeArguments args, |
| 3822 bool retval) { | 3822 bool retval) { |
| 3823 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 3823 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 3824 arguments->SetReturn(retval ? Bool::True() : Bool::False()); | 3824 arguments->SetReturn(Bool::Get(retval)); |
| 3825 } | 3825 } |
| 3826 | 3826 |
| 3827 | 3827 |
| 3828 DART_EXPORT void Dart_SetIntegerReturnValue(Dart_NativeArguments args, | 3828 DART_EXPORT void Dart_SetIntegerReturnValue(Dart_NativeArguments args, |
| 3829 int64_t retval) { | 3829 int64_t retval) { |
| 3830 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 3830 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 3831 Isolate* isolate = arguments->isolate(); | 3831 Isolate* isolate = arguments->isolate(); |
| 3832 CHECK_ISOLATE(isolate); | 3832 CHECK_ISOLATE(isolate); |
| 3833 if (Smi::IsValid64(retval)) { | 3833 if (Smi::IsValid64(retval)) { |
| 3834 Api::SetSmiReturnValue(arguments, retval); | 3834 Api::SetSmiReturnValue(arguments, retval); |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4321 } | 4321 } |
| 4322 { | 4322 { |
| 4323 NoGCScope no_gc; | 4323 NoGCScope no_gc; |
| 4324 RawObject* raw_obj = obj.raw(); | 4324 RawObject* raw_obj = obj.raw(); |
| 4325 isolate->heap()->SetPeer(raw_obj, peer); | 4325 isolate->heap()->SetPeer(raw_obj, peer); |
| 4326 } | 4326 } |
| 4327 return Api::Success(); | 4327 return Api::Success(); |
| 4328 } | 4328 } |
| 4329 | 4329 |
| 4330 } // namespace dart | 4330 } // namespace dart |
| OLD | NEW |