Changeset 36882 in webkit
- Timestamp:
- Sep 24, 2008 7:46:09 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r36877 r36882 1 2008-09-24 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 Move most of the return code back into the callee, now that the callee 6 doesn't have to calculate anything dynamically. 7 8 11.5% speedup on empty function call benchmark. 9 10 SunSpider says 0.3% faster. SunSpider --v8 says no change. 11 12 * VM/CTI.cpp: 13 (JSC::CTI::compileOpCall): 14 (JSC::CTI::privateCompileMainPass): 15 (JSC::CTI::privateCompileSlowCases): 16 1 17 2008-09-24 Sam Weinig <sam@webkit.org> 2 18 -
trunk/JavaScriptCore/VM/CTI.cpp
r36876 r36882 521 521 emitCall(i, X86::eax); 522 522 523 // In the interpreter the following actions are performed by op_ret: 524 525 // Restore ExecState::m_scopeChain and CTI_ARGS_scopeChain. NOTE: After 526 // op_ret, %edx holds the caller's scope chain. 527 emitGetCTIParam(CTI_ARGS_exec, X86::ecx); 528 emitPutCTIParam(X86::edx, CTI_ARGS_scopeChain); 529 m_jit.movl_rm(X86::edx, OBJECT_OFFSET(ExecState, m_scopeChain), X86::ecx); 530 // Restore ExecState::m_callFrame. 531 m_jit.movl_rm(X86::edi, OBJECT_OFFSET(ExecState, m_callFrame), X86::ecx); 532 // Restore CTI_ARGS_codeBlock. 523 // Restore CTI_ARGS_codeBlock. In the interpreter, op_ret does this. 533 524 emitPutCTIParam(m_codeBlock, CTI_ARGS_codeBlock); 534 525 … … 538 529 m_jit.link(wasEval, end); 539 530 531 // Put the return value in dst. In the interpreter, op_ret does this. 540 532 emitPutResult(dst); 541 533 } … … 988 980 emitCall(i, Machine::cti_op_ret_scopeChain); 989 981 990 // Return the result in %eax, and the caller scope chain in %edx (this is read from the callee call frame, 991 // but is only assigned to ExecState::m_scopeChain if returning to a JSFunction). 982 // Return the result in %eax. 992 983 emitGetArg(instruction[i + 1].u.operand, X86::eax); 984 985 // Restore the scope chain. 993 986 m_jit.movl_mr(RegisterFile::CallerScopeChain * static_cast<int>(sizeof(Register)), X86::edi, X86::edx); 987 emitGetCTIParam(CTI_ARGS_exec, X86::ecx); 988 emitPutCTIParam(X86::edx, CTI_ARGS_scopeChain); 989 m_jit.movl_rm(X86::edx, OBJECT_OFFSET(ExecState, m_scopeChain), X86::ecx); 990 991 // Restore ExecState::m_callFrame. 992 m_jit.movl_rm(X86::edi, OBJECT_OFFSET(ExecState, m_callFrame), X86::ecx); 993 994 // Grab the return address. 995 m_jit.movl_mr(RegisterFile::ReturnPC * static_cast<int>(sizeof(Register)), X86::edi, X86::ecx); 996 994 997 // Restore the machine return addess from the callframe, roll the callframe back to the caller callframe, 995 998 // and preserve a copy of r on the stack at CTI_ARGS_r. 996 m_jit.movl_mr(RegisterFile::ReturnPC * static_cast<int>(sizeof(Register)), X86::edi, X86::ecx);997 999 m_jit.movl_mr(RegisterFile::CallerRegisters * static_cast<int>(sizeof(Register)), X86::edi, X86::edi); 998 1000 emitPutCTIParam(X86::edi, CTI_ARGS_r); … … 2242 2244 // Instead of checking for 0 we could initialize the CodeBlock::ctiCode to point to a trampoline that would trigger the translation. 2243 2245 2244 // In the interpreter the following actions are performed by op_ret: 2245 2246 // Restore ExecState::m_scopeChain and CTI_ARGS_scopeChain. NOTE: After 2247 // op_ret, %edx holds the caller's scope chain. 2248 emitGetCTIParam(CTI_ARGS_exec, X86::ecx); 2249 emitPutCTIParam(X86::edx, CTI_ARGS_scopeChain); 2250 m_jit.movl_rm(X86::edx, OBJECT_OFFSET(ExecState, m_scopeChain), X86::ecx); 2251 // Restore ExecState::m_callFrame. 2252 m_jit.movl_rm(X86::edi, OBJECT_OFFSET(ExecState, m_callFrame), X86::ecx); 2253 // Restore CTI_ARGS_codeBlock. 2246 // Restore CTI_ARGS_codeBlock. In the interpreter, op_ret does this. 2254 2247 emitPutCTIParam(m_codeBlock, CTI_ARGS_codeBlock); 2255 2248 2249 // Put the return value in dst. In the interpreter, op_ret does this. 2256 2250 emitPutResult(instruction[i + 1].u.operand); 2257 2251 i += 7;
Note: See TracChangeset
for help on using the changeset viewer.