Title: [161211] branches/jsCStack/Source/_javascript_Core
Revision
161211
Author
fpi...@apple.com
Date
2014-01-02 11:20:52 -0800 (Thu, 02 Jan 2014)

Log Message

Refactor LLInt C stack frame munging helpers so that 32-bit code paths can use them
https://bugs.webkit.org/show_bug.cgi?id=126387

Not yet reviewed.
        
This gets us closer to the 32-bit LLInt working on the C stack by enabling the
32-bit code paths to use the low-level stack/frame pointer munging helpers. This
patch doesn't completely ensure that these helpers actually work - the 32-bit
build is still broken - but it's a good change to land separately since it affects
64-bit code paths as well.

* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

Modified Paths

Diff

Modified: branches/jsCStack/Source/_javascript_Core/ChangeLog (161210 => 161211)


--- branches/jsCStack/Source/_javascript_Core/ChangeLog	2014-01-02 18:45:33 UTC (rev 161210)
+++ branches/jsCStack/Source/_javascript_Core/ChangeLog	2014-01-02 19:20:52 UTC (rev 161211)
@@ -1,3 +1,20 @@
+2014-01-02  Filip Pizlo  <fpi...@apple.com>
+
+        Refactor LLInt C stack frame munging helpers so that 32-bit code paths can use them
+        https://bugs.webkit.org/show_bug.cgi?id=126387
+
+        Not yet reviewed.
+        
+        This gets us closer to the 32-bit LLInt working on the C stack by enabling the
+        32-bit code paths to use the low-level stack/frame pointer munging helpers. This
+        patch doesn't completely ensure that these helpers actually work - the 32-bit
+        build is still broken - but it's a good change to land separately since it affects
+        64-bit code paths as well.
+
+        * llint/LowLevelInterpreter.asm:
+        * llint/LowLevelInterpreter32_64.asm:
+        * llint/LowLevelInterpreter64.asm:
+
 2013-12-31  Mark Lam  <mark....@apple.com>
 
         CStack: Need a separate stack limit for the JS stack and the C stack.

Modified: branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm (161210 => 161211)


--- branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2014-01-02 18:45:33 UTC (rev 161210)
+++ branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2014-01-02 19:20:52 UTC (rev 161211)
@@ -216,6 +216,14 @@
     end
 end
 
+macro checkStackPointerAlignment(tempReg, location)
+    andp sp, 0xf, tempReg
+    btpz tempReg, .stackPointerOkay
+    move location, tempReg
+    break
+.stackPointerOkay:
+end
+
 macro preserveCallerPCAndCFR()
     if C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or ARM64 or MIPS or SH4
         # In C_LOOP case, we're only preserving the bytecode vPC.
@@ -229,7 +237,6 @@
     end
 end
 
-
 macro restoreCallerPCAndCFR()
     if C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or ARM64 or MIPS or SH4
         # In C_LOOP case, we're only preserving the bytecode vPC.
@@ -241,7 +248,6 @@
     end
 end
 
-
 macro preserveReturnAddressAfterCall(destinationRegister)
     if C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or ARM64 or MIPS or SH4
         # In C_LOOP case, we're only preserving the bytecode vPC.
@@ -264,6 +270,54 @@
     end
 end
 
+macro functionPrologue()
+    if X86 or X86_64
+        push cfr
+        move sp, cfr
+    elsif ARM64 or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS
+        pushLRAndFP
+    end
+end
+
+macro functionEpilogue()
+    if X86 or X86_64
+        pop cfr
+    elsif ARM64 or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS
+        popLRAndFP
+    end
+end
+
+macro callToJavaScriptPrologue()
+    if X86 or X86_64
+    elsif ARM64 or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS
+        pushLRAndFP
+    end
+    pushCalleeSaves
+end
+
+macro callToJavaScriptEpilogue()
+    addp CallFrameHeaderSlots * 8, cfr, sp
+    loadp CallerFrame[cfr], cfr
+
+    popCalleeSaves
+    if X86 or X86_64
+    elsif ARM64 or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS
+        popLRAndFP
+    end
+end
+
+macro moveStackPointerForCodeBlock(codeBlock, scratch)
+    loadi CodeBlock::m_numCalleeRegisters[codeBlock], t2
+    lshiftp 3, t2
+    addp maxFrameExtentForSlowPathCall, t2
+    subp cfr, t2, sp
+end
+
+macro restoreStackPointerAfterCall()
+    loadp CodeBlock[cfr], t1
+    moveStackPointerForCodeBlock(t1, t2)
+end
+
 macro traceExecution()
     if EXECUTION_TRACING
         callSlowPath(_llint_trace)
@@ -375,9 +429,7 @@
     end
     codeBlockSetter(t1)
     
-    loadi CodeBlock::m_numCalleeRegisters[t1], t2
-    lshiftp 3, t2
-    subp t2, sp
+    moveStackPointerForCodeBlock(t1, t2)
 
     # Set up the PC.
     if JSVALUE64

Modified: branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm (161210 => 161211)


--- branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2014-01-02 18:45:33 UTC (rev 161210)
+++ branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2014-01-02 19:20:52 UTC (rev 161211)
@@ -145,31 +145,6 @@
     move t1, cfr
 end
 
-macro functionPrologue(extraStackSpace)
-    if X86
-        push cfr
-        move sp, cfr
-    end
-    pushCalleeSaves
-    if ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS
-        push cfr
-        push lr
-    end
-    subp extraStackSpace, sp
-end
-
-macro functionEpilogue(extraStackSpace)
-    addp extraStackSpace, sp
-    if ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS
-        pop lr
-        pop cfr
-    end
-    popCalleeSaves
-    if X86
-        pop cfr
-    end
-end
-
 macro doCallToJavaScript(makeCall, doReturn)
     if X86
         const entry = t4

Modified: branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (161210 => 161211)


--- branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2014-01-02 18:45:33 UTC (rev 161210)
+++ branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2014-01-02 19:20:52 UTC (rev 161211)
@@ -90,64 +90,6 @@
     end
 end
 
-macro checkStackPointerAlignment(tempReg, location)
-    andp sp, 0xf, tempReg
-    btpz tempReg, .stackPointerOkay
-    move location, tempReg
-    break
-.stackPointerOkay:
-end
-
-
-macro functionPrologue()
-    if X86_64
-        push cfr
-        move sp, cfr
-    elsif ARM64
-        pushLRAndFP
-    end
-end
-
-macro functionEpilogue()
-    if X86_64
-        pop cfr
-    elsif ARM64
-        popLRAndFP
-    end
-end
-
-macro callToJavaScriptPrologue()
-    if X86_64
-    elsif ARM64
-        pushLRAndFP
-    end
-    pushCalleeSaves
-end
-
-macro callToJavaScriptEpilogue()
-    addp CallFrameHeaderSlots*8, cfr, sp
-    loadp CallerFrame[cfr], cfr
-
-    popCalleeSaves
-    if X86_64
-    elsif ARM64
-        popLRAndFP
-    end
-end
-
-macro moveStackPointerForCallframe(codeblock)
-    loadi CodeBlock::m_numCalleeRegisters[codeblock], t1
-    lshiftp 3, t1
-    subp cfr, t1, sp
-end
-
-macro restoreStackPointerAfterCall()
-    loadp CodeBlock[cfr], t1
-    loadi CodeBlock::m_numCalleeRegisters[t1], t1
-    lshiftp 3, t1
-    subp cfr, t1, sp
-end
-
 macro doCallToJavaScript(makeCall)
     if X86_64
         const entry = t4
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to