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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/task.dart

Issue 1234753003: dart2js cps: Rewrite mutable variables to continuation parameters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add tests and fix an assertion Created 5 years, 5 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /// Generate code using the cps-based IR pipeline. 5 /// Generate code using the cps-based IR pipeline.
6 library code_generator_task; 6 library code_generator_task;
7 7
8 import 'glue.dart'; 8 import 'glue.dart';
9 import 'codegen.dart'; 9 import 'codegen.dart';
10 import 'unsugar.dart'; 10 import 'unsugar.dart';
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 pass.rewrite(cpsNode); 179 pass.rewrite(cpsNode);
180 traceGraph(pass.passName, cpsNode); 180 traceGraph(pass.passName, cpsNode);
181 assert(checkCpsIntegrity(cpsNode)); 181 assert(checkCpsIntegrity(cpsNode));
182 } 182 }
183 183
184 applyCpsPass(new RedundantPhiEliminator()); 184 applyCpsPass(new RedundantPhiEliminator());
185 TypePropagator typePropagator = new TypePropagator(compiler); 185 TypePropagator typePropagator = new TypePropagator(compiler);
186 applyCpsPass(typePropagator); 186 applyCpsPass(typePropagator);
187 dumpTypedIR(cpsNode, typePropagator); 187 dumpTypedIR(cpsNode, typePropagator);
188 applyCpsPass(new ShrinkingReducer()); 188 applyCpsPass(new ShrinkingReducer());
189 applyCpsPass(new MutableVariableEliminator());
189 applyCpsPass(new RedundantJoinEliminator()); 190 applyCpsPass(new RedundantJoinEliminator());
190 applyCpsPass(new RedundantPhiEliminator()); 191 applyCpsPass(new RedundantPhiEliminator());
191 applyCpsPass(new ShrinkingReducer()); 192 applyCpsPass(new ShrinkingReducer());
192 193
193 return cpsNode; 194 return cpsNode;
194 } 195 }
195 196
196 tree_ir.FunctionDefinition compileToTreeIR(cps.FunctionDefinition cpsNode) { 197 tree_ir.FunctionDefinition compileToTreeIR(cps.FunctionDefinition cpsNode) {
197 tree_builder.Builder builder = new tree_builder.Builder( 198 tree_builder.Builder builder = new tree_builder.Builder(
198 compiler.internalError); 199 compiler.internalError);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // TODO(sigurdm): Make a better list of tasks. 235 // TODO(sigurdm): Make a better list of tasks.
235 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks); 236 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks);
236 } 237 }
237 238
238 js.Node attachPosition(js.Node node, AstElement element) { 239 js.Node attachPosition(js.Node node, AstElement element) {
239 return node.withSourceInformation( 240 return node.withSourceInformation(
240 sourceInformationFactory.createBuilderForContext(element) 241 sourceInformationFactory.createBuilderForContext(element)
241 .buildDeclaration(element)); 242 .buildDeclaration(element));
242 } 243 }
243 } 244 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698