Remove JSIdArray and AutoIdArray

RESOLVED FIXED in Firefox 43

Status

()

RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

Trunk
mozilla43
Points:
---

Firefox Tracking Flags

(firefox42 affected, firefox43 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

3 years ago
Created attachment 8643970 [details] [diff] [review]
1_remove_AutoIdArray_sm-v0.diff

JSIdArray is this wonderfully crufty piece of manual C-style memory mis-management that is still hanging on somehow. Its only user is JS_Enumerate. The actual work here happens into an AutoIdVector, after which we malloc and memcopy a second copy into a JSIdArray and return that so that the caller can root it with AutoId*Array*.

Instead, let's just have the caller pass in a handle to an IdVector. Unfortunately, AutoIdVector is not really a vector, so we can't avoid the copy yet, but this should be fixed soon when we remove AutoIdVector.
Attachment #8643970 - Flags: review?(jcoppeard)
(Assignee)

Comment 1

3 years ago
Created attachment 8643972 [details] [diff] [review]
2_remove_AutoIdArray_gecko-v0.diff

Converting gecko to the new API was trivial: add an outparam and convert to standard SM return conventions.
Attachment #8643972 - Flags: review?(bugs)

Comment 2

3 years ago
Comment on attachment 8643972 [details] [diff] [review]
2_remove_AutoIdArray_gecko-v0.diff

I'm sure Andrew wants to review this ;)
Attachment #8643972 - Flags: review?(bugs) → review?(continuation)
Attachment #8643972 - Flags: review?(continuation) → review+
Comment on attachment 8643970 [details] [diff] [review]
1_remove_AutoIdArray_sm-v0.diff

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

::: js/src/jsatom.h
@@ -26,5 @@
> -    js::HeapId* begin() { return vector; }
> -    const js::HeapId* begin() const { return vector; }
> -    js::HeapId* end() { return vector + length; }
> -    const js::HeapId* end() const { return vector + length; }
> -};

Nice to see this go!
Attachment #8643970 - Flags: review?(jcoppeard) → review+
https://hg.mozilla.org/mozilla-central/rev/f8da9d2fc8dd
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox43: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43

Updated

2 years ago
Depends on: 1315842
You need to log in before you can comment on or make changes to this bug.