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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 super.close(); | 1030 super.close(); |
1031 } | 1031 } |
1032 } | 1032 } |
1033 | 1033 |
1034 /** | 1034 /** |
1035 * This class builds SSA nodes for functions represented in AST. | 1035 * This class builds SSA nodes for functions represented in AST. |
1036 */ | 1036 */ |
1037 class SsaBuilder extends ast.Visitor | 1037 class SsaBuilder extends ast.Visitor |
1038 with BaseImplementationOfCompoundsMixin, | 1038 with BaseImplementationOfCompoundsMixin, |
1039 BaseImplementationOfSetIfNullsMixin, | 1039 BaseImplementationOfSetIfNullsMixin, |
| 1040 BaseImplementationOfSuperIndexSetIfNullMixin, |
1040 SemanticSendResolvedMixin, | 1041 SemanticSendResolvedMixin, |
1041 NewBulkMixin, | 1042 NewBulkMixin, |
1042 ErrorBulkMixin | 1043 ErrorBulkMixin |
1043 implements SemanticSendVisitor { | 1044 implements SemanticSendVisitor { |
1044 | 1045 |
1045 /// The element for which this SSA builder is being used. | 1046 /// The element for which this SSA builder is being used. |
1046 final Element target; | 1047 final Element target; |
1047 | 1048 |
1048 /// Reference to resolved elements in [target]'s AST. | 1049 /// Reference to resolved elements in [target]'s AST. |
1049 TreeElements elements; | 1050 TreeElements elements; |
(...skipping 6051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7101 Element getter, | 7102 Element getter, |
7102 CompoundGetter getterKind, | 7103 CompoundGetter getterKind, |
7103 Element setter, | 7104 Element setter, |
7104 CompoundSetter setterKind, | 7105 CompoundSetter setterKind, |
7105 ast.Node rhs, | 7106 ast.Node rhs, |
7106 arg) { | 7107 arg) { |
7107 handleSuperSendSet(node); | 7108 handleSuperSendSet(node); |
7108 } | 7109 } |
7109 | 7110 |
7110 @override | 7111 @override |
| 7112 handleSuperIndexSetIfNull( |
| 7113 ast.SendSet node, |
| 7114 Element indexFunction, |
| 7115 Element indexSetFunction, |
| 7116 ast.Node index, |
| 7117 ast.Node rhs, |
| 7118 arg, |
| 7119 {bool isGetterValid, |
| 7120 bool isSetterValid}) { |
| 7121 handleCompoundSendSet(node); |
| 7122 } |
| 7123 |
| 7124 @override |
| 7125 visitIndexSetIfNull( |
| 7126 ast.SendSet node, |
| 7127 ast.Node receiver, |
| 7128 ast.Node index, |
| 7129 ast.Node rhs, |
| 7130 arg, |
| 7131 {bool isGetterValid, |
| 7132 bool isSetterValid}) { |
| 7133 generateIsDeferredLoadedCheckOfSend(node); |
| 7134 handleIndexSendSet(node); |
| 7135 } |
| 7136 |
| 7137 @override |
7111 handleTypeLiteralConstantSetIfNulls( | 7138 handleTypeLiteralConstantSetIfNulls( |
7112 ast.SendSet node, | 7139 ast.SendSet node, |
7113 ConstantExpression constant, | 7140 ConstantExpression constant, |
7114 ast.Node rhs, | 7141 ast.Node rhs, |
7115 arg) { | 7142 arg) { |
7116 // The type variable is never `null`. | 7143 // The type variable is never `null`. |
7117 generateConstantTypeLiteral(node); | 7144 generateConstantTypeLiteral(node); |
7118 } | 7145 } |
7119 | 7146 |
7120 @override | 7147 @override |
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9324 const _LoopTypeVisitor(); | 9351 const _LoopTypeVisitor(); |
9325 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP; | 9352 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP; |
9326 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP; | 9353 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP; |
9327 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP; | 9354 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP; |
9328 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP; | 9355 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP; |
9329 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; | 9356 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; |
9330 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; | 9357 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; |
9331 int visitSwitchStatement(ast.SwitchStatement node) => | 9358 int visitSwitchStatement(ast.SwitchStatement node) => |
9332 HLoopBlockInformation.SWITCH_CONTINUE_LOOP; | 9359 HLoopBlockInformation.SWITCH_CONTINUE_LOOP; |
9333 } | 9360 } |
OLD | NEW |