Closed Bug 676738 Opened 13 years ago Closed 13 years ago

Change jsint index arguments to JS_*Element functions to uint32 index

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: Waldo, Assigned: Waldo)

References

Details

Attachments

(7 files)

Sparse/dense property storage will want this API split to make indexed accesses more efficient. I queried the newsgroup about making the change (versus adding yet another kind of property-access API), and no one expressed concern. It's also worth noting that every use of these methods that I found in mozilla-central was using only the non-negative half of the index space. I expect this is the common case. I wonder, even, how much anyone ever used negative elements -- I'd guess element stuff is mostly used for arrays and arraylike things, and you're not going to hit negative elements there. (I did end up changing some Mozilla callers to avoid possible compiler warnings. Technically I probably could have gotten away without doing this, but it seemed a good time to clean up signage usage in that code when I already had to audit them to make sure none depended on being able to pass negative indexes.)
I'm doing one patch per method changed, to keep things bite-sized. There's no particular reason it couldn't all be concatenated together into one patch, it just might get (a little bit) big.
Attachment #550917 - Flags: review?(jst)
Attachment #550917 - Flags: review?(dmandelin)
Attached patch Change JS_AlreadyHasOwnElement (deleted) — Splinter Review
Attachment #550919 - Flags: review?(dmandelin)
Attached patch Change JS_HasElement (deleted) — Splinter Review
Attachment #550920 - Flags: review?(dmandelin)
Attached patch Change JS_LookupElement (deleted) — Splinter Review
Attachment #550921 - Flags: review?(dmandelin)
Attachment #550921 - Attachment description: dmandelin@moz → Change JS_LookupElement
Attached patch Change JS_GetElement (deleted) — Splinter Review
Attachment #550922 - Flags: review?(dmandelin)
Attached patch Change JS_SetElement (deleted) — Splinter Review
Attachment #550923 - Flags: review?(dmandelin)
Attached patch Change JS_DeleteElement{,2} (deleted) — Splinter Review
Attachment #550924 - Flags: review?(dmandelin)
Attachment #550917 - Flags: review?(jst) → review+
Attachment #550917 - Flags: review?(dmandelin) → review+
Attachment #550919 - Flags: review?(dmandelin) → review+
Attachment #550920 - Flags: review?(dmandelin) → review+
Attachment #550921 - Flags: review?(dmandelin) → review+
Attachment #550922 - Flags: review?(dmandelin) → review+
Attachment #550923 - Flags: review?(dmandelin) → review+
Attachment #550924 - Flags: review?(dmandelin) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: