Allow parsing modules using stencils rather than GC objects.
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: mgaudet, Assigned: tcampbell)
References
Details
Attachments
(5 files, 1 obsolete file)
We need to be able to parse modules without requiring the allocation of GC'd objects.
Assignee | ||
Comment 1•4 years ago
|
||
The ModuleObject allocation needs to be handled, but this is similar to the standalone JSFunction case and should be straightforward.
The import/export map is currently built of JSObjects that are allocated in the middle of parsing. We need a stencil abstraction for the following types:
RequestedModuleObject
ImportEntryObject
ExportEntryObject
These are currently aggregated intoArrayObject
s that are attached to theModuleObject
.
Some sort of Import/ExportMap Stencil data structure probably needs to be defined.
Assignee | ||
Comment 2•4 years ago
|
||
Introduce StencilModuleEntry type to replace {Import,Export}EntryObject
during parsing. Avoid allocating those GC objects until the initModule call.
Assignee | ||
Comment 3•4 years ago
|
||
Defer the ModuleObject::functionDeclarations list initiailization until after
parsing.
Depends on D83206
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Similar to what is done for FunctionScope, defer the initialization of
ModuleScope::Data::module field until creating concrete scope.
Depends on D83206
Assignee | ||
Comment 5•4 years ago
|
||
Use StencilModuleMetadata to hold module function-declarations list so that a
ModuleObject is no longer needed to perform parsing.
Depends on D83269
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D83270
Assignee | ||
Comment 7•4 years ago
|
||
The binding name is by definition the explicitName of the JSFunction so do
not store a copy of it. This avoids needing to trace that anymore.
Depends on D83269
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5db78863ff43 Defer ModuleBuilder GC allocations r=arai https://hg.mozilla.org/integration/autoland/rev/73a1977876d1 Stop using ModuleObject* in ScopeCreationData r=mgaudet https://hg.mozilla.org/integration/autoland/rev/c66757095dd4 Stop storing binding name in module function-decl list r=arai https://hg.mozilla.org/integration/autoland/rev/24520be1a1ce Store FunctionDeclarations in StencilModuleMetadata r=arai https://hg.mozilla.org/integration/autoland/rev/32d800de8502 Move ModuleObject allocation into Stencil instantiation r=arai
Comment 9•4 years ago
|
||
Backed outfor causing assertion failure at jsapi.cpp.
Backout link: https://hg.mozilla.org/integration/autoland/rev/5974b9e65af447c1d1b6918ea7887822f05c9a02
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=309675182&repo=autoland&lineNumber=1778
Assignee | ||
Comment 10•4 years ago
|
||
JS_SetElement
cannot be used on helper-threads, so I have restored the behaviour to use NativeObject::initDenseElement
. I also modified the AssertHeapIsIdle
check to disallow helper threads and verify no further issues. I will open a bug to permanently land these checks since they would have caught the problem sooner.
Comment 11•4 years ago
|
||
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/deb22e4b7e1e Defer ModuleBuilder GC allocations r=arai https://hg.mozilla.org/integration/autoland/rev/7d5c34919a24 Stop using ModuleObject* in ScopeCreationData r=mgaudet https://hg.mozilla.org/integration/autoland/rev/ec3d556893bc Stop storing binding name in module function-decl list r=arai https://hg.mozilla.org/integration/autoland/rev/0776aaa8e255 Store FunctionDeclarations in StencilModuleMetadata r=arai https://hg.mozilla.org/integration/autoland/rev/7eaf75ab590a Move ModuleObject allocation into Stencil instantiation r=arai
Comment 12•4 years ago
|
||
Backed out 5 changesets (bug 1614041) for Spidermonkey failure on gecko/js/src/vm/NativeObject.h. CLOSED TREE
Log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=309684554&repo=autoland&lineNumber=3966
Push with failures:
https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&revision=7eaf75ab590a297f8acc56cfec2cc43dcdf1dc3a
Backout:
https://hg.mozilla.org/integration/autoland/rev/45605357f44cedf5d3d6544750c68d482dca0844
Comment 13•4 years ago
|
||
(In reply to Ted Campbell [:tcampbell] from comment #10)
I also modified the
AssertHeapIsIdle
check to disallow helper threads and verify no further issues.
See also the CHECK_THREAD macro where we explicitly allow helper thread contexts... Maybe it's time to change that. But all this is why I'm pushing for removing helper thread JSContexts completely in the future.
Comment 14•4 years ago
|
||
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a9af5a14e497 Defer ModuleBuilder GC allocations r=arai https://hg.mozilla.org/integration/autoland/rev/8823ae6243b7 Stop using ModuleObject* in ScopeCreationData r=mgaudet https://hg.mozilla.org/integration/autoland/rev/e08aadd71f4d Stop storing binding name in module function-decl list r=arai https://hg.mozilla.org/integration/autoland/rev/5927f5feaebf Store FunctionDeclarations in StencilModuleMetadata r=arai https://hg.mozilla.org/integration/autoland/rev/29ff06b4a609 Move ModuleObject allocation into Stencil instantiation r=arai
Assignee | ||
Updated•4 years ago
|
Comment 15•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a9af5a14e497
https://hg.mozilla.org/mozilla-central/rev/8823ae6243b7
https://hg.mozilla.org/mozilla-central/rev/e08aadd71f4d
https://hg.mozilla.org/mozilla-central/rev/5927f5feaebf
https://hg.mozilla.org/mozilla-central/rev/29ff06b4a609
Description
•