Bug 148099

Summary: jsc-tailcall: Integrate FTL OSR entry / exit and exceptions handling of callee save registers with other tiers
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: basile_clement
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 148167, 148345    
Bug Blocks: 146854    
Attachments:
Description Flags
Patch
none
Updated patch including fix for exceptions thrown from the FTL. none

Description Michael Saboff 2015-08-17 15:09:46 PDT
The other tiers now save and restore callee save registers.  The FTL's processing of callee saves for OSR entry, OSR exit and exception unwinding needs to be integrated with the other tiers.
Comment 1 Michael Saboff 2015-08-22 21:21:33 PDT
Created attachment 259733 [details]
Patch
Comment 2 Basile Clement 2015-08-24 13:39:40 PDT
Comment on attachment 259733 [details]
Patch

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

> Source/JavaScriptCore/ChangeLog:8
> +        Turned off register preservation thunks for outgoing calls from FTL gerneated code.

gerneated -> generated

> Source/JavaScriptCore/ChangeLog:10
> +        Fxed the FTL OSR exit compiler to restore the callee saves from an FTL funcion to

funcion -> function

> Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp:392
> +        GPRReg regToLoad = baselineRegisterOffset ? GPRInfo::regT0 : reg.gpr();

Why not just always use reg.gpr()?

> Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp:418
> +        if (reg.isLocal() && reg.toLocal() < static_cast<int>(baselineVirtualRegistersForCalleeSaves))

Can this actually happen?
Comment 3 Michael Saboff 2015-08-25 15:12:48 PDT
(In reply to comment #2)
> Comment on attachment 259733 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=259733&action=review
> 
> > Source/JavaScriptCore/ChangeLog:8
> > +        Turned off register preservation thunks for outgoing calls from FTL gerneated code.
> 
> gerneated -> generated

Fixed.

> > Source/JavaScriptCore/ChangeLog:10
> > +        Fxed the FTL OSR exit compiler to restore the callee saves from an FTL funcion to
> 
> funcion -> function

Fixed.

> > Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp:392
> > +        GPRReg regToLoad = baselineRegisterOffset ? GPRInfo::regT0 : reg.gpr();
> 
> Why not just always use reg.gpr()?

Changed.

> > Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp:418
> > +        if (reg.isLocal() && reg.toLocal() < static_cast<int>(baselineVirtualRegistersForCalleeSaves))
> 
> Can this actually happen?

Yes. The FTL sets those values to undefined.
Comment 4 Michael Saboff 2015-08-25 15:14:00 PDT
Created attachment 259887 [details]
Updated patch including fix for exceptions thrown from the FTL.
Comment 5 Basile Clement 2015-08-25 16:05:02 PDT
Comment on attachment 259887 [details]
Updated patch including fix for exceptions thrown from the FTL.

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

r=me

> Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp:417
> +            dataLogF("Got a local that collided with BL callee saves\n");

Revert this.
Comment 6 Michael Saboff 2015-08-26 13:43:48 PDT
Committed r188986: <http://trac.webkit.org/changeset/188986>
Comment 7 Basile Clement 2015-08-31 18:11:03 PDT

*** This bug has been marked as a duplicate of bug 148666 ***
Comment 8 Csaba Osztrogonác 2015-09-14 11:01:10 PDT
Comment on attachment 259887 [details]
Updated patch including fix for exceptions thrown from the FTL.

Cleared review? from attachment 259887 [details] so that this bug does not appear in http://webkit.org/pending-review.  If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).