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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 16757007: Changes to mirrors in support of metadata access at runtime. Assumes VM changes in flight.… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 23928)
+++ runtime/lib/mirrors_impl.dart (working copy)
@@ -70,6 +70,10 @@
return result;
}
+List<InstanceMirror> _metadata(mirror)
+ native 'Mirrors_metadata';
+
+
class _LocalMirrorSystemImpl extends MirrorSystem {
// Change parameter back to "this.libraries" when native code is changed.
_LocalMirrorSystemImpl(Map<String, LibraryMirror> libraries, this.isolate)
@@ -163,6 +167,7 @@
// language objects (except for objects of type VMReference, of
// course).
VMReference _reference;
+
Ivan Posva 2013/06/14 15:16:48 Extra line?
gbracha 2013/06/14 20:42:46 Done.
}
abstract class _LocalObjectMirrorImpl extends _LocalVMObjectMirrorImpl
@@ -602,6 +607,8 @@
}
}
+ List<InstanceMirror> get metadata => _metadata(this).map(reflect).toList();
Ivan Posva 2013/06/14 15:16:48 You might want to explain what you are using refle
gbracha 2013/06/14 20:42:46 Done.
+
static _invokeConstructor(ref, constructorName, positionalArguments, async)
native 'LocalClassMirrorImpl_invokeConstructor';
}
@@ -704,6 +711,8 @@
return _upperBound;
}
+ List<InstanceMirror> get metadata => _metadata(this).map(reflect).toList();
+
String toString() => "TypeVariableMirror on '$simpleName'";
}
@@ -843,6 +852,9 @@
return _variables;
}
+
+ List<InstanceMirror> get metadata => _metadata(this).map(reflect).toList();
+
String toString() => "LibraryMirror on '$simpleName'";
}
@@ -943,6 +955,11 @@
final bool isRedirectingConstructor;
final bool isFactoryConstructor;
+ List<InstanceMirror> get metadata {
+ owner; // ensure owner is computed
+ return _metadata(this).map(reflect).toList();
+ }
+
String toString() => "MethodMirror on '$simpleName'";
}
@@ -997,6 +1014,11 @@
final bool isStatic;
final bool isFinal;
+ List<InstanceMirror> get metadata {
+ owner; // ensure owner is computed
+ return _metadata(this).map(reflect).toList();
+ }
+
String toString() => "VariableMirror on '$simpleName'";
}

Powered by Google App Engine
This is Rietveld 408576698