Ignore:
Timestamp:
Oct 14, 2019, 3:52:11 PM (6 years ago)
Author:
[email protected]
Message:

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

"broke tests" (Requested by RMorisset on #webkit).

Reverted changeset:

"Split ArithProfile into a Unary and a Binary version"
https://bugs.webkit.org/show_bug.cgi?id=202832
https://trac.webkit.org/changeset/251090

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp

    r251090 r251106  
    453453void JIT::emit_op_negate(const Instruction* currentInstruction)
    454454{
    455     UnaryArithProfile* arithProfile = &currentInstruction->as<OpNegate>().metadata(m_codeBlock).m_arithProfile;
     455    ArithProfile* arithProfile = &currentInstruction->as<OpNegate>().metadata(m_codeBlock).m_arithProfile;
    456456    JITNegIC* negateIC = m_codeBlock->addJITNegIC(arithProfile);
    457457    m_instructionToMathIC.add(currentInstruction, negateIC);
     
    634634}
    635635
     636ALWAYS_INLINE static OperandTypes getOperandTypes(const ArithProfile& arithProfile)
     637{
     638    return OperandTypes(arithProfile.lhsResultType(), arithProfile.rhsResultType());
     639}
     640
    636641void JIT::emit_op_add(const Instruction* currentInstruction)
    637642{
    638     BinaryArithProfile* arithProfile = &currentInstruction->as<OpAdd>().metadata(m_codeBlock).m_arithProfile;
     643    ArithProfile* arithProfile = &currentInstruction->as<OpAdd>().metadata(m_codeBlock).m_arithProfile;
    639644    JITAddIC* addIC = m_codeBlock->addJITAddIC(arithProfile);
    640645    m_instructionToMathIC.add(currentInstruction, addIC);
     
    681686    bool generatedInlineCode = mathIC->generateInline(*this, mathICGenerationState);
    682687    if (!generatedInlineCode) {
    683         UnaryArithProfile* arithProfile = mathIC->arithProfile();
     688        ArithProfile* arithProfile = mathIC->arithProfile();
    684689        if (arithProfile && shouldEmitProfiling())
    685690            callOperationWithResult(profiledFunction, resultRegs, srcRegs, arithProfile);
     
    704709{
    705710    auto bytecode = currentInstruction->as<Op>();
    706     BinaryArithProfile arithProfile = copiedArithProfile(bytecode);
     711    OperandTypes types = getOperandTypes(copiedArithProfile(bytecode));
    707712    int result = bytecode.m_dst.offset();
    708713    int op1 = bytecode.m_lhs.offset();
     
    723728#endif
    724729
    725     SnippetOperand leftOperand(arithProfile.lhsResultType());
    726     SnippetOperand rightOperand(arithProfile.rhsResultType());
     730    SnippetOperand leftOperand(types.first());
     731    SnippetOperand rightOperand(types.second());
    727732
    728733    if (isOperandConstantInt(op1))
     
    754759        else if (rightOperand.isConst())
    755760            emitGetVirtualRegister(op2, rightRegs);
    756         BinaryArithProfile* arithProfile = mathIC->arithProfile();
     761        ArithProfile* arithProfile = mathIC->arithProfile();
    757762        if (arithProfile && shouldEmitProfiling())
    758763            callOperationWithResult(profiledFunction, resultRegs, leftRegs, rightRegs, arithProfile);
     
    794799#endif
    795800
    796     UnaryArithProfile* arithProfile = mathIC->arithProfile();
     801    ArithProfile* arithProfile = mathIC->arithProfile();
    797802    if (arithProfile && shouldEmitProfiling()) {
    798803        if (mathICGenerationState.shouldSlowPathRepatch)
     
    826831
    827832    auto bytecode = currentInstruction->as<Op>();
    828     BinaryArithProfile consistentArithProfile = copiedArithProfile(bytecode);
     833    OperandTypes types = getOperandTypes(copiedArithProfile(bytecode));
    829834    int result = bytecode.m_dst.offset();
    830835    int op1 = bytecode.m_lhs.offset();
     
    841846#endif
    842847   
    843     SnippetOperand leftOperand(consistentArithProfile.lhsResultType());
    844     SnippetOperand rightOperand(consistentArithProfile.rhsResultType());
     848    SnippetOperand leftOperand(types.first());
     849    SnippetOperand rightOperand(types.second());
    845850
    846851    if (isOperandConstantInt(op1))
     
    860865#endif
    861866
    862     BinaryArithProfile* arithProfile = mathIC->arithProfile();
     867    ArithProfile* arithProfile = mathIC->arithProfile();
    863868    if (arithProfile && shouldEmitProfiling()) {
    864869        if (mathICGenerationState.shouldSlowPathRepatch)
     
    888893{
    889894    auto bytecode = currentInstruction->as<OpDiv>();
    890     BinaryArithProfile consistentArithProfile = copiedArithProfile(bytecode);
     895    auto& metadata = bytecode.metadata(m_codeBlock);
    891896    int result = bytecode.m_dst.offset();
    892897    int op1 = bytecode.m_lhs.offset();
     
    894899
    895900#if USE(JSVALUE64)
     901    OperandTypes types = getOperandTypes(metadata.m_arithProfile);
    896902    JSValueRegs leftRegs = JSValueRegs(regT0);
    897903    JSValueRegs rightRegs = JSValueRegs(regT1);
     
    899905    GPRReg scratchGPR = regT2;
    900906#else
     907    OperandTypes types = getOperandTypes(metadata.m_arithProfile);
    901908    JSValueRegs leftRegs = JSValueRegs(regT1, regT0);
    902909    JSValueRegs rightRegs = JSValueRegs(regT3, regT2);
     
    906913    FPRReg scratchFPR = fpRegT2;
    907914
    908     BinaryArithProfile* arithProfile = nullptr;
     915    ArithProfile* arithProfile = nullptr;
    909916    if (shouldEmitProfiling())
    910917        arithProfile = &currentInstruction->as<OpDiv>().metadata(m_codeBlock).m_arithProfile;
    911918
    912     SnippetOperand leftOperand(consistentArithProfile.lhsResultType());
    913     SnippetOperand rightOperand(consistentArithProfile.rhsResultType());
     919    SnippetOperand leftOperand(types.first());
     920    SnippetOperand rightOperand(types.second());
    914921
    915922    if (isOperandConstantInt(op1))
     
    953960void JIT::emit_op_mul(const Instruction* currentInstruction)
    954961{
    955     BinaryArithProfile* arithProfile = &currentInstruction->as<OpMul>().metadata(m_codeBlock).m_arithProfile;
     962    ArithProfile* arithProfile = &currentInstruction->as<OpMul>().metadata(m_codeBlock).m_arithProfile;
    956963    JITMulIC* mulIC = m_codeBlock->addJITMulIC(arithProfile);
    957964    m_instructionToMathIC.add(currentInstruction, mulIC);
     
    969976void JIT::emit_op_sub(const Instruction* currentInstruction)
    970977{
    971     BinaryArithProfile* arithProfile = &currentInstruction->as<OpSub>().metadata(m_codeBlock).m_arithProfile;
     978    ArithProfile* arithProfile = &currentInstruction->as<OpSub>().metadata(m_codeBlock).m_arithProfile;
    972979    JITSubIC* subIC = m_codeBlock->addJITSubIC(arithProfile);
    973980    m_instructionToMathIC.add(currentInstruction, subIC);
Note: See TracChangeset for help on using the changeset viewer.