Ignore:
Timestamp:
Oct 6, 2008, 8:53:47 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-06 Cameron Zwarich <[email protected]>

Reviewed by Oliver Hunt.

Bug 21396: Remove the OptionalCalleeActivation call frame slot
<https://bugs.webkit.org/show_bug.cgi?id=21396>

Remove the OptionalCalleeActivation call frame slot. We have to be
careful to store the activation object in a register, because objects
in the scope chain do not get marked.

This is a 0.3% speedup on both SunSpider and the V8 benchmark.

  • VM/CTI.cpp: (JSC::CTI::privateCompileMainPass):
  • VM/CodeBlock.cpp: (JSC::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (JSC::CodeGenerator::CodeGenerator): (JSC::CodeGenerator::emitReturn):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (JSC::Machine::dumpRegisters): (JSC::Machine::unwindCallFrame): (JSC::Machine::privateExecute): (JSC::Machine::cti_op_call_JSFunction): (JSC::Machine::cti_op_push_activation): (JSC::Machine::cti_op_tear_off_activation): (JSC::Machine::cti_op_construct_JSConstruct):
  • VM/Machine.h: (JSC::Machine::initializeCallFrame):
  • VM/RegisterFile.h: (JSC::RegisterFile::):
File:
1 edited

Legend:

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

    r37324 r37366  
    288288        m_codeBlock->needsFullScopeChain = true;
    289289
    290     if (m_codeBlock->needsFullScopeChain)
    291         emitOpcode(op_enter_with_activation);
    292     else
    293         emitOpcode(op_enter);
    294 
    295290    codeBlock->globalData = m_globalData;
    296291
     
    298293    codeBlock->usesArguments = usesArguments;
    299294    if (usesArguments) {
    300         emitOpcode(op_create_arguments);
    301295        m_argumentsRegister.setIndex(RegisterFile::OptionalCalleeArguments);
    302296        addVar(propertyNames().arguments, false);
    303297    }
     298
     299    if (m_codeBlock->needsFullScopeChain) {
     300        ++m_codeBlock->numVars;
     301        m_activationRegisterIndex = newRegister()->index();
     302        emitOpcode(op_enter_with_activation);
     303        instructions().append(m_activationRegisterIndex);
     304    } else
     305        emitOpcode(op_enter);
     306
     307    if (usesArguments)
     308        emitOpcode(op_create_arguments);
    304309
    305310    const Node::FunctionStack& functionStack = functionBody->functionStack();
     
    11611166RegisterID* CodeGenerator::emitReturn(RegisterID* src)
    11621167{
    1163     if (m_codeBlock->needsFullScopeChain)
     1168    if (m_codeBlock->needsFullScopeChain) {
    11641169        emitOpcode(op_tear_off_activation);
    1165     else if (m_codeBlock->usesArguments)
     1170        instructions().append(m_activationRegisterIndex);
     1171    } else if (m_codeBlock->usesArguments)
    11661172        emitOpcode(op_tear_off_arguments);
    11671173
Note: See TracChangeset for help on using the changeset viewer.