<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>155693</bug_id>
          
          <creation_ts>2016-03-19 18:15:51 -0700</creation_ts>
          <short_desc>Rethink the JITOperations calling convention</short_desc>
          <delta_ts>2016-03-19 23:18:07 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>154874</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>saam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1176546</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2016-03-19 18:15:51 -0700</bug_when>
    <thetext>Currently we do strange things around JITOperations calls:

- We always check exception even if we don&apos;t have to.

- Baseline JIT updates the top callframe on the JIT side, which is sort of good because it readily has the VM pointer.  But then most of the JITOperations also update the top callframe anyway.

- JITOperations don&apos;t have ready access to the JSGlobalObject* or the VM&amp;.  When they get the JSGlobalObject*, they often do it incorrectly.  This is also tracked separately here: https://bugs.webkit.org/show_bug.cgi?id=154874

It seems that:

JITOperations should be passed the JSGlobalObject* in addition to the callframe.  The baseline JIT should never update top callframe on the JIT side - it&apos;s a waste of instructions.  JITOperations should get the VM&amp; from the JSGlobalObject*.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1176568</commentid>
    <comment_count>1</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-03-19 23:18:07 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; Currently we do strange things around JITOperations calls:
&gt; 
&gt; - We always check exception even if we don&apos;t have to.
&gt; 
&gt; - Baseline JIT updates the top callframe on the JIT side, which is sort of
&gt; good because it readily has the VM pointer.  But then most of the
&gt; JITOperations also update the top callframe anyway.
&gt; 
&gt; - JITOperations don&apos;t have ready access to the JSGlobalObject* or the VM&amp;. 
&gt; When they get the JSGlobalObject*, they often do it incorrectly.  This is
&gt; also tracked separately here: https://bugs.webkit.org/show_bug.cgi?id=154874
&gt; 
&gt; It seems that:
&gt; 
&gt; JITOperations should be passed the JSGlobalObject* in addition to the
&gt; callframe.  The baseline JIT should never update top callframe on the JIT
&gt; side - it&apos;s a waste of instructions.  JITOperations should get the VM&amp; from
&gt; the JSGlobalObject*.

I wish we had a better data structure for talking about JITOperations.
That could help with us removing the crazy code that is in DFGSpeculativeJIT.h
We could also remove our weird naming that is there to give us a facade of type
safety and instead turn them into debug assertions. We could also declare if an operation throws an exception so the JIT code we emit can do the right thing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>