Backout 9a6b434b34be for mochitest-2 failures on a CLOSED TREE.

--HG--
extra : rebase_source : 84bb2205e9e9df143d3ba0b21127dd2030957c7d
This commit is contained in:
Terrence Cole 2014-05-01 12:52:22 -07:00
parent d6c96609e3
commit 6f4928bf7f
15 changed files with 112 additions and 153 deletions

View File

@ -41,10 +41,10 @@ const size_t CellSize = size_t(1) << CellShift;
const size_t CellMask = CellSize - 1;
/* These are magic constants derived from actual offsets in gc/Heap.h. */
const size_t ChunkMarkBitmapOffset = 1032352;
const size_t ChunkMarkBitmapOffset = 1032360;
const size_t ChunkMarkBitmapBits = 129024;
const size_t ChunkRuntimeOffset = ChunkSize - sizeof(void*);
const size_t ChunkLocationOffset = ChunkSize - 2 * sizeof(void*) - sizeof(uint64_t);
const size_t ChunkLocationOffset = ChunkSize - sizeof(void*) - sizeof(uintptr_t);
/*
* Live objects are marked black. How many other additional colors are available

View File

@ -42,12 +42,12 @@ HeapSlot::preconditionForSet(Zone *zone, JSObject *owner, Kind kind, uint32_t sl
return ok && owner->zone() == zone;
}
bool
HeapSlot::preconditionForWriteBarrierPost(JSObject *obj, Kind kind, uint32_t slot, Value target) const
void
HeapSlot::preconditionForWriteBarrierPost(JSObject *obj, Kind kind, uint32_t slot, Value target)
{
return kind == Slot
? obj->getSlotAddressUnchecked(slot)->get() == target
: static_cast<HeapSlot *>(obj->getDenseElements() + slot)->get() == target;
JS_ASSERT_IF(kind == Slot, obj->getSlotAddressUnchecked(slot)->get() == target);
JS_ASSERT_IF(kind == Element,
static_cast<HeapSlot *>(obj->getDenseElements() + slot)->get() == target);
}
bool

View File

@ -233,9 +233,9 @@ class BarrieredCell : public gc::Cell
#endif
}
static void writeBarrierPost(T *thing, void *cellp) {}
static void writeBarrierPostRelocate(T *thing, void *cellp) {}
static void writeBarrierPostRemove(T *thing, void *cellp) {}
static void writeBarrierPost(T *thing, void *addr) {}
static void writeBarrierPostRelocate(T *thing, void *addr) {}
static void writeBarrierPostRemove(T *thing, void *addr) {}
};
} // namespace gc
@ -339,7 +339,6 @@ struct InternalGCMethods<Value>
preBarrier(ZoneOfValueFromAnyThread(v), v);
#endif
}
static void preBarrier(Zone *zone, Value v) {
#ifdef JSGC_INCREMENTAL
if (v.isString() && StringIsPermanentAtom(v.toString()))
@ -353,34 +352,24 @@ struct InternalGCMethods<Value>
}
#endif
}
static void postBarrier(Value *vp) {
#ifdef JSGC_GENERATIONAL
if (vp->isObject()) {
gc::StoreBuffer *sb = reinterpret_cast<gc::Cell *>(&vp->toObject())->storeBuffer();
if (sb)
sb->putValueFromAnyThread(vp);
}
if (vp->isObject())
shadowRuntimeFromAnyThread(*vp)->gcStoreBufferPtr()->putValue(vp);
#endif
}
static void postBarrierRelocate(Value *vp) {
#ifdef JSGC_GENERATIONAL
if (vp->isObject()) {
gc::StoreBuffer *sb = reinterpret_cast<gc::Cell *>(&vp->toObject())->storeBuffer();
if (sb)
sb->putRelocatableValueFromAnyThread(vp);
}
shadowRuntimeFromAnyThread(*vp)->gcStoreBufferPtr()->putRelocatableValue(vp);
#endif
}
static void postBarrierRemove(Value *vp) {
#ifdef JSGC_GENERATIONAL
JS_ASSERT(vp);
JS_ASSERT(vp->isMarkable());
JSRuntime *rt = static_cast<js::gc::Cell *>(vp->toGCThing())->runtimeFromAnyThread();
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
shadowRuntime->gcStoreBufferPtr()->removeRelocatableValueFromAnyThread(vp);
shadowRuntime->gcStoreBufferPtr()->removeRelocatableValue(vp);
#endif
}
@ -862,43 +851,64 @@ class HeapSlot : public BarrieredBase<Value>
post(owner, kind, slot, v);
}
void init(JSRuntime *rt, JSObject *owner, Kind kind, uint32_t slot, const Value &v) {
value = v;
post(rt, owner, kind, slot, v);
}
#ifdef DEBUG
bool preconditionForSet(JSObject *owner, Kind kind, uint32_t slot);
bool preconditionForSet(Zone *zone, JSObject *owner, Kind kind, uint32_t slot);
bool preconditionForWriteBarrierPost(JSObject *obj, Kind kind, uint32_t slot, Value target) const;
static void preconditionForWriteBarrierPost(JSObject *obj, Kind kind, uint32_t slot,
Value target);
#endif
void set(JSObject *owner, Kind kind, uint32_t slot, const Value &v) {
JS_ASSERT(preconditionForSet(owner, kind, slot));
JS_ASSERT(!IsPoisonedValue(v));
pre();
JS_ASSERT(!IsPoisonedValue(v));
value = v;
post(owner, kind, slot, v);
}
void set(Zone *zone, JSObject *owner, Kind kind, uint32_t slot, const Value &v) {
JS_ASSERT(preconditionForSet(zone, owner, kind, slot));
JS_ASSERT(!IsPoisonedValue(v));
JS::shadow::Zone *shadowZone = JS::shadow::Zone::asShadowZone(zone);
pre(zone);
JS_ASSERT(!IsPoisonedValue(v));
value = v;
post(owner, kind, slot, v);
post(shadowZone->runtimeFromAnyThread(), owner, kind, slot, v);
}
/* For users who need to manually barrier the raw types. */
static void writeBarrierPost(JSObject *owner, Kind kind, uint32_t slot, const Value &target) {
reinterpret_cast<HeapSlot *>(const_cast<Value *>(&target))->post(owner, kind, slot, target);
static void writeBarrierPost(JSObject *obj, Kind kind, uint32_t slot, const Value &target)
{
#ifdef JSGC_GENERATIONAL
js::gc::Cell *cell = reinterpret_cast<js::gc::Cell*>(obj);
writeBarrierPost(cell->runtimeFromAnyThread(), obj, kind, slot, target);
#endif
}
static void writeBarrierPost(JSRuntime *rt, JSObject *obj, Kind kind, uint32_t slot,
const Value &target)
{
#ifdef DEBUG
preconditionForWriteBarrierPost(obj, kind, slot, target);
#endif
#ifdef JSGC_GENERATIONAL
if (target.isObject()) {
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
shadowRuntime->gcStoreBufferPtr()->putSlot(obj, kind, slot, 1);
}
#endif
}
private:
void post(JSObject *owner, Kind kind, uint32_t slot, const Value &target) {
JS_ASSERT(preconditionForWriteBarrierPost(owner, kind, slot, target));
#ifdef JSGC_GENERATIONAL
if (this->value.isObject()) {
gc::Cell *cell = reinterpret_cast<gc::Cell *>(&this->value.toObject());
if (cell->storeBuffer())
cell->storeBuffer()->putSlotFromAnyThread(owner, kind, slot, 1);
}
#endif
void post(JSObject *owner, Kind kind, uint32_t slot, Value target) {
HeapSlot::writeBarrierPost(owner, kind, slot, target);
}
void post(JSRuntime *rt, JSObject *owner, Kind kind, uint32_t slot, Value target) {
HeapSlot::writeBarrierPost(rt, owner, kind, slot, target);
}
};

View File

@ -111,8 +111,6 @@ struct Cell
inline JSRuntime *runtimeFromAnyThread() const;
inline JS::shadow::Runtime *shadowRuntimeFromAnyThread() const;
inline StoreBuffer *storeBuffer() const;
#ifdef DEBUG
inline bool isAligned() const;
inline bool isTenured() const;
@ -610,16 +608,15 @@ struct ChunkTrailer
{
/* The index the chunk in the nursery, or LocationTenuredHeap. */
uint32_t location;
uint32_t padding;
/* The store buffer for writes to things in this chunk or nullptr. */
StoreBuffer *storeBuffer;
#if JS_BITS_PER_WORD == 64
uint32_t padding;
#endif
JSRuntime *runtime;
};
static_assert(sizeof(ChunkTrailer) == 2 * sizeof(uintptr_t) + sizeof(uint64_t),
"ChunkTrailer size is incorrect.");
static_assert(sizeof(ChunkTrailer) == 2 * sizeof(uintptr_t), "ChunkTrailer size is incorrect.");
/* The chunk header (located at the end of the chunk to preserve arena alignment). */
struct ChunkInfo
@ -868,13 +865,9 @@ static_assert(sizeof(Chunk) == ChunkSize,
static_assert(js::gc::ChunkMarkBitmapOffset == offsetof(Chunk, bitmap),
"The hardcoded API bitmap offset must match the actual offset.");
static_assert(js::gc::ChunkRuntimeOffset == offsetof(Chunk, info) +
offsetof(ChunkInfo, trailer) +
offsetof(ChunkTrailer, runtime),
offsetof(ChunkInfo, trailer) +
offsetof(ChunkTrailer, runtime),
"The hardcoded API runtime offset must match the actual offset.");
static_assert(js::gc::ChunkLocationOffset == offsetof(Chunk, info) +
offsetof(ChunkInfo, trailer) +
offsetof(ChunkTrailer, location),
"The hardcoded API location offset must match the actual offset.");
inline uintptr_t
ArenaHeader::address() const
@ -1104,12 +1097,6 @@ Cell::chunk() const
return reinterpret_cast<Chunk *>(addr);
}
inline StoreBuffer *
Cell::storeBuffer() const
{
return chunk()->info.trailer.storeBuffer;
}
inline bool
InFreeList(ArenaHeader *aheader, void *thing)
{

View File

@ -203,7 +203,6 @@ class Nursery
MOZ_ALWAYS_INLINE void initChunk(int chunkno) {
NurseryChunkLayout &c = chunk(chunkno);
c.trailer.storeBuffer = JS::shadow::Runtime::asShadowRuntime(runtime())->gcStoreBufferPtr();
c.trailer.location = gc::ChunkLocationNursery;
c.trailer.runtime = runtime();
}

View File

@ -335,45 +335,39 @@ StoreBuffer::addSizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf, JS::GCSi
JS_PUBLIC_API(void)
JS::HeapCellPostBarrier(js::gc::Cell **cellp)
{
JS_ASSERT(cellp);
JS_ASSERT(*cellp);
StoreBuffer *storeBuffer = (*cellp)->storeBuffer();
if (storeBuffer)
storeBuffer->putRelocatableCellFromAnyThread(cellp);
JSRuntime *runtime = (*cellp)->runtimeFromMainThread();
runtime->gc.storeBuffer.putRelocatableCell(cellp);
}
JS_PUBLIC_API(void)
JS::HeapCellRelocate(js::gc::Cell **cellp)
{
/* Called with old contents of *cellp before overwriting. */
JS_ASSERT(cellp);
/* Called with old contents of *pp before overwriting. */
JS_ASSERT(*cellp);
JSRuntime *runtime = (*cellp)->runtimeFromMainThread();
runtime->gc.storeBuffer.removeRelocatableCellFromAnyThread(cellp);
runtime->gc.storeBuffer.removeRelocatableCell(cellp);
}
JS_PUBLIC_API(void)
JS::HeapValuePostBarrier(JS::Value *valuep)
{
JS_ASSERT(valuep);
JS_ASSERT(valuep->isMarkable());
if (valuep->isObject()) {
StoreBuffer *storeBuffer = valuep->toObject().storeBuffer();
if (storeBuffer)
storeBuffer->putRelocatableValueFromAnyThread(valuep);
}
if (valuep->isString() && StringIsPermanentAtom(valuep->toString()))
return;
JSRuntime *runtime = static_cast<js::gc::Cell *>(valuep->toGCThing())->runtimeFromMainThread();
runtime->gc.storeBuffer.putRelocatableValue(valuep);
}
JS_PUBLIC_API(void)
JS::HeapValueRelocate(JS::Value *valuep)
{
/* Called with old contents of *valuep before overwriting. */
JS_ASSERT(valuep);
JS_ASSERT(valuep->isMarkable());
if (valuep->isString() && valuep->toString()->isPermanentAtom())
if (valuep->isString() && StringIsPermanentAtom(valuep->toString()))
return;
JSRuntime *runtime = static_cast<js::gc::Cell *>(valuep->toGCThing())->runtimeFromMainThread();
runtime->gc.storeBuffer.removeRelocatableValueFromAnyThread(valuep);
runtime->gc.storeBuffer.removeRelocatableValue(valuep);
}
template class StoreBuffer::MonoTypeBuffer<StoreBuffer::ValueEdge>;

View File

@ -244,8 +244,7 @@ class StoreBuffer
bool operator!=(const CellPtrEdge &other) const { return edge != other.edge; }
bool maybeInRememberedSet(const Nursery &nursery) const {
JS_ASSERT(nursery.isInside(*edge));
return !nursery.isInside(edge);
return !nursery.isInside(edge) && nursery.isInside(*edge);
}
void mark(JSTracer *trc);
@ -268,8 +267,7 @@ class StoreBuffer
void *deref() const { return edge->isGCThing() ? edge->toGCThing() : nullptr; }
bool maybeInRememberedSet(const Nursery &nursery) const {
JS_ASSERT(nursery.isInside(deref()));
return !nursery.isInside(edge);
return !nursery.isInside(edge) && nursery.isInside(deref());
}
void mark(JSTracer *trc);
@ -364,7 +362,8 @@ class StoreBuffer
void *data;
};
bool isOkayToUseBuffer() const {
template <typename Edge>
bool isOkayToUseBuffer(const Edge &edge) const {
/*
* Disabled store buffers may not have a valid state; e.g. when stored
* inline in the ChunkTrailer.
@ -383,8 +382,8 @@ class StoreBuffer
}
template <typename Buffer, typename Edge>
void putFromAnyThread(Buffer &buffer, const Edge &edge) {
if (!isOkayToUseBuffer())
void put(Buffer &buffer, const Edge &edge) {
if (!isOkayToUseBuffer(edge))
return;
mozilla::ReentrancyGuard g(*this);
if (edge.maybeInRememberedSet(nursery_))
@ -392,8 +391,8 @@ class StoreBuffer
}
template <typename Buffer, typename Edge>
void unputFromAnyThread(Buffer &buffer, const Edge &edge) {
if (!isOkayToUseBuffer())
void unput(Buffer &buffer, const Edge &edge) {
if (!isOkayToUseBuffer(edge))
return;
mozilla::ReentrancyGuard g(*this);
buffer.unput(this, edge);
@ -433,38 +432,30 @@ class StoreBuffer
bool isAboutToOverflow() const { return aboutToOverflow_; }
/* Insert a single edge into the buffer/remembered set. */
void putValueFromAnyThread(JS::Value *valuep) { putFromAnyThread(bufferVal, ValueEdge(valuep)); }
void putCellFromAnyThread(Cell **cellp) { putFromAnyThread(bufferCell, CellPtrEdge(cellp)); }
void putSlotFromAnyThread(JSObject *obj, int kind, int32_t start, int32_t count) {
putFromAnyThread(bufferSlot, SlotsEdge(obj, kind, start, count));
void putValue(JS::Value *valuep) { put(bufferVal, ValueEdge(valuep)); }
void putCell(Cell **cellp) { put(bufferCell, CellPtrEdge(cellp)); }
void putSlot(JSObject *obj, int kind, int32_t start, int32_t count) {
put(bufferSlot, SlotsEdge(obj, kind, start, count));
}
void putWholeCell(Cell *cell) {
JS_ASSERT(cell->isTenured());
putFromAnyThread(bufferWholeCell, WholeCellEdges(cell));
put(bufferWholeCell, WholeCellEdges(cell));
}
/* Insert or update a single edge in the Relocatable buffer. */
void putRelocatableValueFromAnyThread(JS::Value *valuep) {
putFromAnyThread(bufferRelocVal, ValueEdge(valuep));
}
void removeRelocatableValueFromAnyThread(JS::Value *valuep) {
unputFromAnyThread(bufferRelocVal, ValueEdge(valuep));
}
void putRelocatableCellFromAnyThread(Cell **cellp) {
putFromAnyThread(bufferRelocCell, CellPtrEdge(cellp));
}
void removeRelocatableCellFromAnyThread(Cell **cellp) {
unputFromAnyThread(bufferRelocCell, CellPtrEdge(cellp));
}
void putRelocatableValue(JS::Value *valuep) { put(bufferRelocVal, ValueEdge(valuep)); }
void putRelocatableCell(Cell **cellp) { put(bufferRelocCell, CellPtrEdge(cellp)); }
void removeRelocatableValue(JS::Value *valuep) { unput(bufferRelocVal, ValueEdge(valuep)); }
void removeRelocatableCell(Cell **cellp) { unput(bufferRelocCell, CellPtrEdge(cellp)); }
/* Insert an entry into the generic buffer. */
template <typename T>
void putGeneric(const T &t) { putFromAnyThread(bufferGeneric, t);}
void putGeneric(const T &t) { put(bufferGeneric, t);}
/* Insert or update a callback entry. */
template <typename Key>
void putCallback(void (*callback)(JSTracer *trc, Key *key, void *data), Key *key, void *data) {
putFromAnyThread(bufferGeneric, CallbackRef<Key>(callback, key, data));
put(bufferGeneric, CallbackRef<Key>(callback, key, data));
}
/* Methods to mark the source of all edges in the store buffer. */

View File

@ -789,7 +789,6 @@ Chunk::init(JSRuntime *rt)
/* Initialize the chunk info. */
info.age = 0;
info.trailer.storeBuffer = nullptr;
info.trailer.location = ChunkLocationTenuredHeap;
info.trailer.runtime = rt;

View File

@ -2293,8 +2293,8 @@ JSObject::TradeGuts(JSContext *cx, JSObject *a, JSObject *b, TradeGutsReserved &
* below, in common with the other case.
*/
for (size_t i = 0; i < a->numFixedSlots(); ++i) {
HeapSlot::writeBarrierPost(a, HeapSlot::Slot, i, a->getSlot(i));
HeapSlot::writeBarrierPost(b, HeapSlot::Slot, i, b->getSlot(i));
HeapSlot::writeBarrierPost(cx->runtime(), a, HeapSlot::Slot, i, a->getSlot(i));
HeapSlot::writeBarrierPost(cx->runtime(), b, HeapSlot::Slot, i, b->getSlot(i));
}
#endif
} else {

View File

@ -187,7 +187,7 @@ DenseRangeWriteBarrierPost(JSRuntime *rt, JSObject *obj, uint32_t start, uint32_
#ifdef JSGC_GENERATIONAL
if (count > 0) {
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
shadowRuntime->gcStoreBufferPtr()->putSlotFromAnyThread(obj, HeapSlot::Element, start, count);
shadowRuntime->gcStoreBufferPtr()->putSlot(obj, HeapSlot::Element, start, count);
}
#endif
}

View File

@ -223,13 +223,12 @@ JSObject::ensureDenseInitializedLengthNoPackedCheck(js::ThreadSafeContext *cx, u
uint32_t &initlen = getElementsHeader()->initializedLength;
if (initlen < index + extra) {
JSRuntime *rt = runtimeFromAnyThread();
size_t offset = initlen;
for (js::HeapSlot *sp = elements + initlen;
sp != elements + (index + extra);
sp++, offset++)
{
sp->init(this, js::HeapSlot::Element, offset, js::MagicValue(JS_ELEMENTS_HOLE));
}
sp->init(rt, this, js::HeapSlot::Element, offset, js::MagicValue(JS_ELEMENTS_HOLE));
initlen = index + extra;
}
}

View File

@ -264,22 +264,24 @@ js::ObjectImpl::initializeSlotRange(uint32_t start, uint32_t length)
HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
getSlotRangeUnchecked(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
JSRuntime *rt = runtimeFromAnyThread();
uint32_t offset = start;
for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
sp->init(this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
sp->init(this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
}
void
js::ObjectImpl::initSlotRange(uint32_t start, const Value *vector, uint32_t length)
{
JSRuntime *rt = runtimeFromAnyThread();
HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
sp->init(this->asObjectPtr(), HeapSlot::Slot, start++, *vector++);
sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, start++, *vector++);
for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
sp->init(this->asObjectPtr(), HeapSlot::Slot, start++, *vector++);
sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, start++, *vector++);
}
void

View File

@ -840,12 +840,7 @@ class ObjectImpl : public gc::BarrieredCell<ObjectImpl>
void privateWriteBarrierPost(void **pprivate) {
#ifdef JSGC_GENERATIONAL
js::gc::Cell **cellp = reinterpret_cast<js::gc::Cell **>(pprivate);
JS_ASSERT(cellp);
JS_ASSERT(*cellp);
js::gc::StoreBuffer *storeBuffer = (*cellp)->storeBuffer();
if (storeBuffer)
storeBuffer->putCellFromAnyThread(cellp);
shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->putCell(reinterpret_cast<js::gc::Cell **>(pprivate));
#endif
}
@ -949,43 +944,30 @@ BarrieredCell<ObjectImpl>::isNullLike(ObjectImpl *obj)
template<>
/* static */ inline void
BarrieredCell<ObjectImpl>::writeBarrierPost(ObjectImpl *obj, void *cellp)
BarrieredCell<ObjectImpl>::writeBarrierPost(ObjectImpl *obj, void *addr)
{
JS_ASSERT(cellp);
#ifdef JSGC_GENERATIONAL
if (IsNullTaggedPointer(obj))
return;
JS_ASSERT(obj == *static_cast<ObjectImpl **>(cellp));
gc::StoreBuffer *storeBuffer = obj->storeBuffer();
if (storeBuffer)
storeBuffer->putCellFromAnyThread(static_cast<Cell **>(cellp));
obj->shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->putCell((Cell **)addr);
#endif
}
template<>
/* static */ inline void
BarrieredCell<ObjectImpl>::writeBarrierPostRelocate(ObjectImpl *obj, void *cellp)
BarrieredCell<ObjectImpl>::writeBarrierPostRelocate(ObjectImpl *obj, void *addr)
{
JS_ASSERT(cellp);
JS_ASSERT(obj);
JS_ASSERT(obj == *static_cast<ObjectImpl **>(cellp));
#ifdef JSGC_GENERATIONAL
gc::StoreBuffer *storeBuffer = obj->storeBuffer();
if (storeBuffer)
storeBuffer->putRelocatableCellFromAnyThread(static_cast<Cell **>(cellp));
obj->shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->putRelocatableCell((Cell **)addr);
#endif
}
template<>
/* static */ inline void
BarrieredCell<ObjectImpl>::writeBarrierPostRemove(ObjectImpl *obj, void *cellp)
BarrieredCell<ObjectImpl>::writeBarrierPostRemove(ObjectImpl *obj, void *addr)
{
JS_ASSERT(cellp);
JS_ASSERT(obj);
JS_ASSERT(obj == *static_cast<ObjectImpl **>(cellp));
#ifdef JSGC_GENERATIONAL
obj->shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->removeRelocatableCellFromAnyThread(
static_cast<Cell **>(cellp));
obj->shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->removeRelocatableCell((Cell **)addr);
#endif
}

View File

@ -525,12 +525,8 @@ static inline void
GetterSetterWriteBarrierPost(JSRuntime *rt, JSObject **objp)
{
#ifdef JSGC_GENERATIONAL
JS_ASSERT(objp);
JS_ASSERT(*objp);
gc::Cell **cellp = reinterpret_cast<gc::Cell **>(objp);
gc::StoreBuffer *storeBuffer = (*cellp)->storeBuffer();
if (storeBuffer)
storeBuffer->putRelocatableCellFromAnyThread(cellp);
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
shadowRuntime->gcStoreBufferPtr()->putRelocatableCell(reinterpret_cast<gc::Cell **>(objp));
#endif
}
@ -539,7 +535,7 @@ GetterSetterWriteBarrierPostRemove(JSRuntime *rt, JSObject **objp)
{
#ifdef JSGC_GENERATIONAL
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
shadowRuntime->gcStoreBufferPtr()->removeRelocatableCellFromAnyThread(reinterpret_cast<gc::Cell **>(objp));
shadowRuntime->gcStoreBufferPtr()->removeRelocatableCell(reinterpret_cast<gc::Cell **>(objp));
#endif
}

View File

@ -139,15 +139,15 @@ InterpreterFrame::writeBarrierPost()
{
/* This needs to follow the same rules as in InterpreterFrame::mark. */
if (scopeChain_)
JSObject::writeBarrierPost(scopeChain_, &scopeChain_);
JSObject::writeBarrierPost(scopeChain_, (void *)&scopeChain_);
if (flags_ & HAS_ARGS_OBJ)
JSObject::writeBarrierPost(argsObj_, &argsObj_);
JSObject::writeBarrierPost(argsObj_, (void *)&argsObj_);
if (isFunctionFrame()) {
JSFunction::writeBarrierPost(exec.fun, &exec.fun);
JSFunction::writeBarrierPost(exec.fun, (void *)&exec.fun);
if (isEvalFrame())
JSScript::writeBarrierPost(u.evalScript, &u.evalScript);
JSScript::writeBarrierPost(u.evalScript, (void *)&u.evalScript);
} else {
JSScript::writeBarrierPost(exec.script, &exec.script);
JSScript::writeBarrierPost(exec.script, (void *)&exec.script);
}
if (hasReturnValue())
HeapValue::writeBarrierPost(rval_, &rval_);