Title: [187759] branches/jsc-tailcall/Source/_javascript_Core
Revision
187759
Author
[email protected]
Date
2015-08-03 13:46:01 -0700 (Mon, 03 Aug 2015)

Log Message

jsc-tailcall: Callee save registers should be saved after the stack pointer is set up
https://bugs.webkit.org/show_bug.cgi?id=147580

Reviewed by Basile Clement.

Moved the saving of callee saves to after we check for stack overflow and have
set up the stack pointer.

* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compile):
* jit/JIT.cpp:
(JSC::JIT::privateCompile):
* llint/LowLevelInterpreter.asm:

Modified Paths

Diff

Modified: branches/jsc-tailcall/Source/_javascript_Core/ChangeLog (187758 => 187759)


--- branches/jsc-tailcall/Source/_javascript_Core/ChangeLog	2015-08-03 20:40:38 UTC (rev 187758)
+++ branches/jsc-tailcall/Source/_javascript_Core/ChangeLog	2015-08-03 20:46:01 UTC (rev 187759)
@@ -1,3 +1,19 @@
+2015-08-03  Michael Saboff  <[email protected]>
+
+        jsc-tailcall: Callee save registers should be saved after the stack pointer is set up
+        https://bugs.webkit.org/show_bug.cgi?id=147580
+
+        Reviewed by Basile Clement.
+
+        Moved the saving of callee saves to after we check for stack overflow and have
+        set up the stack pointer.
+
+        * dfg/DFGJITCompiler.cpp:
+        (JSC::DFG::JITCompiler::compile):
+        * jit/JIT.cpp:
+        (JSC::JIT::privateCompile):
+        * llint/LowLevelInterpreter.asm:
+
 2015-07-31  Michael Saboff  <[email protected]>
 
         jsc-tailcall: REGRESSION(r187676): Broke stress/tail-call-no-stack-overflow.js

Modified: branches/jsc-tailcall/Source/_javascript_Core/dfg/DFGJITCompiler.cpp (187758 => 187759)


--- branches/jsc-tailcall/Source/_javascript_Core/dfg/DFGJITCompiler.cpp	2015-08-03 20:40:38 UTC (rev 187758)
+++ branches/jsc-tailcall/Source/_javascript_Core/dfg/DFGJITCompiler.cpp	2015-08-03 20:46:01 UTC (rev 187759)
@@ -290,7 +290,6 @@
 
     setStartOfCode();
     compileEntry();
-    compileSetupRegistersForEntry();
     m_speculative = std::make_unique<SpeculativeJIT>(*this);
 
     // Plant a check that sufficient space is available in the JSStack.
@@ -299,6 +298,7 @@
 
     addPtr(TrustedImm32(m_graph.stackPointerOffset() * sizeof(Register)), GPRInfo::callFrameRegister, stackPointerRegister);
     checkStackPointerAlignment();
+    compileSetupRegistersForEntry();
     compileBody();
     setEndOfMainPath();
 

Modified: branches/jsc-tailcall/Source/_javascript_Core/jit/JIT.cpp (187758 => 187759)


--- branches/jsc-tailcall/Source/_javascript_Core/jit/JIT.cpp	2015-08-03 20:40:38 UTC (rev 187758)
+++ branches/jsc-tailcall/Source/_javascript_Core/jit/JIT.cpp	2015-08-03 20:46:01 UTC (rev 187759)
@@ -526,9 +526,6 @@
 
     Label beginLabel(this);
 
-    emitSaveCalleeSaves();
-    emitMaterializeTagCheckRegisters();
-
     sampleCodeBlock(m_codeBlock);
 #if ENABLE(OPCODE_SAMPLING)
     sampleInstruction(m_codeBlock->instructions().begin());
@@ -560,6 +557,9 @@
     move(regT1, stackPointerRegister);
     checkStackPointerAlignment();
 
+    emitSaveCalleeSaves();
+    emitMaterializeTagCheckRegisters();
+
     privateCompileMainPass();
     privateCompileLinkPass();
     privateCompileSlowCases();

Modified: branches/jsc-tailcall/Source/_javascript_Core/llint/LowLevelInterpreter.asm (187758 => 187759)


--- branches/jsc-tailcall/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2015-08-03 20:40:38 UTC (rev 187758)
+++ branches/jsc-tailcall/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2015-08-03 20:46:01 UTC (rev 187759)
@@ -845,13 +845,6 @@
 
     codeBlockSetter(t1)
 
-    preserveCalleeSavesUsedByLLInt()
-
-    if JSVALUE64
-        move TagTypeNumber, tagTypeNumber
-        addp TagBitTypeOther, tagTypeNumber, tagMask
-    end
-
     # Set up the PC.
     if JSVALUE64
         loadp CodeBlock::m_instructions[t1], PB
@@ -882,6 +875,13 @@
 
 .stackHeightOK:
     move t0, sp
+
+    preserveCalleeSavesUsedByLLInt()
+
+    if JSVALUE64
+        move TagTypeNumber, tagTypeNumber
+        addp TagBitTypeOther, tagTypeNumber, tagMask
+    end
 end
 
 # Expects that CodeBlock is in t1, which is what prologue() leaves behind.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to