Remove helper thread JSContexts
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox117 | --- | fixed |
People
(Reporter: jandem, Assigned: arai)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
Attachments
(5 files)
At this point helper threads only use a JSContext for the parse tasks. After Stencil, it should now be feasible to remove helper thread JSContexts
completely. Remaining dependencies include things like:
- Exception handling
- Stack limit checks
TempAllocPolicy
cx->dtoaState
We could replace these uses with a stack-allocated class that contains just the data the frontend needs (ParseContext
is already taken, let's call it FrontendContext
for now). This would let us decouple the frontend from JSContext
, very similar to how other Stencil changes decoupled the parser from the VM.
For the stack limit checks, we could copy the stack limit from the main thread's JSContext
to the FrontendContext
if we're parsing on the main thread. If we're parsing off-thread, we would do something similar to what we do now in JSContext::setHelperThread
.
When parsing is finished, exceptions would be converted from the FrontendContext
to an actual JS exception in JSContext
. This will let us unify exception handling in the frontend (instead of having different code paths for main thread vs helper thread contexts).
Updated•3 years ago
|
Reporter | ||
Comment 1•2 years ago
|
||
Bug 1770158 and bug 1771874 will take care of cx->dtoaState
. (The remaining use is for non-base-10 double to string conversion and that's not used by the frontend.)
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 2•2 years ago
|
||
The ORB M1 milestone can use existing parser APIs, so we can move this to M2 as potential performance work.
Updated•2 years ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 3•1 year ago
|
||
Depends on D183841
Assignee | ||
Comment 4•1 year ago
|
||
Depends on D183842
Assignee | ||
Comment 5•1 year ago
|
||
Depends on D183843
Assignee | ||
Comment 6•1 year ago
|
||
Depends on D183844
Assignee | ||
Comment 7•1 year ago
|
||
Depends on D183845
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/b6ec25d30279 Part 1: Remove GlobalHelperThreadState::helperContexts_. r=nbp https://hg.mozilla.org/integration/autoland/rev/fb6e411d1d73 Part 2: Remove JSContext::isHelperThreadContext. r=nbp https://hg.mozilla.org/integration/autoland/rev/01d39e78a971 Part 3: Remove JSContext::errors_. r=nbp https://hg.mozilla.org/integration/autoland/rev/574097795dd2 Part 4: Remove JSContext::isMainThreadContext. r=nbp https://hg.mozilla.org/integration/autoland/rev/0b97cab35896 Part 5: Remove JSContext::kind_. r=nbp
Comment 9•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b6ec25d30279
https://hg.mozilla.org/mozilla-central/rev/fb6e411d1d73
https://hg.mozilla.org/mozilla-central/rev/01d39e78a971
https://hg.mozilla.org/mozilla-central/rev/574097795dd2
https://hg.mozilla.org/mozilla-central/rev/0b97cab35896
Description
•