Ignore:
Timestamp:
Jan 10, 2012, 2:08:47 PM (13 years ago)
Author:
[email protected]
Message:

CodeBlock::m_numParameters should be encapsulated
https://bugs.webkit.org/show_bug.cgi?id=75985
<rdar://problem/10671020>

Reviewed by Oliver Hunt.

Encapsulated CodeBlock::m_numParameters and hooked argument profile creation
into it. This appears to be performance neutral.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::setNumParameters):
(JSC::CodeBlock::addParameter):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::numParameters):
(JSC::CodeBlock::addressOfNumParameters):
(JSC::CodeBlock::offsetOfNumParameters):
(JSC::CodeBlock::numberOfArgumentValueProfiles):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::addParameter):
(JSC::BytecodeGenerator::emitReturn):

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::AbstractState):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::ByteCodeParser):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::predictArgumentTypes):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compileFunction):

  • dfg/DFGOperations.cpp:
  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::checkArgumentTypes):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::SpeculativeJIT):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::slideRegisterWindowForCall):
(JSC::Interpreter::dumpRegisters):
(JSC::Interpreter::execute):
(JSC::Interpreter::prepareForRepeatCall):

  • jit/JIT.cpp:

(JSC::JIT::privateCompile):

  • jit/JITStubs.cpp:

(JSC::arityCheckFor):
(JSC::lazyLinkFor):

  • runtime/Executable.cpp:

(JSC::FunctionExecutable::compileForCallInternal):
(JSC::FunctionExecutable::compileForConstructInternal):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r104094 r104630  
    14141414    , m_numVars(other.m_numVars)
    14151415    , m_numCapturedVars(other.m_numCapturedVars)
    1416     , m_numParameters(other.m_numParameters)
    14171416    , m_isConstructor(other.m_isConstructor)
    14181417    , m_shouldDiscardBytecode(false)
     
    14491448    , m_reoptimizationRetryCounter(0)
    14501449{
     1450    setNumParameters(other.numParameters());
    14511451    optimizeAfterWarmUp();
    14521452   
     
    14701470    , m_numCalleeRegisters(0)
    14711471    , m_numVars(0)
    1472     , m_numParameters(0)
    14731472    , m_isConstructor(isConstructor)
    14741473    , m_shouldDiscardBytecode(false)
     1474    , m_numParameters(0)
    14751475    , m_ownerExecutable(globalObject->globalData(), ownerExecutable, ownerExecutable)
    14761476    , m_globalData(0)
     
    15361536#if DUMP_CODE_BLOCK_STATISTICS
    15371537    liveCodeBlockSet.remove(this);
     1538#endif
     1539}
     1540
     1541void CodeBlock::setNumParameters(int newValue)
     1542{
     1543    m_numParameters = newValue;
     1544
     1545#if ENABLE(VALUE_PROFILER)
     1546    m_argumentValueProfiles.resize(newValue);
     1547#endif
     1548}
     1549
     1550void CodeBlock::addParameter()
     1551{
     1552    m_numParameters++;
     1553
     1554#if ENABLE(VALUE_PROFILER)
     1555    m_argumentValueProfiles.append(ValueProfile());
    15381556#endif
    15391557}
Note: See TracChangeset for help on using the changeset viewer.