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

Unified Diff: sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart

Issue 23593002: Only emit members in mirror helper symbolsmap. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changed comment. Created 7 years, 4 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: sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart b/sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart
index 1316fc4d9fbfc9d0e6ad88effaceef29a5b44e5c..b1f8eafee3cef842c4ccc183e86f5256a6c3895a 100644
--- a/sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart
+++ b/sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart
@@ -47,7 +47,8 @@ class MirrorRenamer {
* code to mangled names appearing in output code, and [topLevelNodes] should
* contain all the toplevel ast nodes that will be emitted in the output.
*/
- void addRenames(Map<Node, String> renames, List<Node> topLevelNodes) {
+ void addRenames(Map<Node, String> renames, List<Node> topLevelNodes,
+ PlaceholderCollector placeholderCollector) {
// Right now we only support instances of MirrorSystem.getName,
// hence if there are no occurence of these we don't do anything.
if (mirrorSystemGetNameNodes.isEmpty) {
@@ -59,13 +60,12 @@ class MirrorRenamer {
return compiler.parser.parseCompilationUnit(tokens);
}
- // Add toplevel map containing all renames.
+ // Add toplevel map containing all renames of members.
symbols = new Map<String, SourceString>();
- for (Node node in renames.keys) {
- Identifier identifier = node.asIdentifier();
- if (identifier != null) {
- symbols.putIfAbsent(renames[node], () => identifier.source);
- }
+ for (Set<Identifier> s in placeholderCollector.memberPlaceholders.values) {
+ // All members in a set have the same name so we only need to look at one.
+ Identifier sampleNode = s.first;
+ symbols.putIfAbsent(renames[sampleNode], () => sampleNode.source);
}
Identifier symbolsMapIdentifier =
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/mirror_renamer/mirror_renamer.dart ('k') | sdk/lib/_internal/lib/mirror_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698