| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 import 'package:kernel/frontend/accessors.dart' | 6 import 'package:kernel/frontend/accessors.dart' |
| 7 show | 7 show |
| 8 Accessor, | 8 Accessor, |
| 9 IndexAccessor, | 9 IndexAccessor, |
| 10 NullAwarePropertyAccessor, | 10 NullAwarePropertyAccessor, |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 final Map<CascadeReceiver, ir.VariableGet> cascadeReceivers = | 198 final Map<CascadeReceiver, ir.VariableGet> cascadeReceivers = |
| 199 <CascadeReceiver, ir.VariableGet>{}; | 199 <CascadeReceiver, ir.VariableGet>{}; |
| 200 | 200 |
| 201 final Map<ir.Node, Element> nodeToElement = <ir.Node, Element>{}; | 201 final Map<ir.Node, Element> nodeToElement = <ir.Node, Element>{}; |
| 202 | 202 |
| 203 ir.Node associate(ir.Node node, Element element) { | 203 ir.Node associate(ir.Node node, Element element) { |
| 204 nodeToElement[node] = element; | 204 nodeToElement[node] = element; |
| 205 return node; | 205 return node; |
| 206 } | 206 } |
| 207 | 207 |
| 208 final Map<ir.Node, Node> nodeToAst = <ir.Node, Node>{}; |
| 209 |
| 208 bool isVoidContext = false; | 210 bool isVoidContext = false; |
| 209 | 211 |
| 210 KernelVisitor(this.currentElement, this.elements, this.kernel); | 212 KernelVisitor(this.currentElement, this.elements, this.kernel); |
| 211 | 213 |
| 212 KernelVisitor get sendVisitor => this; | 214 KernelVisitor get sendVisitor => this; |
| 213 | 215 |
| 214 KernelVisitor get declVisitor => this; | 216 KernelVisitor get declVisitor => this; |
| 215 | 217 |
| 216 ir.TreeNode visitForValue(Expression node) { | 218 ir.TreeNode visitForValue(Expression node) { |
| 217 bool wasVoidContext = isVoidContext; | 219 bool wasVoidContext = isVoidContext; |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 } | 893 } |
| 892 | 894 |
| 893 @override | 895 @override |
| 894 ir.Expression visitLiteralString(LiteralString node) { | 896 ir.Expression visitLiteralString(LiteralString node) { |
| 895 if (node.dartString == null) return new ir.InvalidExpression(); | 897 if (node.dartString == null) return new ir.InvalidExpression(); |
| 896 return new ir.StringLiteral(node.dartString.slowToString()); | 898 return new ir.StringLiteral(node.dartString.slowToString()); |
| 897 } | 899 } |
| 898 | 900 |
| 899 @override | 901 @override |
| 900 ir.SymbolLiteral visitLiteralSymbol(LiteralSymbol node) { | 902 ir.SymbolLiteral visitLiteralSymbol(LiteralSymbol node) { |
| 901 return new ir.SymbolLiteral(node.slowNameString); | 903 var result = new ir.SymbolLiteral(node.slowNameString); |
| 904 nodeToAst[result] = node; |
| 905 return result; |
| 902 } | 906 } |
| 903 | 907 |
| 904 @override | 908 @override |
| 905 visitMetadata(Metadata node) { | 909 visitMetadata(Metadata node) { |
| 906 // Shouldn't be called. Metadata should already have been analyzed and | 910 // Shouldn't be called. Metadata should already have been analyzed and |
| 907 // converted to a constant expression in the resolver. | 911 // converted to a constant expression in the resolver. |
| 908 return internalError(node, "Metadata not handled as constant."); | 912 return internalError(node, "Metadata not handled as constant."); |
| 909 } | 913 } |
| 910 | 914 |
| 911 @override | 915 @override |
| (...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2705 : this(null, true, node, initializers); | 2709 : this(null, true, node, initializers); |
| 2706 | 2710 |
| 2707 accept(ir.Visitor v) => throw "unsupported"; | 2711 accept(ir.Visitor v) => throw "unsupported"; |
| 2708 | 2712 |
| 2709 visitChildren(ir.Visitor v) => throw "unsupported"; | 2713 visitChildren(ir.Visitor v) => throw "unsupported"; |
| 2710 | 2714 |
| 2711 String toString() { | 2715 String toString() { |
| 2712 return "IrFunction($kind, $isConstructor, $node, $initializers)"; | 2716 return "IrFunction($kind, $isConstructor, $node, $initializers)"; |
| 2713 } | 2717 } |
| 2714 } | 2718 } |
| OLD | NEW |