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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 11418183: Fix a bad merge that lead to unused optimization: implement the dataEquals in HInterceptor in order… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
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 abstract class OptimizationPhase { 7 abstract class OptimizationPhase {
8 String get name; 8 String get name;
9 void visitGraph(HGraph graph); 9 void visitGraph(HGraph graph);
10 } 10 }
(...skipping 27 matching lines...) Expand all
38 // some patterns useful for type conversion. 38 // some patterns useful for type conversion.
39 new SsaConstantFolder(constantSystem, backend, work, types), 39 new SsaConstantFolder(constantSystem, backend, work, types),
40 new SsaTypeConversionInserter(compiler), 40 new SsaTypeConversionInserter(compiler),
41 new SsaTypePropagator(compiler, types), 41 new SsaTypePropagator(compiler, types),
42 new SsaCheckInserter(backend, work, types, context.boundsChecked), 42 new SsaCheckInserter(backend, work, types, context.boundsChecked),
43 new SsaConstantFolder(constantSystem, backend, work, types), 43 new SsaConstantFolder(constantSystem, backend, work, types),
44 new SsaRedundantPhiEliminator(), 44 new SsaRedundantPhiEliminator(),
45 new SsaDeadPhiEliminator(), 45 new SsaDeadPhiEliminator(),
46 new SsaConstantFolder(constantSystem, backend, work, types), 46 new SsaConstantFolder(constantSystem, backend, work, types),
47 new SsaTypePropagator(compiler, types), 47 new SsaTypePropagator(compiler, types),
48 new SsaReceiverSpecialization(compiler),
48 new SsaGlobalValueNumberer(compiler, types), 49 new SsaGlobalValueNumberer(compiler, types),
49 new SsaCodeMotion(), 50 new SsaCodeMotion(),
50 new SsaValueRangeAnalyzer(constantSystem, types, work), 51 new SsaValueRangeAnalyzer(constantSystem, types, work),
51 // Previous optimizations may have generated new 52 // Previous optimizations may have generated new
52 // opportunities for constant folding. 53 // opportunities for constant folding.
53 new SsaConstantFolder(constantSystem, backend, work, types), 54 new SsaConstantFolder(constantSystem, backend, work, types),
54 new SsaDeadCodeEliminator(types)]; 55 new SsaDeadCodeEliminator(types)];
55 runPhases(graph, phases); 56 runPhases(graph, phases);
56 if (!speculative) { 57 if (!speculative) {
57 runPhase(graph, new SsaConstructionFieldTypes(backend, work, types)); 58 runPhase(graph, new SsaConstructionFieldTypes(backend, work, types));
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 } 1410 }
1410 1411
1411 // For other fields having setters in the generative constructor body, set 1412 // For other fields having setters in the generative constructor body, set
1412 // the type to UNKNOWN to avoid relying on the type set in the initializer 1413 // the type to UNKNOWN to avoid relying on the type set in the initializer
1413 // list. 1414 // list.
1414 allSetters.forEach((Element element) { 1415 allSetters.forEach((Element element) {
1415 backend.registerFieldConstructor(element, HType.UNKNOWN); 1416 backend.registerFieldConstructor(element, HType.UNKNOWN);
1416 }); 1417 });
1417 } 1418 }
1418 } 1419 }
1420
1421 /**
1422 * This phase specializes dominated uses of a call, where the call
1423 * can give us some type information of what the receiver might be.
1424 * For example, after a call to [:a.foo():], if [:foo:] is only
1425 * in class [:A:], a can be of type [:A:].
1426 */
1427 class SsaReceiverSpecialization extends HBaseVisitor
1428 implements OptimizationPhase {
1429 final String name = "SsaReceiverSpecialization";
1430 final Compiler compiler;
1431
1432 SsaReceiverSpecialization(this.compiler);
1433
1434 void visitGraph(HGraph graph) {
1435 visitDominatorTree(graph);
1436 }
1437
1438 void visitInterceptor(HInterceptor interceptor) {
1439 HInstruction receiver = interceptor.receiver;
1440 for (var user in receiver.usedBy) {
1441 if (user is HInterceptor && interceptor.dominates(user)) {
kasperl 2012/11/29 08:22:27 This is probably fine, but an alternative implemen
ngeoffray 2012/11/29 08:31:56 Good point. Filed http://code.google.com/p/dart/is
1442 user.interceptedClasses = interceptor.interceptedClasses;
1443 }
1444 }
1445 }
1446
1447 // TODO(ngeoffray): Also implement it for non-intercepted calls.
1448 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | tests/language/interceptor3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698