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

Unified Diff: src/compiler/simplified-lowering.cc

Issue 2163173002: [turbofan] In the feedback refinement retyper, always intersect the upper bound with the type. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index 449c882e79c5c3ff9bf9fd1ea3cd55b8160b509f..3e7071ab51236e0f23a60ef187e2c149b18c7d3f 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -487,6 +487,12 @@ class RepresentationSelector {
}
return false;
}
+ // We need to guarantee that the feedback type is a subtype of the upper
+ // bound. Naively that should hold, but weakening can actually produce
+ // a bigger type if we are unlucky with ordering of phi typing. To be
+ // really sure, just intersect the upper bound with the feedback type.
+ new_type = Type::Intersect(GetUpperBound(node), new_type, graph_zone());
+
if (type != nullptr && new_type->Is(type)) return false;
GetInfo(node)->set_feedback_type(new_type);
if (FLAG_trace_representation) {
« 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