Add JSContext-free variant of js::ReportOutOfMemory()
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox105 | --- | fixed |
People
(Reporter: bthrall, Assigned: bthrall)
References
Details
Attachments
(18 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
js::ReportOutOfMemory() requires a JSContext, but is called in several places during compilation (see here , here, and here).
To remove JSContext from off-thread compilation, we need a version of js::ReportOutOfMemory() that uses ErrorContext.
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
| Assignee | ||
Comment 1•3 years ago
|
||
Following the pattern set by JS::ReportOverRecursed().
| Assignee | ||
Comment 2•3 years ago
|
||
Depends on D153961
| Assignee | ||
Comment 3•3 years ago
|
||
JSErrorNotes::addNoteASCII() is the only one currently required for off-thread
compiling, but I added support for addNoteLatin1() and addNoteUTF8() for
consistency.
ErrorArgumentsType declaration moved to ErrorReport.h to resolve header
#include recursion.
There's no need to go through the ParseContext's SharedContext to get the
ErrorContext in GeneralParser. For the main thread, it is the same context, and
off-thread we can use the ErrorContext member directly.
Depends on D153962
| Assignee | ||
Comment 4•3 years ago
|
||
Depends on D153963
| Assignee | ||
Comment 5•3 years ago
|
||
Depends on D153964
| Assignee | ||
Comment 6•3 years ago
|
||
We will use it with ReportOutOfMemory() calls and probably other places.
Specifically: FunctionBox::setAsmJSModule() calls ReportOutOfMemory().
Depends on D153965
| Assignee | ||
Comment 7•3 years ago
|
||
Depends on D153966
| Assignee | ||
Comment 8•3 years ago
|
||
Depends on D153967
| Assignee | ||
Comment 9•3 years ago
|
||
Depends on D153968
| Assignee | ||
Comment 10•3 years ago
|
||
Depends on D153969
| Assignee | ||
Comment 11•3 years ago
|
||
To keep this patch simple to follow, I introduce some temporary functions
(initVector, initMap, setInitial, addDelazification) so I can plumb
ErrorContext through StencilXdr and ParseAtom in separate patches.
Depends on D153970
| Assignee | ||
Comment 12•3 years ago
|
||
ASTSerializer is not used in helper threads, so it doesn't need ErrorContext,
but it is better to reuse the existing MainThreadErrorContext in
reflect_parse() than to create a new one. Deciding which ErrorContext to use
should happen in few places, not everywhere.
Depends on D153971
| Assignee | ||
Comment 13•3 years ago
|
||
ParserBase::liftParserAtomToJSAtom() moved down from ParserSharedBase because
it seemed slightly easier than plumbing the ErrorContext member up to
ParserSharedBase.
CompilationStencil::instantiateSelfHostedAtoms() knows it isn't used by helper
threads because it is for self-hosted code.
CompilationStencil::instantiateStencilAfterPreparation() is instantiating the
stencil, so it happens on the main thread.
Depends on D154459
| Assignee | ||
Comment 14•3 years ago
|
||
Depends on D154460
| Assignee | ||
Comment 15•3 years ago
|
||
Depends on D154461
| Assignee | ||
Comment 16•3 years ago
|
||
Depends on D154462
| Assignee | ||
Comment 17•3 years ago
|
||
Instantiating stencils happens on the main thread, so
InstantiateModuleStencil(), and InstantiateModuleStencilXDR() can safely use
MainThreadErrorContext.
Depends on D154463
| Assignee | ||
Comment 18•3 years ago
|
||
If this is happening off the main thread, the errors are tracked in
ErrorContext, not JSContext.
Depends on D154464
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 19•3 years ago
|
||
Comment 20•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/294263a92e96
https://hg.mozilla.org/mozilla-central/rev/c33f089db610
https://hg.mozilla.org/mozilla-central/rev/af724b3e2951
https://hg.mozilla.org/mozilla-central/rev/b83b667d8244
https://hg.mozilla.org/mozilla-central/rev/6a9f97b3e66a
https://hg.mozilla.org/mozilla-central/rev/24737a6aae0a
https://hg.mozilla.org/mozilla-central/rev/08d3b76abe02
https://hg.mozilla.org/mozilla-central/rev/70436815ee6d
https://hg.mozilla.org/mozilla-central/rev/69dd93866f29
https://hg.mozilla.org/mozilla-central/rev/9d377710076a
https://hg.mozilla.org/mozilla-central/rev/6aad32b63896
https://hg.mozilla.org/mozilla-central/rev/5577cc3982d1
https://hg.mozilla.org/mozilla-central/rev/01541d4bf42e
https://hg.mozilla.org/mozilla-central/rev/18c6e6eea130
https://hg.mozilla.org/mozilla-central/rev/bbe13d650d2c
https://hg.mozilla.org/mozilla-central/rev/a05d45bff643
https://hg.mozilla.org/mozilla-central/rev/dff2454b0433
https://hg.mozilla.org/mozilla-central/rev/ef4121bbd9c8
Description
•