Closed Bug 1061741 Opened 10 years ago Closed 10 years ago

Remove type slot in typed arrays

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

Details

(Whiteboard: [MemShrink:P2])

Attachments

(1 file)

Attached patch patchSplinter Review
Typed arrays have a slot storing their Scalar::Type, which can be easily computed from the array's clasp instead.  The attached patch removes this slot, which also allows typed arrays to use a smaller size class and be able to store 32 more bytes of data inline.
Attachment #8482772 - Flags: review?(sphink)
Whiteboard: [MemShrink]
Comment on attachment 8482772 [details] [diff] [review]
patch

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

::: js/src/vm/SharedTypedArrayObject.h
@@ +106,5 @@
> +inline Scalar::Type
> +SharedTypedArrayObject::type() const
> +{
> +    JS_ASSERT(IsSharedTypedArrayClass(getClass()));
> +    return (Scalar::Type) (getClass() - &classes[0]);

static_cast<Scalar::Type>()
Attachment #8482772 - Flags: review?(sphink) → review+
Whiteboard: [MemShrink] → [MemShrink:P2]
https://hg.mozilla.org/mozilla-central/rev/01da8d5ed02d
Assignee: nobody → bhackett1024
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: