Changeset 95927 in webkit
- Timestamp:
- Sep 25, 2011 5:01:09 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r95925 r95927 1 2011-09-25 Filip Pizlo <fpizlo@apple.com> 2 3 DFG JIT Construct opcode takes a this argument even though it's 4 not passed 5 https://bugs.webkit.org/show_bug.cgi?id=68782 6 7 Reviewed by Oliver Hunt. 8 9 This is performance-neutral, mostly. It's a slight speed-up on 10 v8-splay. 11 12 * dfg/DFGByteCodeParser.cpp: 13 (JSC::DFG::ByteCodeParser::addCall): 14 * dfg/DFGJITCodeGenerator.cpp: 15 (JSC::DFG::JITCodeGenerator::emitCall): 16 1 17 2011-09-25 Filip Pizlo <fpizlo@apple.com> 2 18 -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r95916 r95927 443 443 int registerOffset = currentInstruction[3].u.operand; 444 444 int firstArg = registerOffset - argCount - RegisterFile::CallFrameHeaderSize; 445 for (int argIdx = firstArg ; argIdx < firstArg + argCount; argIdx++)445 for (int argIdx = firstArg + (op == Construct ? 1 : 0); argIdx < firstArg + argCount; argIdx++) 446 446 addVarArgChild(get(argIdx)); 447 447 NodeIndex call = addToGraph(Node::VarArg, op, OpInfo(0), OpInfo(prediction)); -
trunk/Source/JavaScriptCore/dfg/DFGJITCodeGenerator.cpp
r95902 r95927 1884 1884 int numArgs = node.numChildren() - 1; 1885 1885 1886 // For constructors, the this argument is not passed but we have to make space 1887 // for it. 1888 int numPassedArgs = numArgs + (isCall ? 0 : 1); 1889 1886 1890 // amount of stuff (in units of sizeof(Register)) that we need to place at the 1887 1891 // top of the JS stack. … … 1889 1893 1890 1894 // first there are the arguments 1891 callDataSize += num Args;1895 callDataSize += numPassedArgs; 1892 1896 1893 1897 // and then there is the call frame header 1894 1898 callDataSize += RegisterFile::CallFrameHeaderSize; 1895 1899 1896 m_jit.storePtr(MacroAssembler::TrustedImmPtr(JSValue::encode(jsNumber(num Args))), addressOfCallData(RegisterFile::ArgumentCount));1900 m_jit.storePtr(MacroAssembler::TrustedImmPtr(JSValue::encode(jsNumber(numPassedArgs))), addressOfCallData(RegisterFile::ArgumentCount)); 1897 1901 m_jit.storePtr(GPRInfo::callFrameRegister, addressOfCallData(RegisterFile::CallerFrame)); 1898 1902 1899 if (node.op == Construct) 1900 use(m_jit.graph().m_varArgChildren[node.firstChild() + 1]); 1901 1902 for (int argIdx = (node.op == Call ? 0 : 1); argIdx < numArgs; argIdx++) { 1903 for (int argIdx = 0; argIdx < numArgs; argIdx++) { 1903 1904 NodeIndex argNodeIndex = m_jit.graph().m_varArgChildren[node.firstChild() + 1 + argIdx]; 1904 1905 JSValueOperand arg(this, argNodeIndex); … … 1906 1907 use(argNodeIndex); 1907 1908 1908 m_jit.storePtr(argGPR, addressOfCallData(-callDataSize + argIdx ));1909 m_jit.storePtr(argGPR, addressOfCallData(-callDataSize + argIdx + (isCall ? 0 : 1))); 1909 1910 } 1910 1911 … … 1934 1935 m_jit.addPtr(Imm32(m_jit.codeBlock()->m_numCalleeRegisters * sizeof(Register)), GPRInfo::callFrameRegister, GPRInfo::argumentGPR0); 1935 1936 JITCompiler::Call slowCall = m_jit.appendCallWithFastExceptionCheck(slowCallFunction, m_jit.graph()[m_compileIndex].codeOrigin); 1936 m_jit.move(Imm32(num Args), GPRInfo::regT1);1937 m_jit.move(Imm32(numPassedArgs), GPRInfo::regT1); 1937 1938 m_jit.addPtr(Imm32(m_jit.codeBlock()->m_numCalleeRegisters * sizeof(Register)), GPRInfo::callFrameRegister); 1938 1939 m_jit.notifyCall(m_jit.call(GPRInfo::returnValueGPR), m_jit.graph()[m_compileIndex].codeOrigin);
Note: See TracChangeset
for help on using the changeset viewer.