Closed Bug 1923903 Opened 1 year ago Closed 1 year ago

Instantiate only one Object Actor/Front pair for all unique JS values when recording JS Traces

Categories

(DevTools :: Debugger, enhancement)

enhancement

Tracking

(firefox133 fixed)

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(3 files)

For now, the JS Tracer is following the same behavior as the web console actor, as well as all callsites of createValueForTarget.
A new Object Actor is instantiated any time we want to communicate a new JS value to the client via RDP.
That, even if we already notified the client about the same JS value via an existing Object Actor instance.

The thread actor is different and tries to instantiate Object Actor's only once per unique JS Object.
We should try following the same principles in the tracer actor.
It should save some cycles by making the Actor Pools smaller.
But it will also help identify unique JS values from the frontend side and is a blocker for bug 1921020.

This dedicated pool class shared by all the actors instantiating Object Actors
(console, thread and tracer actors) is going to later help reuse the same
WeakMap logic to instantiate only one actor per unique JS value.

I also merged console and target actor to use the same pool
as they basically have the same lifecycle. This simplify lookups
by Actor IDs done for selected object actor or console table objects.

When we communicate a previously notified object actor form,
which was notified through a prevent RDP event or method call,
we passed its actor's form (a.k.a. "grip").
This contains a snapshot of the object in order to be able to display a preview
of it at the time the object was processed in the backend.

Now, when we manipulate the same JS value in the backend,
we may notify about the same object actor instance, but the actor's form ("grip")
will be updated to match the current state of the object.

In the frontend, we need to process this new form/grip in the Object Actor front,
so that the previews are correctly updated over time.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Attachment #9430214 - Attachment description: Bug 1923903 - [devtools] Instantiate only one object actor per JS object in the JS Tracer → Bug 1923903 - [devtools] Instantiate only one object actor per JS object in the JS Tracer.
Depends on: 1924663
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/67bf76d6340a [devtools] Use ObjectActorPool to instantiate and collect all Object Actors. r=devtools-reviewers,bomsy https://hg.mozilla.org/integration/autoland/rev/7780b4f8afad [devtools] Ensure updating object front's form when re-using the same front instance. r=devtools-reviewers,bomsy https://hg.mozilla.org/integration/autoland/rev/80cb6602d3f6 [devtools] Instantiate only one object actor per JS object in the JS Tracer. r=devtools-reviewers,bomsy
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: