3621 void compareEqObjectOrOtherToObject(Edge leftChild, Edge rightChild)
3622 {
3623 LValue rightCell = lowCell(rightChild);
3624 LValue leftValue = lowJSValue(leftChild);
3625
3626 speculateTruthyObject(rightChild, rightCell, SpecObject);
3627
3628 LBasicBlock leftCellCase = FTL_NEW_BLOCK(m_out, ("CompareEqObjectOrOtherToObject left cell case"));
3629 LBasicBlock leftNotCellCase = FTL_NEW_BLOCK(m_out, ("CompareEqObjectOrOtherToObject left not cell case"));
3630 LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CompareEqObjectOrOtherToObject continuation"));
3631
3632 m_out.branch(isCell(leftValue), leftCellCase, leftNotCellCase);
3633
3634 LBasicBlock lastNext = m_out.appendTo(leftCellCase, leftNotCellCase);
3635 speculateTruthyObject(leftChild, leftValue, SpecObject | (~SpecCell));
3636 ValueFromBlock cellResult = m_out.anchor(m_out.equal(rightCell, leftValue));
3637 m_out.jump(continuation);
3638
3639 m_out.appendTo(leftNotCellCase, continuation);
3640 FTL_TYPE_CHECK(
3641 jsValueValue(leftValue), leftChild, SpecOther | SpecCell, isNotNully(leftValue));
3642 ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
3643 m_out.jump(continuation);
3644
3645 m_out.appendTo(continuation, lastNext);
3646 setBoolean(m_out.phi(m_out.boolean, cellResult, notCellResult));
3647 }
3648
3649 void speculateTruthyObject(Edge edge, LValue cell, SpeculatedType filter)
3650 {
3651 if (masqueradesAsUndefinedWatchpointIsStillValid()) {
3652 FTL_TYPE_CHECK(jsValueValue(cell), edge, filter, isNotObject(cell));
3653 return;
3654 }
3655
3656 LValue structure = m_out.loadPtr(cell, m_heaps.JSCell_structure);
3657 FTL_TYPE_CHECK(
3658 jsValueValue(cell), edge, filter,
3659 m_out.equal(structure, m_out.constIntPtr(vm().stringStructure.get())));
3660 speculate(
3661 BadType, jsValueValue(cell), edge.node(),
3662 m_out.testNonZero8(
3663 m_out.load8(structure, m_heaps.Structure_typeInfoFlags),
3664 m_out.constInt8(MasqueradesAsUndefined)));
3665 }
3666