| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 class SsaBuilderTask extends CompilerTask { | 5 class SsaBuilderTask extends CompilerTask { |
| 6 SsaBuilderTask(Compiler compiler) : super(compiler); | 6 SsaBuilderTask(Compiler compiler) : super(compiler); |
| 7 String get name() => 'SSA builder'; | 7 String get name() => 'SSA builder'; |
| 8 | 8 |
| 9 HGraph build(FunctionElement element, TreeElements elements) { | 9 HGraph build(FunctionElement element, TreeElements elements) { |
| 10 return measure(() { | 10 return measure(() { |
| 11 FunctionExpression function = element.node; | 11 FunctionExpression function = element.node; |
| 12 HInstruction.idCounter = 0; | 12 HInstruction.idCounter = 0; |
| 13 SsaBuilder builder = new SsaBuilder(compiler, elements); | 13 SsaBuilder builder = new SsaBuilder(compiler, elements); |
| 14 HGraph graph; | 14 HGraph graph; |
| 15 switch (element.kind) { | 15 switch (element.kind) { |
| 16 case ElementKind.CONSTRUCTOR: | 16 case ElementKind.GENERATIVE_CONSTRUCTOR: |
| 17 graph = compileConstructor(builder, function, element, elements); | 17 graph = compileConstructor(builder, function, element, elements); |
| 18 break; | 18 break; |
| 19 case ElementKind.CONSTRUCTOR_BODY: | 19 case ElementKind.GENERATIVE_CONSTRUCTOR_BODY: |
| 20 graph = compileConstructorBody(builder, function, element, elements); | 20 graph = compileConstructorBody(builder, function, element, elements); |
| 21 break; | 21 break; |
| 22 case ElementKind.FUNCTION: | 22 case ElementKind.FUNCTION: |
| 23 graph = compileMethod(builder, function, element, elements); | 23 graph = compileMethod(builder, function, element, elements); |
| 24 break; | 24 break; |
| 25 } | 25 } |
| 26 assert(graph.isValid()); | 26 assert(graph.isValid()); |
| 27 if (GENERATE_SSA_TRACE) { | 27 if (GENERATE_SSA_TRACE) { |
| 28 Identifier name = function.name; | 28 Identifier name = function.name; |
| 29 new HTracer.singleton().traceCompilation(name.source.toString()); | 29 new HTracer.singleton().traceCompilation(name.source.toString()); |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 | 1034 |
| 1035 visitEmptyStatement(EmptyStatement node) { | 1035 visitEmptyStatement(EmptyStatement node) { |
| 1036 compiler.unimplemented('SsaBuilder.visitEmptyStatement', | 1036 compiler.unimplemented('SsaBuilder.visitEmptyStatement', |
| 1037 node: node); | 1037 node: node); |
| 1038 } | 1038 } |
| 1039 | 1039 |
| 1040 visitModifiers(Modifiers node) { | 1040 visitModifiers(Modifiers node) { |
| 1041 compiler.unimplemented('SsaBuilder.visitModifiers', node: node); | 1041 compiler.unimplemented('SsaBuilder.visitModifiers', node: node); |
| 1042 } | 1042 } |
| 1043 } | 1043 } |
| OLD | NEW |