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

Unified Diff: pkg/compiler/lib/src/universe/universe.dart

Issue 761983002: Support for map literals in cps js emitter (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 6 years, 1 month 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: pkg/compiler/lib/src/universe/universe.dart
diff --git a/pkg/compiler/lib/src/universe/universe.dart b/pkg/compiler/lib/src/universe/universe.dart
index b71d020be5c2b166d4f7b235845d9562b8b6e3dd..c3249d1d925a8421e7249382e43c3a17e9d1cbb0 100644
--- a/pkg/compiler/lib/src/universe/universe.dart
+++ b/pkg/compiler/lib/src/universe/universe.dart
@@ -497,45 +497,37 @@ class Selector {
/**
* Returns a `List` with the evaluated arguments in the normalized order.
*
- * [compileArgument] is a function that returns a compiled version
- * of an argument located in [arguments].
- *
* [compileDefaultValue] is a function that returns a compiled constant
- * of an optional argument that is not in [arguments].
+ * of an optional argument that is not in [compiledArguments].
*
* Precondition: `this.applies(element, world)`.
*
* Invariant: [element] must be the implementation element.
*/
/*<S, T>*/ List/*<T>*/ makeArgumentsList(
- List/*<S>*/ arguments,
FunctionElement element,
- /*T*/ compileArgument(/*S*/ argument),
+ List/*<T>*/ compiledArguments,
/*T*/ compileDefaultValue(ParameterElement element)) {
assert(invariant(element, element.isImplementation));
List/*<T>*/ result = new List();
FunctionSignature parameters = element.functionSignature;
int i = 0;
parameters.forEachRequiredParameter((ParameterElement element) {
- result.add(compileArgument(arguments[i]));
+ result.add(compiledArguments[i]);
++i;
});
if (!parameters.optionalParametersAreNamed) {
parameters.forEachOptionalParameter((ParameterElement element) {
- if (i < arguments.length) {
- result.add(compileArgument(arguments[i]));
+ if (i < compiledArguments.length) {
+ result.add(compiledArguments[i]);
++i;
} else {
result.add(compileDefaultValue(element));
}
});
} else {
- // Visit named arguments and add them into a temporary list.
- List compiledNamedArguments = [];
- for (; i < arguments.length; ++i) {
- compiledNamedArguments.add(compileArgument(arguments[i]));
- }
+ int offset = i;
// Iterate over the optional parameters of the signature, and try to
// find them in [compiledNamedArguments]. If found, we use the
// value in the temporary list, otherwise the default value.
@@ -543,7 +535,7 @@ class Selector {
.forEach((ParameterElement element) {
int foundIndex = namedArguments.indexOf(element.name);
if (foundIndex != -1) {
- result.add(compiledNamedArguments[foundIndex]);
+ result.add(compiledArguments[offset + foundIndex]);
} else {
result.add(compileDefaultValue(element));
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/glue.dart ('k') | tests/compiler/dart2js/js_backend_cps_ir_literals.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698