Use a RAII class for recursion checks
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox89 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
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 |
The goal is to change:
if (!CheckRecursionLimit(cx)) {
return false;
}
to:
AutoCheckRecursionLimit recursion(cx);
if (!recursion.check(cx)) {
return false;
}
This will simplify the WASI changes in bug 1704771.
| Assignee | ||
Comment 1•5 years ago
|
||
The use of a C++ RAII class lets us simplify a few things and prepares for
the WASI changes in bug 1704771.
| Assignee | ||
Comment 2•5 years ago
|
||
Depends on D111868
| Assignee | ||
Comment 3•5 years ago
|
||
Depends on D111869
| Assignee | ||
Comment 4•5 years ago
|
||
Depends on D111870
| Assignee | ||
Comment 5•5 years ago
|
||
In EnterBaseline, it's simpler to use checkWithExtra.
After that we can inline CheckRecursionLimitWithStackPointer into checkWithExtra.
Depends on D111871
| Assignee | ||
Comment 6•5 years ago
|
||
Depends on D111872
| Assignee | ||
Comment 7•5 years ago
|
||
Depends on D111874
| Assignee | ||
Comment 8•5 years ago
|
||
Depends on D111875
| Assignee | ||
Comment 9•5 years ago
|
||
This is now a private method so is better encapsulated.
Depends on D111876
| Assignee | ||
Comment 10•5 years ago
|
||
Depends on D111877
| Assignee | ||
Comment 11•5 years ago
|
||
Depends on D111878
| Assignee | ||
Comment 12•5 years ago
|
||
Depends on D111879
| Assignee | ||
Comment 13•5 years ago
|
||
Depends on D111880
| Assignee | ||
Comment 14•5 years ago
|
||
Depends on D111882
| Assignee | ||
Comment 15•5 years ago
|
||
The next patch wants to remove JS_CHECK_STACK_SIZE, so stop calling it directly.
| Assignee | ||
Comment 16•5 years ago
|
||
All stack overflow checks are now routed through checkLimitImpl, so move the
JS_STACK_OOM_POSSIBLY_FAIL testing check there. This also gives us a place to
check the WASI limit later on.
Depends on D111999
| Assignee | ||
Comment 17•5 years ago
|
||
For check we have an optimization to check the untrusted limit first, to avoid a
slow getStackLimit call.
This patch implements check using checkDontReport, and checkDontReport using
checkWithStackPointerDontReport, and moves the optimization into
checkWithStackPointerDontReport, so that all these functions now have this optimization.
Renames getStackLimit to getStackLimitSlow now that it's only used on the slow path.
Depends on D112000
| Assignee | ||
Comment 18•5 years ago
|
||
It's easier to understand the code withou these helpers.
Depends on D112001
| Assignee | ||
Updated•5 years ago
|
Comment 19•5 years ago
|
||
| Assignee | ||
Updated•5 years ago
|
Comment 20•5 years ago
|
||
Comment 21•5 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/52b63cb9abed
https://hg.mozilla.org/mozilla-central/rev/684284cd28cf
https://hg.mozilla.org/mozilla-central/rev/7766df072ce2
https://hg.mozilla.org/mozilla-central/rev/d544b912da81
https://hg.mozilla.org/mozilla-central/rev/580046346d2e
https://hg.mozilla.org/mozilla-central/rev/47ce7690cd37
https://hg.mozilla.org/mozilla-central/rev/f6b6012baa23
https://hg.mozilla.org/mozilla-central/rev/7688bc2999ea
https://hg.mozilla.org/mozilla-central/rev/aebec6a49d31
https://hg.mozilla.org/mozilla-central/rev/c99d9f76b0b2
https://hg.mozilla.org/mozilla-central/rev/f8d5545d982b
https://hg.mozilla.org/mozilla-central/rev/903bbc357458
https://hg.mozilla.org/mozilla-central/rev/626aae1e53f9
https://hg.mozilla.org/mozilla-central/rev/c2e80cdf57fc
Comment 22•5 years ago
|
||
| bugherder | ||
Description
•