Closed Bug 1232814 Opened 9 years ago Closed 9 years ago

Sweep LazyScript in the background

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla46
Tracking Status
firefox46 --- fixed

People

(Reporter: terrence, Assigned: terrence)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Now that the weak reference to script is managed by WeakRef and not by ad-hoc barriers on access to the pointer, we can trivially sweep LazyScript in the background.

Or at least we should be able to. The first patch fixes NoteWeakReference. We were not actually early-returning in non-marking tracers, causing us to frob the weak refs set while out of the marking phase. Whoops!

https://treeherder.mozilla.org/#/jobs?repo=try&revision=93d20dde3e00
Attachment #8698662 - Flags: review?(sphink)
Try is looking much less angry with the NoteWeakEdge fix.
Attachment #8698664 - Flags: review?(jcoppeard)
Comment on attachment 8698664 [details] [diff] [review]
omt_LazyScript_finalize-v1.diff

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

Great!

::: js/src/jsgc.cpp
@@ +393,5 @@
>      AllocKind::OBJECT_GROUP
>  };
>  
>  static const FinalizePhase BackgroundFinalizePhases[] = {
> +    PHASE(BackgroundPhaseScripts, gcstats::PHASE_SWEEP_SCRIPT),

For incremental finalization on the foreground thread, scripts are swept after strings.  I don't remember the reason for this but I think it makes sense to have a single order for both types of finalization.
Attachment #8698664 - Flags: review?(jcoppeard) → review+
D'oh! I thought I had made the order the same! Will fix it.
Comment on attachment 8698662 [details] [diff] [review]
fix_NoteWeakEdge-v0.diff

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

Wow.

Uh... wow.
Attachment #8698662 - Flags: review?(sphink) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/5e94d0f7a3ddd3a81dd48332bb72fc8660be1e57
Bug 1232814 - Part 1: Fix a missing early return in NoteWeakEdge; r=sfink

https://hg.mozilla.org/integration/mozilla-inbound/rev/cdd02c0e74159bae2d7abc0de78907de479574aa
Bug 1232814 - Part 2: Move LazyScript finalization to the background finalization thread; r=jonco
https://hg.mozilla.org/mozilla-central/rev/5e94d0f7a3dd
https://hg.mozilla.org/mozilla-central/rev/cdd02c0e7415
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: