Changeset 41275 in webkit for trunk/JavaScriptCore/jit/JIT.cpp


Ignore:
Timestamp:
Feb 26, 2009, 5:09:43 PM (16 years ago)
Author:
[email protected]
Message:

2009-02-26 Gavin Barraclough <[email protected]>

Reviewed by Oliver Hunt.

Integer Immediate representation need not be canonical in x86 JIT code.
On x86-64 we already have loosened the requirement that the int immediate
representation in canonical, we should bring x86 into line.

This patch is a minor (~0.5%) improvement on sunspider & v8-tests, and
should reduce memory footoprint (reduces JIT code size).

  • jit/JIT.cpp: (JSC::JIT::compileOpStrictEq): (JSC::JIT::privateCompileSlowCases):
  • jit/JIT.h: (JSC::JIT::emitJumpIfImmediateNumber): (JSC::JIT::emitJumpIfNotImmediateNumber):
  • jit/JITArithmetic.cpp: (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate): (JSC::JIT::compileBinaryArithOp):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JIT.cpp

    r41168 r41275  
    236236    emitGetVirtualRegisters(src1, regT0, src2, regT1);
    237237
    238 #if USE(ALTERNATE_JSIMMEDIATE)
    239238    // Jump to a slow case if either operand is a number, or if both are JSCell*s.
    240239    move(regT0, regT2);
     
    248247        set32(NotEqual, regT1, regT0, regT0);
    249248    emitTagAsBoolImmediate(regT0);
    250 #else
    251     bool negated = (type == OpNStrictEq);
    252 
    253     // Check that both are immediates, if so check if they're equal
    254     Jump firstNotImmediate = emitJumpIfJSCell(regT0);
    255     Jump secondNotImmediate = emitJumpIfJSCell(regT1);
    256     Jump bothWereImmediatesButNotEqual = branchPtr(NotEqual, regT1, regT0);
    257 
    258     // They are equal - set the result to true. (Or false, if negated).
    259     move(ImmPtr(JSValuePtr::encode(jsBoolean(!negated))), regT0);
    260     Jump bothWereImmediatesAndEqual = jump();
    261 
    262     // eax was not an immediate, we haven't yet checked edx.
    263     // If edx is also a JSCell, or is 0, then jump to a slow case,
    264     // otherwise these values are not equal.
    265     firstNotImmediate.link(this);
    266     emitJumpSlowCaseIfJSCell(regT1);
    267     addSlowCase(branchPtr(Equal, regT1, ImmPtr(JSValuePtr::encode(js0()))));
    268     Jump firstWasNotImmediate = jump();
    269 
    270     // eax was an immediate, but edx wasn't.
    271     // If eax is 0 jump to a slow case, otherwise these values are not equal.
    272     secondNotImmediate.link(this);
    273     addSlowCase(branchPtr(Equal, regT0, ImmPtr(JSValuePtr::encode(js0()))));
    274 
    275     // We get here if the two values are different immediates, or one is 0 and the other is a JSCell.
    276     // Vaelues are not equal, set the result to false.
    277     bothWereImmediatesButNotEqual.link(this);
    278     firstWasNotImmediate.link(this);
    279     move(ImmPtr(JSValuePtr::encode(jsBoolean(negated))), regT0);
    280    
    281     bothWereImmediatesAndEqual.link(this);
    282 #endif
    283249
    284250    emitPutVirtualRegister(dst);
     
    15461512            linkSlowCase(iter);
    15471513            linkSlowCase(iter);
    1548 #if !USE(ALTERNATE_JSIMMEDIATE)
    1549             linkSlowCase(iter);
    1550 #endif
    15511514            emitPutJITStubArg(regT0, 1);
    15521515            emitPutJITStubArg(regT1, 2);
     
    15581521            linkSlowCase(iter);
    15591522            linkSlowCase(iter);
    1560 #if !USE(ALTERNATE_JSIMMEDIATE)
    1561             linkSlowCase(iter);
    1562 #endif
    15631523            emitPutJITStubArg(regT0, 1);
    15641524            emitPutJITStubArg(regT1, 2);
Note: See TracChangeset for help on using the changeset viewer.