| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dart2js.ir_builder; | 5 part of dart2js.ir_builder; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * This task iterates through all resolved elements and builds [ir.Node]s. The | 8 * This task iterates through all resolved elements and builds [ir.Node]s. The |
| 9 * nodes are stored in the [nodes] map and accessible through [hasIr] and | 9 * nodes are stored in the [nodes] map and accessible through [hasIr] and |
| 10 * [getIr]. | 10 * [getIr]. |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 } | 937 } |
| 938 valueToStore = new ir.Parameter(null); | 938 valueToStore = new ir.Parameter(null); |
| 939 ir.Continuation k = new ir.Continuation([valueToStore]); | 939 ir.Continuation k = new ir.Continuation([valueToStore]); |
| 940 ir.Expression invoke = | 940 ir.Expression invoke = |
| 941 new ir.InvokeMethod(originalValue, operatorSelector, k, [arg]); | 941 new ir.InvokeMethod(originalValue, operatorSelector, k, [arg]); |
| 942 irBuilder.add(new ir.LetCont(k, invoke)); | 942 irBuilder.add(new ir.LetCont(k, invoke)); |
| 943 } | 943 } |
| 944 | 944 |
| 945 if (Elements.isLocal(element)) { | 945 if (Elements.isLocal(element)) { |
| 946 irBuilder.buildLocalSet(element, valueToStore); | 946 irBuilder.buildLocalSet(element, valueToStore); |
| 947 } else if ((!node.isSuperCall && Elements.isErroneousElement(element)) || | 947 } else if ((!node.isSuperCall && Elements.isErroneous(element)) || |
| 948 Elements.isStaticOrTopLevel(element)) { | 948 Elements.isStaticOrTopLevel(element)) { |
| 949 irBuilder.buildStaticSet( | 949 irBuilder.buildStaticSet( |
| 950 element, elements.getSelector(node), valueToStore); | 950 element, elements.getSelector(node), valueToStore); |
| 951 } else { | 951 } else { |
| 952 // Setter or index-setter invocation | 952 // Setter or index-setter invocation |
| 953 Selector selector = elements.getSelector(node); | 953 Selector selector = elements.getSelector(node); |
| 954 assert(selector.kind == SelectorKind.SETTER || | 954 assert(selector.kind == SelectorKind.SETTER || |
| 955 selector.kind == SelectorKind.INDEX); | 955 selector.kind == SelectorKind.INDEX); |
| 956 if (selector.isIndexSet) { | 956 if (selector.isIndexSet) { |
| 957 if (isSuperCall(node)) { | 957 if (isSuperCall(node)) { |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 currentFunction = elements[node]; | 1128 currentFunction = elements[node]; |
| 1129 if (node.initializers != null) { | 1129 if (node.initializers != null) { |
| 1130 insideInitializer = true; | 1130 insideInitializer = true; |
| 1131 visit(node.initializers); | 1131 visit(node.initializers); |
| 1132 insideInitializer = false; | 1132 insideInitializer = false; |
| 1133 } | 1133 } |
| 1134 visit(node.body); | 1134 visit(node.body); |
| 1135 currentFunction = oldFunction; | 1135 currentFunction = oldFunction; |
| 1136 } | 1136 } |
| 1137 } | 1137 } |
| OLD | NEW |