Closed Bug 1248930 Opened 9 years ago Closed 9 years ago

Use Int32Value in ArrayBufferObject::BYTE_LENGTH_SLOT.

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

Currently ArrayBufferObject::BYTE_LENGTH_SLOT slot is using DoubleValue, but byteLength property should fit into Int32, and using Int32Value should be better for inlining in bug 1165053.
Just replacing DoubleValue with Int32Value works. Green on try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6427abbbd86e
Assignee: nobody → arai.unmht
Attachment #8720253 - Flags: review?(lhansen)
Note that per spec byteLength should be clamped using ToLength, so be in the range of [0,2^53). That we don't currently support lengths above Int32 is something we should fix, not further cement in our code.
IMVHO there's so much code that needs to change if we move away from the int32 assumption that it's better to at least be consistent, if we're not going to make that change straight away. cc'ing Waldo on the theory that he might have opinions.
I kinda suggested this in bug 1165053. :-) I agree being consistent -- and more efficient/faster for now, as well -- is good. (And if we extend to the 2**53 limit at some point, it wouldn't surprise me if we encoded it not as a double value anyway.)
Attachment #8720253 - Flags: review?(lhansen) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: