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

Take one branch instead of two to test for JSValue().

Patch by Geoffrey Garen <[email protected]> on 2009-10-01
Reviewed by Sam Weinig.

1.1% SunSpider speedup.

  • jit/JITCall.cpp:

(JSC::JIT::compileOpCall):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_to_jsnumber):
(JSC::JIT::emit_op_create_arguments):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emit_op_put_by_val): Test for the empty value tag, instead
of testing for the cell tag with a 0 payload.

  • runtime/JSValue.cpp:

(JSC::JSValue::description): Added support for dumping the new empty value,
and deleted values, in debug builds.

  • runtime/JSValue.h:

(JSC::JSValue::JSValue()): Construct JSValue() with the empty value tag.

(JSC::JSValue::JSValue(JSCell*)): Convert null pointer to the empty value
tag, to avoid having two different c++ versions of null / empty.

(JSC::JSValue::operator bool): Test for the empty value tag, instead
of testing for the cell tag with a 0 payload.

File:
1 edited

Legend:

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

    r47614 r49004  
    237237    int registerOffset = instruction[4].u.operand;
    238238
    239     Jump wasEval1;
    240     Jump wasEval2;
     239    Jump wasEval;
    241240    if (opcodeID == op_call_eval) {
    242241        JITStubCall stubCall(this, cti_op_call_eval);
     
    245244        stubCall.addArgument(JIT::Imm32(argCount));
    246245        stubCall.call();
    247         wasEval1 = branchTest32(NonZero, regT0);
    248         wasEval2 = branch32(NotEqual, regT1, Imm32(JSValue::CellTag));
     246        wasEval = branch32(Equal, regT1, Imm32(JSValue::EmptyValueTag));
    249247    }
    250248
     
    272270    emitNakedCall(m_globalData->jitStubs.ctiVirtualCall());
    273271
    274     if (opcodeID == op_call_eval) {
    275         wasEval1.link(this);
    276         wasEval2.link(this);
    277     }
     272    if (opcodeID == op_call_eval)
     273        wasEval.link(this);
    278274
    279275    emitStore(dst, regT1, regT0);;
     
    307303    int registerOffset = instruction[4].u.operand;
    308304
    309     Jump wasEval1;
    310     Jump wasEval2;
     305    Jump wasEval;
    311306    if (opcodeID == op_call_eval) {
    312307        JITStubCall stubCall(this, cti_op_call_eval);
     
    315310        stubCall.addArgument(JIT::Imm32(argCount));
    316311        stubCall.call();
    317         wasEval1 = branchTest32(NonZero, regT0);
    318         wasEval2 = branch32(NotEqual, regT1, Imm32(JSValue::CellTag));
     312        wasEval = branch32(NotEqual, regT1, Imm32(JSValue::EmptyValueTag));
    319313    }
    320314
     
    360354    m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall();
    361355   
    362     if (opcodeID == op_call_eval) {
    363         wasEval1.link(this);
    364         wasEval2.link(this);
    365     }
     356    if (opcodeID == op_call_eval)
     357        wasEval.link(this);
    366358
    367359    // Put the return value in dst. In the interpreter, op_ret does this.
Note: See TracChangeset for help on using the changeset viewer.