| 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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 | 816 |
| 817 @override | 817 @override |
| 818 js.Expression visitGetStatic(tree_ir.GetStatic node) { | 818 js.Expression visitGetStatic(tree_ir.GetStatic node) { |
| 819 assert(node.element is FieldElement || node.element is FunctionElement); | 819 assert(node.element is FieldElement || node.element is FunctionElement); |
| 820 if (node.element is FunctionElement) { | 820 if (node.element is FunctionElement) { |
| 821 // Tear off a method. | 821 // Tear off a method. |
| 822 registry.registerStaticUse( | 822 registry.registerStaticUse( |
| 823 new StaticUse.staticTearOff(node.element.declaration)); | 823 new StaticUse.staticTearOff(node.element.declaration)); |
| 824 return glue.isolateStaticClosureAccess(node.element); | 824 return glue.isolateStaticClosureAccess(node.element); |
| 825 } | 825 } |
| 826 if (glue.isLazilyInitialized(node.element)) { | 826 if (node.useLazyGetter) { |
| 827 // Read a lazily initialized field. | 827 // Read a lazily initialized field. |
| 828 registry.registerStaticUse( | 828 registry.registerStaticUse( |
| 829 new StaticUse.staticInit(node.element.declaration)); | 829 new StaticUse.staticInit(node.element.declaration)); |
| 830 js.Expression getter = glue.isolateLazyInitializerAccess(node.element); | 830 js.Expression getter = glue.isolateLazyInitializerAccess(node.element); |
| 831 return new js.Call(getter, <js.Expression>[], | 831 return new js.Call(getter, <js.Expression>[], |
| 832 sourceInformation: node.sourceInformation); | 832 sourceInformation: node.sourceInformation); |
| 833 } | 833 } |
| 834 // Read an eagerly initialized field. | 834 // Read an eagerly initialized field. |
| 835 registry.registerStaticUse( | 835 registry.registerStaticUse( |
| 836 new StaticUse.staticGet(node.element.declaration)); | 836 new StaticUse.staticGet(node.element.declaration)); |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 void registerDefaultParameterValues(ExecutableElement element) { | 1140 void registerDefaultParameterValues(ExecutableElement element) { |
| 1141 if (element is! FunctionElement) return; | 1141 if (element is! FunctionElement) return; |
| 1142 FunctionElement function = element; | 1142 FunctionElement function = element; |
| 1143 if (function.isStatic) return; // Defaults are inlined at call sites. | 1143 if (function.isStatic) return; // Defaults are inlined at call sites. |
| 1144 function.functionSignature.forEachOptionalParameter((param) { | 1144 function.functionSignature.forEachOptionalParameter((param) { |
| 1145 ConstantValue constant = glue.getDefaultParameterValue(param); | 1145 ConstantValue constant = glue.getDefaultParameterValue(param); |
| 1146 registry.registerCompileTimeConstant(constant); | 1146 registry.registerCompileTimeConstant(constant); |
| 1147 }); | 1147 }); |
| 1148 } | 1148 } |
| 1149 } | 1149 } |
| OLD | NEW |