Closed Bug 1601963 Opened 4 months ago Closed 4 months ago

Combine JSScript / LazyScript constructor

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(2 files)

We should remove the shims for the LazyScript/JSScript constructor and use a single signature defined on BaseScript by including using BaseScript::BaseScript in sub-classes.

Also should move the lineno/column initialization to js::BaseScript constructor with the rest of the source location information.

The line number information is already available on either CompileOptions or
FunctionBox when we construct the JSScript. Initialize the the fields in the
constructor instead of later on in JSScript::fullyInitFromEmitter.

Directly wrap the js::BaseScript constructor and fix up argument names and
ordering as needed. This moves some behavior from LazyScript constructor to
LazyScript::CreateRaw. The immutableFlags for LazyScript are also initialized
in callers for more consistency with JSScript.

Depends on D56194

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a2fb58139611
Pass script lineno/column to JSScript constructor. r=mgaudet
https://hg.mozilla.org/integration/autoland/rev/f8154935d6a2
Remove custom JSScript / LazyScript constructors. r=mgaudet
Attachment #9114155 - Attachment description: Bug 1601963 - Pass script lineno/column to JSScript constructor. r?jandem → Bug 1601963 - Pass script lineno/column to JSScript constructor.
Attachment #9114156 - Attachment description: Bug 1601963 - Remove custom JSScript / LazyScript constructors. r?jandem → Bug 1601963 - Remove custom JSScript / LazyScript constructors.
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/40f5ce44be60
Pass script lineno/column to JSScript constructor. r=mgaudet
https://hg.mozilla.org/integration/autoland/rev/7fd9c7c41a1b
Remove custom JSScript / LazyScript constructors. r=mgaudet

The JSScript constructor need to use the same initialization as the BCE for the lineno in the BinAST case. I've updated the patch.

https://searchfox.org/mozilla-central/rev/0815480479c19646f9330377ffd8730515fca4ec/js/src/frontend/BytecodeCompiler.cpp#761,787

Flags: needinfo?(tcampbell)
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.