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

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

Issue 10101001: Revert "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: 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 addArgumentsToList(Link<Node> arguments, 122 bool addSendArgumentsToList(Send send,
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 addMatchingArgumentsToList(Link<Node> link) { 127 void addMatchingSendArgumentsToList(Link<Node> link) {
128 for (; !link.isEmpty(); link = link.tail) {
129 list.add(compileArgument(link.head));
130 }
128 } 131 }
129 132
130 if (!this.applies(parameters)) return false; 133 if (!this.applies(parameters)) return false;
131 if (this.positionalArgumentCount == parameters.parameterCount) { 134 if (this.positionalArgumentCount == parameters.parameterCount) {
132 for (Link<Node> link = arguments; !link.isEmpty(); link = link.tail) { 135 addMatchingSendArgumentsToList(send.arguments);
133 list.add(compileArgument(link.head));
134 }
135 return true; 136 return true;
136 } 137 }
137 138
138 // If there are named arguments, provide them in the order 139 // If there are named arguments, provide them in the order
139 // expected by the called function, which is the source order. 140 // expected by the called function, which is the source order.
140 141
141 // Visit positional arguments and add them to the list. 142 // Visit positional arguments and add them to the list.
143 Link<Node> arguments = send.arguments;
142 int positionalArgumentCount = this.positionalArgumentCount; 144 int positionalArgumentCount = this.positionalArgumentCount;
143 for (int i = 0; 145 for (int i = 0;
144 i < positionalArgumentCount; 146 i < positionalArgumentCount;
145 arguments = arguments.tail, i++) { 147 arguments = arguments.tail, i++) {
146 list.add(compileArgument(arguments.head)); 148 list.add(compileArgument(arguments.head));
147 } 149 }
148 150
149 // Visit named arguments and add them into a temporary list. 151 // Visit named arguments and add them into a temporary list.
150 List namedArguments = []; 152 List namedArguments = [];
151 for (; !arguments.isEmpty(); arguments = arguments.tail) { 153 for (; !arguments.isEmpty(); arguments = arguments.tail) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if (!orderedNamedArguments.isEmpty()) return orderedNamedArguments; 225 if (!orderedNamedArguments.isEmpty()) return orderedNamedArguments;
224 226
225 List<SourceString> list = new List<SourceString>.from(namedArguments); 227 List<SourceString> list = new List<SourceString>.from(namedArguments);
226 list.sort((SourceString first, SourceString second) { 228 list.sort((SourceString first, SourceString second) {
227 return first.slowToString().compareTo(second.slowToString()); 229 return first.slowToString().compareTo(second.slowToString());
228 }); 230 });
229 orderedNamedArguments = list; 231 orderedNamedArguments = list;
230 return orderedNamedArguments; 232 return orderedNamedArguments;
231 } 233 }
232 } 234 }
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