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

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

Issue 15988003: Fix issue 9228, by nopt doing some optimizations in checked mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 23246)
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy)
@@ -1762,13 +1762,7 @@
visitForeignNew(HForeignNew node) {
String jsClassReference = backend.namer.isolateAccess(node.element);
- List<HInstruction> inputs = node.inputs;
- // We can't use 'visitArguments', since our arguments start at input[0].
- List<js.Expression> arguments = <js.Expression>[];
- for (int i = 0; i < inputs.length; i++) {
- use(inputs[i]);
- arguments.add(pop());
- }
+ List<js.Expression> arguments = visitArguments(node.inputs, start: 0);
// TODO(floitsch): jsClassReference is an Access. We shouldn't treat it
// as if it was a string.
push(new js.New(new js.VariableUse(jsClassReference), arguments), node);
@@ -1996,7 +1990,8 @@
world.registerStaticUse(helper);
js.VariableUse jsHelper =
new js.VariableUse(backend.namer.isolateAccess(helper));
- js.Call value = new js.Call(jsHelper, visitArguments([null, argument]));
+ use(argument);
+ js.Call value = new js.Call(jsHelper, [pop()]);
attachLocation(value, argument);
// BUG(4906): Using throw here adds to the size of the generated code
// but it has the advantage of explicitly telling the JS engine that

Powered by Google App Engine
This is Rietveld 408576698