From a49e312add8af134f32e0c65a95d6963d7773598 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Mon, 18 Mar 2013 18:24:25 -0700 Subject: [PATCH] Backout 49ca6a3ef0b6 (bug 850922), 1ff4af81172a (bug 849453), 5e0347b9a4e4:085337fa9658 (bug 841059) and 88942e6ce28d (bug 850749) for busting the build CLOSED TREE --- js/src/gc/Barrier-inl.h | 11 +++++++---- js/src/gc/Heap.h | 8 ++++---- js/src/gc/Marking.cpp | 8 ++++---- js/src/gc/Verifier.cpp | 13 +++++++------ js/src/gc/Zone.cpp | 2 +- js/src/gc/Zone.h | 2 +- js/src/ion/IonCode.h | 1 - js/src/jsapi-tests/testBug604087.cpp | 2 +- js/src/jscntxt.cpp | 2 +- js/src/jscntxtinlines.h | 2 +- js/src/jsfriendapi.cpp | 4 +--- js/src/jsfun.h | 11 +---------- js/src/jsgc.cpp | 16 ++++++++-------- js/src/jsgcinlines.h | 2 +- js/src/jsinfer.h | 2 -- js/src/jsobjinlines.h | 6 +++--- js/src/jsproxy.h | 2 +- js/src/jsscript.h | 2 -- js/src/jswrapper.cpp | 10 ++++------ js/src/jswrapper.h | 2 +- js/src/vm/ObjectImpl-inl.h | 15 --------------- js/src/vm/ObjectImpl.cpp | 27 --------------------------- js/src/vm/ObjectImpl.h | 3 --- js/src/vm/Shape-inl.h | 6 ++---- js/src/vm/Shape.h | 3 --- js/src/vm/String.h | 3 --- 26 files changed, 49 insertions(+), 116 deletions(-) diff --git a/js/src/gc/Barrier-inl.h b/js/src/gc/Barrier-inl.h index 21f7822be463..c64823f19ae0 100644 --- a/js/src/gc/Barrier-inl.h +++ b/js/src/gc/Barrier-inl.h @@ -71,8 +71,10 @@ inline void EncapsulatedValue::writeBarrierPre(const Value &value) { #ifdef JSGC_INCREMENTAL - if (value.isMarkable()) - writeBarrierPre(ZoneOfValue(value), value); + if (value.isMarkable()) { + js::gc::Cell *cell = (js::gc::Cell *)value.toGCThing(); + writeBarrierPre(cell->zone(), value); + } #endif } @@ -170,8 +172,9 @@ HeapValue::set(Zone *zone, const Value &v) { #ifdef DEBUG if (value.isMarkable()) { - JS_ASSERT(ZoneOfValue(value) == zone || - ZoneOfValue(value) == zone->rt->atomsCompartment->zone()); + js::gc::Cell *cell = (js::gc::Cell *)value.toGCThing(); + JS_ASSERT(cell->zone() == zone || + cell->zone() == zone->rt->atomsCompartment->zone()); } #endif diff --git a/js/src/gc/Heap.h b/js/src/gc/Heap.h index d62194dd495b..b81a0d422774 100644 --- a/js/src/gc/Heap.h +++ b/js/src/gc/Heap.h @@ -85,13 +85,13 @@ static const size_t MAX_BACKGROUND_FINALIZE_KINDS = FINALIZE_LIMIT - FINALIZE_OB struct Cell { inline ArenaHeader *arenaHeader() const; - inline AllocKind tenuredGetAllocKind() const; + inline AllocKind getAllocKind() const; MOZ_ALWAYS_INLINE bool isMarked(uint32_t color = BLACK) const; MOZ_ALWAYS_INLINE bool markIfUnmarked(uint32_t color = BLACK) const; MOZ_ALWAYS_INLINE void unmark(uint32_t color) const; inline JSRuntime *runtime() const; - inline Zone *tenuredZone() const; + inline Zone *zone() const; #ifdef DEBUG inline bool isAligned() const; @@ -950,7 +950,7 @@ Cell::runtime() const } AllocKind -Cell::tenuredGetAllocKind() const +Cell::getAllocKind() const { return arenaHeader()->getAllocKind(); } @@ -981,7 +981,7 @@ Cell::unmark(uint32_t color) const } Zone * -Cell::tenuredZone() const +Cell::zone() const { JS_ASSERT(isTenured()); return arenaHeader()->zone; diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index e023050f8ae4..a8f47b631000 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -251,7 +251,7 @@ IsMarked(T **thingp) { JS_ASSERT(thingp); JS_ASSERT(*thingp); - Zone *zone = (*thingp)->tenuredZone(); + Zone *zone = (*thingp)->zone(); if (!zone->isCollecting() || zone->isGCFinished()) return true; return (*thingp)->isMarked(); @@ -263,7 +263,7 @@ IsAboutToBeFinalized(T **thingp) { JS_ASSERT(thingp); JS_ASSERT(*thingp); - if (!(*thingp)->tenuredZone()->isGCSweeping()) + if (!(*thingp)->zone()->isGCSweeping()) return false; return !(*thingp)->isMarked(); } @@ -629,7 +629,7 @@ ShouldMarkCrossCompartment(JSTracer *trc, RawObject src, Cell *cell) if (!IS_GC_MARKING_TRACER(trc)) return true; - JS::Zone *zone = cell->tenuredZone(); + JS::Zone *zone = cell->zone(); uint32_t color = AsGCMarker(trc)->getMarkColor(); JS_ASSERT(color == BLACK || color == GRAY); @@ -1619,7 +1619,7 @@ JS::UnmarkGrayGCThingRecursively(void *thing, JSGCTraceKind kind) UnmarkGrayGCThing(thing); - JSRuntime *rt = static_cast(thing)->runtime(); + JSRuntime *rt = static_cast(thing)->zone()->rt; UnmarkGrayTracer trc(rt); JS_TraceChildren(&trc, thing, kind); } diff --git a/js/src/gc/Verifier.cpp b/js/src/gc/Verifier.cpp index fde4986bc6ba..ba6fad57859a 100644 --- a/js/src/gc/Verifier.cpp +++ b/js/src/gc/Verifier.cpp @@ -754,14 +754,15 @@ js::gc::EndVerifyPostBarriers(JSRuntime *rt) goto oom; /* Walk the heap. */ - for (GCZoneGroupIter zone(rt); !zone.done(); zone.next()) { - for (CompartmentsIter comp(rt); !comp.done(); comp.next()) { - if (comp->watchpointMap) - comp->watchpointMap->markAll(trc); - } + for (CompartmentsIter c(rt); !c.done(); c.next()) { + if (IsAtomsCompartment(c)) + continue; + + if (c->watchpointMap) + c->watchpointMap->markAll(trc); for (size_t kind = 0; kind < FINALIZE_LIMIT; ++kind) { - for (CellIterUnderGC cells(zone, AllocKind(kind)); !cells.done(); cells.next()) { + for (CellIterUnderGC cells(c, AllocKind(kind)); !cells.done(); cells.next()) { Cell *src = cells.getCell(); if (!rt->gcVerifierNursery.isInside(src)) JS_TraceChildren(trc, src, MapAllocToTraceKind(AllocKind(kind))); diff --git a/js/src/gc/Zone.cpp b/js/src/gc/Zone.cpp index 61e4499ea491..ac5f35816c79 100644 --- a/js/src/gc/Zone.cpp +++ b/js/src/gc/Zone.cpp @@ -30,7 +30,7 @@ JS::Zone::Zone(JSRuntime *rt) hold(false), #ifdef JSGC_GENERATIONAL gcNursery(), - gcStoreBuffer(rt), + gcStoreBuffer(&gcNursery), #endif ionUsingBarriers_(false), active(false), diff --git a/js/src/gc/Zone.h b/js/src/gc/Zone.h index 11ce944e5988..80074f1edaa4 100644 --- a/js/src/gc/Zone.h +++ b/js/src/gc/Zone.h @@ -67,7 +67,7 @@ struct Zone : private JS::shadow::Zone, public js::gc::GraphNodeBase bool hold; #ifdef JSGC_GENERATIONAL - js::gc::VerifierNursery gcNursery; + js::gc::Nursery gcNursery; js::gc::StoreBuffer gcStoreBuffer; #endif diff --git a/js/src/ion/IonCode.h b/js/src/ion/IonCode.h index a732cf02a775..02bfdbfd23f6 100644 --- a/js/src/ion/IonCode.h +++ b/js/src/ion/IonCode.h @@ -131,7 +131,6 @@ class IonCode : public gc::Cell static IonCode *New(JSContext *cx, uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool); public: - JS::Zone *zone() const { return tenuredZone(); } static void readBarrier(IonCode *code); static void writeBarrierPre(IonCode *code); static void writeBarrierPost(IonCode *code, void *addr); diff --git a/js/src/jsapi-tests/testBug604087.cpp b/js/src/jsapi-tests/testBug604087.cpp index c3a907a20b91..b28ab55cbc9b 100644 --- a/js/src/jsapi-tests/testBug604087.cpp +++ b/js/src/jsapi-tests/testBug604087.cpp @@ -22,7 +22,7 @@ struct OuterWrapper : js::Wrapper return true; } - virtual bool finalizeInBackground(JS::Value priv) { + virtual bool finalizeInBackground(JS::HandleValue priv) { return false; } diff --git a/js/src/jscntxt.cpp b/js/src/jscntxt.cpp index bd559406e158..a3d16438c376 100644 --- a/js/src/jscntxt.cpp +++ b/js/src/jscntxt.cpp @@ -264,7 +264,7 @@ JSCompartment::sweepCallsiteClones() for (CallsiteCloneTable::Enum e(callsiteClones); !e.empty(); e.popFront()) { CallsiteCloneKey key = e.front().key; JSFunction *fun = e.front().value; - if (!IsScriptMarked(&key.script) || !IsObjectMarked(&fun)) + if (!key.script->isMarked() || !fun->isMarked()) e.removeFront(); } } diff --git a/js/src/jscntxtinlines.h b/js/src/jscntxtinlines.h index 9c9a03d3b1da..496b8e492bb4 100644 --- a/js/src/jscntxtinlines.h +++ b/js/src/jscntxtinlines.h @@ -73,7 +73,7 @@ NewObjectCache::fill(EntryIndex entry_, Class *clasp, gc::Cell *key, gc::AllocKi entry->key = key; entry->kind = kind; - entry->nbytes = gc::Arena::thingSize(kind); + entry->nbytes = obj->sizeOfThis(); js_memcpy(&entry->templateObject, obj, entry->nbytes); } diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index 664853f3d477..2f46b7fbce92 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -903,9 +903,7 @@ JS::IncrementalReferenceBarrier(void *ptr, JSGCTraceKind kind) return; gc::Cell *cell = static_cast(ptr); - Zone *zone = kind == JSTRACE_OBJECT - ? static_cast(cell)->zone() - : cell->tenuredZone(); + Zone *zone = cell->zone(); JS_ASSERT(!zone->rt->isHeapBusy()); diff --git a/js/src/jsfun.h b/js/src/jsfun.h index a76c9ca09d92..2370cbdf428e 100644 --- a/js/src/jsfun.h +++ b/js/src/jsfun.h @@ -273,7 +273,7 @@ class JSFunction : public JSObject inline bool isExtended() const { JS_STATIC_ASSERT(FinalizeKind != ExtendedFinalizeKind); - JS_ASSERT_IF(isTenured(), !!(flags & EXTENDED) == (tenuredGetAllocKind() == ExtendedFinalizeKind)); + JS_ASSERT(!!(flags & EXTENDED) == (getAllocKind() == ExtendedFinalizeKind)); return !!(flags & EXTENDED); } @@ -287,15 +287,6 @@ class JSFunction : public JSObject static bool setTypeForScriptedFunction(JSContext *cx, js::HandleFunction fun, bool singleton = false); - /* GC support. */ - js::gc::AllocKind getAllocKind() const { - js::gc::AllocKind kind = FinalizeKind; - if (isExtended()) - kind = ExtendedFinalizeKind; - JS_ASSERT_IF(isTenured(), kind == tenuredGetAllocKind()); - return kind; - } - private: /* * These member functions are inherited from JSObject, but should never be applied to diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index e7ceccd36845..67d5c9c48f0c 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -286,7 +286,7 @@ ArenaHeader::checkSynchronizedWithFreeList() const bool js::gc::Cell::isTenured() const { - return !IsInsideNursery(runtime(), this); + return true; } #endif @@ -1843,7 +1843,7 @@ void GCMarker::checkZone(void *p) { JS_ASSERT(started); - JS_ASSERT(static_cast(p)->tenuredZone()->isCollecting()); + JS_ASSERT(static_cast(p)->zone()->isCollecting()); } #endif @@ -1915,7 +1915,7 @@ GCMarker::appendGrayRoot(void *thing, JSGCTraceKind kind) root.debugPrintIndex = debugPrintIndex; #endif - Zone *zone = static_cast(thing)->tenuredZone(); + Zone *zone = static_cast(thing)->zone(); if (zone->isCollecting()) { zone->maybeAlive = true; if (!zone->gcGrayRoots.append(root)) { @@ -2726,8 +2726,8 @@ CheckCompartmentCallback(JSTracer *trcArg, void **thingp, JSGCTraceKind kind) if (comp && trc->compartment) { CheckCompartment(trc, comp, thing, kind); } else { - JS_ASSERT(thing->tenuredZone() == trc->zone || - thing->tenuredZone() == trc->runtime->atomsCompartment->zone()); + JS_ASSERT(thing->zone() == trc->zone || + thing->zone() == trc->runtime->atomsCompartment->zone()); } } @@ -2907,7 +2907,7 @@ BeginMarkPhase(JSRuntime *rt) for (CompartmentsIter c(rt); !c.done(); c.next()) { for (JSCompartment::WrapperEnum e(c); !e.empty(); e.popFront()) { Cell *dst = e.front().key.wrapped; - dst->tenuredZone()->maybeAlive = true; + dst->zone()->maybeAlive = true; } } @@ -3284,7 +3284,7 @@ JSCompartment::findOutgoingEdges(ComponentFinder &finder) * after wrapped compartment. */ if (!other->isMarked(BLACK) || other->isMarked(GRAY)) { - JS::Zone *w = other->tenuredZone(); + JS::Zone *w = other->zone(); if (w->isGCMarking()) finder.addEdgeTo(w); } @@ -3297,7 +3297,7 @@ JSCompartment::findOutgoingEdges(ComponentFinder &finder) * with call to Debugger::findCompartmentEdges below) that debugger * and debuggee objects are always swept in the same group. */ - JS::Zone *w = other->tenuredZone(); + JS::Zone *w = other->zone(); if (w->isGCMarking()) finder.addEdgeTo(w); } diff --git a/js/src/jsgcinlines.h b/js/src/jsgcinlines.h index 286abc0a3afd..e7eb4fa7d409 100644 --- a/js/src/jsgcinlines.h +++ b/js/src/jsgcinlines.h @@ -203,7 +203,7 @@ GetGCThingTraceKind(const void *thing) if (IsInsideNursery(cell->runtime(), cell)) return JSTRACE_OBJECT; #endif - return MapAllocToTraceKind(cell->tenuredGetAllocKind()); + return MapAllocToTraceKind(cell->getAllocKind()); } static inline void diff --git a/js/src/jsinfer.h b/js/src/jsinfer.h index 91383b2daa67..b97b15f17212 100644 --- a/js/src/jsinfer.h +++ b/js/src/jsinfer.h @@ -1082,8 +1082,6 @@ struct TypeObject : gc::Cell */ void finalize(FreeOp *fop) {} - JS::Zone *zone() const { return tenuredZone(); } - static inline void writeBarrierPre(TypeObject *type); static inline void writeBarrierPost(TypeObject *type, void *addr); static inline void readBarrier(TypeObject *type); diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index 60a3cfc6bdb5..4ebade5541eb 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -235,7 +235,7 @@ JSObject::finalize(js::FreeOp *fop) js::Probes::finalizeObject(this); #ifdef DEBUG - if (isTenured() && !IsBackgroundFinalized(tenuredGetAllocKind())) { + if (!IsBackgroundFinalized(getAllocKind())) { /* Assert we're on the main thread. */ fop->runtime()->assertValidThread(); } @@ -1085,7 +1085,7 @@ JSObject::hasShapeTable() const inline size_t JSObject::computedSizeOfThisSlotsElements() const { - size_t n = js::gc::Arena::thingSize(js::gc::GetGCObjectFixedSlotsKind(numFixedSlots())); + size_t n = sizeOfThis(); if (hasDynamicSlots()) n += numDynamicSlots() * sizeof(js::Value); @@ -1721,7 +1721,7 @@ CopyInitializerObject(JSContext *cx, HandleObject baseobj, NewObjectKind newKind gc::AllocKind allocKind = gc::GetGCObjectFixedSlotsKind(baseobj->numFixedSlots()); allocKind = gc::GetBackgroundAllocKind(allocKind); - JS_ASSERT_IF(baseobj->isTenured(), allocKind == baseobj->getAllocKind()); + JS_ASSERT(allocKind == baseobj->getAllocKind()); RootedObject obj(cx); obj = NewBuiltinClassInstance(cx, &ObjectClass, allocKind, newKind); if (!obj) diff --git a/js/src/jsproxy.h b/js/src/jsproxy.h index 4b9f0bc3f380..f6e946b0c8a2 100644 --- a/js/src/jsproxy.h +++ b/js/src/jsproxy.h @@ -77,7 +77,7 @@ class JS_FRIEND_API(BaseProxyHandler) { return false; } - virtual bool finalizeInBackground(Value priv) { + virtual bool finalizeInBackground(HandleValue priv) { /* * Called on creation of a proxy to determine whether its finalize * method can be finalized on the background thread. diff --git a/js/src/jsscript.h b/js/src/jsscript.h index 1907e180a33d..fbbf32667aab 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -952,8 +952,6 @@ class JSScript : public js::gc::Cell void finalize(js::FreeOp *fop); - JS::Zone *zone() const { return tenuredZone(); } - static inline void writeBarrierPre(js::RawScript script); static inline void writeBarrierPost(js::RawScript script, void *addr); diff --git a/js/src/jswrapper.cpp b/js/src/jswrapper.cpp index f94dc90fec04..7fdd9232e34b 100644 --- a/js/src/jswrapper.cpp +++ b/js/src/jswrapper.cpp @@ -206,7 +206,7 @@ CrossCompartmentWrapper::~CrossCompartmentWrapper() { } -bool CrossCompartmentWrapper::finalizeInBackground(Value priv) +bool CrossCompartmentWrapper::finalizeInBackground(HandleValue priv) { if (!priv.isObject()) return true; @@ -215,9 +215,7 @@ bool CrossCompartmentWrapper::finalizeInBackground(Value priv) * Make the 'background-finalized-ness' of the wrapper the same as the * wrapped object, to allow transplanting between them. */ - if (IsInsideNursery(priv.toObject().runtime(), &priv.toObject())) - return false; - return IsBackgroundFinalized(priv.toObject().tenuredGetAllocKind()); + return IsBackgroundFinalized(priv.toObject().getAllocKind()); } #define PIERCE(cx, wrapper, pre, op, post) \ @@ -849,8 +847,8 @@ NukeSlot(JSObject *wrapper, uint32_t slot, Value v) { Value old = wrapper->getSlot(slot); if (old.isMarkable()) { - Zone *zone = ZoneOfValue(old); - AutoMarkInDeadZone amd(zone); + Cell *cell = static_cast(old.toGCThing()); + AutoMarkInDeadZone amd(cell->zone()); wrapper->setReservedSlot(slot, v); } else { wrapper->setReservedSlot(slot, v); diff --git a/js/src/jswrapper.h b/js/src/jswrapper.h index e3e260813ecc..d8cd4a064f9c 100644 --- a/js/src/jswrapper.h +++ b/js/src/jswrapper.h @@ -83,7 +83,7 @@ class JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper virtual ~CrossCompartmentWrapper(); - virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE; + virtual bool finalizeInBackground(HandleValue priv) MOZ_OVERRIDE; /* ES5 Harmony fundamental wrapper traps. */ virtual bool getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, diff --git a/js/src/vm/ObjectImpl-inl.h b/js/src/vm/ObjectImpl-inl.h index 9cada60e5caa..9dae52439d2a 100644 --- a/js/src/vm/ObjectImpl-inl.h +++ b/js/src/vm/ObjectImpl-inl.h @@ -317,21 +317,6 @@ js::ObjectImpl::sizeOfThis() const return js::gc::Arena::thingSize(getAllocKind()); } -JS_ALWAYS_INLINE JS::Zone * -js::ObjectImpl::zone() const -{ - return shape_->zone(); -} - -JS_ALWAYS_INLINE JS::Zone * -ZoneOfValue(const JS::Value &value) -{ - JS_ASSERT(value.isMarkable()); - if (value.isObject()) - return value.toObject().zone(); - return static_cast(value.toGCThing())->tenuredZone(); -} - /* static */ inline void js::ObjectImpl::readBarrier(ObjectImpl *obj) { diff --git a/js/src/vm/ObjectImpl.cpp b/js/src/vm/ObjectImpl.cpp index be4ac80079eb..457af6159b10 100644 --- a/js/src/vm/ObjectImpl.cpp +++ b/js/src/vm/ObjectImpl.cpp @@ -325,33 +325,6 @@ js::ObjectImpl::markChildren(JSTracer *trc) } } -gc::AllocKind -js::ObjectImpl::getAllocKind() const -{ - gc::AllocKind allocKind; - if (asObjectPtr()->isArray()) { - JS_ASSERT(isTenured()); - allocKind = tenuredGetAllocKind(); - } else if (asObjectPtr()->isFunction()) { - allocKind = asObjectPtr()->toFunction()->getAllocKind(); - } else if (asObjectPtr()->isProxy()) { - BaseProxyHandler *handler = - static_cast(getSlot(JSSLOT_PROXY_HANDLER).toPrivate()); - Value priv = getSlot(JSSLOT_PROXY_PRIVATE); - allocKind = gc::GetGCObjectKind(getClass()); - if (handler->finalizeInBackground(priv)) - allocKind = GetBackgroundAllocKind(allocKind); - } else { - Class *clasp = getClass(); - allocKind = gc::GetGCObjectFixedSlotsKind(numFixedSlots()); - JS_ASSERT(!IsBackgroundFinalized(allocKind)); - if (CanBeFinalizedInBackground(allocKind, clasp)) - allocKind = GetBackgroundAllocKind(allocKind); - } - JS_ASSERT_IF(isTenured(), allocKind == tenuredGetAllocKind()); - return allocKind; -} - bool DenseElementsHeader::getOwnElement(JSContext *cx, Handle obj, uint32_t index, unsigned resolveFlags, PropDesc *desc) diff --git a/js/src/vm/ObjectImpl.h b/js/src/vm/ObjectImpl.h index 9de5c23025a1..96654469a97a 100644 --- a/js/src/vm/ObjectImpl.h +++ b/js/src/vm/ObjectImpl.h @@ -1094,7 +1094,6 @@ class ObjectImpl : public gc::Cell } JSObject * asObjectPtr() { return reinterpret_cast(this); } - const JSObject * asObjectPtr() const { return reinterpret_cast(this); } friend inline Value ObjectValue(ObjectImpl &obj); @@ -1371,8 +1370,6 @@ class ObjectImpl : public gc::Cell } /* GC support. */ - JS_ALWAYS_INLINE Zone *zone() const; - gc::AllocKind getAllocKind() const; static inline ThingRootKind rootKind() { return THING_ROOT_OBJECT; } static inline void readBarrier(ObjectImpl *obj); static inline void writeBarrierPre(ObjectImpl *obj); diff --git a/js/src/vm/Shape-inl.h b/js/src/vm/Shape-inl.h index 6fa3157c99cb..d1e263ea73d3 100644 --- a/js/src/vm/Shape-inl.h +++ b/js/src/vm/Shape-inl.h @@ -106,17 +106,15 @@ BaseShape::operator=(const BaseShape &other) getterObj = other.getterObj; GetterSetterWriteBarrierPost(runtime(), &getterObj); } else { - if (rawGetter) - GetterSetterWriteBarrierPostRemove(runtime(), &getterObj); rawGetter = other.rawGetter; + GetterSetterWriteBarrierPostRemove(runtime(), &getterObj); } if (flags & HAS_SETTER_OBJECT) { setterObj = other.setterObj; GetterSetterWriteBarrierPost(runtime(), &setterObj); } else { - if (rawSetter) - GetterSetterWriteBarrierPostRemove(runtime(), &setterObj); rawSetter = other.rawSetter; + GetterSetterWriteBarrierPostRemove(runtime(), &setterObj); } compartment_ = other.compartment_; return *this; diff --git a/js/src/vm/Shape.h b/js/src/vm/Shape.h index 651644b2d221..653085303741 100644 --- a/js/src/vm/Shape.h +++ b/js/src/vm/Shape.h @@ -333,7 +333,6 @@ class BaseShape : public js::gc::Cell void setSlotSpan(uint32_t slotSpan) { JS_ASSERT(isOwned()); slotSpan_ = slotSpan; } JSCompartment *compartment() const { return compartment_; } - JS::Zone *zone() const { return tenuredZone(); } /* Lookup base shapes from the compartment's baseShapes table. */ static UnownedBaseShape* getUnowned(JSContext *cx, const StackBaseShape &base); @@ -817,8 +816,6 @@ class Shape : public js::gc::Cell void finalize(FreeOp *fop); void removeChild(RawShape child); - JS::Zone *zone() const { return tenuredZone(); } - static inline void writeBarrierPre(RawShape shape); static inline void writeBarrierPost(RawShape shape, void *addr); diff --git a/js/src/vm/String.h b/js/src/vm/String.h index d9c447e1a8e7..e343dce3a87f 100644 --- a/js/src/vm/String.h +++ b/js/src/vm/String.h @@ -414,9 +414,6 @@ class JSString : public js::gc::Cell return offsetof(JSString, d.u1.chars); } - JS::Zone *zone() const { return tenuredZone(); } - js::gc::AllocKind getAllocKind() const { return tenuredGetAllocKind(); } - static inline void writeBarrierPre(JSString *str); static inline void writeBarrierPost(JSString *str, void *addr); static inline bool needWriteBarrierPre(JS::Zone *zone);