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

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

Issue 1211223002: Mark static function getters as used in codegen. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: add test Created 5 years, 5 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of ssa; 5 part of ssa;
6 6
7 class SsaCodeGeneratorTask extends CompilerTask { 7 class SsaCodeGeneratorTask extends CompilerTask {
8 8
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 final SourceInformationFactory sourceInformationFactory; 10 final SourceInformationFactory sourceInformationFactory;
(...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 } 2129 }
2130 2130
2131 void visitSwitch(HSwitch node) { 2131 void visitSwitch(HSwitch node) {
2132 // Switches are handled using [visitSwitchInfo]. 2132 // Switches are handled using [visitSwitchInfo].
2133 } 2133 }
2134 2134
2135 void visitStatic(HStatic node) { 2135 void visitStatic(HStatic node) {
2136 Element element = node.element; 2136 Element element = node.element;
2137 assert(element.isFunction || element.isField); 2137 assert(element.isFunction || element.isField);
2138 if (element.isFunction) { 2138 if (element.isFunction) {
2139 push(backend.emitter.isolateStaticClosureAccess(node.element)); 2139 push(backend.emitter.isolateStaticClosureAccess(element));
2140 registry.registerGetOfStaticFunction(element);
2140 } else { 2141 } else {
2141 push(backend.emitter.staticFieldAccess(node.element)); 2142 push(backend.emitter.staticFieldAccess(element));
2142 } 2143 }
2143 registry.registerStaticUse(element); 2144 registry.registerStaticUse(element);
2144 } 2145 }
2145 2146
2146 void visitLazyStatic(HLazyStatic node) { 2147 void visitLazyStatic(HLazyStatic node) {
2147 Element element = node.element; 2148 Element element = node.element;
2148 registry.registerStaticUse(element); 2149 registry.registerStaticUse(element);
2149 js.Expression lazyGetter = 2150 js.Expression lazyGetter =
2150 backend.emitter.isolateLazyInitializerAccess(element); 2151 backend.emitter.isolateLazyInitializerAccess(element);
2151 js.Call call = new js.Call(lazyGetter, <js.Expression>[]); 2152 js.Call call = new js.Call(lazyGetter, <js.Expression>[]);
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
2739 js.PropertyAccess accessHelper(String name) { 2740 js.PropertyAccess accessHelper(String name) {
2740 Element helper = backend.findHelper(name); 2741 Element helper = backend.findHelper(name);
2741 if (helper == null) { 2742 if (helper == null) {
2742 // For mocked-up tests. 2743 // For mocked-up tests.
2743 return js.js('(void 0).$name'); 2744 return js.js('(void 0).$name');
2744 } 2745 }
2745 registry.registerStaticUse(helper); 2746 registry.registerStaticUse(helper);
2746 return backend.emitter.staticFunctionAccess(helper); 2747 return backend.emitter.staticFunctionAccess(helper);
2747 } 2748 }
2748 } 2749 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | tests/compiler/dart2js/top_level_closure_tree_shake_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698