Changeset 194042 in webkit


Ignore:
Timestamp:
Dec 14, 2015 11:44:56 AM (8 years ago)
Author:
mark.lam@apple.com
Message:

Misc. small fixes in snippet related code.
https://bugs.webkit.org/show_bug.cgi?id=152259

Reviewed by Saam Barati.

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileArithMul):

  • When loading a constant JSValue for a node, use the one that the node already provides instead of reconstructing it. This is not a bug, but the fix makes the code cleaner.
  • jit/JITBitAndGenerator.cpp:

(JSC::JITBitAndGenerator::generateFastPath):

  • No need to do a bitand with a constant int 0xffffffff operand.
  • jit/JITBitOrGenerator.cpp:

(JSC::JITBitOrGenerator::generateFastPath):

  • Fix comments: bitor is '|', not '&'.
  • No need to do a bitor with a constant int 0 operand.
  • jit/JITBitXorGenerator.cpp:

(JSC::JITBitXorGenerator::generateFastPath):

  • Fix comments: bitxor is '', not '&'.
  • jit/JITRightShiftGenerator.cpp:

(JSC::JITRightShiftGenerator::generateFastPath):

  • Renamed a jump target name to be clearer about its purpose.
Location:
trunk/Source/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r194040 r194042  
     12015-12-14  Mark Lam  <mark.lam@apple.com>
     2
     3        Misc. small fixes in snippet related code.
     4        https://bugs.webkit.org/show_bug.cgi?id=152259
     5
     6        Reviewed by Saam Barati.
     7
     8        * dfg/DFGSpeculativeJIT.cpp:
     9        (JSC::DFG::SpeculativeJIT::compileArithMul):
     10        - When loading a constant JSValue for a node, use the one that the node already
     11          provides instead of reconstructing it.  This is not a bug, but the fix makes
     12          the code cleaner.
     13
     14        * jit/JITBitAndGenerator.cpp:
     15        (JSC::JITBitAndGenerator::generateFastPath):
     16        - No need to do a bitand with a constant int 0xffffffff operand.
     17
     18        * jit/JITBitOrGenerator.cpp:
     19        (JSC::JITBitOrGenerator::generateFastPath):
     20        - Fix comments: bitor is '|', not '&'.
     21        - No need to do a bitor with a constant int 0 operand.
     22
     23        * jit/JITBitXorGenerator.cpp:
     24        (JSC::JITBitXorGenerator::generateFastPath):
     25        - Fix comments: bitxor is '^', not '&'.
     26
     27        * jit/JITRightShiftGenerator.cpp:
     28        (JSC::JITRightShiftGenerator::generateFastPath):
     29        - Renamed a jump target name to be clearer about its purpose.
     30
    1312015-12-14  Mark Lam  <mark.lam@apple.com>
    232
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r194036 r194042  
    35793579        if (leftOperand.isPositiveConstInt32()) {
    35803580            leftRegs = resultRegs;
    3581             int64_t leftConst = leftOperand.asConstInt32();
    3582             m_jit.moveValue(JSValue(leftConst), leftRegs);
     3581            m_jit.moveValue(leftChild->asJSValue(), leftRegs);
    35833582        } else if (rightOperand.isPositiveConstInt32()) {
    35843583            rightRegs = resultRegs;
    3585             int64_t rightConst = rightOperand.asConstInt32();
    3586             m_jit.moveValue(JSValue(rightConst), rightRegs);
     3584            m_jit.moveValue(rightChild->asJSValue(), rightRegs);
    35873585        }
    35883586
  • trunk/Source/JavaScriptCore/jit/JITBitAndGenerator.cpp

    r193471 r194042  
    5353       
    5454        jit.moveValueRegs(var, m_result);
     55        if (constOpr.asConstInt32() != static_cast<int32_t>(0xffffffff)) {
    5556#if USE(JSVALUE64)
    56         jit.and64(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
    57         if (constOpr.asConstInt32() >= 0)
    58             jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
     57            jit.and64(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
     58            if (constOpr.asConstInt32() >= 0)
     59                jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
    5960#else
    60         jit.and32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
     61            jit.and32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
    6162#endif
    62        
     63        }
     64
    6365    } else {
    6466        ASSERT(!m_leftOperand.isConstInt32() && !m_rightOperand.isConstInt32());
  • trunk/Source/JavaScriptCore/jit/JITBitOrGenerator.cpp

    r193471 r194042  
    4141        SnippetOperand& constOpr = m_leftOperand.isConstInt32() ? m_leftOperand : m_rightOperand;
    4242       
    43         // Try to do intVar & intConstant.
     43        // Try to do intVar | intConstant.
    4444        m_slowPathJumpList.append(jit.branchIfNotInt32(var));
    4545       
    4646        jit.moveValueRegs(var, m_result);
     47        if (constOpr.asConstInt32()) {
    4748#if USE(JSVALUE64)
    48         jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
    49         jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
     49            jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
     50            jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
    5051#else
    51         jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
     52            jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
    5253#endif
    53        
     54        }
     55
    5456    } else {
    5557        ASSERT(!m_leftOperand.isConstInt32() && !m_rightOperand.isConstInt32());
    5658       
    57         // Try to do intVar & intVar.
     59        // Try to do intVar | intVar.
    5860        m_slowPathJumpList.append(jit.branchIfNotInt32(m_left));
    5961        m_slowPathJumpList.append(jit.branchIfNotInt32(m_right));
  • trunk/Source/JavaScriptCore/jit/JITBitXorGenerator.cpp

    r193471 r194042  
    4141        SnippetOperand& constOpr = m_leftOperand.isConstInt32() ? m_leftOperand : m_rightOperand;
    4242       
    43         // Try to do intVar & intConstant.
     43        // Try to do intVar ^ intConstant.
    4444        m_slowPathJumpList.append(jit.branchIfNotInt32(var));
    4545       
     
    5555        ASSERT(!m_leftOperand.isConstInt32() && !m_rightOperand.isConstInt32());
    5656       
    57         // Try to do intVar & intVar.
     57        // Try to do intVar ^ intVar.
    5858        m_slowPathJumpList.append(jit.branchIfNotInt32(m_left));
    5959        m_slowPathJumpList.append(jit.branchIfNotInt32(m_right));
  • trunk/Source/JavaScriptCore/jit/JITRightShiftGenerator.cpp

    r193788 r194042  
    8888        m_slowPathJumpList.append(jit.branchIfNotInt32(m_right));
    8989
    90         CCallHelpers::Jump notInt;
     90        CCallHelpers::Jump leftNotInt;
    9191        if (m_leftOperand.isConstInt32()) {
    9292#if USE(JSVALUE32_64)
     
    9595            jit.move(CCallHelpers::Imm32(m_leftOperand.asConstInt32()), m_result.payloadGPR());
    9696        } else {
    97             notInt = jit.branchIfNotInt32(m_left);
     97            leftNotInt = jit.branchIfNotInt32(m_left);
    9898            jit.moveValueRegs(m_left, m_result);
    9999        }
     
    113113
    114114            // Try to do (doubleVar >> intVar).
    115             notInt.link(&jit);
     115            leftNotInt.link(&jit);
    116116
    117117            m_slowPathJumpList.append(jit.branchIfNotNumber(m_left, m_scratchGPR));
     
    126126
    127127        } else
    128             m_slowPathJumpList.append(notInt);
     128            m_slowPathJumpList.append(leftNotInt);
    129129    }
    130130}
Note: See TracChangeset for help on using the changeset viewer.