Merge inbound to mozilla-central. a=merge

This commit is contained in:
Margareta Eliza Balazs 2018-11-19 11:28:37 +02:00
Родитель 56bbc9b698 a06eae528e
Коммит b03a62c3c8
5 изменённых файлов: 16 добавлений и 20 удалений

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

@ -170,7 +170,7 @@ AsyncImagePipelineManager::AddAsyncImagePipeline(const wr::PipelineId& aPipeline
AsyncImagePipeline* holder = new AsyncImagePipeline();
holder->mImageHost = aImageHost;
mAsyncImagePipelines.Put(id, holder);
AddPipeline(aPipelineId);
AddPipeline(aPipelineId, /* aWrBridge */ nullptr);
}
void

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

@ -47,7 +47,7 @@ protected:
public:
void Destroy();
void AddPipeline(const wr::PipelineId& aPipelineId, WebRenderBridgeParent* aWrBridge = nullptr);
void AddPipeline(const wr::PipelineId& aPipelineId, WebRenderBridgeParent* aWrBridge);
void RemovePipeline(const wr::PipelineId& aPipelineId, const wr::Epoch& aEpoch);
WebRenderBridgeParent* GetWrBridge(const wr::PipelineId& aPipelineId);

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

@ -1532,7 +1532,7 @@ WebRenderBridgeParent::UpdateWebRender(CompositorVsyncScheduler* aScheduler,
mAnimStorage = aAnimStorage;
// Register pipeline to updated AsyncImageManager.
mAsyncImageManager->AddPipeline(mPipelineId);
mAsyncImageManager->AddPipeline(mPipelineId, this);
return GetNextWrEpoch(); // Update webrender epoch
}

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

@ -142,22 +142,24 @@ class FailureSimulator
uint64_t maxChecks_ = UINT64_MAX;
uint64_t counter_ = 0;
bool failAlways_ = true;
bool inUnsafeRegion_ = false;
public:
uint64_t maxChecks() const {
return maxChecks_;
}
void setMaxChecks(uint64_t value) {
maxChecks_ = value;
}
uint64_t counter() const {
return counter_;
}
void setInUnsafeRegion(bool b) {
MOZ_ASSERT(inUnsafeRegion_ != b);
inUnsafeRegion_ = b;
}
uint32_t targetThread() const {
return targetThread_;
}
bool isThreadSimulatingAny() const {
return targetThread_ && targetThread_ == js::oom::GetThreadType();
return targetThread_ && targetThread_ == js::oom::GetThreadType() && !inUnsafeRegion_;
}
bool isThreadSimulating(Kind kind) const {
return kind_ == kind && isThreadSimulatingAny();
@ -319,25 +321,17 @@ struct MOZ_RAII JS_PUBLIC_DATA(AutoEnterOOMUnsafeRegion)
#if defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
AutoEnterOOMUnsafeRegion()
: oomEnabled_(oom::simulator.isThreadSimulatingAny() &&
oom::simulator.maxChecks() != UINT64_MAX),
oomAfter_(0)
: oomEnabled_(oom::simulator.isThreadSimulatingAny())
{
if (oomEnabled_) {
MOZ_ALWAYS_TRUE(owner_.compareExchange(nullptr, this));
oomAfter_ = (int64_t(oom::simulator.maxChecks()) -
int64_t(oom::simulator.counter()));
oom::simulator.setMaxChecks(UINT64_MAX);
oom::simulator.setInUnsafeRegion(true);
}
}
~AutoEnterOOMUnsafeRegion() {
if (oomEnabled_) {
MOZ_ASSERT(oom::simulator.maxChecks() == UINT64_MAX);
int64_t maxChecks = int64_t(oom::simulator.counter()) + oomAfter_;
MOZ_ASSERT(maxChecks >= 0,
"alloc count + oom limit exceeds range, your oom limit is probably too large");
oom::simulator.setMaxChecks(maxChecks);
oom::simulator.setInUnsafeRegion(false);
MOZ_ALWAYS_TRUE(owner_.compareExchange(this, nullptr));
}
}
@ -347,7 +341,6 @@ struct MOZ_RAII JS_PUBLIC_DATA(AutoEnterOOMUnsafeRegion)
static mozilla::Atomic<AutoEnterOOMUnsafeRegion*> owner_;
bool oomEnabled_;
int64_t oomAfter_;
#endif
};

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

@ -1,4 +1,7 @@
// |jit-test| skip-if: !('oomTest' in this)
// |jit-test| skip-if: !('oomTest' in this); --ion-offthread-compile=off
//
// Note: without --ion-offthread-compile=off this test takes a long time and
// may timeout on some platforms. See bug 1507721.
oomTest(() => import("module1.js"));
oomTest(() => import("cyclicImport1.js"));