Closed Bug 1615710 Opened 4 years ago Closed 4 years ago

Use BaseScript in DebuggerScriptReferent

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(10 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

Now that we are able to root js::BaseScript pointers directly it should be possible to cleanup the DebuggerScriptReferent and remove separate code paths used for LazyScripts. It should be possible to achieve this even before the LazyScript/JSScript instances are combined.

In Bug 1512509 we simplified BaseScript::sourceObject() to never use
cross-compartment edges. As a result we can simplify the debugger access of
sourceObject within this patch.

  • Simplify js::CheckDebugeeThing
  • Simplify DelazifyScript
  • Inline js::EnsureFunctionHasScript into callers and avoid using
    JSFunction::nonLazyScript() method.

Depends on D64119

Replace the uses of ScriptVector and LazyScriptVector.

Depends on D64120

This lets us eventually combine the lazy and non-lazy lists. To make this
work, we need to explicitly pass the expected type of variant element instead
of deducing it from the map.

Depends on D64121

Replace with calls to wrapScript instead. Within wrapScript we now check if
script is lazy or not. This paves way to removing LazyScript* from the
DebuggerReferentVariant.

Depends on D64122

This can be combined with the Debugger::scripts map since keys will not
conflict. This is now all possible since we use js::BaseScript as the root
type.

Depends on D64123

Once we use BaseScript as the root type, we can combine the ScriptQuery
result vectors which will be concatenated anyways.

Depends on D64124

Keywords: leave-open
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a0f9c5c63d4f
Simplify debugger usage of BaseScript::sourceObject. r=jandem
https://hg.mozilla.org/integration/autoland/rev/07d450df0aab
Simplify parts of debugger affecting LazyScript. r=jandem
https://hg.mozilla.org/integration/autoland/rev/3ef1e468e53a
Use BaseScriptVector in Debugger. r=jandem
https://hg.mozilla.org/integration/autoland/rev/388b7ae2e7f6
Use BaseScript in Debugger ScriptWeakMap. r=jandem
https://hg.mozilla.org/integration/autoland/rev/2c5176ed5752
Remove Debugger::wrapLazyScript. r=jandem
https://hg.mozilla.org/integration/autoland/rev/30b40b53ff10
Remove the Debugger::lazyScripts weakmap. r=jandem
https://hg.mozilla.org/integration/autoland/rev/d36d060cd6a5
Remove Debugger::ScriptQuery::lazyScriptVector. r=jandem

Eliminate the templates and use BaseScript type instead to simplify.

Add a BaseScript case to variant matcher classes in the debugger and forward
the JSScript and LazyScript cases to it. This will call DelazifyScript for
all cases, so fix a small issue where this failed on non-function scripts.

Subsequent patches will remove the JSScript/LazyScript cases once the variant
type is updated.

Depends on D64365

Fold the JSScript* and LazyScript* variant arms into a single case. The
debugger now either uses BaseScript accessors directly, or uses
DelazifyScript to ensure bytecode exists if needed.

Note that there are still seperate instances for LazyScript and JSScript so
Debugger::wrapVariantReferent continues to be careful about normalizing
references.

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d5935fae1300
Cleanup DebuggerScript::CallData::getUrl(). r=jandem
https://hg.mozilla.org/integration/autoland/rev/2d06ad181243
Add BaseScript cases to debugger variant matchers. r=jandem
https://hg.mozilla.org/integration/autoland/rev/7d3e520aa79a
Use js::BaseScript in DebuggerScriptVariant. r=jandem
Keywords: leave-open
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: