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

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

Issue 1431513010: Revert "Normalize type masks to use the least upper instantiated subclass/type." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « pkg/compiler/lib/src/enqueue.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7 import '../closure.dart' show
8 ClosureClassMap, 8 ClosureClassMap,
9 ClosureScope; 9 ClosureScope;
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 // fields that we haven't initialized for sure. 640 // fields that we haven't initialized for sure.
641 cls.forEachInstanceField((_, FieldElement field) { 641 cls.forEachInstanceField((_, FieldElement field) {
642 if (field.isFinal) return; 642 if (field.isFinal) return;
643 T type = locals.fieldScope.readField(field); 643 T type = locals.fieldScope.readField(field);
644 if (type == null && field.initializer == null) { 644 if (type == null && field.initializer == null) {
645 inferrer.recordTypeOfNonFinalField( 645 inferrer.recordTypeOfNonFinalField(
646 spannable, field, types.nullType); 646 spannable, field, types.nullType);
647 } 647 }
648 }); 648 });
649 } 649 }
650 if (analyzedElement.isGenerativeConstructor && cls.isAbstract) { 650 returnType = types.nonNullExact(cls);
651 if (compiler.world.isDirectlyInstantiated(cls)) {
652 returnType = types.nonNullExact(cls);
653 } else if (compiler.world.isIndirectlyInstantiated(cls)) {
654 returnType = types.nonNullSubclass(cls);
655 } else {
656 // TODO(johnniwinther): Avoid analyzing [analyzedElement] in this
657 // case; it's never called.
658 returnType = types.nonNullEmpty();
659 }
660 } else {
661 returnType = types.nonNullExact(cls);
662 }
663 } else { 651 } else {
664 signature.forEachParameter((LocalParameterElement element) { 652 signature.forEachParameter((LocalParameterElement element) {
665 locals.update(element, inferrer.typeOfElement(element), node); 653 locals.update(element, inferrer.typeOfElement(element), node);
666 }); 654 });
667 visit(node.body); 655 visit(node.body);
668 switch (function.asyncMarker) { 656 switch (function.asyncMarker) {
669 case AsyncMarker.SYNC: 657 case AsyncMarker.SYNC:
670 if (returnType == null) { 658 if (returnType == null) {
671 // No return in the body. 659 // No return in the body.
672 returnType = locals.seenReturnOrThrow 660 returnType = locals.seenReturnOrThrow
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
2341 TypeMask moveNextMask = elements.getMoveNextTypeMask(node); 2329 TypeMask moveNextMask = elements.getMoveNextTypeMask(node);
2342 2330
2343 T iteratorType = handleDynamicSend( 2331 T iteratorType = handleDynamicSend(
2344 node, iteratorSelector, iteratorMask, expressionType, 2332 node, iteratorSelector, iteratorMask, expressionType,
2345 new ArgumentsTypes<T>.empty()); 2333 new ArgumentsTypes<T>.empty());
2346 2334
2347 return handleForInLoop(node, iteratorType, currentSelector, currentMask, 2335 return handleForInLoop(node, iteratorType, currentSelector, currentMask,
2348 moveNextSelector, moveNextMask); 2336 moveNextSelector, moveNextMask);
2349 } 2337 }
2350 } 2338 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/enqueue.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698