⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 197685 in webkit


Ignore:
Timestamp:
Mar 7, 2016, 10:23:46 AM (11 years ago)
Author:
benjamin@webkit.org
Message:

[JSC] Remove a useless "Move" from baseline-JIT op_mul's fast path
https://bugs.webkit.org/show_bug.cgi?id=155071

Reviewed by Geoffrey Garen.

We do not need to multiply to a scratch and then move the result
to the destination. We can just multiply to the destination.

  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_op_mul):

  • jit/JITMulGenerator.cpp:

(JSC::JITMulGenerator::generateFastPath):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r197684 r197685  
     12016-03-07  Benjamin Poulain  <benjamin@webkit.org>
     2
     3        [JSC] Remove a useless "Move" from baseline-JIT op_mul's fast path
     4        https://bugs.webkit.org/show_bug.cgi?id=155071
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        We do not need to multiply to a scratch and then move the result
     9        to the destination. We can just multiply to the destination.
     10
     11        * jit/JITArithmetic.cpp:
     12        (JSC::JIT::emit_op_mul):
     13        * jit/JITMulGenerator.cpp:
     14        (JSC::JITMulGenerator::generateFastPath):
     15
    1162016-03-07  Yusuke Suzuki  <utatane.tea@gmail.com>
    217
  • trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp

    r196273 r197685  
    823823    JSValueRegs leftRegs = JSValueRegs(regT0);
    824824    JSValueRegs rightRegs = JSValueRegs(regT1);
    825     JSValueRegs resultRegs = leftRegs;
    826     GPRReg scratchGPR = regT2;
     825    JSValueRegs resultRegs = JSValueRegs(regT2);
     826    GPRReg scratchGPR = regT3;
    827827    FPRReg scratchFPR = InvalidFPRReg;
    828828#else
  • trunk/Source/JavaScriptCore/jit/JITMulGenerator.cpp

    r194669 r197685  
    6161        CCallHelpers::Jump notInt32 = jit.branchIfNotInt32(var);
    6262
    63         m_slowPathJumpList.append(jit.branchMul32(CCallHelpers::Overflow, var.payloadGPR(), CCallHelpers::Imm32(constOpr.asConstInt32()), m_scratchGPR));
     63        GPRReg multiplyResultGPR = m_result.payloadGPR();
     64        if (multiplyResultGPR == var.payloadGPR())
     65            multiplyResultGPR = m_scratchGPR;
    6466
    65         jit.boxInt32(m_scratchGPR, m_result);
     67        m_slowPathJumpList.append(jit.branchMul32(CCallHelpers::Overflow, var.payloadGPR(), CCallHelpers::Imm32(constOpr.asConstInt32()), multiplyResultGPR));
     68
     69        jit.boxInt32(multiplyResultGPR, m_result);
    6670        m_endJumpList.append(jit.jump());
    6771
Note: See TracChangeset for help on using the changeset viewer.