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.h

    r103384 r104630  
    269269    public:
    270270        virtual ~CodeBlock();
     271       
     272        int numParameters() const { return m_numParameters; }
     273        void setNumParameters(int newValue);
     274        void addParameter();
     275       
     276        int* addressOfNumParameters() { return &m_numParameters; }
     277        static ptrdiff_t offsetOfNumParameters() { return OBJECT_OFFSETOF(CodeBlock, m_numParameters); }
    271278
    272279        CodeBlock* alternative() { return m_alternative.get(); }
     
    658665       
    659666#if ENABLE(VALUE_PROFILER)
    660         void setArgumentValueProfileSize(unsigned size)
    661         {
    662             m_argumentValueProfiles.resize(size);
    663         }
    664667        unsigned numberOfArgumentValueProfiles()
    665668        {
     669            ASSERT(m_numParameters >= 0);
     670            ASSERT(m_argumentValueProfiles.size() == static_cast<unsigned>(m_numParameters));
    666671            return m_argumentValueProfiles.size();
    667672        }
     
    11321137        int m_numVars;
    11331138        int m_numCapturedVars;
    1134         int m_numParameters;
    11351139        bool m_isConstructor;
    11361140
     
    11961200        }
    11971201       
     1202        int m_numParameters;
     1203
    11981204        WriteBarrier<ScriptExecutable> m_ownerExecutable;
    11991205        JSGlobalData* m_globalData;
Note: See TracChangeset for help on using the changeset viewer.