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

Side by Side Diff: pkg/compiler/lib/src/types/union_type_mask.dart

Issue 2488353004: Remove Compiler access from ResolutionEnqueuer (Closed)
Patch Set: Updated cf. comments. Created 4 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/types/types.dart ('k') | pkg/compiler/lib/src/universe/function_set.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 part of masks; 5 part of masks;
6 6
7 class UnionTypeMask implements TypeMask { 7 class UnionTypeMask implements TypeMask {
8 final Iterable<FlatTypeMask> disjointMasks; 8 final Iterable<FlatTypeMask> disjointMasks;
9 9
10 static const int MAX_UNION_LENGTH = 4; 10 static const int MAX_UNION_LENGTH = 4;
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 bool needsNoSuchMethodHandling(Selector selector, ClosedWorld closedWorld) { 328 bool needsNoSuchMethodHandling(Selector selector, ClosedWorld closedWorld) {
329 return disjointMasks 329 return disjointMasks
330 .any((e) => e.needsNoSuchMethodHandling(selector, closedWorld)); 330 .any((e) => e.needsNoSuchMethodHandling(selector, closedWorld));
331 } 331 }
332 332
333 bool canHit(Element element, Selector selector, ClosedWorld closedWorld) { 333 bool canHit(Element element, Selector selector, ClosedWorld closedWorld) {
334 return disjointMasks.any((e) => e.canHit(element, selector, closedWorld)); 334 return disjointMasks.any((e) => e.canHit(element, selector, closedWorld));
335 } 335 }
336 336
337 Element locateSingleElement(Selector selector, Compiler compiler) { 337 Element locateSingleElement(Selector selector, ClosedWorld closedWorld) {
338 Element candidate; 338 Element candidate;
339 for (FlatTypeMask mask in disjointMasks) { 339 for (FlatTypeMask mask in disjointMasks) {
340 Element current = mask.locateSingleElement(selector, compiler); 340 Element current = mask.locateSingleElement(selector, closedWorld);
341 if (current == null) { 341 if (current == null) {
342 return null; 342 return null;
343 } else if (candidate == null) { 343 } else if (candidate == null) {
344 candidate = current; 344 candidate = current;
345 } else if (candidate != current) { 345 } else if (candidate != current) {
346 return null; 346 return null;
347 } 347 }
348 } 348 }
349 return candidate; 349 return candidate;
350 } 350 }
(...skipping 24 matching lines...) Expand all
375 int get hashCode { 375 int get hashCode {
376 int hashCode = isNullable ? 86 : 43; 376 int hashCode = isNullable ? 86 : 43;
377 // The order of the masks in [disjointMasks] must not affect the 377 // The order of the masks in [disjointMasks] must not affect the
378 // hashCode. 378 // hashCode.
379 for (var mask in disjointMasks) { 379 for (var mask in disjointMasks) {
380 hashCode = (hashCode ^ mask.nonNullable().hashCode) & 0x3fffffff; 380 hashCode = (hashCode ^ mask.nonNullable().hashCode) & 0x3fffffff;
381 } 381 }
382 return hashCode; 382 return hashCode;
383 } 383 }
384 } 384 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/types/types.dart ('k') | pkg/compiler/lib/src/universe/function_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698