Closed
Bug 922172
Opened 11 years ago
Closed 11 years ago
Add redimension method for typed objects
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: nmatsakis, Assigned: nmatsakis)
References
Details
Attachments
(1 file, 1 obsolete file)
6.74 KB,
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
Redimensioning arrays means dividing up the elements in distinct ways (e.g., converting a 10xT array into a 5x2xT array). It is a simpler form of casting that is quite useful for parallelism, and -- unlike going all the way to a byte array -- safe even with object or other reference types. The `redimension()` method is proposed for typed objects spec (though not yet in wiki)
Assignee | ||
Updated•11 years ago
|
Assignee | ||
Comment 1•11 years ago
|
||
Assignee: nobody → nmatsakis
Attachment #824849 -
Flags: review?(till)
Assignee | ||
Comment 2•11 years ago
|
||
Accidentally included old version of patch file.
Attachment #824849 -
Attachment is obsolete: true
Attachment #824849 -
Flags: review?(till)
Attachment #824850 -
Flags: review?(till)
Comment 3•11 years ago
|
||
Comment on attachment 824850 [details] [diff] [review] Bug922172.diff Review of attachment 824850 [details] [diff] [review]: ----------------------------------------------------------------- This is very nice. r=me with nits addressed, a license header added to the test file and a test added for redimensioning an array containing references. ::: js/src/builtin/TypedObject.js @@ +461,5 @@ > + newElementType = newElementType.elementType; > + } > + > + // Check that the total number of elements does not change. > + if (oldElementCount !== newElementCount) Nit: braces for multiline then content. Here and below. @@ +463,5 @@ > + > + // Check that the total number of elements does not change. > + if (oldElementCount !== newElementCount) > + ThrowError(JSMSG_TYPEDOBJECT_HANDLE_BAD_ARGS, > + 1, Personally, I'd not put this on its own line. Up to you, though.
Attachment #824850 -
Flags: review?(till) → review+
Assignee | ||
Comment 4•11 years ago
|
||
Till -- arrays of references are not supported until bug 898359 lands, but I'll add a test in that case.
Assignee | ||
Comment 5•11 years ago
|
||
Or rather, I can add a test as part of that bug.
Assignee | ||
Comment 6•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/660ff870ffa7 Try run: https://tbpl.mozilla.org/?tree=Try&rev=ad8fccfc779f
Comment 7•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/660ff870ffa7
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•10 years ago
|
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
Updated•8 years ago
|
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
You need to log in
before you can comment on or make changes to this bug.
Description
•