The default bug view has changed. See this FAQ.

vm/Unicode.h:index{1,2} could be slimmed down

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
Both js::unicode::index{1,2} are declared as arrays of uint16_t, but no entries in either array are larger than 255.  They should be declared as arrays of uint8_t; doing so saves about 12K of space.
(Assignee)

Comment 1

5 years ago
Created attachment 587922 [details] [diff] [review]
patch

Patch.  The change to size_t is to make it obvious that we're not depending on the size of the array's element type.  The assert change in make_unicode.py makes the code more obvious, I think.
Attachment #587922 - Flags: review?(evilpies)
(Assignee)

Comment 2

5 years ago
Created attachment 587924 [details] [diff] [review]
patch

Now with a correct assert!
Attachment #587922 - Attachment is obsolete: true
Attachment #587922 - Flags: review?(evilpies)
Attachment #587924 - Flags: review?(evilpies)
Comment on attachment 587924 [details] [diff] [review]
patch

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

Thanks, good find! I guess after 3+ iterations of this patch, I somehow didn't catch this anymore. From my memory there was something at the first try that prevent me from making them uint8.
Attachment #587924 - Flags: review?(evilpies) → review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed

Updated

5 years ago
Assignee: general → nfroyd

Comment 4

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/6f3285fc0d02
Keywords: checkin-needed
Whiteboard: [inbound]
https://hg.mozilla.org/mozilla-central/rev/6f3285fc0d02
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
You need to log in before you can comment on or make changes to this bug.