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

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

Issue 1605203002: Revert "dart2js cps: Update null checks when updating refinements." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | pkg/compiler/lib/src/js_backend/codegen/task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/update_refinements.dart
diff --git a/pkg/compiler/lib/src/cps_ir/update_refinements.dart b/pkg/compiler/lib/src/cps_ir/update_refinements.dart
index 79b3673b5c3f9b937c5d459e370a1a01eb2f9270..d93e747a9ec589e8774868353bd58b9da72b8b64 100644
--- a/pkg/compiler/lib/src/cps_ir/update_refinements.dart
+++ b/pkg/compiler/lib/src/cps_ir/update_refinements.dart
@@ -20,7 +20,7 @@ class UpdateRefinements extends TrampolineRecursiveVisitor implements Pass {
final TypeMaskSystem typeSystem;
- Map<Primitive, Primitive> refinementFor = <Primitive, Primitive>{};
+ Map<Primitive, Refinement> refinementFor = <Primitive, Refinement>{};
UpdateRefinements(this.typeSystem);
@@ -29,33 +29,11 @@ class UpdateRefinements extends TrampolineRecursiveVisitor implements Pass {
}
Expression traverseLetPrim(LetPrim node) {
- Expression next = node.body;
visit(node.primitive);
- return next;
- }
-
- visitNullCheck(NullCheck node) {
- if (refine(node.value)) {
- Primitive value = node.value.definition;
- if (value.type.isNullable) {
- // Update the type if the input has changed.
- node.type = value.type.nonNullable();
- } else {
- node..replaceUsesWith(value)..destroy();
- LetPrim letPrim = node.parent;
- letPrim.remove();
- return;
- }
- }
- // Use the NullCheck as a refinement.
- Primitive value = node.effectiveDefinition;
- Refinement old = refinementFor[value];
- refinementFor[value] = node;
- pushAction(() {
- refinementFor[value] = old;
- });
+ return node.body;
}
+ @override
visitRefinement(Refinement node) {
if (refine(node.value)) {
// Update the type if the input has changed.
@@ -70,6 +48,7 @@ class UpdateRefinements extends TrampolineRecursiveVisitor implements Pass {
});
}
+ @override
processReference(Reference ref) {
refine(ref);
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/codegen/task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698