<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - jsc-tailcall: JavaScript functions should restore the stack pointer after a call"
   href="https://bugs.webkit.org/show_bug.cgi?id=146846#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - jsc-tailcall: JavaScript functions should restore the stack pointer after a call"
   href="https://bugs.webkit.org/show_bug.cgi?id=146846">bug 146846</a>
              from <span class="vcard"><a class="email" href="mailto:basile_clement&#64;apple.com" title="Basile Clement &lt;basile_clement&#64;apple.com&gt;"> <span class="fn">Basile Clement</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=146846#c1">comment #1</a>)
<span class="quote">&gt; Created <span class=""><a href="attachment.cgi?id=256709&amp;action=diff" name="attach_256709" title="Patch using StackMap size">attachment 256709</a> <a href="attachment.cgi?id=256709&amp;action=edit" title="Patch using StackMap size">[details]</a></span>
&gt; Patch using StackMap size
&gt; 
&gt; This uses the stackmap size from LLVM to restore the stack pointer to where
&gt; it should be in the patchpoint. I am interested in hearing opinions on the
&gt; following two points:
&gt; 
&gt;  - We may want to adapt the default patchpoint size to accommodate the
&gt; additional lea opcode.
&gt; 
&gt;  - LLVM provides a stackmap/stackrestore intrinsic that we should be able to
&gt; use. I am unsure what guarantees we would have with this; in particular, I
&gt; fear LLVM spilling values onto the stack before the call but after saving
&gt; the stack pointer, performing the call, then trying to restore those values
&gt; using the stack pointer as it is supposed to be callee-save. I did not see
&gt; this happen even when testing that approach with high register pressure
&gt; (LLVM ends up using bp-based offsets for the spilling), but again, I am
&gt; unsure how much we can rely on this. I believe messing up with the stack
&gt; pointer in the patchpoint is better because it makes it completely
&gt; transparent to LLVM.</span >

After talking offline with fpizlo, the stackmap size approach looks like the best one.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>