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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 20564002: Make ClassMirror.constructors an internal native and lazy. (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 side-by-side diff with in-line comments
Download patch
Index: runtime/lib/mirrors_impl.dart
===================================================================
--- runtime/lib/mirrors_impl.dart (revision 25508)
+++ runtime/lib/mirrors_impl.dart (working copy)
@@ -401,10 +401,8 @@
this._superclass,
this._superinterfaces,
this._defaultFactory,
- Map<String, Mirror> constructors,
Map<String, Mirror> typeVariables)
: this._simpleName = _s(simpleName),
- this.constructors = _convertStringToSymbolMap(constructors),
this.typeVariables = _convertStringToSymbolMap(typeVariables),
super(reflectee);
@@ -535,7 +533,15 @@
return _variables;
}
- Map<Symbol, MethodMirror> constructors;
+ Map<Symbol, MethodMirror> _constructors;
+
+ Map<Symbol, MethodMirror> get constructors {
+ if (_constructors == null) {
+ _constructors = _makeMemberMap(_computeConstructors(_reflectee));
+ }
+ return _constructors;
+ }
+
Map<Symbol, TypeVariableMirror> typeVariables;
Map<Symbol, TypeMirror> get typeArguments {
@@ -605,6 +611,9 @@
_computeMembers(reflectee)
native "ClassMirror_members";
+
+ _computeConstructors(reflectee)
+ native "ClassMirror_constructors";
_invoke(reflectee, memberName, positionalArguments)
native 'ClassMirror_invoke';
@@ -644,10 +653,10 @@
new _LazyTypeMirror('dart:core', 'Object'),
[ new _LazyTypeMirror('dart:core', 'Function') ],
null,
- const {},
const {});
Map<Symbol, Mirror> get members => new Map<Symbol,Mirror>();
+ Map<Symbol, MethodMirror> get constructors => new Map<Symbol,MethodMirror>();
var _returnType;
TypeMirror get returnType {

Powered by Google App Engine
This is Rietveld 408576698