| 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 '../compile_time_constants.dart' show BackendConstantEnvironment; | 7 import '../compile_time_constants.dart' show BackendConstantEnvironment; |
| 8 import '../constants/constant_system.dart'; | 8 import '../constants/constant_system.dart'; |
| 9 import '../constants/values.dart' show ConstantValue, PrimitiveConstantValue; | 9 import '../constants/values.dart' show ConstantValue, PrimitiveConstantValue; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 break; | 1822 break; |
| 1823 } | 1823 } |
| 1824 if (traceVariable == null) { | 1824 if (traceVariable == null) { |
| 1825 traceVariable = info.stackTraceVariable; | 1825 traceVariable = info.stackTraceVariable; |
| 1826 } | 1826 } |
| 1827 } | 1827 } |
| 1828 ir.Parameter traceParameter = new ir.Parameter(traceVariable); | 1828 ir.Parameter traceParameter = new ir.Parameter(traceVariable); |
| 1829 | 1829 |
| 1830 ir.Expression buildCatchClause(CatchClauseInfo clause) { | 1830 ir.Expression buildCatchClause(CatchClauseInfo clause) { |
| 1831 IrBuilder clauseBuilder = builder.makeDelimitedBuilder(); | 1831 IrBuilder clauseBuilder = builder.makeDelimitedBuilder(); |
| 1832 clauseBuilder.declareLocalVariable(clause.exceptionVariable, | 1832 if (clause.exceptionVariable != null) { |
| 1833 initialValue: exceptionParameter); | 1833 clauseBuilder.declareLocalVariable(clause.exceptionVariable, |
| 1834 initialValue: exceptionParameter); |
| 1835 } |
| 1834 if (clause.stackTraceVariable != null) { | 1836 if (clause.stackTraceVariable != null) { |
| 1835 clauseBuilder.declareLocalVariable(clause.stackTraceVariable, | 1837 clauseBuilder.declareLocalVariable(clause.stackTraceVariable, |
| 1836 initialValue: traceParameter); | 1838 initialValue: traceParameter); |
| 1837 } | 1839 } |
| 1838 clause.buildCatchBlock(clauseBuilder); | 1840 clause.buildCatchBlock(clauseBuilder); |
| 1839 if (clauseBuilder.isOpen) clauseBuilder.jumpTo(join); | 1841 if (clauseBuilder.isOpen) clauseBuilder.jumpTo(join); |
| 1840 return clauseBuilder._root; | 1842 return clauseBuilder._root; |
| 1841 } | 1843 } |
| 1842 | 1844 |
| 1843 // Expand multiple catch clauses into an explicit if/then/else. Iterate | 1845 // Expand multiple catch clauses into an explicit if/then/else. Iterate |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2763 } | 2765 } |
| 2764 | 2766 |
| 2765 class SwitchCaseInfo { | 2767 class SwitchCaseInfo { |
| 2766 final List<ir.Primitive> constants = <ir.Primitive>[]; | 2768 final List<ir.Primitive> constants = <ir.Primitive>[]; |
| 2767 final SubbuildFunction buildBody; | 2769 final SubbuildFunction buildBody; |
| 2768 | 2770 |
| 2769 SwitchCaseInfo(this.buildBody); | 2771 SwitchCaseInfo(this.buildBody); |
| 2770 | 2772 |
| 2771 void addConstant(ir.Primitive constant) => constants.add(constant); | 2773 void addConstant(ir.Primitive constant) => constants.add(constant); |
| 2772 } | 2774 } |
| OLD | NEW |