Bug 128560

Summary: Fail FTL compilation if the required stack is too big
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 125650    
Attachments:
Description Flags
Patch fpizlo: review+

Description Michael Saboff 2014-02-10 16:20:17 PST
If the FTL compiles a function with a stack larger than a certain limit (128K has been suggest), fail the compile.

It probably makes sense to make the limit configurable.
Comment 1 Michael Saboff 2014-02-10 16:24:59 PST
Created attachment 223765 [details]
Patch
Comment 2 Geoffrey Garen 2014-02-10 16:31:28 PST
Comment on attachment 223765 [details]
Patch

r=me
Comment 3 Filip Pizlo 2014-02-10 16:31:50 PST
Comment on attachment 223765 [details]
Patch

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

> Source/JavaScriptCore/ftl/FTLStackMaps.h:104
> +    unsigned getStackSize() const;

I would call this stackSize() and not getStackSize().  We don't usually prepend getters with "get".  The reason why "getRecordMap()" has a "get" in it is that it actually has to do significant work to return the record map.  Probably, that should be called "computeRecordMap()".  But your "getStackSize" is not computing anything, and it's a getter, so lets just call it "stackSize()".
Comment 4 Filip Pizlo 2014-02-10 16:32:10 PST
Comment on attachment 223765 [details]
Patch

r=me but change the name of getStackSize
Comment 5 Michael Saboff 2014-02-10 16:32:56 PST
(In reply to comment #3)
> (From update of attachment 223765 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=223765&action=review
> 
> > Source/JavaScriptCore/ftl/FTLStackMaps.h:104
> > +    unsigned getStackSize() const;
> 
> I would call this stackSize() and not getStackSize().  We don't usually prepend getters with "get".  The reason why "getRecordMap()" has a "get" in it is that it actually has to do significant work to return the record map.  Probably, that should be called "computeRecordMap()".  But your "getStackSize" is not computing anything, and it's a getter, so lets just call it "stackSize()".

Agreed.  I'll change it.
Comment 6 Michael Saboff 2014-02-10 16:42:38 PST
Committed r163838: <http://trac.webkit.org/changeset/163838>