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

Side by Side Diff: pkg/compiler/lib/src/ssa/codegen.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import '../common.dart'; 5 import '../common.dart';
6 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 6 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
7 import '../common/tasks.dart' show CompilerTask; 7 import '../common/tasks.dart' show CompilerTask;
8 import '../compiler.dart' show Compiler; 8 import '../compiler.dart' show Compiler;
9 import '../constants/constant_system.dart'; 9 import '../constants/constant_system.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 11 matching lines...) Expand all
22 import '../universe/selector.dart' show Selector; 22 import '../universe/selector.dart' show Selector;
23 import '../universe/use.dart' show DynamicUse, StaticUse, TypeUse; 23 import '../universe/use.dart' show DynamicUse, StaticUse, TypeUse;
24 import '../util/util.dart'; 24 import '../util/util.dart';
25 import '../world.dart' show ClassWorld; 25 import '../world.dart' show ClassWorld;
26 import 'codegen_helpers.dart'; 26 import 'codegen_helpers.dart';
27 import 'nodes.dart'; 27 import 'nodes.dart';
28 import 'variable_allocator.dart'; 28 import 'variable_allocator.dart';
29 29
30 class SsaCodeGeneratorTask extends CompilerTask { 30 class SsaCodeGeneratorTask extends CompilerTask {
31 final JavaScriptBackend backend; 31 final JavaScriptBackend backend;
32 final Compiler compiler;
32 final SourceInformationStrategy sourceInformationFactory; 33 final SourceInformationStrategy sourceInformationFactory;
33 34
34 SsaCodeGeneratorTask(JavaScriptBackend backend, this.sourceInformationFactory) 35 SsaCodeGeneratorTask(JavaScriptBackend backend, this.sourceInformationFactory)
35 : this.backend = backend, 36 : this.backend = backend,
36 super(backend.compiler); 37 this.compiler = backend.compiler,
38 super(backend.compiler.measurer);
37 39
38 String get name => 'SSA code generator'; 40 String get name => 'SSA code generator';
39 NativeEmitter get nativeEmitter => backend.emitter.nativeEmitter; 41 NativeEmitter get nativeEmitter => backend.emitter.nativeEmitter;
40 42
41 js.Fun buildJavaScriptFunction( 43 js.Fun buildJavaScriptFunction(
42 ResolvedAst resolvedAst, List<js.Parameter> parameters, js.Block body) { 44 ResolvedAst resolvedAst, List<js.Parameter> parameters, js.Block body) {
43 FunctionElement element = resolvedAst.element; 45 FunctionElement element = resolvedAst.element;
44 js.AsyncModifier asyncModifier = element.asyncMarker.isAsync 46 js.AsyncModifier asyncModifier = element.asyncMarker.isAsync
45 ? (element.asyncMarker.isYielding 47 ? (element.asyncMarker.isYielding
46 ? const js.AsyncModifier.asyncStar() 48 ? const js.AsyncModifier.asyncStar()
(...skipping 2847 matching lines...) Expand 10 before | Expand all | Expand 10 after
2894 registry.registerStaticUse(new StaticUse.staticInvoke( 2896 registry.registerStaticUse(new StaticUse.staticInvoke(
2895 helper, new CallStructure.unnamed(argumentCount))); 2897 helper, new CallStructure.unnamed(argumentCount)));
2896 return backend.emitter.staticFunctionAccess(helper); 2898 return backend.emitter.staticFunctionAccess(helper);
2897 } 2899 }
2898 2900
2899 @override 2901 @override
2900 void visitRef(HRef node) { 2902 void visitRef(HRef node) {
2901 visit(node.value); 2903 visit(node.value);
2902 } 2904 }
2903 } 2905 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698