| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 code_generator; | 5 library code_generator; |
| 6 | 6 |
| 7 import 'glue.dart'; | 7 import 'glue.dart'; |
| 8 | 8 |
| 9 import '../../closure.dart' show | 9 import '../../closure.dart' show |
| 10 ClosureClassElement; | 10 ClosureClassElement; |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 .withSourceInformation(node.sourceInformation)); | 782 .withSourceInformation(node.sourceInformation)); |
| 783 } | 783 } |
| 784 } | 784 } |
| 785 | 785 |
| 786 @override | 786 @override |
| 787 void visitThrow(tree_ir.Throw node) { | 787 void visitThrow(tree_ir.Throw node) { |
| 788 accumulator.add(new js.Throw(visitExpression(node.value))); | 788 accumulator.add(new js.Throw(visitExpression(node.value))); |
| 789 } | 789 } |
| 790 | 790 |
| 791 @override | 791 @override |
| 792 void visitRethrow(tree_ir.Rethrow node) { | |
| 793 glue.reportInternalError('rethrow seen in JavaScript output'); | |
| 794 } | |
| 795 | |
| 796 @override | |
| 797 void visitUnreachable(tree_ir.Unreachable node) { | 792 void visitUnreachable(tree_ir.Unreachable node) { |
| 798 if (emitUnreachableAsReturn.last) { | 793 if (emitUnreachableAsReturn.last) { |
| 799 // Emit a return to assist local analysis in the VM. | 794 // Emit a return to assist local analysis in the VM. |
| 800 accumulator.add(new js.Return()); | 795 accumulator.add(new js.Return()); |
| 801 } | 796 } |
| 802 } | 797 } |
| 803 | 798 |
| 804 @override | 799 @override |
| 805 void visitTry(tree_ir.Try node) { | 800 void visitTry(tree_ir.Try node) { |
| 806 js.Block tryBlock = buildBodyBlock(node.tryBody); | 801 js.Block tryBlock = buildBodyBlock(node.tryBody); |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 void registerDefaultParameterValues(ExecutableElement element) { | 1225 void registerDefaultParameterValues(ExecutableElement element) { |
| 1231 if (element is! FunctionElement) return; | 1226 if (element is! FunctionElement) return; |
| 1232 FunctionElement function = element; | 1227 FunctionElement function = element; |
| 1233 if (function.isStatic) return; // Defaults are inlined at call sites. | 1228 if (function.isStatic) return; // Defaults are inlined at call sites. |
| 1234 function.functionSignature.forEachOptionalParameter((param) { | 1229 function.functionSignature.forEachOptionalParameter((param) { |
| 1235 ConstantValue constant = glue.getDefaultParameterValue(param); | 1230 ConstantValue constant = glue.getDefaultParameterValue(param); |
| 1236 registry.registerCompileTimeConstant(constant); | 1231 registry.registerCompileTimeConstant(constant); |
| 1237 }); | 1232 }); |
| 1238 } | 1233 } |
| 1239 } | 1234 } |
| OLD | NEW |