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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 21281002: Hoist .simpleName and .qualifiedName up to _LocalDeclarationMirrorImpl. (Closed) Base URL: https://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
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors_impl.dart
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index 64426eb3343030389b9c492abcf7b80fbcf2bbed..8e74bbd3fa2837a4fc16a48b5f1bd484d77cd8a8 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -656,14 +656,26 @@ class _LocalFunctionTypeMirrorImpl extends _LocalClassMirrorImpl
abstract class _LocalDeclarationMirrorImpl extends _LocalMirrorImpl
implements DeclarationMirror {
- _LocalDeclarationMirrorImpl(this._reflectee);
- final _MirrorReference _reflectee;
+ _LocalDeclarationMirrorImpl(this._reflectee, this._simpleName);
- List<InstanceMirror> get metadata {
- // Get the metadata objects, convert them into InstanceMirrors using
- // reflect() and then make them into a Dart list.
- return _metadata(_reflectee).map(reflect).toList(growable:false);
+ final _MirrorReference _reflectee;
+
+ final Symbol _simpleName;
+ Symbol get simpleName => _simpleName;
rmacnak 2013/07/30 19:48:37 If the getter just answers the field, we can just
Michael Lippautz (Google) 2013/07/30 19:58:18 Done.
+
+ Symbol _qualifiedName = null;
+ Symbol get qualifiedName {
+ if (_qualifiedName == null) {
+ _qualifiedName = _computeQualifiedName(owner, simpleName);
}
+ return _qualifiedName;
+ }
+
+ List<InstanceMirror> get metadata {
+ // Get the metadata objects, convert them into InstanceMirrors using
+ // reflect() and then make them into a Dart list.
+ return _metadata(_reflectee).map(reflect).toList(growable:false);
+ }
}
class _LazyTypeVariableMirror {
@@ -685,18 +697,7 @@ class _LocalTypeVariableMirrorImpl extends _LocalDeclarationMirrorImpl
String simpleName,
this._owner,
this._upperBound)
- : this.simpleName = _s(simpleName),
- super(reflectee);
-
- final Symbol simpleName;
-
- Symbol _qualifiedName = null;
- Symbol get qualifiedName {
- if (_qualifiedName == null) {
- _qualifiedName = _computeQualifiedName(owner, simpleName);
- }
- return _qualifiedName;
- }
+ : super(reflectee, _s(simpleName));
var _owner;
DeclarationMirror get owner {
@@ -738,10 +739,7 @@ class _LocalTypedefMirrorImpl extends _LocalDeclarationMirrorImpl
String simpleName,
this._owner,
this._referent)
- : this.simpleName = _s(simpleName),
- super(reflectee);
-
- final Symbol simpleName;
+ : super(reflectee, _s(simpleName));
Symbol _qualifiedName = null;
Symbol get qualifiedName {
rmacnak 2013/07/30 19:48:37 Isn't this inherited now?
Michael Lippautz (Google) 2013/07/30 19:58:18 Yep, did miss this one.
@@ -902,6 +900,7 @@ class _LocalLibraryMirrorImpl extends _LocalObjectMirrorImpl
class _LocalMethodMirrorImpl extends _LocalDeclarationMirrorImpl
implements MethodMirror {
_LocalMethodMirrorImpl(reflectee,
+ String simpleName,
this._owner,
this.isStatic,
this.isAbstract,
@@ -911,23 +910,8 @@ class _LocalMethodMirrorImpl extends _LocalDeclarationMirrorImpl
this.isConstConstructor,
this.isGenerativeConstructor,
this.isRedirectingConstructor,
- this.isFactoryConstructor) : super(reflectee);
-
- Symbol _simpleName = null;
- Symbol get simpleName {
- if (_simpleName == null) {
- _simpleName = _s(_MethodMirror_name(_reflectee));
- }
- return _simpleName;
- }
-
- Symbol _qualifiedName = null;
- Symbol get qualifiedName {
- if (_qualifiedName == null) {
- _qualifiedName = _computeQualifiedName(owner, simpleName);
- }
- return _qualifiedName;
- }
+ this.isFactoryConstructor)
+ : super(reflectee, _s(simpleName));
var _owner;
DeclarationMirror get owner {
@@ -1017,9 +1001,6 @@ class _LocalMethodMirrorImpl extends _LocalDeclarationMirrorImpl
String toString() => "MethodMirror on '${_n(simpleName)}'";
- static String _MethodMirror_name(reflectee)
- native "MethodMirror_name";
-
static dynamic _MethodMirror_owner(reflectee)
native "MethodMirror_owner";
@@ -1038,18 +1019,7 @@ class _LocalVariableMirrorImpl extends _LocalDeclarationMirrorImpl
this._type,
this.isStatic,
this.isFinal)
- : this.simpleName = _s(simpleName),
- super(reflectee);
-
- final Symbol simpleName;
-
- Symbol _qualifiedName = null;
- Symbol get qualifiedName {
- if (_qualifiedName == null) {
- _qualifiedName = _computeQualifiedName(owner, simpleName);
- }
- return _qualifiedName;
- }
+ : super(reflectee, _s(simpleName));
var _owner;
DeclarationMirror get owner {
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698