Bug 61821

Summary: [V8] Optimize fetches of indexed properties in custom bindings
Product: WebKit Reporter: Kenneth Russell <kbr>
Component: WebGLAssignee: Kenneth Russell <kbr>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, jamesr, japhet, levin
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch japhet: review+

Description Kenneth Russell 2011-05-31 16:55:06 PDT
Currently the custom V8 bindings for typed arrays' set() method taking a JavaScript array allocate a new Number instance for each element fetched. The V8 API contains a method on the Object class which supports faster fetching of indexed properties. I'm not sure whether it was an oversight on my part or whether that method didn't exist at the time the code was written, but it should definitely be used.
Comment 1 Kenneth Russell 2011-05-31 16:57:47 PDT
The associated Chromium bug report is http://crbug.com/84007 .
Comment 2 Kenneth Russell 2011-05-31 17:03:36 PDT
Created attachment 95513 [details]
Patch
Comment 3 anton muhin 2011-06-01 06:44:50 PDT
Comment on attachment 95513 [details]
Patch

LGTM
Comment 4 Nate Chapin 2011-06-01 08:29:44 PDT
Comment on attachment 95513 [details]
Patch

This is fine, though I notice that there are several other places in the v8 bindings where we are still using the the Get() variant you're removing here.  Is there any reason we shouldn't change those too?
Comment 5 Kenneth Russell 2011-06-01 12:05:34 PDT
Good point. I've updated the synopsis and will upload a new patch shortly.
Comment 6 Kenneth Russell 2011-06-01 12:49:40 PDT
Created attachment 95644 [details]
Patch
Comment 7 Nate Chapin 2011-06-01 12:50:34 PDT
Comment on attachment 95644 [details]
Patch

Great, thanks!
Comment 8 Kenneth Russell 2011-06-01 12:56:51 PDT
"webkit-patch land" hung.

Committed as http://trac.webkit.org/changeset/87837 .