OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import '../common.dart'; | 5 import '../common.dart'; |
6 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 6 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
7 import '../common/tasks.dart' show CompilerTask; | 7 import '../common/tasks.dart' show CompilerTask; |
8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
9 import '../constants/constant_system.dart'; | 9 import '../constants/constant_system.dart'; |
10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
(...skipping 2187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2198 // BUG(4906): Using throw/return here adds to the size of the generated code | 2198 // BUG(4906): Using throw/return here adds to the size of the generated code |
2199 // but it has the advantage of explicitly telling the JS engine that | 2199 // but it has the advantage of explicitly telling the JS engine that |
2200 // this code path will terminate abruptly. Needs more work. | 2200 // this code path will terminate abruptly. Needs more work. |
2201 if (helper == helpers.wrapExceptionHelper) { | 2201 if (helper == helpers.wrapExceptionHelper) { |
2202 pushStatement( | 2202 pushStatement( |
2203 new js.Throw(value).withSourceInformation(sourceInformation)); | 2203 new js.Throw(value).withSourceInformation(sourceInformation)); |
2204 } else { | 2204 } else { |
2205 Element element = work.element; | 2205 Element element = work.element; |
2206 if (element is FunctionElement && element.asyncMarker.isYielding) { | 2206 if (element is FunctionElement && element.asyncMarker.isYielding) { |
2207 // `return <expr>;` is illegal in a sync* or async* function. | 2207 // `return <expr>;` is illegal in a sync* or async* function. |
2208 // To have the the async-translator working, we avoid introducing | 2208 // To have the async-translator working, we avoid introducing |
2209 // `return` nodes. | 2209 // `return` nodes. |
2210 pushStatement(new js.ExpressionStatement(value) | 2210 pushStatement(new js.ExpressionStatement(value) |
2211 .withSourceInformation(sourceInformation)); | 2211 .withSourceInformation(sourceInformation)); |
2212 } else { | 2212 } else { |
2213 pushStatement( | 2213 pushStatement( |
2214 new js.Return(value).withSourceInformation(sourceInformation)); | 2214 new js.Return(value).withSourceInformation(sourceInformation)); |
2215 } | 2215 } |
2216 } | 2216 } |
2217 } | 2217 } |
2218 | 2218 |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2894 registry.registerStaticUse(new StaticUse.staticInvoke( | 2894 registry.registerStaticUse(new StaticUse.staticInvoke( |
2895 helper, new CallStructure.unnamed(argumentCount))); | 2895 helper, new CallStructure.unnamed(argumentCount))); |
2896 return backend.emitter.staticFunctionAccess(helper); | 2896 return backend.emitter.staticFunctionAccess(helper); |
2897 } | 2897 } |
2898 | 2898 |
2899 @override | 2899 @override |
2900 void visitRef(HRef node) { | 2900 void visitRef(HRef node) { |
2901 visit(node.value); | 2901 visit(node.value); |
2902 } | 2902 } |
2903 } | 2903 } |
OLD | NEW |