| 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 library dart2js.ir_builder; | 5 library dart2js.ir_builder; |
| 6 | 6 |
| 7 import 'ir_nodes.dart' as ir; | 7 import 'ir_nodes.dart' as ir; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 import '../dart2jslib.dart'; | 9 import '../dart2jslib.dart'; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 } | 1395 } |
| 1396 | 1396 |
| 1397 // Set the value | 1397 // Set the value |
| 1398 if (isClosureVariable(element)) { | 1398 if (isClosureVariable(element)) { |
| 1399 add(new ir.SetClosureVariable(element, valueToStore)); | 1399 add(new ir.SetClosureVariable(element, valueToStore)); |
| 1400 } else if (Elements.isLocal(element)) { | 1400 } else if (Elements.isLocal(element)) { |
| 1401 valueToStore.useElementAsHint(element); | 1401 valueToStore.useElementAsHint(element); |
| 1402 assignedVars[variableIndex[element]] = valueToStore; | 1402 assignedVars[variableIndex[element]] = valueToStore; |
| 1403 } else if ((!node.isSuperCall && Elements.isErroneousElement(element)) || | 1403 } else if ((!node.isSuperCall && Elements.isErroneousElement(element)) || |
| 1404 Elements.isStaticOrTopLevel(element)) { | 1404 Elements.isStaticOrTopLevel(element)) { |
| 1405 assert(element.isField || element.isSetter); | 1405 assert(element.isErroneous || element.isField || element.isSetter); |
| 1406 Selector selector = elements.getSelector(node); | 1406 Selector selector = elements.getSelector(node); |
| 1407 continueWithExpression( | 1407 continueWithExpression( |
| 1408 (k) => new ir.InvokeStatic(element, selector, k, [valueToStore])); | 1408 (k) => new ir.InvokeStatic(element, selector, k, [valueToStore])); |
| 1409 } else { | 1409 } else { |
| 1410 // Setter or index-setter invocation | 1410 // Setter or index-setter invocation |
| 1411 Selector selector = elements.getSelector(node); | 1411 Selector selector = elements.getSelector(node); |
| 1412 assert(selector.kind == SelectorKind.SETTER || | 1412 assert(selector.kind == SelectorKind.SETTER || |
| 1413 selector.kind == SelectorKind.INDEX); | 1413 selector.kind == SelectorKind.INDEX); |
| 1414 List<ir.Definition> arguments = selector.isIndexSet | 1414 List<ir.Definition> arguments = selector.isIndexSet |
| 1415 ? [index, valueToStore] | 1415 ? [index, valueToStore] |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1715 } | 1715 } |
| 1716 | 1716 |
| 1717 visitFunctionExpression(ast.FunctionExpression node) { | 1717 visitFunctionExpression(ast.FunctionExpression node) { |
| 1718 FunctionElement oldFunction = currentFunction; | 1718 FunctionElement oldFunction = currentFunction; |
| 1719 currentFunction = elements[node]; | 1719 currentFunction = elements[node]; |
| 1720 visit(node.body); | 1720 visit(node.body); |
| 1721 currentFunction = oldFunction; | 1721 currentFunction = oldFunction; |
| 1722 } | 1722 } |
| 1723 | 1723 |
| 1724 } | 1724 } |
| OLD | NEW |