Bug 1773319 - Rework FrontendContex::gcSafeCallback so rooting hazard analysis understands it r=arai

Previously, rooting hazard analysis could report calls to gcSafeCallback as
triggering a GC because of the two calls to callback(). Now it understands that
the single call to callback() will not trigger a GC.

Differential Revision: https://phabricator.services.mozilla.com/D172333
This commit is contained in:
Bryan Thrall 2023-04-04 17:36:51 +00:00
Родитель e9fadb2ebe
Коммит 1ed143bc2a
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -89,9 +89,9 @@ void FrontendContext::recoverFromOutOfMemory() {
const JSErrorFormatString* FrontendContext::gcSafeCallback(
JSErrorCallback callback, void* userRef, const unsigned errorNumber) {
mozilla::Maybe<gc::AutoSuppressGC> suppressGC;
if (maybeCx_) {
gc::AutoSuppressGC suppressGC(maybeCx_);
return callback(userRef, errorNumber);
suppressGC.emplace(maybeCx_);
}
return callback(userRef, errorNumber);