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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart

Issue 12445004: Fix simple type inferrer regression by using typeOf instead of returnTypeOf for final fields. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/simple_inferrer_final_field_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (revision 19482)
+++ sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (working copy)
@@ -225,9 +225,9 @@
* Enqueues [e] in the work queue if it is valuable.
*/
void enqueueAgain(Element e) {
- Element returnType = returnTypeOf[e];
+ Element type = e.isField() ? typeOf[e] : returnTypeOf[e];
// If we have found a type for [e], no need to re-analyze it.
- if (returnType != compiler.dynamicClass) return;
+ if (type != compiler.dynamicClass) return;
if (analyzeCount[e] > MAX_ANALYSIS_COUNT_PER_ELEMENT) return;
workSet.add(e);
}
@@ -339,7 +339,7 @@
* Returns whether the new type is worth recompiling the callers of
* [analyzedElement].
*/
- bool recordReturnType(analyzedElement, returnType) {
+ bool recordReturnType(FunctionElement analyzedElement, returnType) {
return internalRecordType(analyzedElement, returnType, returnTypeOf);
}
@@ -360,7 +360,7 @@
* Returns the return type of [element]. Returns [:Dynamic:] if
* [element] has not been analyzed yet.
*/
- ClassElement returnTypeOfElement(Element element) {
+ ClassElement returnTypeOfElement(FunctionElement element) {
element = element.implementation;
if (element.isGenerativeConstructor()) return element.getEnclosingClass();
Element returnType = returnTypeOf[element];
@@ -555,7 +555,7 @@
types.forEach((_, type) {
fieldType = computeLUB(fieldType, type);
});
- returnTypeOf[field] = fieldType;
+ typeOf[field] = fieldType;
});
}
@@ -1019,6 +1019,7 @@
inferrer.registerCalledElement(outermostElement, element, arguments);
return inferrer.returnTypeOfElement(element);
} else {
+ analyzeArguments(node.arguments);
// Closure call on a getter. We don't have function types yet,
// so we just return [:Dynamic:].
return compiler.dynamicClass;
« no previous file with comments | « no previous file | tests/compiler/dart2js/simple_inferrer_final_field_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698