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

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

Issue 14284007: Revert CL https://codereview.chromium.org/14217011/, one test fails in minified mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/types/type_mask.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 22005)
+++ sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (working copy)
@@ -871,7 +871,7 @@
assert(arguments != null);
bool isUseful = addArguments(node, callee, arguments);
if (hasAnalyzedAll && isUseful) {
- enqueueAgain(callee);
+ updateArgumentsType(callee);
}
}
@@ -886,13 +886,13 @@
types.remove(send);
if (hasAnalyzedAll) updateNonFinalFieldType(callee);
}
- } else if (callee.isGetter()) {
+ } if (callee.isGetter()) {
return;
} else {
Map<Node, ArgumentsTypes> types = typeOfArguments[callee];
if (types == null || !types.containsKey(send)) return;
types.remove(send);
- if (hasAnalyzedAll) enqueueAgain(callee);
+ if (hasAnalyzedAll) updateArgumentsType(callee);
}
}
@@ -910,7 +910,7 @@
if (element.name == Compiler.NO_SUCH_METHOD) return;
FunctionSignature signature = element.computeSignature(compiler);
- if (typeOfArguments[element] == null || typeOfArguments[element].isEmpty) {
+ if (typeOfArguments[element].isEmpty) {
signature.forEachParameter((Element parameter) {
typeOf.remove(parameter);
});
@@ -977,25 +977,6 @@
return null;
}
- bool isTargetFor(TypeMask receiverType, Selector selector, Element element) {
- bool isReceiverDynamic = isDynamicType(receiverType);
- assert(selector.mask == receiverType
- || (selector.mask == null && isReceiverDynamic));
- // TODO(ngeoffray) : The following noSuchMethod handling is a bit
- // convoluted, we should make it easier to know what we are sure
- // we cannot hit.
- if (element.name != selector.name) {
- assert(element.name == Compiler.NO_SUCH_METHOD);
- return isReceiverDynamic
- || (!receiverType.willHit(selector, compiler)
- && receiverType.canHit(
- element, compiler.noSuchMethodSelector, compiler));
- } else {
- return isReceiverDynamic
- || receiverType.canHit(element, selector, compiler);
- }
- }
-
/**
* Registers that [caller] calls an element matching [selector]
* with the given [arguments].
@@ -1008,21 +989,23 @@
Selector constraint,
bool inLoop) {
TypeMask result;
- iterateOverElements(selector.asUntyped, (Element element) {
+ iterateOverElements(selector, (Element element) {
assert(element.isImplementation);
- if (isTargetFor(receiverType, selector, element)) {
+ // TODO(ngeoffray): Enable unregistering by having a
+ // [: TypeMask.appliesTo(element) :] method, that will return
+ // whether [: element :] is a potential target for the type.
+ if (true) {
registerCalledElement(
node, selector, caller, element, arguments,
constraint, inLoop);
-
- if (!selector.isSetter()) {
- TypeMask type = handleIntrisifiedSelector(selector, arguments);
- if (type == null) type = typeOfElementWithSelector(element, selector);
- result = computeLUB(result, type);
- }
} else {
- unregisterCalledElement(node, selector, caller, element);
+ unregisterCalledElement(node, selector.asUntyped, caller, element);
}
+ if (!selector.isSetter()) {
+ TypeMask type = handleIntrisifiedSelector(selector, arguments);
+ if (type == null) type = typeOfElementWithSelector(element, selector);
+ result = computeLUB(result, type);
+ }
return true;
});
@@ -1117,11 +1100,6 @@
if (isNativeElement(element)) return;
assert(hasAnalyzedAll);
- if (typeOfFields[element] == null || typeOfFields[element].isEmpty) {
- typeOf.remove(element);
- return;
- }
-
TypeMask fieldType = computeFieldTypeWithConstraints(
element, typeOfFields[element]);
@@ -1426,9 +1404,6 @@
}
FunctionElement function = analyzedElement;
- if (inferrer.hasAnalyzedAll) {
- inferrer.updateArgumentsType(function);
- }
FunctionSignature signature = function.computeSignature(compiler);
signature.forEachOptionalParameter((element) {
Node node = element.parseNode(compiler);
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/types/type_mask.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698