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

Unified Diff: src/hydrogen.cc

Issue 1347063004: [ic] Introduce BOOLEAN state for CompareIC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.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 | « src/code-stubs.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index b24890af2a37daecf0d925221316f1fdb79030ed..eef51e5d952ceddd572edc2e05cd03a3fde2e52c 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -11650,6 +11650,23 @@ HControlInstruction* HOptimizedGraphBuilder::BuildCompareInstruction(
HStringCompareAndBranch* result =
New<HStringCompareAndBranch>(left, right, op);
return result;
+ } else if (combined_type->Is(Type::Boolean())) {
+ AddCheckMap(left, isolate()->factory()->boolean_map());
+ AddCheckMap(right, isolate()->factory()->boolean_map());
+ if (Token::IsEqualityOp(op)) {
+ HCompareObjectEqAndBranch* result =
+ New<HCompareObjectEqAndBranch>(left, right);
+ return result;
+ }
+ left = Add<HLoadNamedField>(
+ left, nullptr,
+ HObjectAccess::ForOddballToNumber(Representation::Smi()));
+ right = Add<HLoadNamedField>(
+ right, nullptr,
+ HObjectAccess::ForOddballToNumber(Representation::Smi()));
+ HCompareNumericAndBranch* result =
+ New<HCompareNumericAndBranch>(left, right, op);
+ return result;
} else {
if (combined_rep.IsTagged() || combined_rep.IsNone()) {
HCompareGeneric* result = Add<HCompareGeneric>(
« no previous file with comments | « src/code-stubs.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698