Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 11312183: - Do not mix scalar values and object fields in RawInstance to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698