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

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

Issue 1521553003: dart2js cps: Replace GetLazyStatic with GetStatic. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove obsolete comment Created 5 years 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
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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/optimizers.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698