Closed Bug 1641202 Opened 5 years ago Closed 5 years ago

Decouple Stencil instantiation from FunctionBox/SharedContext

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: tcampbell, Assigned: arai)

References

Details

Attachments

(17 files, 3 obsolete files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

While the Parser/BCE generate ScriptStencils for the majority of their result data, we still use the FunctionBox/SharedContext while doing the instantiation of VM scripts. This bug is about tracking the missing info in the ScriptStencil so that it can outlive the frontend LifoAlloc.

At least the following need to be fixed:

  • SourceExtent
  • FunctionFlags
  • FunctionName
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED

Also moved FunctionBox::createFunction to CreateFunction in order to
separate the logic from FunctionBox later.

Depends on D81151

Later patch will replace remaining FunctionBox reference in stencil
instantiation.

Depends on D81155

Depends on D81159

Blocks: 1648574
Attachment #9159398 - Attachment description: Bug 1641202 - Part 11: Move more fields from FunctionBox to ScriptStencil. r?tcampbell! → Bug 1641202 - Part 12: Move more fields from FunctionBox to ScriptStencil. r?tcampbell!
Attachment #9159399 - Attachment description: Bug 1641202 - Part 12: Directly use CompilationInfo.funcData instead of FunctionBox list while instantiation. r?tcampbell! → Bug 1641202 - Part 13: Directly use CompilationInfo.funcData instead of FunctionBox list while instantiation. r?tcampbell!
Attachment #9159400 - Attachment description: Bug 1641202 - Part 13: Remove tracing from FunctionBox. r?tcampbell! → Bug 1641202 - Part 14: Remove tracing from FunctionBox. r?tcampbell!

To check if certain stencil is function or not, without relying on
ScriptStencil.functionIndex, ScriptStencil.immutableFlags should be modified
eagarly, instead of at the end of parsing/compilation.

Depends on D81160

there is remaining part in ScopeCreationData, that needs to be replaced by FunctionIndex and individual field data
https://searchfox.org/mozilla-central/rev/5a4aaccb28665807a6fd49cf48367d47fbb5a19a/js/src/frontend/Stencil.h#217

Attachment #9159791 - Attachment is obsolete: true
Attachment #9159400 - Attachment is obsolete: true
Attachment #9159392 - Attachment description: Bug 1641202 - Part 6: Move some JSFunction-related fields from FunctionBox to ScriptStencil. r?tcampbell! → Bug 1641202 - Part 6: Add some JSFunction-related fields from FunctionBox to ScriptStencil. r?tcampbell!
Attachment #9159393 - Attachment description: Bug 1641202 - Part 7: Move SourceExtent into ScriptStencil. r?tcampbell! → Bug 1641202 - Part 7: Copy SourceExtent into ScriptStencil. r?tcampbell!
Attachment #9159394 - Attachment description: Bug 1641202 - Part 8 - Use ScriptStencil.isAsmJSModule in top level. r?tcampbell! → Bug 1641202 - Part 8: Use ScriptStencil.isAsmJSModule in top level. r?tcampbell!
Attachment #9159395 - Attachment description: Bug 1641202 - Part 9: Move function atom to ScriptStencil. r?tcampbell! → Bug 1641202 - Part 9: Copy function atom to ScriptStencil. r?tcampbell!
Attachment #9159398 - Attachment description: Bug 1641202 - Part 12: Move more fields from FunctionBox to ScriptStencil. r?tcampbell! → Bug 1641202 - Part 12: Copy more fields from FunctionBox to ScriptStencil. r?tcampbell!
Attachment #9159793 - Attachment description: Bug 1641202 - Part 16: Remove ScriptStencil.functionIndex. r?tcampbell! → Bug 1641202 - Part 14: Remove ScriptStencil.functionIndex. r?tcampbell!

Depends on D82535

Keywords: leave-open
Attachment #9161885 - Attachment is obsolete: true
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/9f6064e642af Part 1: Remove non-existent FunctionBox::hasFunctionStencil declaration. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/083eaaa198a4 Part 2: Rewind CompilationInfo.{funcData,functions}. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/88867904264a Part 3: Use CompilationInfo.topLevel for top-level function. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/c7a3e1e64779 Part 4: Merge 2 PerHandlerParser::newFunctionBox into single implementation. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/d19842bdc536 Part 5: Eagerly emplace ScriptStencil.functionIndex. r=tcampbell
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/d0e0b6bea64b Part 6: Add some JSFunction-related fields from FunctionBox to ScriptStencil. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/5b59137f3bf2 Part 7: Copy SourceExtent into ScriptStencil. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/d486d03edf00 Part 8: Use ScriptStencil.isAsmJSModule in top level. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/89afdcc3e7e5 Part 9: Copy function atom to ScriptStencil. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/db845919143a Part 10: Use ScriptStencil instead of FunctionBox as much as possible when instantiation. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/388fd0366c21 Part 11: Move top-level function enclosing scope into CompilationInfo, and store ScopeIndex in FunctionBox. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/afd5c026cc19 Part 12: Copy more fields from FunctionBox to ScriptStencil. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/70e75d937da5 Part 13: Directly use CompilationInfo.funcData instead of FunctionBox list while instantiation. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/fae2a26e920a Part 14: Remove ScriptStencil.functionIndex. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/08f7ecebf503 Part 15: Copy treatAsRunOnce to lazy function. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/5e939bbeea80 Part 16: Use FunctionIndex in FunctionBox. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/f7f6f94b7377 Part 17: Store FunctionIndex in ScopeCreationData. r=tcampbell
Keywords: leave-open
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: