Closed Bug 1597795 Opened 4 years ago Closed 4 years ago

Cleanup uses of js::detail::CopyScript

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(4 files)

Fix up some of the script cloning pathways to be a bit more uniform. The aim is to reduce the number of partial initialization states for scripts and to simplify onNewScript callbacks.

Instead of using cloneSelfHostedFunctionScript and then partially undoing
the result, create the JSFunction and use CloneScriptIntoFunction directly.
This avoids initializing fields to wrong values and fixing later.

Attachment #9110072 - Attachment description: Bug 1597795 - Call CloneScriptIntoFunction directly from MakeDefaultConstructor. r?jandem → Bug 1597795 - Call CloneScriptIntoFunction directly from MakeDefaultConstructor. r?mgaudet
Attachment #9110073 - Attachment description: Bug 1597795 - Call onNewScript from CloneGlobalScript. r?jandem → Bug 1597795 - Call onNewScript from CloneGlobalScript. r?caroline
Keywords: leave-open
Depends on: 1626127
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d89e4585eefa
Call onNewScript from CloneGlobalScript. r=caroline

Now that we directly construct the JSFunction of a default constructor, we
set the name and flags correctly. As a result the MakeDefaultConstructor
intrinsic doesn't do anything of consequence and we can remove it.

Depends on D53873

If we add JSScript::initSharedData(), we no longer need to mark CopyScript as
a friend of JSScript and can simplify some things.

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/97deb8f0cd01
Call CloneScriptIntoFunction directly from MakeDefaultConstructor. r=mgaudet
https://hg.mozilla.org/integration/autoland/rev/becfcaa1a8e5
Remove MakeDefaultConstructor intrinsic. r=mgaudet
Keywords: leave-open
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/65b612924b35
Stop requiring js::detail::CopyScript to be a friend. r=caroline
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: