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

Unified Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10991034: Order the parameters of a function at the definition site. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/universe/universe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/codegen.dart
===================================================================
--- lib/compiler/implementation/ssa/codegen.dart (revision 12903)
+++ lib/compiler/implementation/ssa/codegen.dart (working copy)
@@ -158,13 +158,16 @@
}
Map<Element, String> getParameterNames(WorkItem work) {
+ // Make sure the map preserves insertion order, so that fetching
+ // the values will keep the order of parameters.
Map<Element, String> parameterNames = new LinkedHashMap<Element, String>();
FunctionElement function = work.element.implementation;
// The dom/html libraries have inline JS code that reference
// parameter names directly. Long-term such code will be rejected.
// Now, just don't mangle the parameter name.
- function.computeSignature(compiler).forEachParameter((Element element) {
+ FunctionSignature signature = function.computeSignature(compiler);
+ signature.orderedForEachParameter((Element element) {
parameterNames[element] = function.isNative()
? element.name.slowToString()
: JsNames.getValid('${element.name.slowToString()}');
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/universe/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698