Last Comment Bug 717501 - vm/Unicode.h:index{1,2} could be slimmed down
: vm/Unicode.h:index{1,2} could be slimmed down
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Nathan Froyd [:froydnj]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-11 19:19 PST by Nathan Froyd [:froydnj]
Modified: 2012-01-14 01:19 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (2.38 KB, patch)
2012-01-11 19:24 PST, Nathan Froyd [:froydnj]
no flags Details | Diff | Splinter Review
patch (2.38 KB, patch)
2012-01-11 19:28 PST, Nathan Froyd [:froydnj]
evilpies: review+
Details | Diff | Splinter Review

Description Nathan Froyd [:froydnj] 2012-01-11 19:19:00 PST
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.
Comment 1 Nathan Froyd [:froydnj] 2012-01-11 19:24:17 PST
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.
Comment 2 Nathan Froyd [:froydnj] 2012-01-11 19:28:36 PST
Created attachment 587924 [details] [diff] [review]
patch

Now with a correct assert!
Comment 3 Tom Schuster [:evilpie] 2012-01-12 13:59:25 PST
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.
Comment 5 Marco Bonardo [::mak] 2012-01-14 01:19:59 PST
https://hg.mozilla.org/mozilla-central/rev/6f3285fc0d02

Note You need to log in before you can comment on or make changes to this bug.