Closed Bug 1629721 Opened 5 years ago Closed 5 years ago

Cleanup run-once-lambda/singleton handling in BCE

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(4 files)

The TreatAsRunOnce flag is a source of the BytecodeEmitter reading and writing from live BaseScript instances which we would like to avoid for Project Stencil. These patches also try to unify more of the lazy and non-lazy paths in the BCE.

Use the same conditions for qualifying an inner function as a run-once-lambda
between the lazy and non-lazy code paths. Use the FunctionBox::immutableFlags
so that this works well with delazification too.

Depends on D70778

Instead rely on consistent definitions of the TreatAsRunOnce flag on the
SharedContext. Also simplify the BCE::check{RunOnce,Singleton}Context
accessors. Note that the TreatAsRunOnce flag indicates the script is expected
to run-once, but the BCE also checks for isInLoop to decide if current
bytecode location within the script should still be considered run-once.

Depends on D70779

Move the TI heuristic into BCE::emitFunction where the other special mutation
of inner-functions is happening.

Depends on D70780

Attachment #9140291 - Attachment description: Bug 1629721 - Unified runOnceLambmda definition for lazy/non-lazy → Bug 1629721 - Unified runOnceLambda definition for lazy/non-lazy
Attachment #9140292 - Attachment description: Bug 1629721 - Remove BytecodeEmitter::runOnceLamdbda helper → Bug 1629721 - Remove BytecodeEmitter::runOnceLambda helper
Attachment #9140290 - Attachment description: Bug 1629721 - Use the TreatAsRunOnce flag on SharedContext → Bug 1629721 - Use the TreatAsRunOnce flag on SharedContext. r?mgaudet
Attachment #9140291 - Attachment description: Bug 1629721 - Unified runOnceLambda definition for lazy/non-lazy → Bug 1629721 - Unified runOnceLambda definition for lazy/non-lazy. r?mgaudet
Attachment #9140292 - Attachment description: Bug 1629721 - Remove BytecodeEmitter::runOnceLambda helper → Bug 1629721 - Remove BytecodeEmitter::runOnceLambda helper. r?mgaudet
Attachment #9140293 - Attachment description: Bug 1629721 - Remove FunctionEmitter::interpretedCommon → Bug 1629721 - Remove FunctionEmitter::interpretedCommon. r?mgaudet
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f7cd6b6c2334 Use the TreatAsRunOnce flag on SharedContext. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/19a37953cb0d Unified runOnceLambda definition for lazy/non-lazy. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/2c04486aa1e7 Remove BytecodeEmitter::runOnceLambda helper. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/90bc2f89ea84 Remove FunctionEmitter::interpretedCommon. r=mgaudet
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: