| 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 part of ssa; | 5 part of ssa; |
| 6 | 6 |
| 7 class SsaFunctionCompiler implements FunctionCompiler { | 7 class SsaFunctionCompiler implements FunctionCompiler { |
| 8 SsaCodeGeneratorTask generator; | 8 SsaCodeGeneratorTask generator; |
| 9 SsaBuilderTask builder; | 9 SsaBuilderTask builder; |
| 10 SsaOptimizerTask optimizer; | 10 SsaOptimizerTask optimizer; |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 } | 1033 } |
| 1034 } | 1034 } |
| 1035 | 1035 |
| 1036 /** | 1036 /** |
| 1037 * This class builds SSA nodes for functions represented in AST. | 1037 * This class builds SSA nodes for functions represented in AST. |
| 1038 */ | 1038 */ |
| 1039 class SsaBuilder extends ast.Visitor | 1039 class SsaBuilder extends ast.Visitor |
| 1040 with BaseImplementationOfCompoundsMixin, | 1040 with BaseImplementationOfCompoundsMixin, |
| 1041 SendResolverMixin, | 1041 SendResolverMixin, |
| 1042 SemanticSendResolvedMixin, | 1042 SemanticSendResolvedMixin, |
| 1043 NewBulkMixin | 1043 NewBulkMixin, |
| 1044 ErrorBulkMixin |
| 1044 implements SemanticSendVisitor { | 1045 implements SemanticSendVisitor { |
| 1045 final Compiler compiler; | 1046 final Compiler compiler; |
| 1046 final JavaScriptBackend backend; | 1047 final JavaScriptBackend backend; |
| 1047 final ConstantSystem constantSystem; | 1048 final ConstantSystem constantSystem; |
| 1048 final CodegenWorkItem work; | 1049 final CodegenWorkItem work; |
| 1049 final RuntimeTypes rti; | 1050 final RuntimeTypes rti; |
| 1050 TreeElements elements; | 1051 TreeElements elements; |
| 1051 SourceInformationBuilder sourceInformationBuilder; | 1052 SourceInformationBuilder sourceInformationBuilder; |
| 1052 bool inLazyInitializerExpression = false; | 1053 bool inLazyInitializerExpression = false; |
| 1053 | 1054 |
| (...skipping 7215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8269 } | 8270 } |
| 8270 | 8271 |
| 8271 @override | 8272 @override |
| 8272 void errorUndefinedUnaryExpression( | 8273 void errorUndefinedUnaryExpression( |
| 8273 ast.Send node, | 8274 ast.Send node, |
| 8274 ast.Operator operator, | 8275 ast.Operator operator, |
| 8275 ast.Node expression, | 8276 ast.Node expression, |
| 8276 _) { | 8277 _) { |
| 8277 visitNode(node); | 8278 visitNode(node); |
| 8278 } | 8279 } |
| 8280 |
| 8281 @override |
| 8282 void bulkHandleError(ast.Node node, ErroneousElement error, _) { |
| 8283 // TODO(johnniwinther): Use an uncatchable error when supported. |
| 8284 generateRuntimeError(node, error.message); |
| 8285 } |
| 8279 } | 8286 } |
| 8280 | 8287 |
| 8281 /** | 8288 /** |
| 8282 * Visitor that handles generation of string literals (LiteralString, | 8289 * Visitor that handles generation of string literals (LiteralString, |
| 8283 * StringInterpolation), and otherwise delegates to the given visitor for | 8290 * StringInterpolation), and otherwise delegates to the given visitor for |
| 8284 * non-literal subexpressions. | 8291 * non-literal subexpressions. |
| 8285 */ | 8292 */ |
| 8286 class StringBuilderVisitor extends ast.Visitor { | 8293 class StringBuilderVisitor extends ast.Visitor { |
| 8287 final SsaBuilder builder; | 8294 final SsaBuilder builder; |
| 8288 final ast.Node diagnosticNode; | 8295 final ast.Node diagnosticNode; |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8876 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 8883 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 8877 unaliased.accept(this, builder); | 8884 unaliased.accept(this, builder); |
| 8878 } | 8885 } |
| 8879 | 8886 |
| 8880 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 8887 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 8881 JavaScriptBackend backend = builder.compiler.backend; | 8888 JavaScriptBackend backend = builder.compiler.backend; |
| 8882 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 8889 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
| 8883 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 8890 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 8884 } | 8891 } |
| 8885 } | 8892 } |
| OLD | NEW |