Bug 1557193 - Enable the assertion in testScriptSourceCompression.cpp verifying that script source was, in fact, compressed off-thread synchronously. r=arai, r=jonco

Differential Revision: https://phabricator.services.mozilla.com/D33890

--HG--
extra : rebase_source : e8f56515747af7c0894f8dc8c63eecff99a725f9
This commit is contained in:
Jeff Walden 2019-06-05 14:23:20 -07:00
Родитель f1fec1561e
Коммит 0d21e618f8
3 изменённых файлов: 11 добавлений и 8 удалений

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

@ -111,13 +111,9 @@ static void CompressSourceSync(JS::Handle<JSFunction*> fun, JSContext* cx) {
MOZ_RELEASE_ASSERT(script);
MOZ_RELEASE_ASSERT(script->scriptSource()->hasSourceText());
js::RunPendingSourceCompressions(cx->runtime());
js::RunPendingSourceCompressions(cx);
// XXX Temporarily don't assert this because not all builds guarantee it.
// We test behavior that is *affected in its implementation* by this
// condition, but is the same whether or not this assertion actually
// holds. We'll figure out how to guarantee it in a followup change.
// MOZ_RELEASE_ASSERT(script->scriptSource()->hasCompressedSource());
MOZ_RELEASE_ASSERT(script->scriptSource()->hasCompressedSource());
}
static constexpr char FunctionStart[] = "function @() {";

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

@ -2329,7 +2329,14 @@ void js::AttachFinishedCompressions(JSRuntime* runtime,
}
}
void js::RunPendingSourceCompressions(JSRuntime* runtime) {
void js::RunPendingSourceCompressions(JSContext* cx) {
// |SourceCompressionTask::shouldStart| delays compression until two major GCs
// happen. Bleah.
JS_GC(cx);
JS_GC(cx);
JSRuntime* runtime = cx->runtime();
AutoLockHelperThreadState lock;
if (!HelperThreadState().threads) {

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

@ -676,7 +676,7 @@ void AttachFinishedCompressions(JSRuntime* runtime,
AutoLockHelperThreadState& lock);
// Run all pending source compression tasks synchronously, for testing purposes
void RunPendingSourceCompressions(JSRuntime* runtime);
void RunPendingSourceCompressions(JSContext* cx);
class MOZ_RAII AutoLockHelperThreadState : public LockGuard<Mutex> {
using Base = LockGuard<Mutex>;