Commit 1cd33f8a authored by msaboff@apple.com's avatar msaboff@apple.com
Browse files

REGRESSION (r158586): callToJavaScript needs to save return PC to Sentinel frame

https://bugs.webkit.org/show_bug.cgi?id=124420

Reviewed by Filip Pizlo.

Save the return PC into the sentinel frame.

* jit/JITStubsMSVC64.asm:
* jit/JITStubsX86.h:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 52e1a9f3
2013-11-15 Michael Saboff <msaboff@apple.com>
REGRESSION (r158586): callToJavaScript needs to save return PC to Sentinel frame
https://bugs.webkit.org/show_bug.cgi?id=124420
Reviewed by Filip Pizlo.
Save the return PC into the sentinel frame.
* jit/JITStubsMSVC64.asm:
* jit/JITStubsX86.h:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
2013-11-14 Oliver Hunt <oliver@apple.com>
Make CLoop easier to build, and make it work
......
......@@ -32,6 +32,7 @@ PUBLIC getHostCallReturnValue
_TEXT SEGMENT
callToJavaScript PROC
mov r10, qword ptr[sp]
push rbp
mov rax, rbp ; Save previous frame pointer
mov rbp, rsp
......@@ -49,6 +50,7 @@ callToJavaScript PROC
mov rbp, rdx
mov r11, qword ptr[rbp] ; Put the previous frame pointer in the sentinel call frame above us
mov qword ptr[r11], rax
mov qword ptr[r11 + 8], r10
mov r14, 0FFFF000000000000h
mov r15, 0FFFF000000000002h
call rcx
......
......@@ -209,6 +209,7 @@ extern "C" {
__declspec(naked) EncodedJSValue callToJavaScript(void* code, ExecState*)
{
__asm {
mov edx, [esp]
push ebp;
mov eax, ebp;
mov ebp, esp;
......@@ -219,6 +220,7 @@ extern "C" {
mov ebp, [esp + 0x34];
mov ebx, [ebp];
mov [ebx], eax;
mov 4[ebx], edx
call [esp + 0x30];
add esp, 0x1c;
pop ebx;
......
......@@ -174,31 +174,37 @@ macro doCallToJavaScript()
if X86
const extraStackSpace = 28
const previousCFR = t0
const previousPC = t1
const entry = t5
const newCallFrame = t4
elsif ARM or ARMv7_TRADITIONAL
const extraStackSpace = 16
const previousCFR = t3
const previousPC = lr
const entry = a0
const newCallFrame = a1
elsif ARMv7
const extraStackSpace = 28
const previousCFR = t3
const previousPC = lr
const entry = a0
const newCallFrame = a1
elsif MIPS
const extraStackSpace = 20
const previousCFR = t2
const previousPC = lr
const entry = a0
const newCallFrame = a1
elsif SH4
const extraStackSpace = 20
const previousCFR = t3
const previousPC = lr
const entry = a0
const newCallFrame = a1
end
if X86
loadp [sp], previousPC
move cfr, previousCFR
end
functionPrologue(extraStackSpace)
......@@ -212,6 +218,7 @@ macro doCallToJavaScript()
move newCallFrame, cfr
loadp [cfr], newCallFrame
storep previousCFR, [newCallFrame]
storep previousPC, 4[newCallFrame]
call entry
_returnFromJavaScript:
......
......@@ -119,26 +119,33 @@ macro doCallToJavaScript()
if X86_64
const extraStackSpace = 8
const previousCFR = t0
const previousPC = t6
const entry = t5
const newCallFrame = t4
elsif ARM64
const extraStackSpace = 0
const previousCFR = t4
const previousCFR = t4
const previousPC = lr
const entry = a0
const newCallFrame = a1
elsif C_LOOP
const extraStackSpace = 0
const previousCFR = t4
const previousPC = lr
const entry = a0
const newCallFrame = a1
end
if X86_64
loadp [sp], previousPC
end
move cfr, previousCFR
functionPrologue(extraStackSpace)
move newCallFrame, cfr
loadp [cfr], newCallFrame
storep previousCFR, [newCallFrame]
storep previousPC, 8[newCallFrame]
move 0xffff000000000000, csr1
addp 2, csr1, csr2
call entry
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment