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

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

Issue 1771253002: Fix typo in TypeInformationSystem.joinTypeMasks (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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 type_graph_inferrer; 5 library type_graph_inferrer;
6 6
7 import 'dart:collection' show Queue; 7 import 'dart:collection' show Queue;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/names.dart' show 10 import '../common/names.dart' show
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 for (TypeMask mask in masks) { 546 for (TypeMask mask in masks) {
547 // Don't do any work on computing unions if we know that after all that 547 // Don't do any work on computing unions if we know that after all that
548 // work the result will be `dynamic`. 548 // work the result will be `dynamic`.
549 // TODO(sigmund): change to `mask == dynamicType` so we can continue to 549 // TODO(sigmund): change to `mask == dynamicType` so we can continue to
550 // track the non-nullable bit. 550 // track the non-nullable bit.
551 if (mask.containsAll(classWorld)) return dynamicType; 551 if (mask.containsAll(classWorld)) return dynamicType;
552 list.add(mask); 552 list.add(mask);
553 } 553 }
554 554
555 TypeMask newType = null; 555 TypeMask newType = null;
556 for (TypeMask mask in masks) { 556 for (TypeMask mask in list) {
557 newType = newType == null ? mask : newType.union(mask, classWorld); 557 newType = newType == null ? mask : newType.union(mask, classWorld);
558 // Likewise - stop early if we already reach dynamic. 558 // Likewise - stop early if we already reach dynamic.
559 if (newType.containsAll(classWorld)) return dynamicType; 559 if (newType.containsAll(classWorld)) return dynamicType;
560 } 560 }
561 561
562 return newType ?? const TypeMask.nonNullEmpty(); 562 return newType ?? const TypeMask.nonNullEmpty();
563 } 563 }
564 } 564 }
565 565
566 /** 566 /**
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 bool isCalledOnce(Element element) { 1423 bool isCalledOnce(Element element) {
1424 if (compiler.disableTypeInference) return false; 1424 if (compiler.disableTypeInference) return false;
1425 MemberTypeInformation info = inferrer.types.getInferredTypeOf(element); 1425 MemberTypeInformation info = inferrer.types.getInferredTypeOf(element);
1426 return info.isCalledOnce(); 1426 return info.isCalledOnce();
1427 } 1427 }
1428 1428
1429 void clear() { 1429 void clear() {
1430 inferrer.clear(); 1430 inferrer.clear();
1431 } 1431 }
1432 } 1432 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698