Title: [104630] trunk/Source/_javascript_Core
Revision
104630
Author
[email protected]
Date
2012-01-10 14:08:47 -0800 (Tue, 10 Jan 2012)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (104629 => 104630)


--- trunk/Source/_javascript_Core/ChangeLog	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-01-10 22:08:47 UTC (rev 104630)
@@ -1,3 +1,55 @@
+2012-01-10  Filip Pizlo  <[email protected]>
+
+        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):
+
 2012-01-10  Gavin Barraclough  <[email protected]>
 
         Build fix following https://bugs.webkit.org/show_bug.cgi?id=75935

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -1413,7 +1413,6 @@
     , m_numCalleeRegisters(other.m_numCalleeRegisters)
     , m_numVars(other.m_numVars)
     , m_numCapturedVars(other.m_numCapturedVars)
-    , m_numParameters(other.m_numParameters)
     , m_isConstructor(other.m_isConstructor)
     , m_shouldDiscardBytecode(false)
     , m_ownerExecutable(*other.m_globalData, other.m_ownerExecutable.get(), other.m_ownerExecutable.get())
@@ -1448,6 +1447,7 @@
     , m_optimizationDelayCounter(0)
     , m_reoptimizationRetryCounter(0)
 {
+    setNumParameters(other.numParameters());
     optimizeAfterWarmUp();
     
     if (other.m_rareData) {
@@ -1469,9 +1469,9 @@
     , m_heap(&m_globalObject->globalData().heap)
     , m_numCalleeRegisters(0)
     , m_numVars(0)
-    , m_numParameters(0)
     , m_isConstructor(isConstructor)
     , m_shouldDiscardBytecode(false)
+    , m_numParameters(0)
     , m_ownerExecutable(globalObject->globalData(), ownerExecutable, ownerExecutable)
     , m_globalData(0)
     , m_instructions(adoptRef(new Instructions))
@@ -1538,6 +1538,24 @@
 #endif
 }
 
+void CodeBlock::setNumParameters(int newValue)
+{
+    m_numParameters = newValue;
+
+#if ENABLE(VALUE_PROFILER)
+    m_argumentValueProfiles.resize(newValue);
+#endif
+}
+
+void CodeBlock::addParameter()
+{
+    m_numParameters++;
+
+#if ENABLE(VALUE_PROFILER)
+    m_argumentValueProfiles.append(ValueProfile());
+#endif
+}
+
 void CodeBlock::visitStructures(SlotVisitor& visitor, Instruction* vPC) const
 {
     Interpreter* interpreter = m_globalData->interpreter;

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (104629 => 104630)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2012-01-10 22:08:47 UTC (rev 104630)
@@ -268,6 +268,13 @@
 
     public:
         virtual ~CodeBlock();
+        
+        int numParameters() const { return m_numParameters; }
+        void setNumParameters(int newValue);
+        void addParameter();
+        
+        int* addressOfNumParameters() { return &m_numParameters; }
+        static ptrdiff_t offsetOfNumParameters() { return OBJECT_OFFSETOF(CodeBlock, m_numParameters); }
 
         CodeBlock* alternative() { return m_alternative.get(); }
         PassOwnPtr<CodeBlock> releaseAlternative() { return m_alternative.release(); }
@@ -657,12 +664,10 @@
 #endif
         
 #if ENABLE(VALUE_PROFILER)
-        void setArgumentValueProfileSize(unsigned size)
-        {
-            m_argumentValueProfiles.resize(size);
-        }
         unsigned numberOfArgumentValueProfiles()
         {
+            ASSERT(m_numParameters >= 0);
+            ASSERT(m_argumentValueProfiles.size() == static_cast<unsigned>(m_numParameters));
             return m_argumentValueProfiles.size();
         }
         ValueProfile* valueProfileForArgument(unsigned argumentIndex)
@@ -1131,7 +1136,6 @@
         int m_numCalleeRegisters;
         int m_numVars;
         int m_numCapturedVars;
-        int m_numParameters;
         bool m_isConstructor;
 
         // This is public because otherwise we would have many friends.
@@ -1195,6 +1199,8 @@
                 m_rareData = adoptPtr(new RareData);
         }
         
+        int m_numParameters;
+
         WriteBarrier<ScriptExecutable> m_ownerExecutable;
         JSGlobalData* m_globalData;
 

Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -230,7 +230,7 @@
 
     // FIXME: Move code that modifies the global object to Interpreter::execute.
     
-    m_codeBlock->m_numParameters = 1; // Allocate space for "this"
+    m_codeBlock->setNumParameters(1); // Allocate space for "this"
     codeBlock->m_numCapturedVars = codeBlock->m_numVars;
     
     if (compilationKind == OptimizingCompilation)
@@ -401,7 +401,7 @@
     // Add "this" as a parameter
     int nextParameterIndex = CallFrame::thisArgumentOffset();
     m_thisRegister.setIndex(nextParameterIndex--);
-    ++m_codeBlock->m_numParameters;
+    m_codeBlock->addParameter();
     
     for (size_t i = 0; i < parameters.size(); ++i)
         addParameter(parameters[i], nextParameterIndex--);
@@ -459,7 +459,7 @@
 
     emitOpcode(op_enter);
     codeBlock->setGlobalData(m_globalData);
-    m_codeBlock->m_numParameters = 1; // Allocate space for "this"
+    m_codeBlock->setNumParameters(1);
 
     const DeclarationStacks::FunctionStack& functionStack = evalNode->functionStack();
     for (size_t i = 0; i < functionStack.size(); ++i)
@@ -500,7 +500,7 @@
 
     // To maintain the calling convention, we have to allocate unique space for
     // each parameter, even if the parameter doesn't make it into the symbol table.
-    ++m_codeBlock->m_numParameters;
+    m_codeBlock->addParameter();
 }
 
 RegisterID* BytecodeGenerator::registerFor(const Identifier& ident)
@@ -1869,7 +1869,7 @@
         emitOpcode(op_tear_off_activation);
         instructions().append(m_activationRegister->index());
         instructions().append(m_codeBlock->argumentsRegister());
-    } else if (m_codeBlock->usesArguments() && m_codeBlock->m_numParameters != 1 && !m_codeBlock->isStrictMode()) {
+    } else if (m_codeBlock->usesArguments() && m_codeBlock->numParameters() != 1 && !m_codeBlock->isStrictMode()) {
         emitOpcode(op_tear_off_arguments);
         instructions().append(m_codeBlock->argumentsRegister());
     }

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -51,7 +51,7 @@
 AbstractState::AbstractState(CodeBlock* codeBlock, Graph& graph)
     : m_codeBlock(codeBlock)
     , m_graph(graph)
-    , m_variables(codeBlock->m_numParameters, graph.m_localVars)
+    , m_variables(codeBlock->numParameters(), graph.m_localVars)
     , m_block(0)
 {
     size_t maxBlockSize = 0;

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -53,7 +53,7 @@
         , m_constantNaN(UINT_MAX)
         , m_constant1(UINT_MAX)
         , m_constants(codeBlock->numberOfConstantRegisters())
-        , m_numArguments(codeBlock->m_numParameters)
+        , m_numArguments(codeBlock->numParameters())
         , m_numLocals(codeBlock->m_numCalleeRegisters)
         , m_preservedVars(codeBlock->m_numVars)
         , m_parameterSlots(0)
@@ -2478,7 +2478,7 @@
         inlineCallFrame.stackOffset = inlineCallFrameStart + RegisterFile::CallFrameHeaderSize;
         inlineCallFrame.callee.set(*byteCodeParser->m_globalData, byteCodeParser->m_codeBlock->ownerExecutable(), callee);
         inlineCallFrame.caller = byteCodeParser->currentCodeOrigin();
-        inlineCallFrame.arguments.resize(codeBlock->m_numParameters); // Set the number of arguments including this, but don't configure the value recoveries, yet.
+        inlineCallFrame.arguments.resize(codeBlock->numParameters()); // Set the number of arguments including this, but don't configure the value recoveries, yet.
         inlineCallFrame.isCall = isCall(kind);
         byteCodeParser->m_codeBlock->inlineCallFrames().append(inlineCallFrame);
         m_inlineCallFrame = &byteCodeParser->m_codeBlock->inlineCallFrames().last();

Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -344,8 +344,8 @@
     ASSERT(codeBlock->alternative());
 
     CodeBlock* profiledCodeBlock = codeBlock->alternative();
-    ASSERT(codeBlock->m_numParameters >= 1);
-    for (size_t arg = 0; arg < static_cast<size_t>(codeBlock->m_numParameters); ++arg) {
+    ASSERT(codeBlock->numParameters() >= 1);
+    for (size_t arg = 0; arg < static_cast<size_t>(codeBlock->numParameters()); ++arg) {
         ValueProfile* profile = ""
         if (!profile)
             continue;

Modified: trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -260,7 +260,7 @@
     compileEntry();
 
     load32(AssemblyHelpers::payloadFor((VirtualRegister)RegisterFile::ArgumentCount), GPRInfo::regT1);
-    branch32(AboveOrEqual, GPRInfo::regT1, Imm32(m_codeBlock->m_numParameters)).linkTo(fromArityCheck, this);
+    branch32(AboveOrEqual, GPRInfo::regT1, Imm32(m_codeBlock->numParameters())).linkTo(fromArityCheck, this);
     move(stackPointerRegister, GPRInfo::argumentGPR0);
     poke(GPRInfo::callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
     Call callArityCheck = call();

Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -656,7 +656,7 @@
             return 0;
         }
         codeBlock = &functionExecutable->generatedBytecodeFor(kind);
-        if (execCallee->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->m_numParameters))
+        if (execCallee->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters()))
             codePtr = functionExecutable->generatedJITCodeWithArityCheckFor(kind);
         else
             codePtr = functionExecutable->generatedJITCodeFor(kind).addressForCall();

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -1070,7 +1070,7 @@
     for (size_t i = 0; i < m_variables.size(); ++i)
         m_variables[i] = ValueSource(ValueInRegisterFile);
     
-    for (int i = 0; i < m_jit.codeBlock()->m_numParameters; ++i) {
+    for (int i = 0; i < m_jit.codeBlock()->numParameters(); ++i) {
         VariableAccessData* variableAccessData = at(m_jit.graph().m_arguments[i]).variableAccessData();
         VirtualRegister virtualRegister = variableAccessData->local();
         PredictedType predictedType = variableAccessData->prediction();

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h (104629 => 104630)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h	2012-01-10 22:08:47 UTC (rev 104630)
@@ -2744,7 +2744,7 @@
     , m_compileIndex(0)
     , m_generationInfo(m_jit.codeBlock()->m_numCalleeRegisters)
     , m_blockHeads(jit.graph().m_blocks.size())
-    , m_arguments(jit.codeBlock()->m_numParameters)
+    , m_arguments(jit.codeBlock()->numParameters())
     , m_variables(jit.graph().m_localVars)
     , m_lastSetOperand(std::numeric_limits<int>::max())
     , m_state(m_jit.codeBlock(), m_jit.graph())

Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -370,16 +370,16 @@
 ALWAYS_INLINE CallFrame* Interpreter::slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, CallFrame* callFrame, size_t registerOffset, int argumentCountIncludingThis)
 {
     // This ensures enough space for the worst case scenario of zero arguments passed by the caller.
-    if (!registerFile->grow(callFrame->registers() + registerOffset + newCodeBlock->m_numParameters + newCodeBlock->m_numCalleeRegisters))
+    if (!registerFile->grow(callFrame->registers() + registerOffset + newCodeBlock->numParameters() + newCodeBlock->m_numCalleeRegisters))
         return 0;
 
-    if (argumentCountIncludingThis >= newCodeBlock->m_numParameters) {
+    if (argumentCountIncludingThis >= newCodeBlock->numParameters()) {
         Register* newCallFrame = callFrame->registers() + registerOffset;
         return CallFrame::create(newCallFrame);
     }
 
     // Too few arguments -- copy arguments, then fill in missing arguments with undefined.
-    size_t delta = newCodeBlock->m_numParameters - argumentCountIncludingThis;
+    size_t delta = newCodeBlock->numParameters() - argumentCountIncludingThis;
     CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset + delta);
 
     Register* dst = &newCallFrame->uncheckedR(CallFrame::thisArgumentOffset());
@@ -602,14 +602,14 @@
     const Register* end;
     JSValue v;
 
-    it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock->m_numParameters;
+    it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock->numParameters();
     v = (*it).jsValue();
 #if USE(JSVALUE32_64)
     printf("[this]                     | %10p | %-16s 0x%llx \n", it, v.description(), JSValue::encode(v)); ++it;
 #else
     printf("[this]                     | %10p | %-16s %p \n", it, v.description(), JSValue::encode(v)); ++it;
 #endif
-    end = it + max(codeBlock->m_numParameters - 1, 0); // - 1 to skip "this"
+    end = it + max(codeBlock->numParameters() - 1, 0); // - 1 to skip "this"
     if (it != end) {
         do {
             v = (*it).jsValue();
@@ -985,13 +985,13 @@
     CodeBlock* codeBlock = &program->generatedBytecode();
 
     Register* oldEnd = m_registerFile.end();
-    Register* newEnd = oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
+    Register* newEnd = oldEnd + codeBlock->numParameters() + RegisterFile::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
     if (!m_registerFile.grow(newEnd))
         return checkedReturn(throwStackOverflowError(callFrame));
 
-    CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize);
-    ASSERT(codeBlock->m_numParameters == 1); // 1 parameter for 'this'.
-    newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), codeBlock->m_numParameters, 0);
+    CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->numParameters() + RegisterFile::CallFrameHeaderSize);
+    ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'.
+    newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), codeBlock->numParameters(), 0);
     newCallFrame->setThisValue(thisObj);
     TopCallFrameSetter topCallFrame(callFrame->globalData(), newCallFrame);
 
