| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 3814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3825 DARTSCOPE(isolate); | 3825 DARTSCOPE(isolate); |
| 3826 const Instance& instance = Api::UnwrapInstanceHandle(isolate, obj); | 3826 const Instance& instance = Api::UnwrapInstanceHandle(isolate, obj); |
| 3827 if (instance.IsNull()) { | 3827 if (instance.IsNull()) { |
| 3828 RETURN_TYPE_ERROR(isolate, obj, Instance); | 3828 RETURN_TYPE_ERROR(isolate, obj, Instance); |
| 3829 } | 3829 } |
| 3830 if (!instance.IsValidNativeIndex(index)) { | 3830 if (!instance.IsValidNativeIndex(index)) { |
| 3831 return Api::NewError( | 3831 return Api::NewError( |
| 3832 "%s: invalid index %d passed in to access native instance field", | 3832 "%s: invalid index %d passed in to access native instance field", |
| 3833 CURRENT_FUNC, index); | 3833 CURRENT_FUNC, index); |
| 3834 } | 3834 } |
| 3835 *value = instance.GetNativeField(index); | 3835 *value = instance.GetNativeField(isolate, index); |
| 3836 return Api::Success(isolate); | 3836 return Api::Success(isolate); |
| 3837 } | 3837 } |
| 3838 | 3838 |
| 3839 | 3839 |
| 3840 DART_EXPORT Dart_Handle Dart_SetNativeInstanceField(Dart_Handle obj, | 3840 DART_EXPORT Dart_Handle Dart_SetNativeInstanceField(Dart_Handle obj, |
| 3841 int index, | 3841 int index, |
| 3842 intptr_t value) { | 3842 intptr_t value) { |
| 3843 Isolate* isolate = Isolate::Current(); | 3843 Isolate* isolate = Isolate::Current(); |
| 3844 DARTSCOPE(isolate); | 3844 DARTSCOPE(isolate); |
| 3845 const Instance& instance = Api::UnwrapInstanceHandle(isolate, obj); | 3845 const Instance& instance = Api::UnwrapInstanceHandle(isolate, obj); |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4463 } | 4463 } |
| 4464 { | 4464 { |
| 4465 NoGCScope no_gc; | 4465 NoGCScope no_gc; |
| 4466 RawObject* raw_obj = obj.raw(); | 4466 RawObject* raw_obj = obj.raw(); |
| 4467 isolate->heap()->SetPeer(raw_obj, peer); | 4467 isolate->heap()->SetPeer(raw_obj, peer); |
| 4468 } | 4468 } |
| 4469 return Api::Success(isolate); | 4469 return Api::Success(isolate); |
| 4470 } | 4470 } |
| 4471 | 4471 |
| 4472 } // namespace dart | 4472 } // namespace dart |
| OLD | NEW |