Ignore:
Timestamp:
Sep 26, 2017, 2:25:44 PM (8 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r222518.
https://bugs.webkit.org/show_bug.cgi?id=177507

Break the High Sierra build (Requested by yusukesuzuki on
#webkit).

Reverted changeset:

"Add Above/Below comparisons for UInt32 patterns"
https://bugs.webkit.org/show_bug.cgi?id=177281
http://trac.webkit.org/changeset/222518

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r222518 r222523  
    19821982    OpcodeID opcodeID = this->opcodeID();
    19831983
    1984     if (opcodeID == op_less || opcodeID == op_lesseq || opcodeID == op_greater || opcodeID == op_greatereq) {
    1985         enum class UInt32Result {
    1986             UInt32,
    1987             Constant,
    1988         };
    1989         auto isUInt32 = [&] (ExpressionNode* node) -> std::optional<UInt32Result> {
    1990             if (node->isBinaryOpNode() && static_cast<BinaryOpNode*>(node)->opcodeID() == op_urshift)
    1991                 return UInt32Result::UInt32;
    1992             if (node->isNumber() && static_cast<NumberNode*>(node)->isIntegerNode()) {
    1993                 int32_t value = static_cast<int32_t>(static_cast<IntegerNode*>(node)->value());
    1994                 if (value >= 0)
    1995                     return UInt32Result::Constant;
    1996             }
    1997             return std::nullopt;
    1998         };
    1999         auto leftResult = isUInt32(m_expr1);
    2000         auto rightResult = isUInt32(m_expr2);
    2001         if ((leftResult && rightResult) && (leftResult.value() == UInt32Result::UInt32 || rightResult.value() == UInt32Result::UInt32)) {
    2002             auto* left = m_expr1;
    2003             auto* right = m_expr2;
    2004             if (left->isBinaryOpNode()) {
    2005                 ASSERT(static_cast<BinaryOpNode*>(left)->opcodeID() == op_urshift);
    2006                 static_cast<BinaryOpNode*>(left)->m_shouldToUnsignedResult = false;
    2007             }
    2008             if (right->isBinaryOpNode()) {
    2009                 ASSERT(static_cast<BinaryOpNode*>(right)->opcodeID() == op_urshift);
    2010                 static_cast<BinaryOpNode*>(right)->m_shouldToUnsignedResult = false;
    2011             }
    2012             RefPtr<RegisterID> src1 = generator.emitNodeForLeftHandSide(left, m_rightHasAssignments, right->isPure(generator));
    2013             RefPtr<RegisterID> src2 = generator.emitNode(right);
    2014             generator.emitExpressionInfo(position(), position(), position());
    2015 
    2016             // Since the both sides only accept Int32, replacing operands is not observable to users.
    2017             bool replaceOperands = false;
    2018             OpcodeID resultOp = opcodeID;
    2019             switch (opcodeID) {
    2020             case op_less:
    2021                 resultOp = op_below;
    2022                 break;
    2023             case op_lesseq:
    2024                 resultOp = op_beloweq;
    2025                 break;
    2026             case op_greater:
    2027                 resultOp = op_below;
    2028                 replaceOperands = true;
    2029                 break;
    2030             case op_greatereq:
    2031                 resultOp = op_beloweq;
    2032                 replaceOperands = true;
    2033                 break;
    2034             default:
    2035                 RELEASE_ASSERT_NOT_REACHED();
    2036             }
    2037             OperandTypes operandTypes(left->resultDescriptor(), right->resultDescriptor());
    2038             if (replaceOperands) {
    2039                 std::swap(src1, src2);
    2040                 operandTypes = OperandTypes(right->resultDescriptor(), left->resultDescriptor());
    2041             }
    2042             return generator.emitBinaryOp(resultOp, generator.finalDestination(dst, src1.get()), src1.get(), src2.get(), operandTypes);
    2043         }
    2044     }
    2045 
    20461984    if (opcodeID == op_add && m_expr1->isAdd() && m_expr1->resultDescriptor().definitelyIsString()) {
    20471985        generator.emitExpressionInfo(position(), position(), position());
     
    20792017    }
    20802018    RegisterID* result = generator.emitBinaryOp(opcodeID, generator.finalDestination(dst, src1.get()), src1.get(), src2.get(), OperandTypes(left->resultDescriptor(), right->resultDescriptor()));
    2081     if (m_shouldToUnsignedResult) {
    2082         if (opcodeID == op_urshift && dst != generator.ignoredResult())
    2083             return generator.emitUnaryOp(op_unsigned, result, result);
    2084     }
     2019    if (opcodeID == op_urshift && dst != generator.ignoredResult())
     2020        return generator.emitUnaryOp(op_unsigned, result, result);
    20852021    return result;
    20862022}
Note: See TracChangeset for help on using the changeset viewer.