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


Ignore:
Timestamp:
Mar 27, 2009, 8:50:39 PM (16 years ago)
Author:
[email protected]
Message:

Improve performance of Function.prototype.call
<https://bugs.webkit.org/show_bug.cgi?id=24907>

Reviewed by Gavin Barraclough

Optimistically assume that expression.call(..) is going to be a call to
Function.prototype.call, and handle it specially to attempt to reduce the
degree of VM reentrancy.

When everything goes right this removes the vm reentry improving .call()
by around a factor of 10.

File:
1 edited

Legend:

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

    r41544 r42065  
    820820            NEXT_OPCODE(op_jneq_null);
    821821        }
     822        case op_jneq_ptr: {
     823            unsigned src = currentInstruction[1].u.operand;
     824            JSCell* ptr = currentInstruction[2].u.jsCell;
     825            unsigned target = currentInstruction[3].u.operand;
     826           
     827            emitGetVirtualRegister(src, regT0);
     828            addJump(branchPtr(NotEqual, regT0, ImmPtr(JSValuePtr::encode(JSValuePtr(ptr)))), target + 3);           
     829
     830            RECORD_JUMP_TARGET(target + 3);
     831            NEXT_OPCODE(op_jneq_ptr);
     832        }
    822833        case op_post_inc: {
    823834            compileFastArith_op_post_inc(currentInstruction[1].u.operand, currentInstruction[2].u.operand);
Note: See TracChangeset for help on using the changeset viewer.