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

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

Issue 1613853003: dart2js cps: More rewritings for compound assignments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove a helper method from the conditionals patch Created 4 years, 11 months 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 | pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart » ('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 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 new StaticUse.staticGet(node.element.declaration)); 926 new StaticUse.staticGet(node.element.declaration));
927 return glue.staticFieldAccess(node.element); 927 return glue.staticFieldAccess(node.element);
928 } 928 }
929 929
930 @override 930 @override
931 js.Expression visitSetStatic(tree_ir.SetStatic node) { 931 js.Expression visitSetStatic(tree_ir.SetStatic node) {
932 assert(node.element is FieldElement); 932 assert(node.element is FieldElement);
933 registry.registerStaticUse( 933 registry.registerStaticUse(
934 new StaticUse.staticSet(node.element.declaration)); 934 new StaticUse.staticSet(node.element.declaration));
935 js.Expression field = glue.staticFieldAccess(node.element); 935 js.Expression field = glue.staticFieldAccess(node.element);
936 js.Expression value = visitExpression(node.value); 936 return makeAssignment(field, node.value, compound: node.compound);
937 return new js.Assignment(field, value);
938 } 937 }
939 938
940 @override 939 @override
941 js.Expression visitGetLength(tree_ir.GetLength node) { 940 js.Expression visitGetLength(tree_ir.GetLength node) {
942 return new js.PropertyAccess.field(visitExpression(node.object), 'length'); 941 return new js.PropertyAccess.field(visitExpression(node.object), 'length');
943 } 942 }
944 943
945 @override 944 @override
946 js.Expression visitGetIndex(tree_ir.GetIndex node) { 945 js.Expression visitGetIndex(tree_ir.GetIndex node) {
947 return new js.PropertyAccess( 946 return new js.PropertyAccess(
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 void registerDefaultParameterValues(ExecutableElement element) { 1236 void registerDefaultParameterValues(ExecutableElement element) {
1238 if (element is! FunctionElement) return; 1237 if (element is! FunctionElement) return;
1239 FunctionElement function = element; 1238 FunctionElement function = element;
1240 if (function.isStatic) return; // Defaults are inlined at call sites. 1239 if (function.isStatic) return; // Defaults are inlined at call sites.
1241 function.functionSignature.forEachOptionalParameter((param) { 1240 function.functionSignature.forEachOptionalParameter((param) {
1242 ConstantValue constant = glue.getDefaultParameterValue(param); 1241 ConstantValue constant = glue.getDefaultParameterValue(param);
1243 registry.registerCompileTimeConstant(constant); 1242 registry.registerCompileTimeConstant(constant);
1244 }); 1243 });
1245 } 1244 }
1246 } 1245 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698