Ignore:
Timestamp:
Nov 4, 2019, 3:47:07 PM (6 years ago)
Author:
Truitt Savell
Message:

Unreviewed, rolling out r252015.

Broke the Windows build

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/252015

File:
1 edited

Legend:

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

    r252015 r252021  
    454454void JIT::emit_op_negate(const Instruction* currentInstruction)
    455455{
    456     UnaryArithProfile* arithProfile = &currentInstruction->as<OpNegate>().metadata(m_codeBlock).m_arithProfile;
     456    ArithProfile* arithProfile = &currentInstruction->as<OpNegate>().metadata(m_codeBlock).m_arithProfile;
    457457    JITNegIC* negateIC = m_codeBlock->addJITNegIC(arithProfile);
    458458    m_instructionToMathIC.add(currentInstruction, negateIC);
     
    635635}
    636636
     637ALWAYS_INLINE static OperandTypes getOperandTypes(const ArithProfile& arithProfile)
     638{
     639    return OperandTypes(arithProfile.lhsResultType(), arithProfile.rhsResultType());
     640}
     641
    637642void JIT::emit_op_add(const Instruction* currentInstruction)
    638643{
    639     BinaryArithProfile* arithProfile = &currentInstruction->as<OpAdd>().metadata(m_codeBlock).m_arithProfile;
     644    ArithProfile* arithProfile = &currentInstruction->as<OpAdd>().metadata(m_codeBlock).m_arithProfile;
    640645    JITAddIC* addIC = m_codeBlock->addJITAddIC(arithProfile);
    641646    m_instructionToMathIC.add(currentInstruction, addIC);
     
    682687    bool generatedInlineCode = mathIC->generateInline(*this, mathICGenerationState);
    683688    if (!generatedInlineCode) {
    684         UnaryArithProfile* arithProfile = mathIC->arithProfile();
     689        ArithProfile* arithProfile = mathIC->arithProfile();
    685690        if (arithProfile && shouldEmitProfiling())
    686691            callOperationWithResult(profiledFunction, resultRegs, TrustedImmPtr(m_codeBlock->globalObject()), srcRegs, arithProfile);
     
    705710{
    706711    auto bytecode = currentInstruction->as<Op>();
     712    OperandTypes types = getOperandTypes(copiedArithProfile(bytecode));
    707713    int result = bytecode.m_dst.offset();
    708714    int op1 = bytecode.m_lhs.offset();
     
    723729#endif
    724730
    725     SnippetOperand leftOperand(bytecode.m_operandTypes.first());
    726     SnippetOperand rightOperand(bytecode.m_operandTypes.second());
     731    SnippetOperand leftOperand(types.first());
     732    SnippetOperand rightOperand(types.second());
    727733
    728734    if (isOperandConstantInt(op1))
     
    754760        else if (rightOperand.isConst())
    755761            emitGetVirtualRegister(op2, rightRegs);
    756         BinaryArithProfile* arithProfile = mathIC->arithProfile();
     762        ArithProfile* arithProfile = mathIC->arithProfile();
    757763        if (arithProfile && shouldEmitProfiling())
    758764            callOperationWithResult(profiledFunction, resultRegs, TrustedImmPtr(m_codeBlock->globalObject()), leftRegs, rightRegs, arithProfile);
     
    794800#endif
    795801
    796     UnaryArithProfile* arithProfile = mathIC->arithProfile();
     802    ArithProfile* arithProfile = mathIC->arithProfile();
    797803    if (arithProfile && shouldEmitProfiling()) {
    798804        if (mathICGenerationState.shouldSlowPathRepatch)
     
    826832
    827833    auto bytecode = currentInstruction->as<Op>();
     834    OperandTypes types = getOperandTypes(copiedArithProfile(bytecode));
    828835    int result = bytecode.m_dst.offset();
    829836    int op1 = bytecode.m_lhs.offset();
     
    840847#endif
    841848   
    842     SnippetOperand leftOperand(bytecode.m_operandTypes.first());
    843     SnippetOperand rightOperand(bytecode.m_operandTypes.second());
     849    SnippetOperand leftOperand(types.first());
     850    SnippetOperand rightOperand(types.second());
    844851
    845852    if (isOperandConstantInt(op1))
     
    859866#endif
    860867
    861     BinaryArithProfile* arithProfile = mathIC->arithProfile();
     868    ArithProfile* arithProfile = mathIC->arithProfile();
    862869    if (arithProfile && shouldEmitProfiling()) {
    863870        if (mathICGenerationState.shouldSlowPathRepatch)
     
    887894{
    888895    auto bytecode = currentInstruction->as<OpDiv>();
     896    auto& metadata = bytecode.metadata(m_codeBlock);
    889897    int result = bytecode.m_dst.offset();
    890898    int op1 = bytecode.m_lhs.offset();
     
    892900
    893901#if USE(JSVALUE64)
     902    OperandTypes types = getOperandTypes(metadata.m_arithProfile);
    894903    JSValueRegs leftRegs = JSValueRegs(regT0);
    895904    JSValueRegs rightRegs = JSValueRegs(regT1);
     
    897906    GPRReg scratchGPR = regT2;
    898907#else
     908    OperandTypes types = getOperandTypes(metadata.m_arithProfile);
    899909    JSValueRegs leftRegs = JSValueRegs(regT1, regT0);
    900910    JSValueRegs rightRegs = JSValueRegs(regT3, regT2);
     
    904914    FPRReg scratchFPR = fpRegT2;
    905915
    906     BinaryArithProfile* arithProfile = nullptr;
     916    ArithProfile* arithProfile = nullptr;
    907917    if (shouldEmitProfiling())
    908918        arithProfile = &currentInstruction->as<OpDiv>().metadata(m_codeBlock).m_arithProfile;
    909919
    910     SnippetOperand leftOperand(bytecode.m_operandTypes.first());
    911     SnippetOperand rightOperand(bytecode.m_operandTypes.second());
     920    SnippetOperand leftOperand(types.first());
     921    SnippetOperand rightOperand(types.second());
    912922
    913923    if (isOperandConstantInt(op1))
     
    951961void JIT::emit_op_mul(const Instruction* currentInstruction)
    952962{
    953     BinaryArithProfile* arithProfile = &currentInstruction->as<OpMul>().metadata(m_codeBlock).m_arithProfile;
     963    ArithProfile* arithProfile = &currentInstruction->as<OpMul>().metadata(m_codeBlock).m_arithProfile;
    954964    JITMulIC* mulIC = m_codeBlock->addJITMulIC(arithProfile);
    955965    m_instructionToMathIC.add(currentInstruction, mulIC);
     
    967977void JIT::emit_op_sub(const Instruction* currentInstruction)
    968978{
    969     BinaryArithProfile* arithProfile = &currentInstruction->as<OpSub>().metadata(m_codeBlock).m_arithProfile;
     979    ArithProfile* arithProfile = &currentInstruction->as<OpSub>().metadata(m_codeBlock).m_arithProfile;
    970980    JITSubIC* subIC = m_codeBlock->addJITSubIC(arithProfile);
    971981    m_instructionToMathIC.add(currentInstruction, subIC);
Note: See TracChangeset for help on using the changeset viewer.