Changeset 39428 in webkit for trunk/JavaScriptCore/jit/JIT.cpp
- Timestamp:
- Dec 21, 2008, 5:00:07 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JIT.cpp
r39422 r39428 1891 1891 StructureStubInfo& info = m_codeBlock->structureStubInfo(i); 1892 1892 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) 1893 info.callReturnLocation = X86Assembler::getRelocatedAddress(code,m_propertyAccessCompilationInfo[i].callReturnLocation);1894 info.hotPathBegin = X86Assembler::getRelocatedAddress(code,m_propertyAccessCompilationInfo[i].hotPathBegin);1893 info.callReturnLocation = repatchBuffer.addressOf(m_propertyAccessCompilationInfo[i].callReturnLocation); 1894 info.hotPathBegin = repatchBuffer.addressOf(m_propertyAccessCompilationInfo[i].hotPathBegin); 1895 1895 #else 1896 1896 info.callReturnLocation = 0; … … 1901 1901 CallLinkInfo& info = m_codeBlock->callLinkInfo(i); 1902 1902 #if ENABLE(JIT_OPTIMIZE_CALL) 1903 info.callReturnLocation = X86Assembler::getRelocatedAddress(code,m_callStructureStubCompilationInfo[i].callReturnLocation);1904 info.hotPathBegin = X86Assembler::getRelocatedAddress(code,m_callStructureStubCompilationInfo[i].hotPathBegin);1905 info.hotPathOther = X86Assembler::getRelocatedAddress(code,m_callStructureStubCompilationInfo[i].hotPathOther);1906 info.coldPathOther = X86Assembler::getRelocatedAddress(code,m_callStructureStubCompilationInfo[i].coldPathOther);1903 info.callReturnLocation = repatchBuffer.addressOf(m_callStructureStubCompilationInfo[i].callReturnLocation); 1904 info.hotPathBegin = repatchBuffer.addressOf(m_callStructureStubCompilationInfo[i].hotPathBegin); 1905 info.hotPathOther = repatchBuffer.addressOf(m_callStructureStubCompilationInfo[i].hotPathOther); 1906 info.coldPathOther = repatchBuffer.addressOf(m_callStructureStubCompilationInfo[i].coldPathOther); 1907 1907 #else 1908 1908 info.callReturnLocation = 0; … … 1960 1960 Label virtualCallPreLinkBegin = align(); 1961 1961 1962 #define __ m_assembler.1963 1962 // Load the callee CodeBlock* into eax 1964 __ movl_mr(FIELD_OFFSET(JSFunction, m_body), X86::ecx, X86::eax); 1965 __ movl_mr(FIELD_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax); 1966 __ testl_rr(X86::eax, X86::eax); 1967 X86Assembler::JmpSrc hasCodeBlock1 = __ jne(); 1968 __ pop_r(X86::ebx); 1963 loadPtr(Address(X86::ecx, FIELD_OFFSET(JSFunction, m_body)), X86::eax); 1964 loadPtr(Address(X86::eax, FIELD_OFFSET(FunctionBodyNode, m_code)), X86::eax); 1965 Jump hasCodeBlock1 = jnzPtr(X86::eax); 1966 pop(X86::ebx); 1969 1967 restoreArgumentReference(); 1970 X86Assembler::JmpSrc callJSFunction1 = __call();1968 Jump callJSFunction1 = call(); 1971 1969 emitGetJITStubArg(1, X86::ecx); 1972 1970 emitGetJITStubArg(3, X86::edx); 1973 __ push_r(X86::ebx);1974 __ link(hasCodeBlock1, __ label());1971 push(X86::ebx); 1972 hasCodeBlock1.link(this); 1975 1973 1976 1974 // Check argCount matches callee arity. 1977 __ cmpl_rm(X86::edx, FIELD_OFFSET(CodeBlock, m_numParameters), X86::eax); 1978 X86Assembler::JmpSrc arityCheckOkay1 = __ je(); 1979 __ pop_r(X86::ebx); 1975 Jump arityCheckOkay1 = je32(Address(X86::eax, FIELD_OFFSET(CodeBlock, m_numParameters)), X86::edx); 1976 pop(X86::ebx); 1980 1977 emitPutJITStubArg(X86::ebx, 2); 1981 1978 emitPutJITStubArg(X86::eax, 4); 1982 1979 restoreArgumentReference(); 1983 X86Assembler::JmpSrc callArityCheck1 = __call();1984 __ movl_rr(X86::edx, callFrameRegister);1980 Jump callArityCheck1 = call(); 1981 move(X86::edx, callFrameRegister); 1985 1982 emitGetJITStubArg(1, X86::ecx); 1986 1983 emitGetJITStubArg(3, X86::edx); 1987 __ push_r(X86::ebx);1988 __ link(arityCheckOkay1, __ label());1989 1984 push(X86::ebx); 1985 arityCheckOkay1.link(this); 1986 1990 1987 compileOpCallInitializeCallFrame(); 1991 1988 1992 __ pop_r(X86::ebx);1989 pop(X86::ebx); 1993 1990 emitPutJITStubArg(X86::ebx, 2); 1994 1991 restoreArgumentReference(); 1995 X86Assembler::JmpSrc callDontLazyLinkCall = __call();1996 __ push_r(X86::ebx);1997 1998 __ jmp_r(X86::eax);1992 Jump callDontLazyLinkCall = call(); 1993 push(X86::ebx); 1994 1995 jump(X86::eax); 1999 1996 2000 1997 Label virtualCallLinkBegin = align(); 2001 1998 2002 1999 // Load the callee CodeBlock* into eax 2003 __ movl_mr(FIELD_OFFSET(JSFunction, m_body), X86::ecx, X86::eax); 2004 __ movl_mr(FIELD_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax); 2005 __ testl_rr(X86::eax, X86::eax); 2006 X86Assembler::JmpSrc hasCodeBlock2 = __ jne(); 2007 __ pop_r(X86::ebx); 2000 loadPtr(Address(X86::ecx, FIELD_OFFSET(JSFunction, m_body)), X86::eax); 2001 loadPtr(Address(X86::eax, FIELD_OFFSET(FunctionBodyNode, m_code)), X86::eax); 2002 Jump hasCodeBlock2 = jnzPtr(X86::eax); 2003 pop(X86::ebx); 2008 2004 restoreArgumentReference(); 2009 X86Assembler::JmpSrc callJSFunction2 = __call();2005 Jump callJSFunction2 = call(); 2010 2006 emitGetJITStubArg(1, X86::ecx); 2011 2007 emitGetJITStubArg(3, X86::edx); 2012 __ push_r(X86::ebx);2013 __ link(hasCodeBlock2, __ label());2008 push(X86::ebx); 2009 hasCodeBlock2.link(this); 2014 2010 2015 2011 // Check argCount matches callee arity. 2016 __ cmpl_rm(X86::edx, FIELD_OFFSET(CodeBlock, m_numParameters), X86::eax); 2017 X86Assembler::JmpSrc arityCheckOkay2 = __ je(); 2018 __ pop_r(X86::ebx); 2012 Jump arityCheckOkay2 = je32(Address(X86::eax, FIELD_OFFSET(CodeBlock, m_numParameters)), X86::edx); 2013 pop(X86::ebx); 2019 2014 emitPutJITStubArg(X86::ebx, 2); 2020 2015 emitPutJITStubArg(X86::eax, 4); 2021 2016 restoreArgumentReference(); 2022 X86Assembler::JmpSrc callArityCheck2 = __call();2023 __ movl_rr(X86::edx, callFrameRegister);2017 Jump callArityCheck2 = call(); 2018 move(X86::edx, callFrameRegister); 2024 2019 emitGetJITStubArg(1, X86::ecx); 2025 2020 emitGetJITStubArg(3, X86::edx); 2026 __ push_r(X86::ebx);2027 __ link(arityCheckOkay2, __ label());2021 push(X86::ebx); 2022 arityCheckOkay2.link(this); 2028 2023 2029 2024 compileOpCallInitializeCallFrame(); 2030 2025 2031 __ pop_r(X86::ebx);2026 pop(X86::ebx); 2032 2027 emitPutJITStubArg(X86::ebx, 2); 2033 2028 restoreArgumentReference(); 2034 X86Assembler::JmpSrc callLazyLinkCall = __call();2035 __ push_r(X86::ebx);2036 2037 __ jmp_r(X86::eax);2029 Jump callLazyLinkCall = call(); 2030 push(X86::ebx); 2031 2032 jump(X86::eax); 2038 2033 2039 2034 Label virtualCallBegin = align(); … … 2045 2040 pop(X86::ebx); 2046 2041 restoreArgumentReference(); 2047 X86Assembler::JmpSrccallJSFunction3 = call();2042 Jump callJSFunction3 = call(); 2048 2043 emitGetJITStubArg(1, X86::ecx); 2049 2044 emitGetJITStubArg(3, X86::edx); … … 2057 2052 emitPutJITStubArg(X86::eax, 4); 2058 2053 restoreArgumentReference(); 2059 X86Assembler::JmpSrccallArityCheck3 = call();2054 Jump callArityCheck3 = call(); 2060 2055 move(X86::edx, callFrameRegister); 2061 2056 emitGetJITStubArg(1, X86::ecx); … … 2087 2082 m_interpreter->m_ctiStringLengthTrampoline = repatchBuffer.addressOf(stringLengthBegin); 2088 2083 #endif 2089 X86Assembler::link(code,callArityCheck1, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck));2090 X86Assembler::link(code,callArityCheck2, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck));2091 X86Assembler::link(code,callArityCheck3, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck));2092 X86Assembler::link(code,callJSFunction1, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction));2093 X86Assembler::link(code,callJSFunction2, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction));2094 X86Assembler::link(code,callJSFunction3, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction));2095 X86Assembler::link(code,callDontLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_dontLazyLinkCall));2096 X86Assembler::link(code,callLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_lazyLinkCall));2084 repatchBuffer.link(callArityCheck1, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck)); 2085 repatchBuffer.link(callArityCheck2, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck)); 2086 repatchBuffer.link(callArityCheck3, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck)); 2087 repatchBuffer.link(callJSFunction1, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction)); 2088 repatchBuffer.link(callJSFunction2, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction)); 2089 repatchBuffer.link(callJSFunction3, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction)); 2090 repatchBuffer.link(callDontLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_dontLazyLinkCall)); 2091 repatchBuffer.link(callLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_lazyLinkCall)); 2097 2092 2098 2093 m_interpreter->m_ctiVirtualCallPreLink = repatchBuffer.addressOf(virtualCallPreLinkBegin);
Note:
See TracChangeset
for help on using the changeset viewer.