Changeset 59339 in webkit for trunk/JavaScriptCore/jit/JITStubs.cpp
- Timestamp:
- May 12, 2010, 9:01:56 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITStubs.cpp
r59064 r59339 1778 1778 } 1779 1779 1780 DEFINE_STUB_FUNCTION(void*, op_call_ JSFunction)1780 DEFINE_STUB_FUNCTION(void*, op_call_jitCompile) 1781 1781 { 1782 1782 STUB_INIT_STACK_FRAME(stackFrame); … … 1791 1791 FunctionExecutable* executable = function->jsExecutable(); 1792 1792 ScopeChainNode* callDataScopeChain = function->scope().node(); 1793 executable->jitCode(stackFrame.callFrame, callDataScopeChain); 1793 executable->jitCodeForCall(stackFrame.callFrame, callDataScopeChain); 1794 1795 return function; 1796 } 1797 1798 DEFINE_STUB_FUNCTION(void*, op_construct_jitCompile) 1799 { 1800 STUB_INIT_STACK_FRAME(stackFrame); 1801 1802 #if !ASSERT_DISABLED 1803 CallData callData; 1804 ASSERT(stackFrame.args[0].jsValue().getCallData(callData) == CallTypeJS); 1805 #endif 1806 1807 JSFunction* function = asFunction(stackFrame.args[0].jsValue()); 1808 ASSERT(!function->isHostFunction()); 1809 FunctionExecutable* executable = function->jsExecutable(); 1810 ScopeChainNode* callDataScopeChain = function->scope().node(); 1811 executable->jitCodeForConstruct(stackFrame.callFrame, callDataScopeChain); 1794 1812 1795 1813 return function; … … 1803 1821 JSFunction* callee = asFunction(stackFrame.args[0].jsValue()); 1804 1822 ASSERT(!callee->isHostFunction()); 1805 CodeBlock* newCodeBlock = &callee->jsExecutable()->generatedBytecode ();1823 CodeBlock* newCodeBlock = &callee->jsExecutable()->generatedBytecodeForCall(); 1806 1824 int argCount = stackFrame.args[2].int32(); 1807 1825 … … 1843 1861 } 1844 1862 1863 DEFINE_STUB_FUNCTION(VoidPtrPair, op_construct_arityCheck) 1864 { 1865 STUB_INIT_STACK_FRAME(stackFrame); 1866 1867 CallFrame* callFrame = stackFrame.callFrame; 1868 JSFunction* callee = asFunction(stackFrame.args[0].jsValue()); 1869 ASSERT(!callee->isHostFunction()); 1870 CodeBlock* newCodeBlock = &callee->jsExecutable()->generatedBytecodeForConstruct(); 1871 int argCount = stackFrame.args[2].int32(); 1872 1873 ASSERT(argCount != newCodeBlock->m_numParameters); 1874 1875 CallFrame* oldCallFrame = callFrame->callerFrame(); 1876 1877 if (argCount > newCodeBlock->m_numParameters) { 1878 size_t numParameters = newCodeBlock->m_numParameters; 1879 Register* r = callFrame->registers() + numParameters; 1880 1881 Register* argv = r - RegisterFile::CallFrameHeaderSize - numParameters - argCount; 1882 for (size_t i = 0; i < numParameters; ++i) 1883 argv[i + argCount] = argv[i]; 1884 1885 callFrame = CallFrame::create(r); 1886 callFrame->setCallerFrame(oldCallFrame); 1887 } else { 1888 size_t omittedArgCount = newCodeBlock->m_numParameters - argCount; 1889 Register* r = callFrame->registers() + omittedArgCount; 1890 Register* newEnd = r + newCodeBlock->m_numCalleeRegisters; 1891 if (!stackFrame.registerFile->grow(newEnd)) { 1892 // Rewind to the previous call frame because op_call already optimistically 1893 // moved the call frame forward. 1894 stackFrame.callFrame = oldCallFrame; 1895 throwStackOverflowError(oldCallFrame, stackFrame.globalData, stackFrame.args[1].returnAddress(), STUB_RETURN_ADDRESS); 1896 RETURN_POINTER_PAIR(0, 0); 1897 } 1898 1899 Register* argv = r - RegisterFile::CallFrameHeaderSize - omittedArgCount; 1900 for (size_t i = 0; i < omittedArgCount; ++i) 1901 argv[i] = jsUndefined(); 1902 1903 callFrame = CallFrame::create(r); 1904 callFrame->setCallerFrame(oldCallFrame); 1905 } 1906 1907 RETURN_POINTER_PAIR(callee, callFrame); 1908 } 1909 1845 1910 #if ENABLE(JIT_OPTIMIZE_CALL) 1846 1911 DEFINE_STUB_FUNCTION(void*, vm_lazyLinkCall) … … 1849 1914 JSFunction* callee = asFunction(stackFrame.args[0].jsValue()); 1850 1915 ExecutableBase* executable = callee->executable(); 1851 JITCode& jitCode = executable->generatedJITCode ();1916 JITCode& jitCode = executable->generatedJITCodeForCall(); 1852 1917 1853 1918 CodeBlock* codeBlock = 0; 1854 1919 if (!executable->isHostFunction()) 1855 codeBlock = &static_cast<FunctionExecutable*>(executable)->bytecode (stackFrame.callFrame, callee->scope().node());1920 codeBlock = &static_cast<FunctionExecutable*>(executable)->bytecodeForCall(stackFrame.callFrame, callee->scope().node()); 1856 1921 CallLinkInfo* callLinkInfo = &stackFrame.callFrame->callerFrame()->codeBlock()->getCallLinkInfo(stackFrame.args[1].returnAddress()); 1857 1922 … … 1860 1925 else 1861 1926 JIT::linkCall(callee, stackFrame.callFrame->callerFrame()->codeBlock(), codeBlock, jitCode, callLinkInfo, stackFrame.args[2].int32(), stackFrame.globalData); 1927 1928 return jitCode.addressForCall().executableAddress(); 1929 } 1930 1931 DEFINE_STUB_FUNCTION(void*, vm_lazyLinkConstruct) 1932 { 1933 STUB_INIT_STACK_FRAME(stackFrame); 1934 JSFunction* callee = asFunction(stackFrame.args[0].jsValue()); 1935 ExecutableBase* executable = callee->executable(); 1936 JITCode& jitCode = executable->generatedJITCodeForConstruct(); 1937 1938 CodeBlock* codeBlock = 0; 1939 if (!executable->isHostFunction()) 1940 codeBlock = &static_cast<FunctionExecutable*>(executable)->bytecodeForConstruct(stackFrame.callFrame, callee->scope().node()); 1941 CallLinkInfo* callLinkInfo = &stackFrame.callFrame->callerFrame()->codeBlock()->getCallLinkInfo(stackFrame.args[1].returnAddress()); 1942 1943 if (!callLinkInfo->seenOnce()) 1944 callLinkInfo->setSeen(); 1945 else 1946 JIT::linkConstruct(callee, stackFrame.callFrame->callerFrame()->codeBlock(), codeBlock, jitCode, callLinkInfo, stackFrame.args[2].int32(), stackFrame.globalData); 1862 1947 1863 1948 return jitCode.addressForCall().executableAddress();
Note:
See TracChangeset
for help on using the changeset viewer.