OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |