| 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 3595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3606 } | 3606 } |
| 3607 | 3607 |
| 3608 | 3608 |
| 3609 DART_EXPORT Dart_Handle Dart_GetNativeReceiver(Dart_NativeArguments args, | 3609 DART_EXPORT Dart_Handle Dart_GetNativeReceiver(Dart_NativeArguments args, |
| 3610 intptr_t* value) { | 3610 intptr_t* value) { |
| 3611 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 3611 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 3612 Isolate* isolate = arguments->isolate(); | 3612 Isolate* isolate = arguments->isolate(); |
| 3613 CHECK_ISOLATE(isolate); | 3613 CHECK_ISOLATE(isolate); |
| 3614 ReusableObjectHandleScope reused_obj_handle(isolate); | 3614 ReusableObjectHandleScope reused_obj_handle(isolate); |
| 3615 Object& obj = reused_obj_handle.Handle(); | 3615 Object& obj = reused_obj_handle.Handle(); |
| 3616 obj = arguments->NativeArgAt(0); | 3616 obj = arguments->NativeReceiver(); |
| 3617 intptr_t cid = obj.GetClassId(); | 3617 intptr_t cid = obj.GetClassId(); |
| 3618 if (cid <= kNumPredefinedCids) { | 3618 if (cid <= kNumPredefinedCids) { |
| 3619 if (cid == kNullCid) { | 3619 if (cid == kNullCid) { |
| 3620 return Api::NewError("%s expects receiver argument to be non-null.", | 3620 return Api::NewError("%s expects receiver argument to be non-null.", |
| 3621 CURRENT_FUNC); | 3621 CURRENT_FUNC); |
| 3622 } | 3622 } |
| 3623 return Api::NewError("%s expects receiver argument to be of" | 3623 return Api::NewError("%s expects receiver argument to be of" |
| 3624 " type Instance.", CURRENT_FUNC); | 3624 " type Instance.", CURRENT_FUNC); |
| 3625 } | 3625 } |
| 3626 const Instance& instance = Instance::Cast(obj); | 3626 const Instance& instance = Instance::Cast(obj); |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4284 } | 4284 } |
| 4285 { | 4285 { |
| 4286 NoGCScope no_gc; | 4286 NoGCScope no_gc; |
| 4287 RawObject* raw_obj = obj.raw(); | 4287 RawObject* raw_obj = obj.raw(); |
| 4288 isolate->heap()->SetPeer(raw_obj, peer); | 4288 isolate->heap()->SetPeer(raw_obj, peer); |
| 4289 } | 4289 } |
| 4290 return Api::Success(); | 4290 return Api::Success(); |
| 4291 } | 4291 } |
| 4292 | 4292 |
| 4293 } // namespace dart | 4293 } // namespace dart |
| OLD | NEW |