Implement a WeakCache wrapper type to cause a thing to be swept automatically every GC

RESOLVED FIXED in Firefox 48

Status

()

Core
JavaScript: GC
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

(Blocks: 2 bugs)

Trunk
mozilla48
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox46 affected, firefox48 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

2 years ago
Created attachment 8700200 [details] [diff] [review]
impl_WeakCache-v0.diff

This is like WeakRef, but for things that are part of the runtime environment rather than discovered via tracing.
Attachment #8700200 - Flags: review?(sphink)
Comment on attachment 8700200 [details] [diff] [review]
impl_WeakCache-v0.diff

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

Sorry, this slipped through the cracks.

::: js/src/jsapi-tests/testGCWeakCache.cpp
@@ +39,5 @@
> +    CHECK(cache.has(tenured2));
> +    CHECK(cache.has(nursery1));
> +    CHECK(cache.has(nursery2));
> +
> +    // Since this relies on the UID map, we cannot check the non-existance

*nonexistence

@@ +40,5 @@
> +    CHECK(cache.has(nursery1));
> +    CHECK(cache.has(nursery2));
> +
> +    // Since this relies on the UID map, we cannot check the non-existance
> +    // of a pointer in the map -- see below for that.

You don't want to do it via CHECK(cache.count() == 2)?
Attachment #8700200 - Flags: review?(sphink) → review+
(Assignee)

Updated

2 years ago
Depends on: 1248094
(Assignee)

Comment 2

2 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a19e246b0470
(Assignee)

Comment 3

2 years ago
Created attachment 8740182 [details] [diff] [review]
impl_WeakCache-v1.diff

Rebased to use the new Policy stuff. Quite a bit cleaner now. Certainly cleaner to use. I'm going to carry the r+.
Attachment #8700200 - Attachment is obsolete: true
Attachment #8740182 - Flags: review+
(Assignee)

Updated

2 years ago
Blocks: 1263769
(Assignee)

Comment 4

2 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6b1bee876d26
(Assignee)

Comment 5

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/58c36d9ae2af72144b7dd995b4f2344f543c0f7d
Bug 1233862 - Add a WeakCache builtin to automatically manage sweeping; r=sfink

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/58c36d9ae2af
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Depends on: 1265480
You need to log in before you can comment on or make changes to this bug.