Bug 155693 - Rethink the JITOperations calling convention
Summary: Rethink the JITOperations calling convention
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 154874
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-19 18:15 PDT by Filip Pizlo
Modified: 2016-03-19 23:18 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2016-03-19 18:15:51 PDT
Currently we do strange things around JITOperations calls:

- We always check exception even if we don'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't have ready access to the JSGlobalObject* or the VM&.  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's a waste of instructions.  JITOperations should get the VM& from the JSGlobalObject*.
Comment 1 Saam Barati 2016-03-19 23:18:07 PDT
(In reply to comment #0)
> Currently we do strange things around JITOperations calls:
> 
> - We always check exception even if we don'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't have ready access to the JSGlobalObject* or the VM&. 
> 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's a waste of instructions.  JITOperations should get the VM& from
> 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.