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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart

Issue 12509005: Add intersection of disjoint masks to the TypeMask implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Allow base == null. Ugh. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
index f06ff6f5fdf8a49398425b0159e903e802e40d7d..d5c6438391ac2b2c37ce67e6e1e2e9c6df448479 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
@@ -1114,6 +1114,14 @@ abstract class HInstruction implements Spannable {
HInstruction convertType(Compiler compiler, DartType type, int kind) {
if (type == null) return this;
+
+ // TODO(kasperl): This needs cleaning up. We shouldn't be creating
+ // HType objects for malformed types.
+ if (kind == HTypeConversion.CHECKED_MODE_CHECK && type.isMalformed) {
+ kind = HTypeConversion.MALFORMED_CHECKED_MODE_CHECK;
+ return new HTypeConversion(new HType.subtype(type, compiler), this, kind);
+ }
+
if (identical(type.element, compiler.dynamicClass)) return this;
if (identical(type.element, compiler.objectClass)) return this;
@@ -2189,6 +2197,7 @@ class HTypeConversion extends HCheck {
static const int ARGUMENT_TYPE_CHECK = 2;
static const int CAST_TYPE_CHECK = 3;
static const int BOOLEAN_CONVERSION_CHECK = 4;
+ static const int MALFORMED_CHECKED_MODE_CHECK = 5;
HTypeConversion(HType type, HInstruction input, [this.kind = NO_CHECK])
: super(<HInstruction>[input]) {
@@ -2203,14 +2212,16 @@ class HTypeConversion extends HCheck {
HTypeConversion.castCheck(HType type, HInstruction input)
: this(type, input, CAST_TYPE_CHECK);
-
bool get isChecked => kind != NO_CHECK;
bool get isCheckedModeCheck {
- return kind == CHECKED_MODE_CHECK || kind == BOOLEAN_CONVERSION_CHECK;
+ return kind == CHECKED_MODE_CHECK
+ || kind == BOOLEAN_CONVERSION_CHECK
+ || kind == MALFORMED_CHECKED_MODE_CHECK;
}
bool get isArgumentTypeCheck => kind == ARGUMENT_TYPE_CHECK;
bool get isCastTypeCheck => kind == CAST_TYPE_CHECK;
bool get isBooleanConversionCheck => kind == BOOLEAN_CONVERSION_CHECK;
+ bool get isMalformedCheckedModeCheck => kind == MALFORMED_CHECKED_MODE_CHECK;
accept(HVisitor visitor) => visitor.visitTypeConversion(this);
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698