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

Unified Diff: src/compiler/js-typed-lowering.cc

Issue 2547043002: [Interpreter] Optimize equality check with null/undefined with a check on the map. (Closed)
Patch Set: Fixed a bug in reducing JSIsUndetectable. Created 4 years 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
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index 24081b9535f0d9fa781c56af47070a3f8a0f21a3..96eee426c247305d2e03bb7b224b75b7b50d0c3c 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -889,6 +889,13 @@ Reduction JSTypedLowering::ReduceJSEqual(Node* node, bool invert) {
return NoChange();
}
+Reduction JSTypedLowering::ReduceJSIsUndetectable(Node* node) {
+ // ObjectIsUndetectable does not need a context input. So remove it.
+ node->TrimInputCount(1);
+ NodeProperties::ChangeOp(node, simplified()->ObjectIsUndetectable());
+ return Changed(node);
+}
+
Reduction JSTypedLowering::ReduceJSStrictEqual(Node* node, bool invert) {
JSBinopReduction r(this, node);
if (r.left() == r.right()) {
@@ -2209,6 +2216,8 @@ Reduction JSTypedLowering::Reduce(Node* node) {
return ReduceJSEqual(node, true);
case IrOpcode::kJSStrictEqual:
return ReduceJSStrictEqual(node, false);
+ case IrOpcode::kJSIsUndetectable:
+ return ReduceJSIsUndetectable(node);
case IrOpcode::kJSStrictNotEqual:
return ReduceJSStrictEqual(node, true);
case IrOpcode::kJSLessThan: // fall through

Powered by Google App Engine
This is Rietveld 408576698