OLD | NEW |
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 CpsFunctionCompiler(Compiler compiler, JavaScriptBackend backend, | 62 CpsFunctionCompiler(Compiler compiler, JavaScriptBackend backend, |
63 SourceInformationStrategy sourceInformationFactory) | 63 SourceInformationStrategy sourceInformationFactory) |
64 : fallbackCompiler = | 64 : fallbackCompiler = |
65 new ssa.SsaFunctionCompiler(backend, sourceInformationFactory), | 65 new ssa.SsaFunctionCompiler(backend, sourceInformationFactory), |
66 cpsBuilderTask = new IrBuilderTask(compiler, sourceInformationFactory), | 66 cpsBuilderTask = new IrBuilderTask(compiler, sourceInformationFactory), |
67 sourceInformationFactory = sourceInformationFactory, | 67 sourceInformationFactory = sourceInformationFactory, |
68 constantSystem = backend.constantSystem, | 68 constantSystem = backend.constantSystem, |
69 compiler = compiler, | 69 compiler = compiler, |
70 glue = new Glue(compiler), | 70 glue = new Glue(compiler), |
71 cpsOptimizationTask = new GenericTask('CPS optimization', compiler), | 71 cpsOptimizationTask = |
72 treeBuilderTask = new GenericTask('Tree builder', compiler), | 72 new GenericTask('CPS optimization', compiler.measurer), |
73 treeOptimizationTask = new GenericTask('Tree optimization', compiler) { | 73 treeBuilderTask = new GenericTask('Tree builder', compiler.measurer), |
| 74 treeOptimizationTask = |
| 75 new GenericTask('Tree optimization', compiler.measurer) { |
74 inliner = new Inliner(this); | 76 inliner = new Inliner(this); |
75 } | 77 } |
76 | 78 |
77 String get name => 'CPS Ir pipeline'; | 79 String get name => 'CPS Ir pipeline'; |
78 | 80 |
79 JavaScriptBackend get backend => compiler.backend; | 81 JavaScriptBackend get backend => compiler.backend; |
80 | 82 |
81 DiagnosticReporter get reporter => compiler.reporter; | 83 DiagnosticReporter get reporter => compiler.reporter; |
82 | 84 |
83 /// Generates JavaScript code for `work.element`. | 85 /// Generates JavaScript code for `work.element`. |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 treeOptimizationTask | 349 treeOptimizationTask |
348 ]..addAll(fallbackCompiler.tasks); | 350 ]..addAll(fallbackCompiler.tasks); |
349 } | 351 } |
350 | 352 |
351 js.Node attachPosition(js.Node node, ResolvedAst resolvedAst) { | 353 js.Node attachPosition(js.Node node, ResolvedAst resolvedAst) { |
352 return node.withSourceInformation(sourceInformationFactory | 354 return node.withSourceInformation(sourceInformationFactory |
353 .createBuilderForContext(resolvedAst) | 355 .createBuilderForContext(resolvedAst) |
354 .buildDeclaration(resolvedAst)); | 356 .buildDeclaration(resolvedAst)); |
355 } | 357 } |
356 } | 358 } |
OLD | NEW |