Changeset 49005 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Oct 1, 2009, 4:49:28 PM (16 years ago)
Author:
[email protected]
Message:

Roll out r49004 since it broke the debug build.

Location:
trunk/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r49004 r49005  
    1 2009-10-01  Geoffrey Garen  <[email protected]>
    2 
    3         Reviewed by Sam Weinig.
    4 
    5         Take one branch instead of two to test for JSValue().
    6        
    7         1.1% SunSpider speedup.
    8 
    9         * jit/JITCall.cpp:
    10         (JSC::JIT::compileOpCall):
    11         * jit/JITOpcodes.cpp:
    12         (JSC::JIT::emit_op_to_jsnumber):
    13         (JSC::JIT::emit_op_create_arguments):
    14         * jit/JITPropertyAccess.cpp:
    15         (JSC::JIT::emitSlow_op_get_by_val):
    16         (JSC::JIT::emit_op_put_by_val): Test for the empty value tag, instead
    17         of testing for the cell tag with a 0 payload.
    18 
    19         * runtime/JSValue.cpp:
    20         (JSC::JSValue::description): Added support for dumping the new empty value,
    21         and deleted values, in debug builds.
    22 
    23         * runtime/JSValue.h:
    24         (JSC::JSValue::JSValue()): Construct JSValue() with the empty value tag.
    25 
    26         (JSC::JSValue::JSValue(JSCell*)): Convert null pointer to the empty value
    27         tag, to avoid having two different c++ versions of null / empty.
    28 
    29         (JSC::JSValue::operator bool): Test for the empty value tag, instead
    30         of testing for the cell tag with a 0 payload.
    31 
    3212009-10-01  Yongjun Zhang  <[email protected]>
    332
  • trunk/JavaScriptCore/jit/JITCall.cpp

    r49004 r49005  
    237237    int registerOffset = instruction[4].u.operand;
    238238
    239     Jump wasEval;
     239    Jump wasEval1;
     240    Jump wasEval2;
    240241    if (opcodeID == op_call_eval) {
    241242        JITStubCall stubCall(this, cti_op_call_eval);
     
    244245        stubCall.addArgument(JIT::Imm32(argCount));
    245246        stubCall.call();
    246         wasEval = branch32(Equal, regT1, Imm32(JSValue::EmptyValueTag));
     247        wasEval1 = branchTest32(NonZero, regT0);
     248        wasEval2 = branch32(NotEqual, regT1, Imm32(JSValue::CellTag));
    247249    }
    248250
     
    270272    emitNakedCall(m_globalData->jitStubs.ctiVirtualCall());
    271273
    272     if (opcodeID == op_call_eval)
    273         wasEval.link(this);
     274    if (opcodeID == op_call_eval) {
     275        wasEval1.link(this);
     276        wasEval2.link(this);
     277    }
    274278
    275279    emitStore(dst, regT1, regT0);;
     
    303307    int registerOffset = instruction[4].u.operand;
    304308
    305     Jump wasEval;
     309    Jump wasEval1;
     310    Jump wasEval2;
    306311    if (opcodeID == op_call_eval) {
    307312        JITStubCall stubCall(this, cti_op_call_eval);
     
    310315        stubCall.addArgument(JIT::Imm32(argCount));
    311316        stubCall.call();
    312         wasEval = branch32(NotEqual, regT1, Imm32(JSValue::EmptyValueTag));
     317        wasEval1 = branchTest32(NonZero, regT0);
     318        wasEval2 = branch32(NotEqual, regT1, Imm32(JSValue::CellTag));
    313319    }
    314320
     
    354360    m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall();
    355361   
    356     if (opcodeID == op_call_eval)
    357         wasEval.link(this);
     362    if (opcodeID == op_call_eval) {
     363        wasEval1.link(this);
     364        wasEval2.link(this);
     365    }
    358366
    359367    // Put the return value in dst. In the interpreter, op_ret does this.
  • trunk/JavaScriptCore/jit/JITOpcodes.cpp

    r49004 r49005  
    249249
    250250    // Check for an exception
     251    // FIXME: Maybe we can optimize this comparison to JSValue().
    251252    move(ImmPtr(&globalData->exception), regT2);
    252     Jump sawException = branch32(NotEqual, tagFor(0, regT2), Imm32(JSValue::EmptyValueTag));
     253    Jump sawException1 = branch32(NotEqual, tagFor(0, regT2), Imm32(JSValue::CellTag));
     254    Jump sawException2 = branch32(NonZero, payloadFor(0, regT2), Imm32(0));
    253255
    254256    // Grab the return address.
     
    263265
    264266    // Handle an exception
    265     sawException.link(this);
     267    sawException1.link(this);
     268    sawException2.link(this);
    266269    // Grab the return address.
    267270    emitGetFromCallFrameHeaderPtr(RegisterFile::ReturnPC, regT1);
     
    12351238
    12361239    Jump isInt32 = branch32(Equal, regT1, Imm32(JSValue::Int32Tag));
    1237     addSlowCase(branch32(AboveOrEqual, regT1, Imm32(JSValue::EmptyValueTag)));
     1240    addSlowCase(branch32(AboveOrEqual, regT1, Imm32(JSValue::DeletedValueTag)));
    12381241    isInt32.link(this);
    12391242
     
    13791382void JIT::emit_op_create_arguments(Instruction*)
    13801383{
    1381     Jump argsCreated = branch32(NotEqual, tagFor(RegisterFile::ArgumentsRegister, callFrameRegister), Imm32(JSValue::EmptyValueTag));
     1384    Jump argsNotCell = branch32(NotEqual, tagFor(RegisterFile::ArgumentsRegister, callFrameRegister), Imm32(JSValue::CellTag));
     1385    Jump argsNotNull = branchTestPtr(NonZero, payloadFor(RegisterFile::ArgumentsRegister, callFrameRegister));
    13821386
    13831387    // If we get here the arguments pointer is a null cell - i.e. arguments need lazy creation.
     
    13871391        JITStubCall(this, cti_op_create_arguments).call();
    13881392
    1389     argsCreated.link(this);
     1393    argsNotCell.link(this);
     1394    argsNotNull.link(this);
    13901395}
    13911396   
  • trunk/JavaScriptCore/jit/JITPropertyAccess.cpp

    r49004 r49005  
    311311    load32(BaseIndex(regT0, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4), regT1); // tag
    312312    load32(BaseIndex(regT0, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), regT0); // payload
    313     branch32(Equal, regT1, Imm32(JSValue::EmptyValueTag)).linkTo(callGetByValJITStub, this);
    314 
     313
     314    // FIXME: Maybe we can optimize this comparison to JSValue().
     315    Jump skip = branch32(NotEqual, regT0, Imm32(0));
     316    branch32(Equal, regT1, Imm32(JSValue::CellTag), callGetByValJITStub);
     317
     318    skip.link(this);
    315319    emitStore(dst, regT1, regT0);
    316320}
     
    330334
    331335    Jump inFastVector = branch32(Below, regT2, Address(regT0, OBJECT_OFFSETOF(JSArray, m_fastAccessCutoff)));
    332    
     336
    333337    // Check if the access is within the vector.
    334338    addSlowCase(branch32(AboveOrEqual, regT2, Address(regT3, OBJECT_OFFSETOF(ArrayStorage, m_vectorLength))));
     
    336340    // This is a write to the slow part of the vector; first, we have to check if this would be the first write to this location.
    337341    // FIXME: should be able to handle initial write to array; increment the the number of items in the array, and potentially update fast access cutoff.
    338     addSlowCase(branch32(Equal, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4), Imm32(JSValue::EmptyValueTag)));
     342    Jump skip = branch32(NotEqual, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4), Imm32(JSValue::CellTag));
     343    addSlowCase(branch32(Equal, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), Imm32(0)));
     344    skip.link(this);
    339345
    340346    inFastVector.link(this);
  • trunk/JavaScriptCore/runtime/JSValue.cpp

    r49004 r49005  
    123123    else if (isNull())
    124124        snprintf(description, size, "Null");
    125     else if (isUndefined())
     125    else {
     126        ASSERT(isUndefined());
    126127        snprintf(description, size, "Undefined");
    127     else if (tag() == EmptyValueTag)
    128         snprintf(description, size, "<JSValue()>");
    129     else {
    130         ASSERT(tag() == DeletedValueTag);
    131         snprintf(description, size, "<HashTableDeletedValue>");
    132128    }
    133129
  • trunk/JavaScriptCore/runtime/JSValue.h

    r49004 r49005  
    214214        enum { NullTag =         0xfffffffb };
    215215        enum { UndefinedTag =    0xfffffffa };
    216         enum { EmptyValueTag =   0xfffffff9 };
    217         enum { DeletedValueTag = 0xfffffff8 };
     216        enum { DeletedValueTag = 0xfffffff9 };
    218217
    219218        enum { LowestTag =  DeletedValueTag };
     
    429428    inline JSValue::JSValue()
    430429    {
    431         u.asBits.tag = EmptyValueTag;
     430        u.asBits.tag = CellTag;
    432431        u.asBits.payload = 0;
    433432    }
     
    465464    inline JSValue::JSValue(JSCell* ptr)
    466465    {
    467         if (ptr)
    468             u.asBits.tag = CellTag;
    469         else
    470             u.asBits.tag = EmptyValueTag;
     466        u.asBits.tag = CellTag;
    471467        u.asBits.payload = reinterpret_cast<int32_t>(ptr);
    472468    }
     
    474470    inline JSValue::JSValue(const JSCell* ptr)
    475471    {
    476         if (ptr)
    477             u.asBits.tag = CellTag;
    478         else
    479             u.asBits.tag = EmptyValueTag;
     472        u.asBits.tag = CellTag;
    480473        u.asBits.payload = reinterpret_cast<int32_t>(const_cast<JSCell*>(ptr));
    481474    }
     
    483476    inline JSValue::operator bool() const
    484477    {
    485         ASSERT(tag() != DeletedValueTag);
    486         return tag() != EmptyValueTag;
     478        return u.asBits.payload || tag() != CellTag;
    487479    }
    488480
Note: See TracChangeset for help on using the changeset viewer.