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

Side by Side Diff: lib/compiler/implementation/universe.dart

Issue 10094013: Reapply "Use default values of named arguments when invoking the default super constructor." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test. Created 8 years, 8 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
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | tests/language/language.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 class Universe { 5 class Universe {
6 Map<Element, String> generatedCode; 6 Map<Element, String> generatedCode;
7 Map<Element, String> generatedBailoutCode; 7 Map<Element, String> generatedBailoutCode;
8 final Set<ClassElement> instantiatedClasses; 8 final Set<ClassElement> instantiatedClasses;
9 final Set<SourceString> instantiatedClassInstanceFields; 9 final Set<SourceString> instantiatedClassInstanceFields;
10 final Set<FunctionElement> staticFunctionsNeedingGetter; 10 final Set<FunctionElement> staticFunctionsNeedingGetter;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 nameSet.remove(name); 112 nameSet.remove(name);
113 } 113 }
114 return true; 114 return true;
115 } 115 }
116 } 116 }
117 117
118 /** 118 /**
119 * Returns [:true:] if the selector and the [element] match; [:false:] 119 * Returns [:true:] if the selector and the [element] match; [:false:]
120 * otherwise. 120 * otherwise.
121 */ 121 */
122 bool addSendArgumentsToList(Send send, 122 bool addArgumentsToList(Link<Node> arguments,
123 List list, 123 List list,
124 FunctionParameters parameters, 124 FunctionParameters parameters,
125 compileArgument(Node argument), 125 compileArgument(Node argument),
126 compileConstant(Element element)) { 126 compileConstant(Element element)) {
127 void addMatchingSendArgumentsToList(Link<Node> link) { 127 void addMatchingArgumentsToList(Link<Node> link) {
128 for (; !link.isEmpty(); link = link.tail) {
129 list.add(compileArgument(link.head));
130 }
131 } 128 }
132 129
133 if (!this.applies(parameters)) return false; 130 if (!this.applies(parameters)) return false;
134 if (this.positionalArgumentCount == parameters.parameterCount) { 131 if (this.positionalArgumentCount == parameters.parameterCount) {
135 addMatchingSendArgumentsToList(send.arguments); 132 for (Link<Node> link = arguments; !link.isEmpty(); link = link.tail) {
133 list.add(compileArgument(link.head));
134 }
136 return true; 135 return true;
137 } 136 }
138 137
139 // If there are named arguments, provide them in the order 138 // If there are named arguments, provide them in the order
140 // expected by the called function, which is the source order. 139 // expected by the called function, which is the source order.
141 140
142 // Visit positional arguments and add them to the list. 141 // Visit positional arguments and add them to the list.
143 Link<Node> arguments = send.arguments;
144 int positionalArgumentCount = this.positionalArgumentCount; 142 int positionalArgumentCount = this.positionalArgumentCount;
145 for (int i = 0; 143 for (int i = 0;
146 i < positionalArgumentCount; 144 i < positionalArgumentCount;
147 arguments = arguments.tail, i++) { 145 arguments = arguments.tail, i++) {
148 list.add(compileArgument(arguments.head)); 146 list.add(compileArgument(arguments.head));
149 } 147 }
150 148
151 // Visit named arguments and add them into a temporary list. 149 // Visit named arguments and add them into a temporary list.
152 List namedArguments = []; 150 List namedArguments = [];
153 for (; !arguments.isEmpty(); arguments = arguments.tail) { 151 for (; !arguments.isEmpty(); arguments = arguments.tail) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 if (!orderedNamedArguments.isEmpty()) return orderedNamedArguments; 223 if (!orderedNamedArguments.isEmpty()) return orderedNamedArguments;
226 224
227 List<SourceString> list = new List<SourceString>.from(namedArguments); 225 List<SourceString> list = new List<SourceString>.from(namedArguments);
228 list.sort((SourceString first, SourceString second) { 226 list.sort((SourceString first, SourceString second) {
229 return first.slowToString().compareTo(second.slowToString()); 227 return first.slowToString().compareTo(second.slowToString());
230 }); 228 });
231 orderedNamedArguments = list; 229 orderedNamedArguments = list;
232 return orderedNamedArguments; 230 return orderedNamedArguments;
233 } 231 }
234 } 232 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698