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

Unified Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 750323003: Remove js.ArrayElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add parsing and testing of array holes, make lists non-growable 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/ssa/codegen.dart
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index fa1ea1f83da5d4cfcd93e708f69d35dbdabda863..8f5e0983bdef677f562b2fd4ce4210ad7d817b7d 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -2129,13 +2129,11 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
void generateArrayLiteral(HLiteralList node) {
- int len = node.inputs.length;
- List<js.ArrayElement> elements = <js.ArrayElement>[];
- for (int i = 0; i < len; i++) {
- use(node.inputs[i]);
- elements.add(new js.ArrayElement(i, pop()));
- }
- push(new js.ArrayInitializer(len, elements), node);
+ List<js.Expression> elements = node.inputs.map((HInstruction input) {
+ use(input);
+ return pop();
+ }).toList();
+ push(new js.ArrayInitializer(elements), node);
}
void visitIndex(HIndex node) {
@@ -2649,16 +2647,16 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
if (namedParameters.isEmpty) {
var arguments = [returnType];
if (!parameterTypes.isEmpty || !optionalParameterTypes.isEmpty) {
- arguments.add(new js.ArrayInitializer.from(parameterTypes));
+ arguments.add(new js.ArrayInitializer(parameterTypes));
}
if (!optionalParameterTypes.isEmpty) {
- arguments.add(new js.ArrayInitializer.from(optionalParameterTypes));
+ arguments.add(new js.ArrayInitializer(optionalParameterTypes));
}
push(js.js('#(#)', [accessHelper('buildFunctionType'), arguments]));
} else {
var arguments = [
returnType,
- new js.ArrayInitializer.from(parameterTypes),
+ new js.ArrayInitializer(parameterTypes),
new js.ObjectInitializer(namedParameters)];
push(js.js('#(#)', [accessHelper('buildNamedFunctionType'), arguments]));
}
@@ -2700,7 +2698,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
ClassElement cls = node.dartType.element;
var arguments = [backend.namer.elementAccess(cls)];
if (!typeArguments.isEmpty) {
- arguments.add(new js.ArrayInitializer.from(typeArguments));
+ arguments.add(new js.ArrayInitializer(typeArguments));
}
push(js.js('#(#)', [accessHelper('buildInterfaceType'), arguments]));
}

Powered by Google App Engine
This is Rietveld 408576698