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

Side by Side Diff: runtime/lib/mirrors_impl.dart

Issue 18242003: Add a VM defined class MirrorReference as an opaque pointer for Dart code to VM internal objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months 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
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 // VM-specific implementation of the dart:mirrors library. 5 // VM-specific implementation of the dart:mirrors library.
6 6
7 // These values are allowed to be passed directly over the wire. 7 // These values are allowed to be passed directly over the wire.
8 bool _isSimpleValue(var value) { 8 bool _isSimpleValue(var value) {
9 return (value == null || value is num || value is String || value is bool); 9 return (value == null || value is num || value is String || value is bool);
10 } 10 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 _rootLibrary = _rootLibrary.resolve(mirrors); 149 _rootLibrary = _rootLibrary.resolve(mirrors);
150 } 150 }
151 return _rootLibrary; 151 return _rootLibrary;
152 } 152 }
153 153
154 String toString() => "IsolateMirror on '$debugName'"; 154 String toString() => "IsolateMirror on '$debugName'";
155 } 155 }
156 156
157 // A VMReference is used to hold a reference to a VM-internal object, 157 // A VMReference is used to hold a reference to a VM-internal object,
158 // which can include things like libraries, classes, etc. 158 // which can include things like libraries, classes, etc.
159 class VMReference extends NativeFieldWrapperClass1 { 159 class OldVMReference extends NativeFieldWrapperClass1 {
160 } 160 }
161 161
162 abstract class _LocalVMObjectMirrorImpl extends _LocalMirrorImpl { 162 abstract class _LocalVMObjectMirrorImpl extends _LocalMirrorImpl {
163 _LocalVMObjectMirrorImpl(this._reference) {} 163 _LocalVMObjectMirrorImpl(this._reference) {}
164 164
165 // For now, all VMObjects hold a VMReference. We could consider 165 // For now, all VMObjects hold a VMReference. We could consider
166 // storing the Object reference itself here if the object is a Dart 166 // storing the Object reference itself here if the object is a Dart
167 // language objects (except for objects of type VMReference, of 167 // language objects (except for objects of type VMReference, of
168 // course). 168 // course).
169 VMReference _reference; 169 OldVMReference _reference;
170 } 170 }
171 171
172 abstract class _LocalObjectMirrorImpl extends _LocalVMObjectMirrorImpl 172 abstract class _LocalObjectMirrorImpl extends _LocalVMObjectMirrorImpl
173 implements ObjectMirror { 173 implements ObjectMirror {
174 _LocalObjectMirrorImpl(ref) : super(ref) {} 174 _LocalObjectMirrorImpl(ref) : super(ref) {}
175 175
176 InstanceMirror invoke(Symbol memberName, 176 InstanceMirror invoke(Symbol memberName,
177 List positionalArguments, 177 List positionalArguments,
178 [Map<Symbol, dynamic> namedArguments]) { 178 [Map<Symbol, dynamic> namedArguments]) {
179 if (namedArguments != null) { 179 if (namedArguments != null) {
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 } 1037 }
1038 1038
1039 // Creates a new local ClassMirror. 1039 // Creates a new local ClassMirror.
1040 static ClassMirror makeLocalClassMirror(Type key) 1040 static ClassMirror makeLocalClassMirror(Type key)
1041 native "Mirrors_makeLocalClassMirror"; 1041 native "Mirrors_makeLocalClassMirror";
1042 1042
1043 static ClassMirror reflectClass(Type key) { 1043 static ClassMirror reflectClass(Type key) {
1044 return makeLocalClassMirror(key); 1044 return makeLocalClassMirror(key);
1045 } 1045 }
1046 } 1046 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698