Implement GCVector::sweep

RESOLVED FIXED in Firefox 54

Status

()

Core
JavaScript: GC
RESOLVED FIXED
10 months ago
9 months ago

People

(Reporter: sfink, Assigned: sfink)

Tracking

(Blocks: 1 bug)

unspecified
mozilla54
Points:
---

Firefox Tracking Flags

(firefox54 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

10 months ago
GCVector cannot currently be used within WeakCache<> because it doesn't implement sweep().
(Assignee)

Comment 1

10 months ago
Created attachment 8834459 [details] [diff] [review]
Implement GCVector::sweep

I implemented this because I mistakenly thought I could use it for bug 1337209 (registering a list of objects to read mark bits from in a way that would not mark them or keep them alive), but then realized I couldn't use it because it compacted the indexes. But still, it seems worth filling out the functionality, so that all of our GCFoo containers can both trace and sweep.
Attachment #8834459 - Flags: review?(jcoppeard)

Comment 2

10 months ago
Comment on attachment 8834459 [details] [diff] [review]
Implement GCVector::sweep

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

Great, looks nice.

::: js/src/jsapi-tests/testGCWeakCache.cpp
@@ +111,5 @@
> +
> +    cache.append(tenured1);
> +    cache.append(tenured2);
> +    cache.append(nursery1);
> +    cache.append(nursery2);

Need to check return values here.

Actually, these methods could all be MOZ_MUST_USE.
Attachment #8834459 - Flags: review?(jcoppeard) → review+

Comment 3

9 months ago
Pushed by sfink@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9bccecac02bb
Implement GCVector::sweep, r=jonco
https://hg.mozilla.org/integration/mozilla-inbound/rev/237552f782e7
Add MOZ_MUST_USE to GCVector bool returns, r=woof!

Comment 4

9 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9bccecac02bb
https://hg.mozilla.org/mozilla-central/rev/237552f782e7
Status: ASSIGNED → RESOLVED
Last Resolved: 9 months ago
status-firefox54: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.