Index: src/compiler/js-inlining.cc |
diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc |
index 8ab07c5fa67cf7ecfd62e171e38688c898ab59b6..abb352b16fb7b75431529abc53306abeb80a0698 100644 |
--- a/src/compiler/js-inlining.cc |
+++ b/src/compiler/js-inlining.cc |
@@ -282,6 +282,19 @@ Node* JSInliner::CreateTailCallerFrameState(Node* node, Node* frame_state) { |
namespace { |
+// TODO(turbofan): Shall we move this to the NodeProperties? Or some (untyped) |
+// alias analyzer? |
+bool IsSame(Node* a, Node* b) { |
+ if (a == b) { |
+ return true; |
+ } else if (a->opcode() == IrOpcode::kCheckHeapObject) { |
+ return IsSame(a->InputAt(0), b); |
+ } else if (b->opcode() == IrOpcode::kCheckHeapObject) { |
+ return IsSame(a, b->InputAt(0)); |
+ } |
+ return false; |
+} |
+ |
// TODO(bmeurer): Unify this with the witness helper functions in the |
// js-builtin-reducer.cc once we have a better understanding of the |
// map tracking we want to do, and eventually changed the CheckMaps |
@@ -296,7 +309,7 @@ namespace { |
bool NeedsConvertReceiver(Node* receiver, Node* effect) { |
for (Node* dominator = effect;;) { |
if (dominator->opcode() == IrOpcode::kCheckMaps && |
- dominator->InputAt(0) == receiver) { |
+ IsSame(dominator->InputAt(0), receiver)) { |
// Check if all maps have the given {instance_type}. |
for (int i = 1; i < dominator->op()->ValueInputCount(); ++i) { |
HeapObjectMatcher m(NodeProperties::GetValueInput(dominator, i)); |