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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/gvn.dart

Issue 1571433002: dart2js cps: Compute intercepted classes in optimize_interceptors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.cps_ir.gvn; 5 library dart2js.cps_ir.gvn;
6 6
7 import 'cps_ir_nodes.dart'; 7 import 'cps_ir_nodes.dart';
8 import '../universe/side_effects.dart'; 8 import '../universe/side_effects.dart';
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import 'optimizers.dart' show Pass; 10 import 'optimizers.dart' show Pass;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 gvnFor[prim] = gvn; 152 gvnFor[prim] = gvn;
153 153
154 // Try to reuse a previously computed value with the same GVN. 154 // Try to reuse a previously computed value with the same GVN.
155 Primitive existing = environment[gvn]; 155 Primitive existing = environment[gvn];
156 if (existing != null && 156 if (existing != null &&
157 canReplaceWithExistingValue(prim) && 157 canReplaceWithExistingValue(prim) &&
158 !isTrivialPrimitive(prim)) { 158 !isTrivialPrimitive(prim)) {
159 if (prim is Interceptor) { 159 if (prim is Interceptor) {
160 Interceptor interceptor = existing; 160 Interceptor interceptor = existing;
161 interceptor.interceptedClasses.addAll(prim.interceptedClasses); 161 interceptor.interceptedClasses.addAll(prim.interceptedClasses);
162 interceptor.flags |= prim.flags;
163 } 162 }
164 prim..replaceUsesWith(existing)..destroy(); 163 prim..replaceUsesWith(existing)..destroy();
165 node.remove(); 164 node.remove();
166 return next; 165 return next;
167 } 166 }
168 167
169 if (tryToHoistOutOfLoop(prim, gvn)) { 168 if (tryToHoistOutOfLoop(prim, gvn)) {
170 return next; 169 return next;
171 } 170 }
172 171
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 742
744 @override 743 @override
745 processReference(Reference ref) { 744 processReference(Reference ref) {
746 callback(ref); 745 callback(ref);
747 } 746 }
748 747
749 static void forEach(Primitive node, ReferenceCallback callback) { 748 static void forEach(Primitive node, ReferenceCallback callback) {
750 new InputVisitor(callback).visit(node); 749 new InputVisitor(callback).visit(node);
751 } 750 }
752 } 751 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/optimize_interceptors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698