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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart

Issue 694353007: Move dart2js from sdk/lib/_internal/compiler to pkg/compiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart b/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
deleted file mode 100644
index 5f224627923bb986c1faf264317d03621d4b538a..0000000000000000000000000000000000000000
--- a/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of types;
-
-/// A [ContainerTypeMask] is a [TypeMask] for a specific allocation
-/// site of a container (currently only List) that will get specialized
-/// once the [TypeGraphInferrer] phase finds an element type for it.
-class ContainerTypeMask extends ForwardingTypeMask {
- final TypeMask forwardTo;
-
- // The [Node] where this type mask was created.
- final Node allocationNode;
-
- // The [Element] where this type mask was created.
- final Element allocationElement;
-
- // The element type of this container.
- final TypeMask elementType;
-
- // The length of the container.
- final int length;
-
- ContainerTypeMask(this.forwardTo,
- this.allocationNode,
- this.allocationElement,
- this.elementType,
- this.length);
-
- TypeMask nullable() {
- return isNullable
- ? this
- : new ContainerTypeMask(forwardTo.nullable(),
- allocationNode,
- allocationElement,
- elementType,
- length);
- }
-
- TypeMask nonNullable() {
- return isNullable
- ? new ContainerTypeMask(forwardTo.nonNullable(),
- allocationNode,
- allocationElement,
- elementType,
- length)
- : this;
- }
-
- bool get isContainer => true;
- bool get isExact => true;
-
- bool equalsDisregardNull(other) {
- if (other is! ContainerTypeMask) return false;
- return super.equalsDisregardNull(other) &&
- allocationNode == other.allocationNode &&
- elementType == other.elementType &&
- length == other.length;
- }
-
- TypeMask intersection(TypeMask other, ClassWorld classWorld) {
- TypeMask forwardIntersection = forwardTo.intersection(other, classWorld);
- if (forwardIntersection.isEmpty) return forwardIntersection;
- return forwardIntersection.isNullable
- ? nullable()
- : nonNullable();
- }
-
- TypeMask union(other, ClassWorld classWorld) {
- if (this == other) {
- return this;
- } else if (equalsDisregardNull(other)) {
- return other.isNullable ? other : this;
- } else if (other.isEmpty) {
- return other.isNullable ? this.nullable() : this;
- } else if (other.isContainer
- && elementType != null
- && other.elementType != null) {
- TypeMask newElementType =
- elementType.union(other.elementType, classWorld);
- int newLength = (length == other.length) ? length : null;
- TypeMask newForwardTo = forwardTo.union(other.forwardTo, classWorld);
- return new ContainerTypeMask(
- newForwardTo,
- allocationNode == other.allocationNode ? allocationNode : null,
- allocationElement == other.allocationElement ? allocationElement
- : null,
- newElementType, newLength);
- } else {
- return forwardTo.union(other, classWorld);
- }
- }
-
- bool operator==(other) => super == other;
-
- int get hashCode {
- return computeHashCode(
- allocationNode, isNullable, elementType, length, forwardTo);
- }
-
- String toString() {
- return 'Container mask: $elementType length: $length type: $forwardTo';
- }
-}

Powered by Google App Engine
This is Rietveld 408576698