@@ -1256,7 +1256,7 @@
     }
     newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), argumentCountIncludingThis, function);  
     scopeChain->globalData->topCallFrame = newCallFrame;
-    CallFrameClosure result = { callFrame, newCallFrame, function, functionExecutable, scopeChain->globalData, oldEnd, scopeChain, codeBlock->m_numParameters, argumentCountIncludingThis };
+    CallFrameClosure result = { callFrame, newCallFrame, function, functionExecutable, scopeChain->globalData, oldEnd, scopeChain, codeBlock->numParameters(), argumentCountIncludingThis };
     return result;
 }
 
@@ -1367,8 +1367,8 @@
 
     CallFrame* newCallFrame = CallFrame::create(m_registerFile.begin() + globalRegisterOffset);
 
-    ASSERT(codeBlock->m_numParameters == 1); // 1 parameter for 'this'.
-    newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), codeBlock->m_numParameters, 0);
+    ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'.
+    newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), codeBlock->numParameters(), 0);
     newCallFrame->setThisValue(thisValue);
 
     TopCallFrameSetter topCallFrame(callFrame->globalData(), newCallFrame);

Modified: trunk/Source/_javascript_Core/jit/JIT.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/jit/JIT.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/jit/JIT.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -557,8 +557,7 @@
 #if ENABLE(VALUE_PROFILER)
         ASSERT(m_bytecodeOffset == (unsigned)-1);
         if (shouldEmitProfiling()) {
-            m_codeBlock->setArgumentValueProfileSize(m_codeBlock->m_numParameters);
-            for (int argument = 0; argument < m_codeBlock->m_numParameters; ++argument) {
+            for (int argument = 0; argument < m_codeBlock->numParameters(); ++argument) {
                 // If this is a constructor, then we want to put in a dummy profiling site (to
                 // keep things consistent) but we don't actually want to record the dummy value.
                 if (m_codeBlock->m_isConstructor && !argument)

Modified: trunk/Source/_javascript_Core/jit/JITStubs.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/jit/JITStubs.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/jit/JITStubs.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -2172,13 +2172,13 @@
     int argumentCountIncludingThis = callFrame->argumentCountIncludingThis();
 
     // This ensures enough space for the worst case scenario of zero arguments passed by the caller.
-    if (!registerFile->grow(callFrame->registers() + newCodeBlock->m_numParameters + newCodeBlock->m_numCalleeRegisters))
+    if (!registerFile->grow(callFrame->registers() + newCodeBlock->numParameters() + newCodeBlock->m_numCalleeRegisters))
         return 0;
 
-    ASSERT(argumentCountIncludingThis < newCodeBlock->m_numParameters);
+    ASSERT(argumentCountIncludingThis < newCodeBlock->numParameters());
 
     // Too few arguments -- copy call frame and arguments, then fill in missing arguments with undefined.
-    size_t delta = newCodeBlock->m_numParameters - argumentCountIncludingThis;
+    size_t delta = newCodeBlock->numParameters() - argumentCountIncludingThis;
     Register* src = ""
     Register* dst = callFrame->registers() + delta;
 
@@ -2239,7 +2239,7 @@
         if (error)
             return 0;
         codeBlock = &functionExecutable->generatedBytecodeFor(kind);
-        if (callFrame->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->m_numParameters)
+        if (callFrame->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters())
             || callLinkInfo->callType == CallLinkInfo::CallVarargs)
             codePtr = functionExecutable->generatedJITCodeWithArityCheckFor(kind);
         else

Modified: trunk/Source/_javascript_Core/runtime/Executable.cpp (104629 => 104630)


--- trunk/Source/_javascript_Core/runtime/Executable.cpp	2012-01-10 22:03:13 UTC (rev 104629)
+++ trunk/Source/_javascript_Core/runtime/Executable.cpp	2012-01-10 22:08:47 UTC (rev 104630)
@@ -534,7 +534,7 @@
     newCodeBlock->setAlternative(static_pointer_cast<CodeBlock>(m_codeBlockForCall.release()));
     m_codeBlockForCall = newCodeBlock.release();
     
-    m_numParametersForCall = m_codeBlockForCall->m_numParameters;
+    m_numParametersForCall = m_codeBlockForCall->numParameters();
     ASSERT(m_numParametersForCall);
     m_numCapturedVariables = m_codeBlockForCall->m_numCapturedVars;
     m_symbolTable = m_codeBlockForCall->sharedSymbolTable();
@@ -597,7 +597,7 @@
     newCodeBlock->setAlternative(static_pointer_cast<CodeBlock>(m_codeBlockForConstruct.release()));
     m_codeBlockForConstruct = newCodeBlock.release();
     
-    m_numParametersForConstruct = m_codeBlockForConstruct->m_numParameters;
+    m_numParametersForConstruct = m_codeBlockForConstruct->numParameters();
     ASSERT(m_numParametersForConstruct);
     m_numCapturedVariables = m_codeBlockForConstruct->m_numCapturedVars;
     m_symbolTable = m_codeBlockForConstruct->sharedSymbolTable();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to