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

Side by Side Diff: pkg/compiler/lib/src/inferrer/builder.dart

Issue 2630743002: Remove use of FunctionSignature et al from call_structure.dart (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library simple_types_inferrer; 5 library simple_types_inferrer;
6 6
7 import '../closure.dart' show ClosureClassMap; 7 import '../closure.dart' show ClosureClassMap;
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/names.dart' show Identifiers, Selectors; 9 import '../common/names.dart' show Identifiers, Selectors;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 2298 matching lines...) Expand 10 before | Expand all | Expand 10 after
2309 } 2309 }
2310 if (compiler.backend.isForeign(target)) { 2310 if (compiler.backend.isForeign(target)) {
2311 return handleForeignSend(node, target); 2311 return handleForeignSend(node, target);
2312 } 2312 }
2313 Selector selector = elements.getSelector(node); 2313 Selector selector = elements.getSelector(node);
2314 CallStructure callStructure = selector.callStructure; 2314 CallStructure callStructure = selector.callStructure;
2315 TypeMask mask = inTreeData.typeOfSend(node); 2315 TypeMask mask = inTreeData.typeOfSend(node);
2316 // In erroneous code the number of arguments in the selector might not 2316 // In erroneous code the number of arguments in the selector might not
2317 // match the function element. 2317 // match the function element.
2318 // TODO(polux): return nonNullEmpty and check it doesn'TypeInformation break anything 2318 // TODO(polux): return nonNullEmpty and check it doesn'TypeInformation break anything
2319 if (target.isMalformed || 2319 if (target.isMalformed || !callStructure.signatureApplies(target.type)) {
2320 !callStructure.signatureApplies(target.functionSignature)) {
2321 return types.dynamicType; 2320 return types.dynamicType;
2322 } 2321 }
2323 2322
2324 TypeInformation returnType = 2323 TypeInformation returnType =
2325 handleStaticSend(node, selector, mask, target, arguments); 2324 handleStaticSend(node, selector, mask, target, arguments);
2326 if (Elements.isGrowableListConstructorCall( 2325 if (Elements.isGrowableListConstructorCall(
2327 constructor, node, closedWorld.commonElements)) { 2326 constructor, node, closedWorld.commonElements)) {
2328 return inferrer.concreteTypes.putIfAbsent( 2327 return inferrer.concreteTypes.putIfAbsent(
2329 node, 2328 node,
2330 () => types.allocateList(types.growableListType, node, 2329 () => types.allocateList(types.growableListType, node,
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
2931 Selector moveNextSelector = Selectors.moveNext; 2930 Selector moveNextSelector = Selectors.moveNext;
2932 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); 2931 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node);
2933 2932
2934 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, 2933 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector,
2935 iteratorMask, expressionType, new ArgumentsTypes.empty()); 2934 iteratorMask, expressionType, new ArgumentsTypes.empty());
2936 2935
2937 return handleForInLoop(node, iteratorType, currentSelector, currentMask, 2936 return handleForInLoop(node, iteratorType, currentSelector, currentMask,
2938 moveNextSelector, moveNextMask); 2937 moveNextSelector, moveNextMask);
2939 } 2938 }
2940 } 2939 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698