Closed Bug 1589767 Opened 5 years ago Closed 4 years ago

[meta] Cleanup JSFunction/JSScript/LazyScript/Scope initialization sequence

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED

People

(Reporter: tcampbell, Unassigned)

References

Details

(Keywords: meta)

Attachments

(1 file)

The sequence of construction and the partial-initialization states of the JSFunction / JSScript / LazyScript / Scope is pretty inconsistent right now, particularly with OOM. We should try to clean this up to support Bug 1529456 and Bug 1544117.

  • Define the partial-initialization states (eg. JSFunction without a script; JSScript without SSD)
  • Identify the fields (such as LazyScript::enclosingLazyScriptOrScope_) that form cycles and explicitly document them
  • More helper methods for patching scripts into tree into the JSFunction namespace
  • Add a script tree verification helper
  • ??
Blocks: 1529456, 1544117
No longer depends on: 1529456, 1544117
Depends on: 1599936

This will largely be addressed by shipping Stencil and replacing script cloning and XDR. The current model used is to do one pass to allocate all JSFunctions in any order, then a second pass to allocate any BaseScript and their Scopes.

This has basically been achieved by the rest of the Stencil work. Removing XDR will be the last element, but the new initialization order is already working in https://searchfox.org/mozilla-central/rev/af5cff556a9482d7aa2267a82f2ccfaf18e797e9/js/src/frontend/Stencil.cpp#546-584

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: