Closed Bug 1619803 Opened 5 years ago Closed 5 years ago

Delazify scripts in-place

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

This bug is the pivotal part of Bug 1529456. Most of the groundwork is complete for the delazification/relazification processes to work in-place on a single BaseScript.

  • This allows clones of lambda functions to all delazify at once, avoid the need to JITs to detect this case.
  • The debugger will only need two track a single BaseScript in it's maps and will not need to reconcile them.
  • We no longer need to allocate pairs of BaseScripts with almost identical information.
  • We can lazify functions that do not have an initial LazyScript.

The primary complexity to watch out for is correctly cleaning up if an OOM occurs during delazification so that the BaseScript is returned to its previous state.

Use a single GC allocation for the JSScript and the LazyScript of a
function. This reuses the script during delazification / relazification
transitions.

The debugger and JITs are simplified as a result of having a single identity
for a BaseScript rather than tracking both a lazy and non-lazy form.

To simplify in-place relazification, we disallow relazification when the
function originally had a non-null PrivateScriptData pointer. This excludes
class constructors (without inner functions) that previously supported
relazification. All other scripted leaf functions do not allocate a
PrivateScriptData because they cannot have closed-over-bindings (since they
have no inner functions).

Add helper method to manage updating BaseScript::data_ that correctly
notifies the GC MemoryUse tracking. This simplifies things later when we will
need to update data_ during delazification / relazification.

Depends on D66139

Attachment #9132107 - Attachment description: Bug 1619803 - Do not relazify functions with non-null LazyScript::data_. r?mgaudet → Bug 1619803 - Do not relazify functions with non-null LazyScript::data_
Attachment #9132108 - Attachment description: Bug 1619803 - Add BaseScript::swapData for updating data_ field. r?mgaudet → Bug 1619803 - Add BaseScript::swapData for updating data_ field
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/052cf2656bdc Do not relazify functions with non-null LazyScript::data_ r=mgaudet https://hg.mozilla.org/integration/autoland/rev/424df8f11c16 Add BaseScript::swapData for updating data_ field r=sfink https://hg.mozilla.org/integration/autoland/rev/4dd9206018a3 Unify JSScript and LazyScript instances r=jandem,mgaudet
Regressions: 1622371

== Change summary for alert #25416 (as of Mon, 16 Mar 2020 11:58:04 GMT) ==

Improvements:

0.39% Base Content JS windows7-32 opt 2,959,256.00 -> 2,947,736.00
0.39% Base Content JS windows7-32-shippable opt 2,959,309.33 -> 2,947,725.33
0.27% Base Content JS linux1804-64 opt 3,711,887.33 -> 3,701,930.00
0.27% Base Content JS linux1804-64-qr opt 3,711,926.00 -> 3,701,940.00
0.27% Base Content JS linux1804-64-shippable opt 3,711,920.00 -> 3,701,936.00
0.27% Base Content JS linux1804-64-shippable-qr opt 3,711,932.00 -> 3,701,936.00
0.27% Base Content JS macosx1014-64-shippable opt 3,713,973.33 -> 3,704,002.00
0.26% Base Content JS windows10-64-qr opt 3,770,644.67 -> 3,760,717.33
0.25% Base Content JS windows10-64 opt 3,770,604.00 -> 3,761,078.67
0.25% Base Content JS windows10-64-shippable opt 3,770,620.00 -> 3,761,086.67
0.25% Base Content JS windows10-64-shippable-qr opt 3,770,598.00 -> 3,761,050.00
0.25% Base Content JS windows10-64-qr opt 3,770,606.00 -> 3,761,080.67

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=25416

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: