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' hide ClosureScope; | 7 import '../closure.dart' hide ClosureScope; |
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 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 new ir.InvokeMethod( | 1401 new ir.InvokeMethod( |
1402 iterator, | 1402 iterator, |
1403 Selectors.current, | 1403 Selectors.current, |
1404 currentMask, | 1404 currentMask, |
1405 emptyArguments, currentInvoked))); | 1405 emptyArguments, currentInvoked))); |
1406 // TODO(sra): Does this cover all cases? The general setter case include | 1406 // TODO(sra): Does this cover all cases? The general setter case include |
1407 // super. | 1407 // super. |
1408 // TODO(johnniwinther): Extract this as a provided strategy. | 1408 // TODO(johnniwinther): Extract this as a provided strategy. |
1409 if (Elements.isLocal(variableElement)) { | 1409 if (Elements.isLocal(variableElement)) { |
1410 bodyBuilder.buildLocalVariableSet(variableElement, currentValue); | 1410 bodyBuilder.buildLocalVariableSet(variableElement, currentValue); |
1411 } else if (Elements.isErroneous(variableElement)) { | 1411 } else if (Elements.isMalformed(variableElement)) { |
1412 bodyBuilder.buildErroneousInvocation(variableElement, | 1412 bodyBuilder.buildErroneousInvocation(variableElement, |
1413 new Selector.setter( | 1413 new Selector.setter( |
1414 new Name(variableElement.name, variableElement.library)), | 1414 new Name(variableElement.name, variableElement.library)), |
1415 <ir.Primitive>[currentValue]); | 1415 <ir.Primitive>[currentValue]); |
1416 } else if (Elements.isStaticOrTopLevel(variableElement)) { | 1416 } else if (Elements.isStaticOrTopLevel(variableElement)) { |
1417 if (variableElement.isField) { | 1417 if (variableElement.isField) { |
1418 bodyBuilder.buildStaticFieldSet(variableElement, currentValue); | 1418 bodyBuilder.buildStaticFieldSet(variableElement, currentValue); |
1419 } else { | 1419 } else { |
1420 bodyBuilder.buildStaticSetterSet(variableElement, currentValue); | 1420 bodyBuilder.buildStaticSetterSet(variableElement, currentValue); |
1421 } | 1421 } |
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2886 } | 2886 } |
2887 | 2887 |
2888 class SwitchCaseInfo { | 2888 class SwitchCaseInfo { |
2889 final List<ir.Primitive> constants = <ir.Primitive>[]; | 2889 final List<ir.Primitive> constants = <ir.Primitive>[]; |
2890 final SubbuildFunction buildBody; | 2890 final SubbuildFunction buildBody; |
2891 | 2891 |
2892 SwitchCaseInfo(this.buildBody); | 2892 SwitchCaseInfo(this.buildBody); |
2893 | 2893 |
2894 void addConstant(ir.Primitive constant) => constants.add(constant); | 2894 void addConstant(ir.Primitive constant) => constants.add(constant); |
2895 } | 2895 } |
OLD | NEW |