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 'dart:collection'; | 5 import 'dart:collection'; |
6 | 6 |
7 import 'package:js_runtime/shared/embedded_names.dart'; | 7 import 'package:js_runtime/shared/embedded_names.dart'; |
8 | 8 |
9 import '../closure.dart'; | 9 import '../closure.dart'; |
10 import '../common.dart'; | 10 import '../common.dart'; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 SyntheticLocal(this.name, this.executableContext); | 85 SyntheticLocal(this.name, this.executableContext); |
86 | 86 |
87 toString() => 'SyntheticLocal($name)'; | 87 toString() => 'SyntheticLocal($name)'; |
88 } | 88 } |
89 | 89 |
90 class SsaBuilderTask extends CompilerTask { | 90 class SsaBuilderTask extends CompilerTask { |
91 final CodeEmitterTask emitter; | 91 final CodeEmitterTask emitter; |
92 final JavaScriptBackend backend; | 92 final JavaScriptBackend backend; |
93 final SourceInformationStrategy sourceInformationFactory; | 93 final SourceInformationStrategy sourceInformationFactory; |
| 94 final Compiler compiler; |
94 | 95 |
95 String get name => 'SSA builder'; | 96 String get name => 'SSA builder'; |
96 | 97 |
97 SsaBuilderTask(JavaScriptBackend backend, this.sourceInformationFactory) | 98 SsaBuilderTask(JavaScriptBackend backend, this.sourceInformationFactory) |
98 : emitter = backend.emitter, | 99 : emitter = backend.emitter, |
99 backend = backend, | 100 backend = backend, |
100 super(backend.compiler); | 101 compiler = backend.compiler, |
| 102 super(backend.compiler.measurer); |
101 | 103 |
102 DiagnosticReporter get reporter => compiler.reporter; | 104 DiagnosticReporter get reporter => compiler.reporter; |
103 | 105 |
104 HGraph build(CodegenWorkItem work) { | 106 HGraph build(CodegenWorkItem work) { |
105 return measure(() { | 107 return measure(() { |
106 Element element = work.element.implementation; | 108 Element element = work.element.implementation; |
107 return reporter.withCurrentElement(element, () { | 109 return reporter.withCurrentElement(element, () { |
108 SsaBuilder builder = new SsaBuilder( | 110 SsaBuilder builder = new SsaBuilder( |
109 work.element.implementation, | 111 work.element.implementation, |
110 work.resolvedAst, | 112 work.resolvedAst, |
(...skipping 8512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8623 const _LoopTypeVisitor(); | 8625 const _LoopTypeVisitor(); |
8624 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP; | 8626 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP; |
8625 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP; | 8627 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP; |
8626 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP; | 8628 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP; |
8627 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP; | 8629 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP; |
8628 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; | 8630 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; |
8629 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; | 8631 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; |
8630 int visitSwitchStatement(ast.SwitchStatement node) => | 8632 int visitSwitchStatement(ast.SwitchStatement node) => |
8631 HLoopBlockInformation.SWITCH_CONTINUE_LOOP; | 8633 HLoopBlockInformation.SWITCH_CONTINUE_LOOP; |
8632 } | 8634 } |
OLD | NEW |