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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart

Issue 12528008: Implement CHA through type mask and TypedSelector in the simple type inferrer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart (revision 19670)
+++ sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart (working copy)
@@ -129,23 +129,7 @@
int receiverIndex = instruction.isInterceptorCall ? 1 : 0;
HType receiverType = instruction.inputs[receiverIndex].instructionType;
Selector refined = receiverType.refine(instruction.selector, compiler);
- // TODO(kasperl): Ask the type inferrer about the type of the
- // selector not the individual elements. This is basically code
- // lifted out of the inferrer. Not good.
- HType type = HType.CONFLICTING;
- DartType functionType = compiler.functionClass.computeType(compiler);
- for (Element each in compiler.world.allFunctions.filter(refined)) {
- HType inferred;
- if (refined.isGetter() && each.isFunction()) {
- inferred = new HType.nonNullExact(functionType, compiler);
- } else if (refined.isGetter() && each.isField()) {
- inferred = new HType.inferredTypeForElement(each, compiler);
- } else {
- inferred = new HType.inferredReturnTypeForElement(each, compiler);
- }
- type = type.union(inferred, compiler);
- if (type.isUnknown()) break;
- }
+ HType type = new HType.inferredTypeForSelector(refined, compiler);
if (type.isUseful()) return type;
return instruction.specializer.computeTypeFromInputTypes(
instruction, compiler);

Powered by Google App Engine
This is Rietveld 408576698