Ignore:
Timestamp:
Oct 23, 2008, 3:29:54 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-23 Gavin Barraclough <[email protected]>

Reviewed by Oliver Hunt.

Fix hideous pathological case performance when looking up repatch info, bug #21727.

When repatching JIT code to optimize we look up records providing information about
the generated code (also used to track recsources used in linking to be later released).
The lookup was being performed using a linear scan of all such records.

(1) Split up the different types of reptach information. This means we can search them

separately, and in some cases should reduce their size.

(2) In the case of property accesses, search with a binary chop over the data.
(3) In the case of calls, pass a pointer to the repatch info into the relink function.

  • VM/CTI.cpp: (JSC::CTI::CTI): (JSC::CTI::compileOpCall): (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompileSlowCases): (JSC::CTI::privateCompile): (JSC::CTI::unlinkCall): (JSC::CTI::linkCall):
  • VM/CTI.h:
  • VM/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::unlinkCallers): (JSC::CodeBlock::derefStructureIDs):
  • VM/CodeBlock.h: (JSC::StructureStubInfo::StructureStubInfo): (JSC::CallLinkInfo::CallLinkInfo): (JSC::CallLinkInfo::setUnlinked): (JSC::CallLinkInfo::isLinked): (JSC::getStructureStubInfoReturnLocation): (JSC::binaryChop): (JSC::CodeBlock::addCaller): (JSC::CodeBlock::getStubInfo):
  • VM/CodeGenerator.cpp: (JSC::CodeGenerator::emitResolve): (JSC::CodeGenerator::emitGetById): (JSC::CodeGenerator::emitPutById): (JSC::CodeGenerator::emitCall): (JSC::CodeGenerator::emitConstruct):
  • VM/Machine.cpp: (JSC::Machine::cti_vm_lazyLinkCall):
File:
1 edited

Legend:

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

    r37812 r37831  
    966966
    967967    if (globalObject) {
    968         m_codeBlock->structureIDInstructions.append(instructions().size());
     968        m_codeBlock->globalResolveInstructions.append(instructions().size());
    969969        emitOpcode(op_resolve_global);
    970970        instructions().append(dst->index());
     
    10461046RegisterID* CodeGenerator::emitGetById(RegisterID* dst, RegisterID* base, const Identifier& property)
    10471047{
    1048     m_codeBlock->structureIDInstructions.append(instructions().size());
     1048    m_codeBlock->propertyAccessInstructions.append(instructions().size());
    10491049
    10501050    emitOpcode(op_get_by_id);
     
    10611061RegisterID* CodeGenerator::emitPutById(RegisterID* base, const Identifier& property, RegisterID* value)
    10621062{
    1063     m_codeBlock->structureIDInstructions.append(instructions().size());
     1063    m_codeBlock->propertyAccessInstructions.append(instructions().size());
    10641064
    10651065    emitOpcode(op_put_by_id);
     
    12201220
    12211221    emitExpressionInfo(divot, startOffset, endOffset);
    1222     m_codeBlock->structureIDInstructions.append(instructions().size());
     1222    m_codeBlock->callLinkInfos.append(CallLinkInfo());
    12231223    emitOpcode(opcodeID);
    12241224    instructions().append(dst->index());
     
    12841284
    12851285    emitExpressionInfo(divot, startOffset, endOffset);
    1286     m_codeBlock->structureIDInstructions.append(instructions().size());
     1286    m_codeBlock->callLinkInfos.append(CallLinkInfo());
    12871287    emitOpcode(op_construct);
    12881288    instructions().append(dst->index());
Note: See TracChangeset for help on using the changeset viewer.