diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-28 15:32:59 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-28 15:32:59 (GMT) |
commit | 14aa95bf83e8fa91151b5edd3c346c20d942eb81 (patch) | |
tree | 46ec6389eb1590e0a018c4acbfba670d315987ba /src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp | |
parent | 1c72e77e43593dfea6c6392d1058e63762efb534 (diff) | |
parent | f340825f35ad3de28685f4890cd73bbf9bb6c0e6 (diff) | |
download | Qt-14aa95bf83e8fa91151b5edd3c346c20d942eb81.zip Qt-14aa95bf83e8fa91151b5edd3c346c20d942eb81.tar.gz Qt-14aa95bf83e8fa91151b5edd3c346c20d942eb81.tar.bz2 |
Merge branch 'qtwebkit-4.6-staging' into qtscript-jsc-backend
Conflicts:
src/corelib/tools/qregexp.cpp
src/script/qscriptengine.cpp
src/script/qscriptvalue.cpp
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp index f1b22c0..a0e462b 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp @@ -26,6 +26,12 @@ #include "config.h" #include "JIT.h" +// This probably does not belong here; adding here for now as a quick Windows build fix. +#if ENABLE(ASSEMBLER) && PLATFORM(X86) && !PLATFORM(MAC) +#include "MacroAssembler.h" +JSC::MacroAssemblerX86Common::SSE2CheckState JSC::MacroAssemblerX86Common::s_sse2CheckState = NotCheckedSSE2; +#endif + #if ENABLE(JIT) #include "CodeBlock.h" @@ -34,6 +40,8 @@ #include "JITStubCall.h" #include "JSArray.h" #include "JSFunction.h" +#include "LinkBuffer.h" +#include "RepatchBuffer.h" #include "ResultType.h" #include "SamplingTool.h" @@ -45,21 +53,21 @@ using namespace std; namespace JSC { -void ctiPatchNearCallByReturnAddress(ReturnAddressPtr returnAddress, MacroAssemblerCodePtr newCalleeFunction) +void ctiPatchNearCallByReturnAddress(CodeBlock* codeblock, ReturnAddressPtr returnAddress, MacroAssemblerCodePtr newCalleeFunction) { - MacroAssembler::RepatchBuffer repatchBuffer; + RepatchBuffer repatchBuffer(codeblock); repatchBuffer.relinkNearCallerToTrampoline(returnAddress, newCalleeFunction); } -void ctiPatchCallByReturnAddress(ReturnAddressPtr returnAddress, MacroAssemblerCodePtr newCalleeFunction) +void ctiPatchCallByReturnAddress(CodeBlock* codeblock, ReturnAddressPtr returnAddress, MacroAssemblerCodePtr newCalleeFunction) { - MacroAssembler::RepatchBuffer repatchBuffer; + RepatchBuffer repatchBuffer(codeblock); repatchBuffer.relinkCallerToTrampoline(returnAddress, newCalleeFunction); } -void ctiPatchCallByReturnAddress(ReturnAddressPtr returnAddress, FunctionPtr newCalleeFunction) +void ctiPatchCallByReturnAddress(CodeBlock* codeblock, ReturnAddressPtr returnAddress, FunctionPtr newCalleeFunction) { - MacroAssembler::RepatchBuffer repatchBuffer; + RepatchBuffer repatchBuffer(codeblock); repatchBuffer.relinkCallerToFunction(returnAddress, newCalleeFunction); } @@ -396,7 +404,7 @@ void JIT::privateCompile() #endif // Could use a pop_m, but would need to offset the following instruction if so. - preverveReturnAddressAfterCall(regT2); + preserveReturnAddressAfterCall(regT2); emitPutToCallFrameHeader(regT2, RegisterFile::ReturnPC); Jump slowRegisterFileCheck; @@ -488,6 +496,7 @@ void JIT::privateCompile() #if ENABLE(JIT_OPTIMIZE_CALL) for (unsigned i = 0; i < m_codeBlock->numberOfCallLinkInfos(); ++i) { CallLinkInfo& info = m_codeBlock->callLinkInfo(i); + info.ownerCodeBlock = m_codeBlock; info.callReturnLocation = patchBuffer.locationOfNearCall(m_callStructureStubCompilationInfo[i].callReturnLocation); info.hotPathBegin = patchBuffer.locationOf(m_callStructureStubCompilationInfo[i].hotPathBegin); info.hotPathOther = patchBuffer.locationOfNearCall(m_callStructureStubCompilationInfo[i].hotPathOther); @@ -553,7 +562,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable loadPtr(Address(regT2, OBJECT_OFFSETOF(JSFunction, m_body)), regT3); loadPtr(Address(regT3, OBJECT_OFFSETOF(FunctionBodyNode, m_code)), regT0); Jump hasCodeBlock1 = branchTestPtr(NonZero, regT0); - preverveReturnAddressAfterCall(regT3); + preserveReturnAddressAfterCall(regT3); restoreArgumentReference(); Call callJSFunction1 = call(); emitGetJITStubArg(1, regT2); @@ -565,7 +574,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable // Check argCount matches callee arity. Jump arityCheckOkay1 = branch32(Equal, Address(regT0, OBJECT_OFFSETOF(CodeBlock, m_numParameters)), regT1); - preverveReturnAddressAfterCall(regT3); + preserveReturnAddressAfterCall(regT3); emitPutJITStubArg(regT3, 2); emitPutJITStubArg(regT0, 4); restoreArgumentReference(); @@ -579,7 +588,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable compileOpCallInitializeCallFrame(); - preverveReturnAddressAfterCall(regT3); + preserveReturnAddressAfterCall(regT3); emitPutJITStubArg(regT3, 2); restoreArgumentReference(); Call callDontLazyLinkCall = call(); @@ -594,7 +603,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable loadPtr(Address(regT2, OBJECT_OFFSETOF(JSFunction, m_body)), regT3); loadPtr(Address(regT3, OBJECT_OFFSETOF(FunctionBodyNode, m_code)), regT0); Jump hasCodeBlock2 = branchTestPtr(NonZero, regT0); - preverveReturnAddressAfterCall(regT3); + preserveReturnAddressAfterCall(regT3); restoreArgumentReference(); Call callJSFunction2 = call(); emitGetJITStubArg(1, regT2); @@ -606,7 +615,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable // Check argCount matches callee arity. Jump arityCheckOkay2 = branch32(Equal, Address(regT0, OBJECT_OFFSETOF(CodeBlock, m_numParameters)), regT1); - preverveReturnAddressAfterCall(regT3); + preserveReturnAddressAfterCall(regT3); emitPutJITStubArg(regT3, 2); emitPutJITStubArg(regT0, 4); restoreArgumentReference(); @@ -620,7 +629,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable compileOpCallInitializeCallFrame(); - preverveReturnAddressAfterCall(regT3); + preserveReturnAddressAfterCall(regT3); emitPutJITStubArg(regT3, 2); restoreArgumentReference(); Call callLazyLinkCall = call(); @@ -634,7 +643,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable loadPtr(Address(regT2, OBJECT_OFFSETOF(JSFunction, m_body)), regT3); loadPtr(Address(regT3, OBJECT_OFFSETOF(FunctionBodyNode, m_code)), regT0); Jump hasCodeBlock3 = branchTestPtr(NonZero, regT0); - preverveReturnAddressAfterCall(regT3); + preserveReturnAddressAfterCall(regT3); restoreArgumentReference(); Call callJSFunction3 = call(); emitGetJITStubArg(1, regT2); @@ -647,7 +656,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable // Check argCount matches callee arity. Jump arityCheckOkay3 = branch32(Equal, Address(regT0, OBJECT_OFFSETOF(CodeBlock, m_numParameters)), regT1); - preverveReturnAddressAfterCall(regT3); + preserveReturnAddressAfterCall(regT3); emitPutJITStubArg(regT3, 2); emitPutJITStubArg(regT0, 4); restoreArgumentReference(); @@ -668,7 +677,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable Label nativeCallThunk = align(); - preverveReturnAddressAfterCall(regT0); + preserveReturnAddressAfterCall(regT0); emitPutToCallFrameHeader(regT0, RegisterFile::ReturnPC); // Push return address // Load caller frame's scope chain into this callframe so that whatever we call can @@ -903,14 +912,14 @@ void JIT::unlinkCall(CallLinkInfo* callLinkInfo) // When the JSFunction is deleted the pointer embedded in the instruction stream will no longer be valid // (and, if a new JSFunction happened to be constructed at the same location, we could get a false positive // match). Reset the check so it no longer matches. - RepatchBuffer repatchBuffer; + RepatchBuffer repatchBuffer(callLinkInfo->ownerCodeBlock); repatchBuffer.repatch(callLinkInfo->hotPathBegin, JSValue::encode(JSValue())); } -void JIT::linkCall(JSFunction* callee, CodeBlock* calleeCodeBlock, JITCode& code, CallLinkInfo* callLinkInfo, int callerArgCount, JSGlobalData* globalData) +void JIT::linkCall(JSFunction* callee, CodeBlock* callerCodeBlock, CodeBlock* calleeCodeBlock, JITCode& code, CallLinkInfo* callLinkInfo, int callerArgCount, JSGlobalData* globalData) { ASSERT(calleeCodeBlock); - RepatchBuffer repatchBuffer; + RepatchBuffer repatchBuffer(callerCodeBlock); // Currently we only link calls with the exact number of arguments. // If this is a native call calleeCodeBlock is null so the number of parameters is unimportant @@ -931,12 +940,3 @@ void JIT::linkCall(JSFunction* callee, CodeBlock* calleeCodeBlock, JITCode& code } // namespace JSC #endif // ENABLE(JIT) - -// This probably does not belong here; adding here for now as a quick Windows build fix. -#if ENABLE(ASSEMBLER) - -#if PLATFORM(X86) && !PLATFORM(MAC) -JSC::MacroAssemblerX86Common::SSE2CheckState JSC::MacroAssemblerX86Common::s_sse2CheckState = NotCheckedSSE2; -#endif - -#endif |