Bug 157299

Summary: Drop some unnecessary exception checking in the generated bindings
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: BindingsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, ggaren, rniwa, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Chris Dumez 2016-05-02 21:21:19 PDT
Drop some unnecessary exception checking in the generated bindings. Reduces the amount on unnecessary branching.
Comment 1 Chris Dumez 2016-05-02 21:52:21 PDT
Created attachment 277978 [details]
Patch
Comment 2 Darin Adler 2016-05-02 21:54:56 PDT
Comment on attachment 277978 [details]
Patch

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

I’m not sure that all of those things that are marked ", 1" in JSValueToNative can actually raise exceptions.

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:4324
> +# returns (convertString, mayThrowException).

If you are going to have a period on this comment, then you should capitalize the first word, "Returns".
Comment 3 Chris Dumez 2016-05-02 21:57:51 PDT
(In reply to comment #2)
> Comment on attachment 277978 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=277978&action=review
> 
> I’m not sure that all of those things that are marked ", 1" in
> JSValueToNative can actually raise exceptions.

They all take in a "state" to they may throw (in theory). I did not look further and wanted to be on the safe side. Just avoiding these checks for wrapper types is already nice.
Comment 4 Chris Dumez 2016-05-02 21:58:52 PDT
Created attachment 277979 [details]
Patch
Comment 5 WebKit Commit Bot 2016-05-03 08:24:36 PDT
Comment on attachment 277979 [details]
Patch

Rejecting attachment 277979 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'apply-attachment', '--no-update', '--non-interactive', 277979, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
 96 lines).
Hunk #31 succeeded at 5455 (offset 96 lines).
Hunk #32 succeeded at 5472 (offset 96 lines).
Hunk #33 succeeded at 5586 (offset 96 lines).
Hunk #34 succeeded at 5611 (offset 96 lines).
Hunk #35 succeeded at 5673 (offset 96 lines).
Hunk #36 succeeded at 5831 (offset 96 lines).
patching file Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/1261270
Comment 6 Chris Dumez 2016-05-03 08:43:21 PDT
Created attachment 277999 [details]
Patch
Comment 7 Chris Dumez 2016-05-03 08:43:59 PDT
Comment on attachment 277999 [details]
Patch

Clearing flags on attachment: 277999

Committed r200374: <http://trac.webkit.org/changeset/200374>
Comment 8 Chris Dumez 2016-05-03 08:44:06 PDT
All reviewed patches have been landed.  Closing bug.