| Index: sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
|
| ===================================================================
|
| --- sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (revision 21880)
|
| +++ sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (working copy)
|
| @@ -823,7 +823,7 @@
|
| assert(arguments != null);
|
| bool isUseful = addArguments(node, callee, arguments);
|
| if (hasAnalyzedAll && isUseful) {
|
| - updateArgumentsType(callee);
|
| + enqueueAgain(callee);
|
| }
|
| }
|
|
|
| @@ -838,13 +838,13 @@
|
| types.remove(send);
|
| if (hasAnalyzedAll) updateNonFinalFieldType(callee);
|
| }
|
| - } if (callee.isGetter()) {
|
| + } else if (callee.isGetter()) {
|
| return;
|
| } else {
|
| Map<Node, ArgumentsTypes> types = typeOfArguments[callee];
|
| if (types == null || !types.containsKey(send)) return;
|
| types.remove(send);
|
| - if (hasAnalyzedAll) updateArgumentsType(callee);
|
| + if (hasAnalyzedAll) enqueueAgain(callee);
|
| }
|
| }
|
|
|
| @@ -862,7 +862,7 @@
|
| if (element.name == Compiler.NO_SUCH_METHOD) return;
|
| FunctionSignature signature = element.computeSignature(compiler);
|
|
|
| - if (typeOfArguments[element].isEmpty) {
|
| + if (typeOfArguments[element] == null || typeOfArguments[element].isEmpty) {
|
| signature.forEachParameter((Element parameter) {
|
| typeOf.remove(parameter);
|
| });
|
| @@ -941,23 +941,25 @@
|
| Selector constraint,
|
| bool inLoop) {
|
| TypeMask result;
|
| - iterateOverElements(selector, (Element element) {
|
| + bool isReceiverDynamic = isDynamicType(receiverType);
|
| + assert(selector.mask == receiverType
|
| + || (selector.mask == null && isReceiverDynamic));
|
| + iterateOverElements(selector.asUntyped, (Element element) {
|
| assert(element.isImplementation);
|
| - // 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) {
|
| + if (isReceiverDynamic
|
| + || receiverType.canHit(element, selector, compiler)) {
|
| 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.asUntyped, caller, element);
|
| + unregisterCalledElement(node, selector, caller, element);
|
| }
|
| - if (!selector.isSetter()) {
|
| - TypeMask type = handleIntrisifiedSelector(selector, arguments);
|
| - if (type == null) type = typeOfElementWithSelector(element, selector);
|
| - result = computeLUB(result, type);
|
| - }
|
| return true;
|
| });
|
|
|
| @@ -1356,6 +1358,9 @@
|
| }
|
|
|
| FunctionElement function = analyzedElement;
|
| + if (inferrer.hasAnalyzedAll) {
|
| + inferrer.updateArgumentsType(function);
|
| + }
|
| FunctionSignature signature = function.computeSignature(compiler);
|
| signature.forEachOptionalParameter((element) {
|
| Node node = element.parseNode(compiler);
|
|
|