| 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 3643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3654 if (Api::StringGetPeerHelper(args, arg_index, peer)) { | 3654 if (Api::StringGetPeerHelper(args, arg_index, peer)) { |
| 3655 return Api::Success(); | 3655 return Api::Success(); |
| 3656 } | 3656 } |
| 3657 *peer = NULL; | 3657 *peer = NULL; |
| 3658 ReusableObjectHandleScope reused_obj_handle(isolate); | 3658 ReusableObjectHandleScope reused_obj_handle(isolate); |
| 3659 Object& obj = reused_obj_handle.Handle(); | 3659 Object& obj = reused_obj_handle.Handle(); |
| 3660 obj = arguments->NativeArgAt(arg_index); | 3660 obj = arguments->NativeArgAt(arg_index); |
| 3661 if (RawObject::IsStringClassId(obj.GetClassId())) { | 3661 if (RawObject::IsStringClassId(obj.GetClassId())) { |
| 3662 return Api::NewHandle(isolate, obj.raw()); | 3662 return Api::NewHandle(isolate, obj.raw()); |
| 3663 } | 3663 } |
| 3664 if (obj.IsNull()) { |
| 3665 return Api::Null(); |
| 3666 } |
| 3664 return Api::NewError("%s expects argument to be of" | 3667 return Api::NewError("%s expects argument to be of" |
| 3665 " type String.", CURRENT_FUNC); | 3668 " type String.", CURRENT_FUNC); |
| 3666 } | 3669 } |
| 3667 | 3670 |
| 3668 | 3671 |
| 3669 DART_EXPORT Dart_Handle Dart_GetNativeIntegerArgument(Dart_NativeArguments args, | 3672 DART_EXPORT Dart_Handle Dart_GetNativeIntegerArgument(Dart_NativeArguments args, |
| 3670 int index, | 3673 int index, |
| 3671 int64_t* value) { | 3674 int64_t* value) { |
| 3672 TRACE_API_CALL(CURRENT_FUNC); | 3675 TRACE_API_CALL(CURRENT_FUNC); |
| 3673 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 3676 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4293 } | 4296 } |
| 4294 { | 4297 { |
| 4295 NoGCScope no_gc; | 4298 NoGCScope no_gc; |
| 4296 RawObject* raw_obj = obj.raw(); | 4299 RawObject* raw_obj = obj.raw(); |
| 4297 isolate->heap()->SetPeer(raw_obj, peer); | 4300 isolate->heap()->SetPeer(raw_obj, peer); |
| 4298 } | 4301 } |
| 4299 return Api::Success(); | 4302 return Api::Success(); |
| 4300 } | 4303 } |
| 4301 | 4304 |
| 4302 } // namespace dart | 4305 } // namespace dart |
| OLD | NEW |