Closed Bug 717501 Opened 13 years ago Closed 12 years ago

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

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file, 1 obsolete file)

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.
Attached patch patch (obsolete) — Splinter Review
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)
Attached patch patchSplinter Review
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+
Keywords: checkin-needed
Assignee: general → nfroyd
https://hg.mozilla.org/mozilla-central/rev/6f3285fc0d02
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: