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

Unified Diff: pkg/compiler/lib/src/cps_ir/type_propagation.dart

Issue 1358843002: Revert "dart2js cps: Change type tests to null tests when applicable." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/type_propagation.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index b8fa9184826c37286420b1138db3e8ff970ecc6c..0bcd7a9d05229f57950b57ce676c14aa10148502 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -43,15 +43,12 @@ class ConstantPropagationLattice {
final ConstantSystem constantSystem;
final types.DartTypes dartTypes;
final AbstractValue anything;
- final AbstractValue nullValue;
ConstantPropagationLattice(TypeMaskSystem typeSystem,
this.constantSystem,
this.dartTypes)
: this.typeSystem = typeSystem,
- anything = new AbstractValue.nonConstant(typeSystem.dynamicType),
- nullValue = new AbstractValue.constantValue(
- new NullConstantValue(), new TypeMask.empty());
+ anything = new AbstractValue.nonConstant(typeSystem.dynamicType);
final AbstractValue nothing = new AbstractValue.nothing();
@@ -1833,23 +1830,6 @@ class TransformingVisitor extends LeafVisitor {
<Primitive>[prim],
node.sourceInformation);
}
- AbstractBool isNullableSubtype =
- lattice.isSubtypeOf(value, node.dartType, allowNull: true);
- AbstractBool isNullPassingTest =
- lattice.isSubtypeOf(lattice.nullValue, node.dartType);
- if (isNullableSubtype == AbstractBool.True &&
- isNullPassingTest == AbstractBool.False) {
- // Null is the only value not satisfying the type test.
- // Replace the type test with a null-check.
- // This has lower priority than the 'typeof'-based tests because
- // 'typeof' expressions might give the VM some more useful information.
- Primitive nullConst = makeConstantPrimitive(new NullConstantValue());
- insertLetPrim(node.parent, nullConst);
- return new ApplyBuiltinOperator(
- BuiltinOperator.LooseNeq,
- <Primitive>[prim, nullConst],
- node.sourceInformation);
- }
return null;
}
« 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