From d4acfa8daec6cdfaaad8f177fbb4c3d8aacc9ddf Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Tue, 30 Apr 2013 15:40:00 -0700 Subject: [PATCH] Bug 867426 - Remove RawUnownedBaseShape typedef; r=jonco --HG-- extra : rebase_source : 8a0c79db1cb2a75c9f55eee179e541fbefaddf8a --- js/src/gc/Marking.cpp | 2 +- js/src/jsscript.cpp | 2 +- js/src/vm/Shape-inl.h | 10 +++++----- js/src/vm/Shape.cpp | 16 ++++++++-------- js/src/vm/Shape.h | 32 ++++++++++++++++---------------- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index 8241c1957ce..531510218e0 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -873,7 +873,7 @@ ScanBaseShape(GCMarker *gcmarker, BaseShape *base) * unowned base shape. */ if (base->isOwned()) { - RawUnownedBaseShape unowned = base->baseUnowned(); + UnownedBaseShape *unowned = base->baseUnowned(); JS_ASSERT(base->compartment() == unowned->compartment()); unowned->markIfUnmarked(gcmarker->getMarkColor()); } diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index 4c0399365a4..89587745b07 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -123,7 +123,7 @@ Bindings::initWithTemporaryStorage(JSContext *cx, InternalBindingsHandle self, StackBaseShape base(cx->compartment, &CallClass, cx->global(), BaseShape::VAROBJ | BaseShape::DELEGATE); - RawUnownedBaseShape nbase = BaseShape::getUnowned(cx, base); + UnownedBaseShape *nbase = BaseShape::getUnowned(cx, base); if (!nbase) return false; diff --git a/js/src/vm/Shape-inl.h b/js/src/vm/Shape-inl.h index 579787e7290..d0e8e223ddc 100644 --- a/js/src/vm/Shape-inl.h +++ b/js/src/vm/Shape-inl.h @@ -160,7 +160,7 @@ StackBaseShape::updateGetterSetter(uint8_t attrs, } inline void -BaseShape::adoptUnowned(RawUnownedBaseShape other) +BaseShape::adoptUnowned(UnownedBaseShape *other) { /* * This is a base shape owned by a dictionary object, update it to reflect the @@ -180,7 +180,7 @@ BaseShape::adoptUnowned(RawUnownedBaseShape other) } inline void -BaseShape::setOwned(RawUnownedBaseShape unowned) +BaseShape::setOwned(UnownedBaseShape *unowned) { flags |= OWNED_SHAPE; this->unowned_ = unowned; @@ -191,7 +191,7 @@ BaseShape::assertConsistency() { #ifdef DEBUG if (isOwned()) { - RawUnownedBaseShape unowned = baseUnowned(); + UnownedBaseShape *unowned = baseUnowned(); JS_ASSERT(hasGetterObject() == unowned->hasGetterObject()); JS_ASSERT(hasSetterObject() == unowned->hasSetterObject()); JS_ASSERT_IF(hasGetterObject(), getterObject() == unowned->getterObject()); @@ -216,7 +216,7 @@ Shape::Shape(const StackShape &other, uint32_t nfixed) } inline -Shape::Shape(RawUnownedBaseShape base, uint32_t nfixed) +Shape::Shape(UnownedBaseShape *base, uint32_t nfixed) : base_(base), propid_(JSID_EMPTY), slotInfo(SHAPE_INVALID_SLOT | (nfixed << FIXED_SLOTS_SHIFT)), @@ -396,7 +396,7 @@ Shape::initDictionaryShape(const StackShape &child, uint32_t nfixed, HeapPtrShap } inline -EmptyShape::EmptyShape(RawUnownedBaseShape base, uint32_t nfixed) +EmptyShape::EmptyShape(UnownedBaseShape *base, uint32_t nfixed) : js::Shape(base, nfixed) { /* Only empty shapes can be NON_NATIVE. */ diff --git a/js/src/vm/Shape.cpp b/js/src/vm/Shape.cpp index 439fe4b5146..dc25a7a6d0c 100644 --- a/js/src/vm/Shape.cpp +++ b/js/src/vm/Shape.cpp @@ -305,7 +305,7 @@ Shape::replaceLastProperty(JSContext *cx, const StackBaseShape &base, StackShape child(shape); StackShape::AutoRooter childRoot(cx, &child); { - RawUnownedBaseShape nbase = BaseShape::getUnowned(cx, base); + UnownedBaseShape *nbase = BaseShape::getUnowned(cx, base); if (!nbase) return NULL; @@ -703,7 +703,7 @@ JSObject::putProperty(JSContext *cx, HandleObject obj, HandleId id, StackBaseShape base(obj->lastProperty()->base()); base.updateGetterSetter(attrs, getter, setter); - RawUnownedBaseShape nbase = BaseShape::getUnowned(cx, base); + UnownedBaseShape *nbase = BaseShape::getUnowned(cx, base); if (!nbase) return NULL; @@ -1008,7 +1008,7 @@ JSObject::setParent(JSContext *cx, HandleObject obj, HandleObject parent) if (obj->inDictionaryMode()) { StackBaseShape base(obj->lastProperty()); base.parent = parent; - RawUnownedBaseShape nbase = BaseShape::getUnowned(cx, base); + UnownedBaseShape *nbase = BaseShape::getUnowned(cx, base); if (!nbase) return false; @@ -1087,7 +1087,7 @@ js::ObjectImpl::setFlag(JSContext *cx, /*BaseShape::Flag*/ uint32_t flag_, return false; StackBaseShape base(self->lastProperty()); base.flags |= flag; - RawUnownedBaseShape nbase = BaseShape::getUnowned(cx, base); + UnownedBaseShape *nbase = BaseShape::getUnowned(cx, base); if (!nbase) return false; @@ -1114,7 +1114,7 @@ js::ObjectImpl::clearFlag(JSContext *cx, /*BaseShape::Flag*/ uint32_t flag) StackBaseShape base(self->lastProperty()); base.flags &= ~flag; - RawUnownedBaseShape nbase = BaseShape::getUnowned(cx, base); + UnownedBaseShape *nbase = BaseShape::getUnowned(cx, base); if (!nbase) return false; @@ -1147,7 +1147,7 @@ StackBaseShape::hash(const StackBaseShape *base) } /* static */ inline bool -StackBaseShape::match(RawUnownedBaseShape key, const StackBaseShape *lookup) +StackBaseShape::match(UnownedBaseShape *key, const StackBaseShape *lookup) { return key->flags == lookup->flags && key->clasp == lookup->clasp @@ -1177,7 +1177,7 @@ BaseShape::getUnowned(JSContext *cx, const StackBaseShape &base) new (nbase_) BaseShape(base); - RawUnownedBaseShape nbase = static_cast(nbase_); + UnownedBaseShape *nbase = static_cast(nbase_); if (!table.relookupOrAdd(p, &base, nbase)) return NULL; @@ -1192,7 +1192,7 @@ JSCompartment::sweepBaseShapeTable() if (baseShapes.initialized()) { for (BaseShapeSet::Enum e(baseShapes); !e.empty(); e.popFront()) { - RawUnownedBaseShape base = e.front(); + UnownedBaseShape *base = e.front(); if (IsBaseShapeAboutToBeFinalized(&base)) e.removeFront(); } diff --git a/js/src/vm/Shape.h b/js/src/vm/Shape.h index 9e74bca556a..ef08aa933dc 100644 --- a/js/src/vm/Shape.h +++ b/js/src/vm/Shape.h @@ -223,7 +223,7 @@ struct ShapeTable { * an earlier property, however. */ -ForwardDeclare(UnownedBaseShape); +class UnownedBaseShape; ForwardDeclare(Shape); struct StackBaseShape; @@ -312,8 +312,8 @@ class BaseShape : public js::gc::Cell inline bool matchesGetterSetter(PropertyOp rawGetter, StrictPropertyOp rawSetter) const; - inline void adoptUnowned(RawUnownedBaseShape other); - inline void setOwned(RawUnownedBaseShape unowned); + inline void adoptUnowned(UnownedBaseShape *other); + inline void setOwned(UnownedBaseShape *unowned); JSObject *getObjectParent() const { return parent; } uint32_t getObjectFlags() const { return flags & OBJECT_FLAG_MASK; } @@ -369,16 +369,16 @@ class BaseShape : public js::gc::Cell class UnownedBaseShape : public BaseShape {}; -UnownedBaseShape* +UnownedBaseShape * BaseShape::unowned() { return isOwned() ? baseUnowned() : toUnowned(); } -UnownedBaseShape* +UnownedBaseShape * BaseShape::toUnowned() { - JS_ASSERT(!isOwned() && !unowned_); return static_cast(this); + JS_ASSERT(!isOwned() && !unowned_); return static_cast(this); } UnownedBaseShape* @@ -424,7 +424,7 @@ struct StackBaseShape StrictPropertyOp rawSetter); static inline HashNumber hash(const StackBaseShape *lookup); - static inline bool match(RawUnownedBaseShape key, const StackBaseShape *lookup); + static inline bool match(UnownedBaseShape *key, const StackBaseShape *lookup); class AutoRooter : private JS::CustomAutoRooter { @@ -626,7 +626,7 @@ class Shape : public js::gc::Cell Shape(const StackShape &other, uint32_t nfixed); /* Used by EmptyShape (see jsscopeinlines.h). */ - Shape(RawUnownedBaseShape base, uint32_t nfixed); + Shape(UnownedBaseShape *base, uint32_t nfixed); /* Copy constructor disabled, to avoid misuse of the above form. */ Shape(const Shape &other) MOZ_DELETE; @@ -903,7 +903,7 @@ class AutoRooterGetterSetter struct EmptyShape : public js::Shape { - EmptyShape(RawUnownedBaseShape base, uint32_t nfixed); + EmptyShape(UnownedBaseShape *base, uint32_t nfixed); /* * Lookup an initial shape matching the given parameters, creating an empty @@ -969,14 +969,14 @@ typedef HashSet Initial struct StackShape { /* For performance, StackShape only roots when absolutely necessary. */ - RawUnownedBaseShape base; - RawId propid; - uint32_t slot_; - uint8_t attrs; - uint8_t flags; - int16_t shortid; + UnownedBaseShape *base; + RawId propid; + uint32_t slot_; + uint8_t attrs; + uint8_t flags; + int16_t shortid; - explicit StackShape(RawUnownedBaseShape base, jsid propid, uint32_t slot, + explicit StackShape(UnownedBaseShape *base, jsid propid, uint32_t slot, uint32_t nfixed, unsigned attrs, unsigned flags, int shortid) : base(base), propid(propid),