Closed Bug 1564178 Opened 5 years ago Closed 5 years ago

[jsdbg2] Separate Debugger maps from wrapper maps

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jimb, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Whenever Debugger API creates a Debugger.Foo object referring to something in a debuggee realm, it must record that relation in two tables: the weak map belonging to the Debugger itself, and the compartment's cross-compartment wrapper table. This is clumsy, but it is not quite redundant: the cross-compartment wrapper table and the Debugger's weak maps have different rules for retaining entries.

It would be simpler to have a separate table, stored on the Compartment where the GC can find it easily, that serves both Debugger's and the GC's needs. The GC would then need to consult two places to find all incoming edges for partial collections, but that code already includes Debugger-specific logic anyway.

Summary: [jsdbg2] Unify wrapper maps and Debugger maps → [jsdbg2] Separate Debugger maps from wrapper maps
Priority: -- → P3
Assignee: nobody → jcoppeard

Debuggers and debuggees are swept in the same sweep group and that is accomplished by adding edges in both directions between the debugger and debuggee zones for all debugger wrapper objects. Currently this happens by examining the cross compartment wrapper map. This patch changes this to use the debugger's weakmaps instead.

This removes the code to create CCWs for all debugger wrapper objects and updates compartment checks to query the debugger weakmaps.

Depends on D40040

Not that we no longer create debugger entries in the cross compartment wrapper map we can remove all the associated infrastructure.

Depends on D40041

Attachment #9081951 - Attachment description: Bug 1564178 - Add sweep group edges for debugger weakmap entries r=jimb? → Bug 1564178 - Add sweep group edges for debugger weakmap entries r=jimb
Attachment #9081952 - Attachment description: Bug 1564178 - Don't create cross compartment wrappers for debugger wrapper objects r=jimb? → Bug 1564178 - Don't create cross compartment wrappers for debugger wrapper objects r=jimb
Attachment #9081953 - Attachment description: Bug 1564178 - Remove infrastructure for storing debugger CCWs r=jandem? → Bug 1564178 - Remove infrastructure for storing debugger CCWs r=jandem
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/65ef4d825770
Add sweep group edges for debugger weakmap entries r=jimb
https://hg.mozilla.org/integration/autoland/rev/597a43be8c60
Don't create cross compartment wrappers for debugger wrapper objects r=jimb
https://hg.mozilla.org/integration/autoland/rev/e604b2fb2eb1
Remove infrastructure for storing debugger CCWs r=jandem
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Blocks: 1571021
Regressions: 1577146
Regressions: 1580192
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: