Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.dart

Issue 1415843006: dart2js cps: Fix codegen for yield. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update status file Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 888
889 @override 889 @override
890 void visitForeignStatement(tree_ir.ForeignStatement node) { 890 void visitForeignStatement(tree_ir.ForeignStatement node) {
891 accumulator.add(handleForeignCode(node)); 891 accumulator.add(handleForeignCode(node));
892 } 892 }
893 893
894 @override 894 @override
895 void visitYield(tree_ir.Yield node) { 895 void visitYield(tree_ir.Yield node) {
896 js.Expression value = visitExpression(node.input); 896 js.Expression value = visitExpression(node.input);
897 accumulator.add(new js.DartYield(value, node.hasStar)); 897 accumulator.add(new js.DartYield(value, node.hasStar));
898 visitStatement(node.next);
898 } 899 }
899 900
900 @override 901 @override
901 js.Expression visitApplyBuiltinOperator(tree_ir.ApplyBuiltinOperator node) { 902 js.Expression visitApplyBuiltinOperator(tree_ir.ApplyBuiltinOperator node) {
902 List<js.Expression> args = visitExpressionList(node.arguments); 903 List<js.Expression> args = visitExpressionList(node.arguments);
903 switch (node.operator) { 904 switch (node.operator) {
904 case BuiltinOperator.NumAdd: 905 case BuiltinOperator.NumAdd:
905 return new js.Binary('+', args[0], args[1]); 906 return new js.Binary('+', args[0], args[1]);
906 case BuiltinOperator.NumSubtract: 907 case BuiltinOperator.NumSubtract:
907 return new js.Binary('-', args[0], args[1]); 908 return new js.Binary('-', args[0], args[1]);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 void registerDefaultParameterValues(ExecutableElement element) { 1080 void registerDefaultParameterValues(ExecutableElement element) {
1080 if (element is! FunctionElement) return; 1081 if (element is! FunctionElement) return;
1081 FunctionElement function = element; 1082 FunctionElement function = element;
1082 if (function.isStatic) return; // Defaults are inlined at call sites. 1083 if (function.isStatic) return; // Defaults are inlined at call sites.
1083 function.functionSignature.forEachOptionalParameter((param) { 1084 function.functionSignature.forEachOptionalParameter((param) {
1084 ConstantValue constant = glue.getDefaultParameterValue(param); 1085 ConstantValue constant = glue.getDefaultParameterValue(param);
1085 registry.registerCompileTimeConstant(constant); 1086 registry.registerCompileTimeConstant(constant);
1086 }); 1087 });
1087 } 1088 }
1088 } 1089 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698