Changeset 36427 in webkit for trunk/JavaScriptCore/VM/CTI.cpp


Ignore:
Timestamp:
Sep 14, 2008, 11:26:15 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-14 Maciej Stachowiak <[email protected]>

Reviewed by Cameron Zwarich.


  • speed up JS construction by extracting "prototype" lookup so PIC applies.


~0.5% speedup on SunSpider
Speeds up some of the V8 tests as well, most notably earley-boyer.

  • VM/CTI.cpp: (JSC::CTI::compileOpCall): Account for extra arg for prototype. (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
  • VM/CodeGenerator.cpp: (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
  • VM/Machine.cpp: (JSC::Machine::privateExecute): Expect prototype arg in op_construct. (JSC::Machine::cti_op_construct_JSConstruct): ditto (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CTI.cpp

    r36418 r36427  
    413413{
    414414    if (type == OpConstruct) {
    415         emitPutArgConstant(reinterpret_cast<unsigned>(instruction + i), 12);
     415        emitPutArgConstant(reinterpret_cast<unsigned>(instruction + i), 16);
     416        emitPutArgConstant(instruction[i + 5].u.operand, 12);
    416417        emitPutArgConstant(instruction[i + 4].u.operand, 8);
    417         emitPutArgConstant(instruction[i + 3].u.operand, 4);
     418        emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx);
    418419    } else {
    419420        emitPutArgConstant(reinterpret_cast<unsigned>(instruction + i), 16);
     
    434435        m_jit.emitRestoreArgumentReference();
    435436
    436        emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
     437        emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
    437438
    438439        m_jit.cmpl_i32r(reinterpret_cast<unsigned>(JSImmediate::impossibleValue()), X86::eax);
     
    825826        case op_construct: {
    826827            compileOpCall(instruction, i, OpConstruct);
    827             i += 5;
     828            i += 6;
    828829            break;
    829830        }
Note: See TracChangeset for help on using the changeset viewer.