Bug 210721

Summary: [JSC] LLInt slow path call should not have third argument
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=175454
Attachments:
Description Flags
Patch
none
Patch mark.lam: review+

Description Yusuke Suzuki 2020-04-19 08:16:56 PDT
[JSC] LLInt slow path call should not have third argument
Comment 1 Yusuke Suzuki 2020-04-19 08:18:12 PDT
Created attachment 396908 [details]
Patch
Comment 2 Yusuke Suzuki 2020-04-19 08:26:21 PDT
Created attachment 396909 [details]
Patch
Comment 3 Mark Lam 2020-04-19 08:56:34 PDT
Comment on attachment 396909 [details]
Patch

r=me
Comment 4 Saam Barati 2020-04-19 13:41:56 PDT
Comment on attachment 396909 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=396909&action=review

Wasn’t the goal to speed this up though?

> Source/JavaScriptCore/ChangeLog:8
> +        LLInt callSlowPath does not work with third argument in Windows, CLoop etc. LLInt slow-path should not take third argument,

Why doesn’t it work?
Comment 5 Mark Lam 2020-04-19 13:59:28 PDT
(In reply to Saam Barati from comment #4)
> Comment on attachment 396909 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=396909&action=review
> 
> Wasn’t the goal to speed this up though?
> 
> > Source/JavaScriptCore/ChangeLog:8
> > +        LLInt callSlowPath does not work with third argument in Windows, CLoop etc. LLInt slow-path should not take third argument,
> 
> Why doesn’t it work?

Because the CLoop is able to call arbitrary native functions.  It needs to be taught how call a native function with different arguments.

As for Windows, I suspect it is just a matter teaching it how to call with a 3rd argument due to ABI differences.
Comment 6 Mark Lam 2020-04-19 14:00:16 PDT
(In reply to Mark Lam from comment #5)
> (In reply to Saam Barati from comment #4)
> > Comment on attachment 396909 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=396909&action=review
> > 
> > Wasn’t the goal to speed this up though?
> > 
> > > Source/JavaScriptCore/ChangeLog:8
> > > +        LLInt callSlowPath does not work with third argument in Windows, CLoop etc. LLInt slow-path should not take third argument,
> > 
> > Why doesn’t it work?
> 
> Because the CLoop is able to call arbitrary native functions.

typo: I meant "is NOT able to"
Comment 7 Yusuke Suzuki 2020-04-19 16:50:45 PDT
I think this change does not introduce speed down in LLInt since LLInt is anyway loading metadata in asm side.
For baseline, it would be possible that this causes speed down. I think in this case, the right thing is introducing JIT operation instead of sharing this with LLInt.
I'll create a patch for Baseline after landing this to fix Windows.
Comment 8 Yusuke Suzuki 2020-04-19 16:53:45 PDT
Committed r260344: <https://trac.webkit.org/changeset/260344>
Comment 9 Radar WebKit Bug Importer 2020-04-19 16:54:14 PDT
<rdar://problem/62033808>