Directly pass the stack limit from GlobalHelperThreadState to AutoCheckRecursionLimit
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox105 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(2 files, 1 obsolete file)
The helper thread's stack quota is passed from embedding, and stored into GlobalHelperThreadState.stackQuota
:
void GlobalHelperThreadState::setDispatchTaskCallback(
JS::HelperThreadTaskCallback callback, size_t threadCount, size_t stackSize,
const AutoLockHelperThreadState& lock) {
...
this->stackQuota = ThreadStackQuotaForSize(stackSize);
And then set to RootingContext::nativeStackLimit
:
AutoSetHelperThreadContext::AutoSetHelperThreadContext(
const JS::ContextOptions& options, AutoLockHelperThreadState& lock)
: lock(lock) {
...
JS_SetNativeStackQuota(cx, HelperThreadState().stackQuota);
and used by AutoCheckRecursionLimit
MOZ_ALWAYS_INLINE uintptr_t AutoCheckRecursionLimit::getStackLimitHelper(
JSContext* cx, JS::StackKind kind, int extraAllowance) const {
uintptr_t limit = JS::RootingContext::get(cx)->nativeStackLimit[kind];
Bug 1781008 patch will make AutoCheckRecursionLimit
possible to directly receive the stack limit.
After that, we should directly pass the limit from GlobalHelperThreadState
Assignee | ||
Comment 1•3 years ago
|
||
Depends on D152854
Assignee | ||
Comment 2•3 years ago
|
||
Depends on D152855
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D152856
Comment 4•3 years ago
|
||
Comment on attachment 9287208 [details]
Bug 1781255 - Part 3: Do not set JSContext::nativeStackBase_ in helper thread. r?bthrall!
Revision D152857 was moved to bug 1782706. Setting attachment 9287208 [details] to obsolete.
https://hg.mozilla.org/mozilla-central/rev/ee33ca7b2fc9
https://hg.mozilla.org/mozilla-central/rev/bb102b309f93
Description
•