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

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

Issue 2000323006: Make CompilerTask independent of compiler. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698