mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out 2 changesets (bug 1122640) for jsapi test failures on a CLOSED TREE
Backed out changeset 52a98fafd551 (bug 1122640) Backed out changeset 8c11a58bf243 (bug 1122640)
This commit is contained in:
parent
ed7b76af68
commit
821a42f1e0
@ -8,7 +8,6 @@
|
||||
#include "gc/Nursery-inl.h"
|
||||
|
||||
#include "mozilla/IntegerPrintfMacros.h"
|
||||
#include "mozilla/Move.h"
|
||||
|
||||
#include "jscompartment.h"
|
||||
#include "jsgc.h"
|
||||
@ -37,19 +36,6 @@ using mozilla::ArrayLength;
|
||||
using mozilla::PodCopy;
|
||||
using mozilla::PodZero;
|
||||
|
||||
struct js::Nursery::FreeHugeSlotsTask : public GCParallelTask
|
||||
{
|
||||
explicit FreeHugeSlotsTask(FreeOp *fop) : fop_(fop) {}
|
||||
bool init() { return slots_.init(); }
|
||||
void transferSlotsToFree(HugeSlotsSet &slotsToFree);
|
||||
|
||||
private:
|
||||
FreeOp *fop_;
|
||||
HugeSlotsSet slots_;
|
||||
|
||||
virtual void run() MOZ_OVERRIDE;
|
||||
};
|
||||
|
||||
bool
|
||||
js::Nursery::init(uint32_t maxNurseryBytes)
|
||||
{
|
||||
@ -67,10 +53,6 @@ js::Nursery::init(uint32_t maxNurseryBytes)
|
||||
if (!heap)
|
||||
return false;
|
||||
|
||||
freeHugeSlotsTask = js_new<FreeHugeSlotsTask>(runtime()->defaultFreeOp());
|
||||
if (!freeHugeSlotsTask || !freeHugeSlotsTask->init())
|
||||
return false;
|
||||
|
||||
heapStart_ = uintptr_t(heap);
|
||||
heapEnd_ = heapStart_ + nurserySize();
|
||||
currentStart_ = start();
|
||||
@ -98,8 +80,6 @@ js::Nursery::~Nursery()
|
||||
{
|
||||
if (start())
|
||||
UnmapPages((void *)start(), nurserySize());
|
||||
|
||||
js_delete(freeHugeSlotsTask);
|
||||
}
|
||||
|
||||
void
|
||||
@ -983,48 +963,13 @@ js::Nursery::collect(JSRuntime *rt, JS::gcreason::Reason reason, ObjectGroupList
|
||||
#undef TIME_END
|
||||
#undef TIME_TOTAL
|
||||
|
||||
void
|
||||
js::Nursery::FreeHugeSlotsTask::transferSlotsToFree(HugeSlotsSet &slotsToFree)
|
||||
{
|
||||
// Transfer the contents of the source set to the task's slots_ member by
|
||||
// swapping the sets, which also clears the source.
|
||||
MOZ_ASSERT(!isRunning());
|
||||
MOZ_ASSERT(slots_.empty());
|
||||
mozilla::Swap(slots_, slotsToFree);
|
||||
}
|
||||
|
||||
void
|
||||
js::Nursery::FreeHugeSlotsTask::run()
|
||||
{
|
||||
for (HugeSlotsSet::Range r = slots_.all(); !r.empty(); r.popFront())
|
||||
fop_->free_(r.front());
|
||||
slots_.clear();
|
||||
}
|
||||
|
||||
void
|
||||
js::Nursery::freeHugeSlots()
|
||||
{
|
||||
if (hugeSlots.empty())
|
||||
return;
|
||||
|
||||
bool started;
|
||||
{
|
||||
AutoLockHelperThreadState lock;
|
||||
freeHugeSlotsTask->joinWithLockHeld();
|
||||
freeHugeSlotsTask->transferSlotsToFree(hugeSlots);
|
||||
started = freeHugeSlotsTask->startWithLockHeld();
|
||||
}
|
||||
|
||||
if (!started)
|
||||
freeHugeSlotsTask->runFromMainThread(runtime());
|
||||
|
||||
MOZ_ASSERT(hugeSlots.empty());
|
||||
}
|
||||
|
||||
void
|
||||
js::Nursery::waitBackgroundFreeEnd()
|
||||
{
|
||||
freeHugeSlotsTask->join();
|
||||
FreeOp *fop = runtime()->defaultFreeOp();
|
||||
for (HugeSlotsSet::Range r = hugeSlots.all(); !r.empty(); r.popFront())
|
||||
fop->free_(r.front());
|
||||
hugeSlots.clear();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -68,8 +68,7 @@ class Nursery
|
||||
numNurseryChunks_(0),
|
||||
finalizers_(nullptr),
|
||||
profileThreshold_(0),
|
||||
enableProfiling_(false),
|
||||
freeHugeSlotsTask(nullptr)
|
||||
enableProfiling_(false)
|
||||
{}
|
||||
~Nursery();
|
||||
|
||||
@ -142,8 +141,6 @@ class Nursery
|
||||
setForwardingPointer(oldData, newData, direct);
|
||||
}
|
||||
|
||||
void waitBackgroundFreeEnd();
|
||||
|
||||
size_t sizeOfHeapCommitted() const {
|
||||
return numActiveChunks_ * gc::ChunkSize;
|
||||
}
|
||||
@ -227,10 +224,6 @@ class Nursery
|
||||
typedef HashSet<HeapSlot *, PointerHasher<HeapSlot *, 3>, SystemAllocPolicy> HugeSlotsSet;
|
||||
HugeSlotsSet hugeSlots;
|
||||
|
||||
/* A task structure used to free the huge slots on a background thread. */
|
||||
struct FreeHugeSlotsTask;
|
||||
FreeHugeSlotsTask *freeHugeSlotsTask;
|
||||
|
||||
/*
|
||||
* During a collection most hoisted slot and element buffers indicate their
|
||||
* new location with a forwarding pointer at the base. This does not work
|
||||
|
@ -6347,9 +6347,6 @@ GCRuntime::onOutOfMallocMemory()
|
||||
// Stop allocating new chunks.
|
||||
allocTask.cancel(GCParallelTask::CancelAndWait);
|
||||
|
||||
// Wait for background free of nursery huge slots to finish.
|
||||
nursery.waitBackgroundFreeEnd();
|
||||
|
||||
AutoLockGC lock(rt);
|
||||
onOutOfMallocMemory(lock);
|
||||
}
|
||||
|
@ -998,7 +998,6 @@ class GCParallelTask
|
||||
|
||||
public:
|
||||
GCParallelTask() : state(NotStarted), duration_(0) {}
|
||||
virtual ~GCParallelTask();
|
||||
|
||||
// Time spent in the most recent invocation of this task.
|
||||
int64_t duration() const { return duration_; }
|
||||
|
@ -738,11 +738,6 @@ GlobalHelperThreadState::canStartGCParallelTask()
|
||||
return !gcParallelWorklist().empty();
|
||||
}
|
||||
|
||||
js::GCParallelTask::~GCParallelTask()
|
||||
{
|
||||
join();
|
||||
}
|
||||
|
||||
bool
|
||||
js::GCParallelTask::startWithLockHeld()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user