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

Side by Side Diff: lib/compiler/implementation/ssa/types.dart

Issue 10119010: Start propagating non-primitive types in the backend, and fold instructions that know about the typ… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/ssa/optimize.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class SsaTypePropagator extends HGraphVisitor implements OptimizationPhase { 5 class SsaTypePropagator extends HGraphVisitor implements OptimizationPhase {
6 6
7 final Map<int, HInstruction> workmap; 7 final Map<int, HInstruction> workmap;
8 final List<int> worklist; 8 final List<int> worklist;
9 final Compiler compiler; 9 final Compiler compiler;
10 String get name() => 'type propagator'; 10 String get name() => 'type propagator';
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 if (oldType.isConflicting()) return oldType; 124 if (oldType.isConflicting()) return oldType;
125 125
126 HType newType = super.computeType(instruction); 126 HType newType = super.computeType(instruction);
127 // [computeDesiredType] goes to all usedBys and lets them compute their 127 // [computeDesiredType] goes to all usedBys and lets them compute their
128 // desired type. By setting the [newType] here we give them more context to 128 // desired type. By setting the [newType] here we give them more context to
129 // work with. 129 // work with.
130 instruction.propagatedType = newType; 130 instruction.propagatedType = newType;
131 HType desiredType = computeDesiredType(instruction); 131 HType desiredType = computeDesiredType(instruction);
132 // If the desired type is conflicting just return the computed type. 132 // If the desired type is conflicting just return the computed type.
133 if (desiredType.isConflicting()) return newType; 133 if (desiredType.isConflicting()) return newType;
134 // TODO(ngeoffray): Allow speculative optimizations on
135 // non-primitive types?
136 if (desiredType.isNonPrimitive()) return newType;
134 return newType.combine(desiredType); 137 return newType.combine(desiredType);
135 } 138 }
136 } 139 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/optimize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698