Bug 127018

Summary: FTL should be cool with runtime functions throwing exceptions
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, ggaren, mark.lam, mhahnenberg, msaboff, nrotem, oliver, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 113622    
Attachments:
Description Flags
the patch ggaren: review+

Description Filip Pizlo 2014-01-14 16:30:24 PST
This requires an exception throw off-ramp from the FTL.  It's pretty easy.
Comment 1 Filip Pizlo 2014-01-14 16:32:30 PST
Created attachment 221213 [details]
the patch
Comment 2 Geoffrey Garen 2014-01-14 17:19:12 PST
Comment on attachment 221213 [details]
the patch

r=me

Would be nice to have a test case for the rare case where an FTL function does not handle any exceptions.
Comment 3 Filip Pizlo 2014-01-14 18:24:49 PST
(In reply to comment #2)
> (From update of attachment 221213 [details])
> r=me
> 
> Would be nice to have a test case for the rare case where an FTL function does not handle any exceptions.

This gives me the excuse to write this test:

function foo() { }

noInline(foo);

for (var i = 0; i < 100000; ++i) {
    var result = foo();
    if (result !== void 0)
        throw "You broke JSC so hard that even the empty function doesn't work: " + result;
}
Comment 4 Filip Pizlo 2014-01-14 19:16:43 PST
Landed in http://trac.webkit.org/changeset/162035
Comment 5 Geoffrey Garen 2014-01-15 14:11:26 PST
Nice!