Bug 116847

Summary: testRunner should be able to tell you if a function is DFG compiled
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: New BugsAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: mhahnenberg
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch mhahnenberg: review+

Description Filip Pizlo 2013-05-27 17:02:23 PDT
testRunner should be able to tell you if a function is DFG compiled
Comment 1 Filip Pizlo 2013-05-27 17:06:48 PDT
Created attachment 203017 [details]
Patch
Comment 2 Mark Hahnenberg 2013-05-27 18:42:07 PDT
Comment on attachment 203017 [details]
Patch

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

> Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp:52
> +        return 0;

Is this meant to return the JSValueRef of 0 or a null JSValueRef? I ask because everywhere else we return undefined.
Comment 3 Filip Pizlo 2013-05-27 18:48:22 PDT
(In reply to comment #2)
> (From update of attachment 203017 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=203017&action=review
> 
> > Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp:52
> > +        return 0;
> 
> Is this meant to return the JSValueRef of 0 or a null JSValueRef? I ask because everywhere else we return undefined.

It's meant to return 0. 

We return undefined if the user didn't pass a function. 

Here, the user passed a function. If it doesn't have a code block that just means that it hasn't been called yet so by definition it has had zero DFG compiles.
Comment 4 Mark Hahnenberg 2013-05-28 08:22:00 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 203017 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=203017&action=review
> > 
> > > Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp:52
> > > +        return 0;
> > 
> > Is this meant to return the JSValueRef of 0 or a null JSValueRef? I ask because everywhere else we return undefined.
> 
> It's meant to return 0. 
> 
> We return undefined if the user didn't pass a function. 
> 
> Here, the user passed a function. If it doesn't have a code block that just means that it hasn't been called yet so by definition it has had zero DFG compiles.

In that case, don't you need to make a JSValueRef that contains zero instead of returning a null JSValueRef?
Comment 5 Filip Pizlo 2013-05-28 09:27:34 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > (From update of attachment 203017 [details] [details] [details])
> > > View in context: https://bugs.webkit.org/attachment.cgi?id=203017&action=review
> > > 
> > > > Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp:52
> > > > +        return 0;
> > > 
> > > Is this meant to return the JSValueRef of 0 or a null JSValueRef? I ask because everywhere else we return undefined.
> > 
> > It's meant to return 0. 
> > 
> > We return undefined if the user didn't pass a function. 
> > 
> > Here, the user passed a function. If it doesn't have a code block that just means that it hasn't been called yet so by definition it has had zero DFG compiles.
> 
> In that case, don't you need to make a JSValueRef that contains zero instead of returning a null JSValueRef?

Oh.  Good point!
Comment 6 Filip Pizlo 2013-05-28 09:31:02 PDT
Created attachment 203062 [details]
Patch
Comment 7 Mark Hahnenberg 2013-05-28 09:41:31 PDT
Comment on attachment 203062 [details]
Patch

r=me
Comment 8 Filip Pizlo 2013-05-28 10:09:18 PDT
Landed in http://trac.webkit.org/changeset/150807