| 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 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |