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

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

Issue 379353003: Implement Evaluate without creating new classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | runtime/vm/object.cc » ('J')
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 // VM-specific implementation of the dart:mirrors library. 5 // VM-specific implementation of the dart:mirrors library.
6 6
7 import "dart:collection"; 7 import "dart:collection";
8 8
9 final emptyList = new UnmodifiableListView([]); 9 final emptyList = new UnmodifiableListView([]);
10 final emptyMap = new UnmodifiableMapView({}); 10 final emptyMap = new UnmodifiableMapView({});
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 393 }
394 394
395 InstanceMirror setField(Symbol memberName, arg) { 395 InstanceMirror setField(Symbol memberName, arg) {
396 var unwrapped = _n(memberName); 396 var unwrapped = _n(memberName);
397 var f = _setFieldClosures[unwrapped]; 397 var f = _setFieldClosures[unwrapped];
398 return (f == null) 398 return (f == null)
399 ? _setFieldSlow(unwrapped, arg) 399 ? _setFieldSlow(unwrapped, arg)
400 : reflect(f(_reflectee, arg)); 400 : reflect(f(_reflectee, arg));
401 } 401 }
402 402
403 eval(e) => _eval(e, null);
403 static _eval(expression, privateKey) 404 static _eval(expression, privateKey)
404 native "Mirrors_evalInLibraryWithPrivateKey"; 405 native "Mirrors_evalInLibraryWithPrivateKey";
405 406
406 // Override to include the receiver in the arguments. 407 // Override to include the receiver in the arguments.
407 InstanceMirror invoke(Symbol memberName, 408 InstanceMirror invoke(Symbol memberName,
408 List positionalArguments, 409 List positionalArguments,
409 [Map<Symbol, dynamic> namedArguments]) { 410 [Map<Symbol, dynamic> namedArguments]) {
410 int numPositionalArguments = positionalArguments.length + 1; // Receiver. 411 int numPositionalArguments = positionalArguments.length + 1; // Receiver.
411 int numNamedArguments = namedArguments != null ? namedArguments.length : 0; 412 int numNamedArguments = namedArguments != null ? namedArguments.length : 0;
412 int numArguments = numPositionalArguments + numNamedArguments; 413 int numArguments = numPositionalArguments + numNamedArguments;
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 if (typeMirror == null) { 1588 if (typeMirror == null) {
1588 typeMirror = makeLocalTypeMirror(key); 1589 typeMirror = makeLocalTypeMirror(key);
1589 _instanitationCache[key] = typeMirror; 1590 _instanitationCache[key] = typeMirror;
1590 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { 1591 if (typeMirror is ClassMirror && !typeMirror._isGeneric) {
1591 _declarationCache[key] = typeMirror; 1592 _declarationCache[key] = typeMirror;
1592 } 1593 }
1593 } 1594 }
1594 return typeMirror; 1595 return typeMirror;
1595 } 1596 }
1596 } 1597 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698