Changeset 38928 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Dec 2, 2008, 6:10:54 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-02 Gavin Barraclough <[email protected]>

Reviewed by Geoffrey Garen.

Plant shift right immediate instructions, which are awesome.
https://bugs.webkit.org/show_bug.cgi?id=22610
~5% on the v8-crypto test.

  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r38925 r38928  
     12008-12-02  Gavin Barraclough  <[email protected]>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        Plant shift right immediate instructions, which are awesome.
     6        https://bugs.webkit.org/show_bug.cgi?id=22610
     7        ~5% on the v8-crypto test.
     8
     9        * jit/JIT.cpp:
     10        (JSC::JIT::privateCompileMainPass):
     11        (JSC::JIT::privateCompileSlowCases):
     12
    1132008-12-02  Geoffrey Garen  <[email protected]>
    214
  • trunk/JavaScriptCore/jit/JIT.cpp

    r38917 r38928  
    18131813        }
    18141814        case op_rshift: {
    1815             emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::ecx, i);
    1816             emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    1817             emitJumpSlowCaseIfNotImmNum(X86::ecx, i);
    1818             emitFastArithImmToInt(X86::ecx);
    1819             __ sarl_CLr(X86::eax);
     1815            unsigned src1 = instruction[i + 2].u.operand;
     1816            unsigned src2 = instruction[i + 3].u.operand;
     1817            if (JSValue* value = getConstantImmediateNumericArg(src2)) {
     1818                emitGetVirtualRegister(src1, X86::eax, i);
     1819                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     1820                // Mask with 0x1f as per ecma-262 11.7.2 step 7.
     1821                __ sarl_i8r(JSImmediate::getTruncatedUInt32(value) & 0x1f, X86::eax);
     1822            } else {
     1823                emitGetVirtualRegisters(src1, X86::eax, src2, X86::ecx, i);
     1824                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     1825                emitJumpSlowCaseIfNotImmNum(X86::ecx, i);
     1826                emitFastArithImmToInt(X86::ecx);
     1827                __ sarl_CLr(X86::eax);
     1828            }
    18201829            emitFastArithPotentiallyReTagImmediate(X86::eax);
    18211830            emitPutVirtualRegister(instruction[i + 1].u.operand);
     
    24152424        }
    24162425        case op_rshift: {
     2426            unsigned src2 = instruction[i + 3].u.operand;
    24172427            __ link(iter->from, __ label());
    2418             __ link((++iter)->from, __ label());
     2428            if (getConstantImmediateNumericArg(src2))
     2429                emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx);
     2430            else {
     2431                __ link((++iter)->from, __ label());
     2432                emitPutCTIArg(X86::ecx, 4);
     2433            }
     2434
    24192435            emitPutCTIArg(X86::eax, 0);
    2420             emitPutCTIArg(X86::ecx, 4);
    24212436            emitCTICall(i, Interpreter::cti_op_rshift);
    24222437            emitPutVirtualRegister(instruction[i + 1].u.operand);
Note: See TracChangeset for help on using the changeset viewer.