Closed
Bug 1490055
Opened 6 years ago
Closed 6 years ago
ParseTask can report OOM on the wrong context, and other improvements
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(3 files)
8.12 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
5.95 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
11.66 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
ParseTask is created with a main thread JSContext and then used on a helper thread with a different JSContext. It contains two vectors which use the default TempAllocPolicy, which records the context used to create it and uses that to report OOM. I think this means that multi script decode jobs can report OOM to the wrong context.
Assignee | ||
Comment 1•6 years ago
|
||
Patch to use SystemAllocPolicy for ParseTask vectors because it doesn't hold a pointer to a JSContext and so this confusion can't arise.
Attachment #9007829 -
Flags: review?(nicolas.b.pierron)
Assignee | ||
Comment 2•6 years ago
|
||
Helper thread JSContexts already have a LifoAlloc that we can use for parsing. We don't need to create a new one for every parse task.
Attachment #9007831 -
Flags: review?(nicolas.b.pierron)
Assignee | ||
Comment 3•6 years ago
|
||
Finally, this patch removes the callback to finishParseTask. We can run this code after it returns so we don't need the complexity. I also renamed the finishParseTask methods to hopefully make things clearer and moved the contents of ParseTask::finish into finishParseTaskCommon.
Attachment #9007832 -
Flags: review?(nicolas.b.pierron)
Updated•6 years ago
|
Attachment #9007829 -
Flags: review?(nicolas.b.pierron) → review+
Updated•6 years ago
|
Attachment #9007831 -
Flags: review?(nicolas.b.pierron) → review+
Comment 4•6 years ago
|
||
Comment on attachment 9007832 [details] [diff] [review] bug1490055-parse-task-refactor-callback Review of attachment 9007832 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for these clean-ups!
Attachment #9007832 -
Flags: review?(nicolas.b.pierron) → review+
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/20e30197e490 Use SystemAllocPolicy for ParseTask which can be used by both main thread and helper thread contexts r=nbp https://hg.mozilla.org/integration/mozilla-inbound/rev/44ca8ba219dd Use JSContext's temp LifoAlloc for off-thread parsing r=nbp https://hg.mozilla.org/integration/mozilla-inbound/rev/3f4e2a2ad3be Refactor to remove callback passed when finishing a parse task r=nbp
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/20e30197e490 https://hg.mozilla.org/mozilla-central/rev/44ca8ba219dd https://hg.mozilla.org/mozilla-central/rev/3f4e2a2ad3be
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•