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/CodeGenerator.cpp

    r36417 r36427  
    11011101    // is safe.
    11021102
     1103    RefPtr<RegisterID> protectFunc = func;
     1104
     1105    // Reserve space for prototype
     1106    RefPtr<RegisterID> funcProto = newTemporary();
     1107
    11031108    // Reserve space for call frame.
    11041109    Vector<RefPtr<RegisterID>, RegisterFile::CallFrameHeaderSize> callFrame;
     
    11141119    }
    11151120
     1121    emitGetById(funcProto.get(), func, globalExec()->propertyNames().prototype);
     1122
    11161123    emitOpcode(op_construct);
    11171124    instructions().append(dst->index());
    11181125    instructions().append(func->index());
     1126    instructions().append(funcProto->index());
    11191127    instructions().append(argv.size() ? argv[0]->index() : m_temporaries.size()); // argv
    11201128    instructions().append(argv.size()); // argc
Note: See TracChangeset for help on using the changeset viewer.