Remove helper thread JSContexts
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
People
(Reporter: jandem, Unassigned)
References
(Depends on 2 open bugs, Blocks 2 open bugs)
Details
(Whiteboard: [orb:m2])
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•1 year ago
|
Reporter | ||
Comment 1•10 months 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•10 months ago
|
Updated•10 months ago
|
Updated•4 months ago
|
Updated•3 months ago
|
Comment 2•3 months ago
|
||
The ORB M1 milestone can use existing parser APIs, so we can move this to M2 as potential performance work.
Description
•