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

Unified Diff: pkg/compiler/lib/src/ssa/types.dart

Issue 693183006: Revert "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
« no previous file with comments | « pkg/compiler/lib/src/ssa/ssa_tracer.dart ('k') | pkg/compiler/lib/src/ssa/types_propagation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/types.dart
diff --git a/pkg/compiler/lib/src/ssa/types.dart b/pkg/compiler/lib/src/ssa/types.dart
deleted file mode 100644
index cc950236c68c770b4cc201a8159d353ad413cafb..0000000000000000000000000000000000000000
--- a/pkg/compiler/lib/src/ssa/types.dart
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) 2012, 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 ssa;
-
-class TypeMaskFactory {
- static TypeMask fromInferredType(TypeMask mask, Compiler compiler) {
- JavaScriptBackend backend = compiler.backend;
- if (mask == null) return backend.dynamicType;
- return mask;
- }
-
- static TypeMask inferredReturnTypeForElement(
- Element element, Compiler compiler) {
- return fromInferredType(
- compiler.typesTask.getGuaranteedReturnTypeOfElement(element),
- compiler);
- }
-
- static TypeMask inferredTypeForElement(Element element, Compiler compiler) {
- return fromInferredType(
- compiler.typesTask.getGuaranteedTypeOfElement(element),
- compiler);
- }
-
- static TypeMask inferredTypeForSelector(Selector selector, Compiler compiler) {
- return fromInferredType(
- compiler.typesTask.getGuaranteedTypeOfSelector(selector),
- compiler);
- }
-
- static TypeMask inferredForNode(Element owner, ast.Node node,
- Compiler compiler) {
- return fromInferredType(
- compiler.typesTask.getGuaranteedTypeOfNode(owner, node),
- compiler);
- }
-
- static TypeMask fromNativeBehavior(native.NativeBehavior nativeBehavior,
- Compiler compiler) {
- ClassWorld classWorld = compiler.world;
- JavaScriptBackend backend = compiler.backend;
- if (nativeBehavior.typesReturned.isEmpty) return backend.dynamicType;
-
- TypeMask result = nativeBehavior.typesReturned
- .map((type) => fromNativeType(type, compiler))
- .reduce((t1, t2) => t1.union(t2, classWorld));
- assert(!(result.isEmpty && !result.isNullable));
- return result;
- }
-
- // [type] is either an instance of [DartType] or special objects
- // like [native.SpecialType.JsObject].
- static TypeMask fromNativeType(type, Compiler compiler) {
- ClassWorld classWorld = compiler.world;
- JavaScriptBackend backend = compiler.backend;
- if (type == native.SpecialType.JsObject) {
- return new TypeMask.nonNullExact(compiler.objectClass, classWorld);
- } else if (type.isVoid) {
- return backend.nullType;
- } else if (type.element == compiler.nullClass) {
- return backend.nullType;
- } else if (type.treatAsDynamic) {
- return backend.dynamicType;
- } else {
- return new TypeMask.nonNullSubtype(type.element, classWorld);
- }
- }
-}
« no previous file with comments | « pkg/compiler/lib/src/ssa/ssa_tracer.dart ('k') | pkg/compiler/lib/src/ssa/types_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698