Bug 1684122 - Demarcate region where GC would break stuff r=jgilbert

Differential Revision: https://phabricator.services.mozilla.com/D100427
This commit is contained in:
Steve Fink 2021-01-13 22:24:36 +00:00
Родитель 613e55711f
Коммит 9738113572
1 изменённых файлов: 10 добавлений и 1 удалений

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

@ -3933,6 +3933,10 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
// -
// Demarcate the region within which GC is disallowed. Typed arrays can move
// their data during a GC, so this will allow the rooting hazard analysis to
// report if a GC is possible while any data pointers extracted from the
// typed array are still live.
dom::Uint8ClampedArray scopedArr;
// -
@ -3997,7 +4001,10 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
return Some(webgl::TexUnpackBlobDesc{
imageTarget, explicitSize, gfxAlphaType::NonPremult, {}, {}});
}();
if (!desc) return;
if (!desc) {
scopedArr.Reset();
return;
}
// -
// Further, for uploads from TexImageSource, implied UNPACK_ROW_LENGTH and
@ -4028,6 +4035,7 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
EnqueueError(LOCAL_GL_INVALID_OPERATION,
"Non-DOM-Element uploads with alpha-premult"
" or y-flip do not support subrect selection.");
scopedArr.Reset(); // (For the hazard analysis) Done with the data.
return;
}
}
@ -4082,6 +4090,7 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
Run<RPROC(TexImage)>(static_cast<uint32_t>(level), respecFormat,
CastUvec3(offset), pi, std::move(*desc));
scopedArr.Reset(); // (For the hazard analysis) Done with the data.
}
void ClientWebGLContext::CompressedTexImage(bool sub, uint8_t funcDims,