| 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 '../closure.dart' as closure; | 7 import '../closure.dart' as closure; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/names.dart' show | 9 import '../common/names.dart' show |
| 10 Names, | 10 Names, |
| (...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1419 bodyBuilder._enterScope(closureScope); | 1419 bodyBuilder._enterScope(closureScope); |
| 1420 if (buildVariableDeclaration != null) { | 1420 if (buildVariableDeclaration != null) { |
| 1421 buildVariableDeclaration(bodyBuilder); | 1421 buildVariableDeclaration(bodyBuilder); |
| 1422 } | 1422 } |
| 1423 ir.Primitive currentValue = bodyBuilder.addPrimitive( | 1423 ir.Primitive currentValue = bodyBuilder.addPrimitive( |
| 1424 new ir.InvokeMethod( | 1424 new ir.InvokeMethod( |
| 1425 iterator, | 1425 iterator, |
| 1426 Selectors.current, | 1426 Selectors.current, |
| 1427 currentMask, | 1427 currentMask, |
| 1428 emptyArguments)); | 1428 emptyArguments)); |
| 1429 // TODO(sra): Does this cover all cases? The general setter case include | |
| 1430 // super. | |
| 1431 // TODO(johnniwinther): Extract this as a provided strategy. | 1429 // TODO(johnniwinther): Extract this as a provided strategy. |
| 1432 if (Elements.isLocal(variableElement)) { | 1430 if (Elements.isLocal(variableElement)) { |
| 1433 bodyBuilder.buildLocalVariableSet(variableElement, currentValue); | 1431 bodyBuilder.buildLocalVariableSet(variableElement, currentValue); |
| 1434 } else if (Elements.isError(variableElement) || | 1432 } else if (Elements.isError(variableElement) || |
| 1435 Elements.isMalformed(variableElement)) { | 1433 Elements.isMalformed(variableElement)) { |
| 1436 Selector selector = new Selector.setter( | 1434 Selector selector = new Selector.setter( |
| 1437 new Name(variableElement.name, variableElement.library)); | 1435 new Name(variableElement.name, variableElement.library)); |
| 1438 List<ir.Primitive> value = <ir.Primitive>[currentValue]; | 1436 List<ir.Primitive> value = <ir.Primitive>[currentValue]; |
| 1439 // Note the order of the comparisons below. It can be the case that an | 1437 // Note the order of the comparisons below. It can be the case that an |
| 1440 // element isError and isMalformed. | 1438 // element isError and isMalformed. |
| (...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2899 } | 2897 } |
| 2900 | 2898 |
| 2901 class SwitchCaseInfo { | 2899 class SwitchCaseInfo { |
| 2902 final List<ir.Primitive> constants = <ir.Primitive>[]; | 2900 final List<ir.Primitive> constants = <ir.Primitive>[]; |
| 2903 final SubbuildFunction buildBody; | 2901 final SubbuildFunction buildBody; |
| 2904 | 2902 |
| 2905 SwitchCaseInfo(this.buildBody); | 2903 SwitchCaseInfo(this.buildBody); |
| 2906 | 2904 |
| 2907 void addConstant(ir.Primitive constant) => constants.add(constant); | 2905 void addConstant(ir.Primitive constant) => constants.add(constant); |
| 2908 } | 2906 } |
| OLD | NEW |