Last Comment Bug 749864 - Typed array argument codegen for bindings
: Typed array argument codegen for bindings
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla15
Assigned To: Boris Zbarsky [:bz] (still a bit busy)
:
Mentors:
Depends on: 742145 747827 748267
Blocks: 748266 749866
  Show dependency treegraph
 
Reported: 2012-04-27 18:30 PDT by Boris Zbarsky [:bz] (still a bit busy)
Modified: 2012-05-29 20:57 PDT (History)
2 users (show)
bzbarsky: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Codegen for typed array and arraybuffer arguments. (15.90 KB, patch)
2012-04-27 23:07 PDT, Boris Zbarsky [:bz] (still a bit busy)
no flags Details | Diff | Splinter Review
Updated to be a little simpler (15.98 KB, patch)
2012-05-22 19:20 PDT, Boris Zbarsky [:bz] (still a bit busy)
peterv: review+
Details | Diff | Splinter Review

Description Boris Zbarsky [:bz] (still a bit busy) 2012-04-27 18:30:05 PDT
Once bug 742145 is fixed...
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2012-04-27 23:07:15 PDT
Created attachment 619254 [details] [diff] [review]
Codegen for typed array and arraybuffer arguments.

I think this depends on the infrastructure bug 748267.  Also, I didn't do typed array return values yet, because I have no real way to test them.
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2012-04-28 00:04:37 PDT
Comment on attachment 619254 [details] [diff] [review]
Codegen for typed array and arraybuffer arguments.

Review of attachment 619254 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/src/nsXMLHttpRequest.cpp
@@ +2633,5 @@
>    aContentType.SetIsVoid(true);
>    aCharset.Truncate();
>  
> +  PRInt32 length = aArrayBuffer->mLength;
> +  char* data = reinterpret_cast<char*>(aArrayBuffer->mData);

Can this be a static_cast?
Comment 3 Boris Zbarsky [:bz] (still a bit busy) 2012-04-28 00:12:45 PDT
No.  Can't static_cast from uint8_t* to char*.  At least not on my compiler.  ;)
Comment 4 Boris Zbarsky [:bz] (still a bit busy) 2012-05-22 19:20:23 PDT
Created attachment 626287 [details] [diff] [review]
Updated to be a little simpler
Comment 5 Peter Van der Beken [:peterv] 2012-05-23 14:25:18 PDT
Comment on attachment 626287 [details] [diff] [review]
Updated to be a little simpler

Review of attachment 626287 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bindings/Codegen.py
@@ +1414,5 @@
> +        elif type.isArrayBufferView():
> +            name = "ArrayBufferView"
> +            jsname = "TypedArrayObject"
> +        else:
> +            name = type.name

Can't you always set name to type.name, even for ArrayBuffer and ArrayBufferView?
Comment 6 Boris Zbarsky [:bz] (still a bit busy) 2012-05-23 14:29:17 PDT
> Can't you always set name to type.name, even for ArrayBuffer and ArrayBufferView?

I think so, yes.  Will do.
Comment 7 Boris Zbarsky [:bz] (still a bit busy) 2012-05-24 22:10:11 PDT
http://hg.mozilla.org/mozilla-central/rev/faa1929dc247
Comment 8 Boris Zbarsky [:bz] (still a bit busy) 2012-05-29 20:57:22 PDT
Added decent tests in https://hg.mozilla.org/integration/mozilla-inbound/rev/e0d8fa7fe174

Note You need to log in before you can comment on or make changes to this bug.