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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1775163005: [crankshaft] Add support for comparing with indirect undetectable values (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index dd99183faa3a18ab16168c734d5b93c14cc3bce8..1b8fb4d6d6093fb05204b632c479bcee2ccd3ccc 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -11689,6 +11689,20 @@ HControlInstruction* HOptimizedGraphBuilder::BuildCompareInstruction(
New<HCompareNumericAndBranch>(left, right, op);
return result;
} else {
+ if (op == Token::EQ) {
+ if (left->IsConstant() &&
+ HConstant::cast(left)->GetInstanceType() == ODDBALL_TYPE &&
+ HConstant::cast(left)->IsUndetectable()) {
+ return New<HIsUndetectableAndBranch>(right);
+ }
+
+ if (right->IsConstant() &&
+ HConstant::cast(right)->GetInstanceType() == ODDBALL_TYPE &&
+ HConstant::cast(right)->IsUndetectable()) {
+ return New<HIsUndetectableAndBranch>(left);
+ }
+ }
+
if (combined_rep.IsTagged() || combined_rep.IsNone()) {
HCompareGeneric* result = Add<HCompareGeneric>(left, right, op);
result->set_observed_input_representation(1, left_rep);
« 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