Bug 1019304 - Part 3: Mark rematerialized frames inside ForkJoin during ForkJoin minor collection. (r=lth)

This commit is contained in:
Shu-yu Guo 2014-06-20 11:08:14 -07:00
Родитель ffdeecbf4b
Коммит c223d57d83
6 изменённых файлов: 34 добавлений и 17 удалений

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

@ -15,6 +15,7 @@
#include "gc/Heap.h"
#include "jit/IonFrames.h"
#include "jit/RematerializedFrame.h"
#include "vm/ArrayObject.h"
#include "vm/ForkJoin.h"
#include "vm/TypedArrayObject.h"
@ -390,6 +391,7 @@ ForkJoinNursery::forwardFromRoots(ForkJoinNurseryCollectionTracer *trc)
forwardFromUpdatable(trc);
forwardFromStack(trc);
forwardFromTenured(trc);
forwardFromRematerializedFrames(trc);
}
void
@ -444,6 +446,13 @@ ForkJoinNursery::forwardFromTenured(ForkJoinNurseryCollectionTracer *trc)
}
}
void
ForkJoinNursery::forwardFromRematerializedFrames(ForkJoinNurseryCollectionTracer *trc)
{
if (cx_->bailoutRecord->hasFrames())
jit::RematerializedFrame::MarkInVector(trc, cx_->bailoutRecord->frames());
}
/*static*/ void
ForkJoinNursery::forwardBufferPointer(JSTracer *trc, HeapSlot **pSlotsElems)
{

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

@ -236,6 +236,7 @@ class ForkJoinNursery
void forwardFromUpdatable(ForkJoinNurseryCollectionTracer *trc);
void forwardFromStack(ForkJoinNurseryCollectionTracer *trc);
void forwardFromTenured(ForkJoinNurseryCollectionTracer *trc);
void forwardFromRematerializedFrames(ForkJoinNurseryCollectionTracer *trc);
void collectToFixedPoint(ForkJoinNurseryCollectionTracer *trc);
void freeFromspace();
void computeNurserySizeAfterGC(size_t live, const char **msg);

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

@ -91,6 +91,13 @@ RematerializedFrame::FreeInVector(Vector<RematerializedFrame *> &frames)
frames.clear();
}
/* static */ void
RematerializedFrame::MarkInVector(JSTracer *trc, Vector<RematerializedFrame *> &frames)
{
for (size_t i = 0; i < frames.length(); i++)
frames[i]->mark(trc);
}
CallObject &
RematerializedFrame::callObj() const
{

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

@ -61,6 +61,9 @@ class RematerializedFrame
// destructor. Also clears the vector.
static void FreeInVector(Vector<RematerializedFrame *> &frames);
// Mark a vector of RematerializedFrames.
static void MarkInVector(JSTracer *trc, Vector<RematerializedFrame *> &frames);
bool prevUpToDate() const {
return prevUpToDate_;
}

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

@ -305,7 +305,7 @@ class ForkJoinOperation
HandleObject updatable_;
uint16_t sliceStart_;
uint16_t sliceEnd_;
Vector<ParallelBailoutRecord, 16> bailoutRecords_;
Vector<ParallelBailoutRecord> bailoutRecords_;
AutoScriptVector worklist_;
Vector<WorklistData, 16> worklistData_;
ForkJoinMode mode_;
@ -339,14 +339,14 @@ class ForkJoinShared : public ParallelJob, public Monitor
/////////////////////////////////////////////////////////////////////////
// Constant fields
JSContext *const cx_; // Current context
ThreadPool *const threadPool_; // The thread pool
HandleFunction fun_; // The JavaScript function to execute
HandleObject updatable_; // Pre-existing object that might be updated
uint16_t sliceStart_; // The starting slice id.
uint16_t sliceEnd_; // The ending slice id + 1.
PRLock *cxLock_; // Locks cx_ for parallel VM calls
ParallelBailoutRecord *const records_; // Bailout records for each worker
JSContext *const cx_; // Current context
ThreadPool *const threadPool_; // The thread pool
HandleFunction fun_; // The JavaScript function to execute
HandleObject updatable_; // Pre-existing object that might be updated
uint16_t sliceStart_; // The starting slice id.
uint16_t sliceEnd_; // The ending slice id + 1.
PRLock *cxLock_; // Locks cx_ for parallel VM calls
Vector<ParallelBailoutRecord> &records_; // Bailout records for each worker
/////////////////////////////////////////////////////////////////////////
// Per-thread arenas
@ -382,7 +382,7 @@ class ForkJoinShared : public ParallelJob, public Monitor
HandleObject updatable,
uint16_t sliceStart,
uint16_t sliceEnd,
ParallelBailoutRecord *records);
Vector<ParallelBailoutRecord> &records);
~ForkJoinShared();
bool init();
@ -1334,7 +1334,7 @@ ForkJoinOperation::parallelExecution(ExecutionStatus *status)
ForkJoinActivation activation(cx_);
ThreadPool *threadPool = &cx_->runtime()->threadPool;
ForkJoinShared shared(cx_, threadPool, fun_, updatable_, sliceStart_, sliceEnd_,
&bailoutRecords_[0]);
bailoutRecords_);
if (!shared.init()) {
*status = ExecutionFatal;
return RedLight;
@ -1447,7 +1447,7 @@ ForkJoinShared::ForkJoinShared(JSContext *cx,
HandleObject updatable,
uint16_t sliceStart,
uint16_t sliceEnd,
ParallelBailoutRecord *records)
Vector<ParallelBailoutRecord> &records)
: cx_(cx),
threadPool_(threadPool),
fun_(fun),

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

@ -1671,11 +1671,8 @@ jit::JitActivation::markRematerializedFrames(JSTracer *trc)
{
if (!rematerializedFrames_)
return;
for (RematerializedFrameTable::Enum e(*rematerializedFrames_); !e.empty(); e.popFront()) {
RematerializedFrameVector &frames = e.front().value();
for (size_t i = 0; i < frames.length(); i++)
frames[i]->mark(trc);
}
for (RematerializedFrameTable::Enum e(*rematerializedFrames_); !e.empty(); e.popFront())
RematerializedFrame::MarkInVector(trc, e.front().value());
}
#endif // JS_ION