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

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

Issue 1348233002: dart2js cps: Set receiver-nullability in analysis pass. (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 631aaf2d4529da1be85c90e0c82c7f331c10e84e..a7bfb3fc5558de277bf898770965296fd0d719a5 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -978,8 +978,7 @@ class TransformingVisitor extends LeafVisitor {
CpsFragment cps = new CpsFragment(sourceInfo);
cps.invokeBuiltin(BuiltinMethod.Push,
list,
- <Primitive>[addedItem],
- receiverIsNotNull: listValue.isDefinitelyNotNull);
+ <Primitive>[addedItem]);
cps.invokeContinuation(cont, [cps.makeNull()]);
replaceSubtree(node, cps.result);
push(cps.result);
@@ -1002,8 +1001,7 @@ class TransformingVisitor extends LeafVisitor {
[list, fail.makeConstant(new IntConstantValue(-1))]);
Primitive removedItem = cps.invokeBuiltin(BuiltinMethod.Pop,
list,
- <Primitive>[],
- receiverIsNotNull: listValue.isDefinitelyNotNull);
+ <Primitive>[]);
cps.invokeContinuation(cont, [removedItem]);
replaceSubtree(node, cps.result);
push(cps.result);
@@ -1027,8 +1025,7 @@ class TransformingVisitor extends LeafVisitor {
CpsFragment cps = new CpsFragment(sourceInfo);
cps.invokeBuiltin(BuiltinMethod.Push,
list,
- addedLiteral.values.map((ref) => ref.definition).toList(),
- receiverIsNotNull: listValue.isDefinitelyNotNull);
+ addedLiteral.values.map((ref) => ref.definition).toList());
cps.invokeContinuation(cont, [cps.makeNull()]);
replaceSubtree(node, cps.result);
push(cps.result);
@@ -1476,7 +1473,6 @@ class TransformingVisitor extends LeafVisitor {
if (specializeClosureCall(node)) return;
AbstractValue receiver = getValue(node.receiver.definition);
- node.receiverIsNotNull = receiver.isDefinitelyNotNull;
if (node.receiverIsIntercepted &&
node.receiver.definition.sameValue(node.arguments[0].definition)) {
@@ -1833,14 +1829,6 @@ class TransformingVisitor extends LeafVisitor {
return null;
}
- void visitGetField(GetField node) {
- node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull;
- }
-
- void visitGetLength(GetLength node) {
- node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull;
- }
-
Primitive visitInterceptor(Interceptor node) {
AbstractValue value = getValue(node.input.definition);
// If the exact class of the input is known, replace with a constant
@@ -2139,6 +2127,7 @@ class TypePropagationVisitor implements Visitor {
void visitInvokeMethod(InvokeMethod node) {
AbstractValue receiver = getValue(node.receiver.definition);
+ node.receiverIsNotNull = receiver.isDefinitelyNotNull;
if (receiver.isNothing) {
return; // And come back later.
}
@@ -2443,6 +2432,7 @@ class TypePropagationVisitor implements Visitor {
}
void visitGetField(GetField node) {
+ node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull;
setValue(node, nonConstant(typeSystem.getFieldType(node.field)));
}
@@ -2488,6 +2478,7 @@ class TypePropagationVisitor implements Visitor {
@override
void visitGetLength(GetLength node) {
AbstractValue input = getValue(node.object.definition);
+ node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull;
int length = typeSystem.getContainerLength(input.type);
if (length != null) {
// TODO(asgerf): Constant-folding the length might degrade the VM's
« 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