Changeset 159376 in webkit
- Timestamp:
- Nov 15, 2013 7:25:45 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r159369 r159376 1 2013-11-15 peavo@outlook.com <peavo@outlook.com> 2 3 [Win] JavaScript crashes on 64-bit with JIT enabled. 4 https://bugs.webkit.org/show_bug.cgi?id=124409 5 6 Reviewed by Michael Saboff. 7 8 These are issues found with JIT on 64-bit: 9 - The registers rsi and rdi in callToJavaScript needs to be saved and restored. This is required by the Windows 64-bit ABI. 10 - The getHostCallReturnValue function needs to be updated according to it's GCC counterpart. 11 - The poke argument offset needs to be 20h, because Windows 64-bit ABI requires stack space allocated for the 4 argument registers. 12 13 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Re-added JITStubsMSVC64.asm to project. 14 * jit/CCallHelpers.h: Set poke argument offset. 15 (JSC::CCallHelpers::setupArguments): Compile fix, added needed method. 16 * jit/JITStubsMSVC64.asm: Save and restore registers rsi and rdi. 17 Update getHostCallReturnValue according to the GCC version. 18 1 19 2013-11-14 David Farler <dfarler@apple.com> 2 20 -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
r159360 r159376 1311 1311 <MASM Include="..\jit\JITStubsMSVC64.asm"> 1312 1312 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild> 1313 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>1314 1313 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> 1315 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>1316 1314 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild> 1317 1315 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild> 1318 1316 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild> 1319 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>1320 1317 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 1321 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>1322 1318 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild> 1323 1319 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild> -
trunk/Source/JavaScriptCore/jit/CCallHelpers.h
r158830 r159376 731 731 } 732 732 733 #if CPU(MIPS) 733 #if CPU(MIPS) || (OS(WINDOWS) && CPU(X86_64)) 734 734 #define POKE_ARGUMENT_OFFSET 4 735 735 #else … … 1486 1486 poke(arg4, POKE_ARGUMENT_OFFSET); 1487 1487 setupArgumentsWithExecState(arg1, arg2, arg3); 1488 } 1489 1490 ALWAYS_INLINE void setupArguments(GPRReg arg1, GPRReg arg2, TrustedImmPtr arg3, TrustedImm32 arg4, GPRReg arg5) 1491 { 1492 poke(arg5, POKE_ARGUMENT_OFFSET); 1493 setupTwoStubArgsGPR<GPRInfo::argumentGPR0, GPRInfo::argumentGPR1>(arg1, arg2); 1494 move(arg3, GPRInfo::argumentGPR2); 1495 move(arg4, GPRInfo::argumentGPR3); 1488 1496 } 1489 1497 #endif // NUMBER_OF_ARGUMENT_REGISTERS == 4 -
trunk/Source/JavaScriptCore/jit/JITStubsMSVC64.asm
r159346 r159376 33 33 34 34 callToJavaScript PROC 35 mov r10, qword ptr[ sp]35 mov r10, qword ptr[rsp] 36 36 push rbp 37 37 mov rax, rbp ; Save previous frame pointer … … 42 42 push r15 43 43 push rbx 44 push rsi 45 push rdi 44 46 45 47 ; JIT operations can use up to 6 args (4 in registers and 2 on the stack). … … 56 58 call rcx 57 59 add rsp, 28h 60 pop rdi 61 pop rsi 58 62 pop rbx 59 63 pop r15 … … 67 71 returnFromJavaScript PROC 68 72 add rsp, 28h 73 pop rdi 74 pop rsi 69 75 pop rbx 70 76 pop r15 … … 77 83 78 84 getHostCallReturnValue PROC 79 sub r13, 4080 mov r 13, rdi85 mov rbp, [rbp] ; CallFrame 86 mov rcx, rbp ; rcx is first argument register on Windows 81 87 jmp getHostCallReturnValueWithExecState 82 88 getHostCallReturnValue ENDP
Note: See TracChangeset
for help on using the changeset viewer.