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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 359413006: Fix handling of type literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. 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
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 part of dart_backend; 5 part of dart_backend;
6 6
7 class LocalPlaceholder { 7 class LocalPlaceholder {
8 final String identifier; 8 final String identifier;
9 final Set<Node> nodes; 9 final Set<Node> nodes;
10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>();
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 assert(elements[node.receiver].isPrefix); 134 assert(elements[node.receiver].isPrefix);
135 // Hack: putting null into map overrides receiver of original node. 135 // Hack: putting null into map overrides receiver of original node.
136 collector.makeNullPlaceholder(node.receiver); 136 collector.makeNullPlaceholder(node.receiver);
137 } 137 }
138 } 138 }
139 139
140 internalError(String reason, {Node node}) { 140 internalError(String reason, {Node node}) {
141 collector.internalError(reason, node: node); 141 collector.internalError(reason, node: node);
142 } 142 }
143 143
144 visitTypeReferenceSend(Send node) { 144 visitTypePrefixSend(Send node) {
145 collector.makeElementPlaceholder(node.selector, elements[node]); 145 collector.makeElementPlaceholder(node.selector, elements[node]);
146 } 146 }
147
148 visitTypeLiteralSend(Send node) {
149 DartType type = elements.getTypeLiteralType(node);
150 if (!type.isDynamic) {
151 collector.makeElementPlaceholder(node.selector, type.element);
152 }
153 }
147 } 154 }
148 155
149 class PlaceholderCollector extends Visitor { 156 class PlaceholderCollector extends Visitor {
150 final Compiler compiler; 157 final Compiler compiler;
151 final Set<String> fixedMemberNames; // member names which cannot be renamed. 158 final Set<String> fixedMemberNames; // member names which cannot be renamed.
152 final Map<Element, ElementAst> elementAsts; 159 final Map<Element, ElementAst> elementAsts;
153 final Set<Node> nullNodes; // Nodes that should not be in output. 160 final Set<Node> nullNodes; // Nodes that should not be in output.
154 final Set<Node> unresolvedNodes; 161 final Set<Node> unresolvedNodes;
155 final Map<Element, Set<Node>> elementNodes; 162 final Map<Element, Set<Node>> elementNodes;
156 final Map<FunctionElement, FunctionScope> functionScopes; 163 final Map<FunctionElement, FunctionScope> functionScopes;
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 600
594 visitBlock(Block node) { 601 visitBlock(Block node) {
595 for (Node statement in node.statements.nodes) { 602 for (Node statement in node.statements.nodes) {
596 if (statement is VariableDefinitions) { 603 if (statement is VariableDefinitions) {
597 makeVarDeclarationTypePlaceholder(statement); 604 makeVarDeclarationTypePlaceholder(statement);
598 } 605 }
599 } 606 }
600 node.visitChildren(this); 607 node.visitChildren(this);
601 } 608 }
602 } 609 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698