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


Ignore:
Timestamp:
Sep 26, 2008, 3:40:26 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-26 Geoffrey Garen <[email protected]>

Reviewed by Maciej Stachowiak.


Removed dynamic check for whether the callee needs an activation object.
Replaced with callee code to create the activation object.

0.5% speedup on SunSpider.
No change on v8 benchmark. (Might be a speedup, but it's in range of the
variance.)

0.7% speedup on v8 benchmark in bytecode.
1.3% speedup on empty call benchmark in bytecode.

  • VM/CTI.cpp: (JSC::CTI::privateCompileMainPass): Added support for op_init_activation, the new opcode that specifies that the callee's initialization should create an activation object. (JSC::CTI::privateCompile): Removed previous code that did a similar thing in an ad-hoc way.
  • VM/CodeBlock.cpp: (JSC::CodeBlock::dump): Added a case for dumping op_init_activation.
  • VM/CodeGenerator.cpp: (JSC::CodeGenerator::generate): Added fixup code to change op_init to op_init_activation if necessary. (With a better parser, we would know which to use from the beginning.)
  • VM/Instruction.h: (JSC::Instruction::Instruction): (WTF::): Faster traits for the instruction vector. An earlier version of this patch relied on inserting at the beginning of the vector, and depended on this change for speed.
  • VM/Machine.cpp: (JSC::Machine::execute): Removed clients of setScopeChain, the old abstraction for dynamically checking for whether an activation object needed to be created. (JSC::Machine::privateExecute): ditto

(JSC::Machine::cti_op_push_activation): Renamed this function from
cti_vm_updateScopeChain, and made it faster by removing the call to
setScopeChain.

  • VM/Machine.h:
  • VM/Opcode.h: Declared op_init_activation.
File:
1 edited

Legend:

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

    r36882 r36972  
    17521752            break;
    17531753        }
     1754        case op_init_activation: {
     1755            emitCall(i, Machine::cti_op_push_activation);
     1756
     1757            // Even though CTI doesn't use them, we initialize our constant
     1758            // registers to zap stale pointers, to avoid unnecessarily prolonging
     1759            // object lifetime and increasing GC pressure.
     1760            size_t count = m_codeBlock->numVars + m_codeBlock->constantRegisters.size();
     1761            for (size_t j = 0; j < count; ++j)
     1762                emitInitRegister(j);
     1763
     1764            i+= 1;
     1765            break;
     1766        }
    17541767        case op_get_array_length:
    17551768        case op_get_by_id_chain:
     
    22712284    emitPutToCallFrameHeader(X86::ecx, RegisterFile::ReturnPC);
    22722285
    2273     // Lazy copy of the scopeChain
    2274     X86Assembler::JmpSrc callToUpdateScopeChain;
    2275     if ((m_codeBlock->codeType == FunctionCode) && m_codeBlock->needsFullScopeChain) {
    2276         m_jit.emitRestoreArgumentReference();
    2277         callToUpdateScopeChain = m_jit.emitCall();
    2278     }
    2279 
    22802286    privateCompileMainPass();
    22812287    privateCompileLinkPass();
     
    23232329        m_codeBlock->ctiReturnAddressVPCMap.add(m_jit.getRelocatedAddress(code, iter->from), iter->opcodeIndex);
    23242330    }
    2325 
    2326     if ((m_codeBlock->codeType == FunctionCode) && m_codeBlock->needsFullScopeChain)
    2327         X86Assembler::link(code, callToUpdateScopeChain, (void*)Machine::cti_vm_updateScopeChain);
    23282331
    23292332    // Link absolute addresses for jsr
Note: See TracChangeset for help on using the changeset viewer.