Bug 771018 - Replace "const Shape" with "Shape" (r=luke)

This commit is contained in:
Bill McCloskey 2012-07-04 19:33:41 -07:00
parent 83fa53f7f9
commit 252cf2ecc5
39 changed files with 169 additions and 169 deletions

View File

@ -2005,7 +2005,7 @@ BindLet(JSContext *cx, BindData *data, JSAtom *atom, Parser *parser)
*/
bool redeclared;
jsid id = AtomToId(atom);
const Shape *shape = blockObj->addVar(cx, id, blockCount, &redeclared);
Shape *shape = blockObj->addVar(cx, id, blockCount, &redeclared);
if (!shape) {
if (redeclared)
ReportRedeclaration(cx, parser, pn, false, atom);
@ -2022,7 +2022,7 @@ static inline bool
ForEachLetDef(TreeContext *tc, StaticBlockObject &blockObj, Op op)
{
for (Shape::Range r = blockObj.lastProperty()->all(); !r.empty(); r.popFront()) {
const Shape &shape = r.front();
Shape &shape = r.front();
/* Beware the destructuring dummy slots. */
if (JSID_IS_INT(shape.propid()))

View File

@ -155,7 +155,7 @@ frontend::LexicalLookup(ContextT *ct, JSAtom *atom, int *slotp, typename Context
continue;
StaticBlockObject &blockObj = *stmt->blockObj;
const Shape *shape = blockObj.nativeLookup(ct->sc->context, AtomToId(atom));
Shape *shape = blockObj.nativeLookup(ct->sc->context, AtomToId(atom));
if (shape) {
JS_ASSERT(shape->hasShortID());

View File

@ -4376,7 +4376,7 @@ JS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp)
{
AssertRootingUnnecessary safe(cx);
int32_t i;
const Shape *shape;
Shape *shape;
JSIdArray *ida;
AssertNoGC(cx);

View File

@ -318,7 +318,7 @@ JSObject::arrayGetOwnDataElement(JSContext *cx, size_t i, Value *vp)
if (!IndexToId(cx, this, i, &hole, &id))
return false;
const Shape *shape = nativeLookup(cx, id);
Shape *shape = nativeLookup(cx, id);
if (!shape || !shape->isDataDescriptor())
vp->setMagic(JS_ARRAY_HOLE);
else

View File

@ -542,7 +542,7 @@ ReportUsageError(JSContext *cx, JSObject *callee, const char *msg)
{
const char *usageStr = "usage";
PropertyName *usageAtom = js_Atomize(cx, usageStr, strlen(usageStr))->asPropertyName();
DebugOnly<const Shape *> shape = callee->nativeLookup(cx, NameToId(usageAtom));
DebugOnly<Shape *> shape = callee->nativeLookup(cx, NameToId(usageAtom));
JS_ASSERT(!shape->configurable());
JS_ASSERT(!shape->writable());
JS_ASSERT(shape->hasDefaultGetter());

View File

@ -1762,13 +1762,13 @@ MakeRangeGCSafe(jsid *vec, size_t len)
}
static JS_ALWAYS_INLINE void
MakeRangeGCSafe(const Shape **beg, const Shape **end)
MakeRangeGCSafe(Shape **beg, Shape **end)
{
PodZero(beg, end - beg);
}
static JS_ALWAYS_INLINE void
MakeRangeGCSafe(const Shape **vec, size_t len)
MakeRangeGCSafe(Shape **vec, size_t len)
{
PodZero(vec, len);
}
@ -1812,12 +1812,12 @@ class AutoObjectVector : public AutoVectorRooter<JSObject *>
JS_DECL_USE_GUARD_OBJECT_NOTIFIER
};
class AutoShapeVector : public AutoVectorRooter<const Shape *>
class AutoShapeVector : public AutoVectorRooter<Shape *>
{
public:
explicit AutoShapeVector(JSContext *cx
JS_GUARD_OBJECT_NOTIFIER_PARAM)
: AutoVectorRooter<const Shape *>(cx, SHAPEVECTOR)
: AutoVectorRooter<Shape *>(cx, SHAPEVECTOR)
{
JS_GUARD_OBJECT_NOTIFIER_INIT;
}

View File

@ -768,12 +768,12 @@ TypeSet::addFilterPrimitives(JSContext *cx, TypeSet *target, FilterKind filter)
}
/* If id is a normal slotful 'own' property of an object, get its shape. */
static inline const Shape *
static inline Shape *
GetSingletonShape(JSContext *cx, JSObject *obj, jsid id)
{
if (!obj->isNative())
return NULL;
const Shape *shape = obj->nativeLookup(cx, id);
Shape *shape = obj->nativeLookup(cx, id);
if (shape && shape->hasDefaultGetter() && shape->hasSlot())
return shape;
return NULL;
@ -792,7 +792,7 @@ ScriptAnalysis::pruneTypeBarriers(JSContext *cx, uint32_t offset)
}
if (barrier->singleton) {
JS_ASSERT(barrier->type.isPrimitive(JSVAL_TYPE_UNDEFINED));
const Shape *shape = GetSingletonShape(cx, barrier->singleton, barrier->singletonId);
Shape *shape = GetSingletonShape(cx, barrier->singleton, barrier->singletonId);
if (shape && !barrier->singleton->nativeGetSlot(shape->slot()).isUndefined()) {
/*
* When we analyzed the script the singleton had an 'own'
@ -999,7 +999,7 @@ PropertyAccess(JSContext *cx, JSScript *script_, jsbytecode *pc, TypeObject *obj
* to remove the barrier after the property becomes defined,
* even if no undefined value is ever observed at pc.
*/
const Shape *shape = GetSingletonShape(cx, object->singleton, id);
Shape *shape = GetSingletonShape(cx, object->singleton, id);
if (shape && object->singleton->nativeGetSlot(shape->slot()).isUndefined())
script->analysis()->addSingletonTypeBarrier(cx, pc, target, object->singleton, id);
}
@ -2514,7 +2514,7 @@ struct types::ObjectTableKey
obj->getProto() != v.proto) {
return false;
}
const Shape *shape = obj->lastProperty();
Shape *shape = obj->lastProperty();
while (!shape->isEmptyShape()) {
if (shape->propid() != v.ids[shape->slot()])
return false;
@ -2557,7 +2557,7 @@ TypeCompartment::fixObjectType(JSContext *cx, JSObject *obj_)
return;
ObjectTypeTable::AddPtr p = objectTypeTable->lookupForAdd(obj.get());
const Shape *baseShape = obj->lastProperty();
Shape *baseShape = obj->lastProperty();
if (p) {
/* The lookup ensures the shape matches, now check that the types match. */
@ -2568,7 +2568,7 @@ TypeCompartment::fixObjectType(JSContext *cx, JSObject *obj_)
if (NumberTypes(ntype, types[i])) {
if (types[i].isPrimitive(JSVAL_TYPE_INT32)) {
types[i] = Type::DoubleType();
const Shape *shape = baseShape;
Shape *shape = baseShape;
while (!shape->isEmptyShape()) {
if (shape->slot() == i) {
Type type = Type::DoubleType();
@ -2608,7 +2608,7 @@ TypeCompartment::fixObjectType(JSContext *cx, JSObject *obj_)
return;
}
const Shape *shape = baseShape;
Shape *shape = baseShape;
while (!shape->isEmptyShape()) {
ids[shape->slot()] = shape->propid();
types[shape->slot()] = GetValueTypeForTable(cx, obj->getSlot(shape->slot()));
@ -2671,7 +2671,7 @@ TypeObject::getFromPrototypes(JSContext *cx, jsid id, TypeSet *types, bool force
}
static inline void
UpdatePropertyType(JSContext *cx, TypeSet *types, JSObject *obj, const Shape *shape, bool force)
UpdatePropertyType(JSContext *cx, TypeSet *types, JSObject *obj, Shape *shape, bool force)
{
types->setOwnProperty(cx, false);
if (!shape->writable())
@ -2715,14 +2715,14 @@ TypeObject::addProperty(JSContext *cx, jsid id, Property **pprop)
if (JSID_IS_VOID(id)) {
/* Go through all shapes on the object to get integer-valued properties. */
const Shape *shape = singleton->lastProperty();
Shape *shape = singleton->lastProperty();
while (!shape->isEmptyShape()) {
if (JSID_IS_VOID(MakeTypeId(cx, shape->propid())))
UpdatePropertyType(cx, &base->types, singleton, shape, true);
shape = shape->previous();
}
} else if (!JSID_IS_EMPTY(id) && singleton->isNative()) {
const Shape *shape = singleton->nativeLookup(cx, id);
Shape *shape = singleton->nativeLookup(cx, id);
if (shape)
UpdatePropertyType(cx, &base->types, singleton, shape, false);
}
@ -2754,7 +2754,7 @@ TypeObject::addDefiniteProperties(JSContext *cx, JSObject *obj)
/* Mark all properties of obj as definite properties of this type. */
AutoEnterTypeInference enter(cx);
const Shape *shape = obj->lastProperty();
Shape *shape = obj->lastProperty();
while (!shape->isEmptyShape()) {
jsid id = MakeTypeId(cx, shape->propid());
if (!JSID_IS_VOID(id) && obj->isFixedSlot(shape->slot()) &&
@ -2782,7 +2782,7 @@ TypeObject::matchDefiniteProperties(JSObject *obj)
unsigned slot = prop->types.definiteSlot();
bool found = false;
const Shape *shape = obj->lastProperty();
Shape *shape = obj->lastProperty();
while (!shape->isEmptyShape()) {
if (shape->slot() == slot && shape->propid() == prop->id) {
found = true;

View File

@ -1282,7 +1282,7 @@ TypeObject::getProperty(JSContext *cx, jsid id, bool assign)
continue;
}
const Shape *shape = protoWalk->nativeLookup(cx, id);
Shape *shape = protoWalk->nativeLookup(cx, id);
foundSetter = shape &&
!shape->hasDefaultSetter();

View File

@ -968,7 +968,7 @@ js::AssertValidPropertyCacheHit(JSContext *cx, JSObject *start_,
JS_ASSERT(prop);
JS_ASSERT(pobj == found);
const Shape *shape = (Shape *) prop;
Shape *shape = (Shape *) prop;
JS_ASSERT(entry->prop == shape);
}
#endif /* DEBUG && !JS_THREADSAFE */

View File

@ -163,7 +163,7 @@ ValuePropertyBearer(JSContext *cx, StackFrame *fp, const Value &v, int spindex)
}
inline bool
NativeGet(JSContext *cx, Handle<JSObject*> obj, Handle<JSObject*> pobj, const Shape *shape,
NativeGet(JSContext *cx, Handle<JSObject*> obj, Handle<JSObject*> pobj, Shape *shape,
unsigned getHow, Value *vp)
{
if (shape->isDataDescriptor() && shape->hasDefaultGetter()) {
@ -305,7 +305,7 @@ SetPropertyOperation(JSContext *cx, jsbytecode *pc, const Value &lval, const Val
* The entry predicts a set either an existing "own" property, or
* on a prototype property that has a setter.
*/
const Shape *shape = entry->prop;
Shape *shape = entry->prop;
JS_ASSERT_IF(shape->isDataDescriptor(), shape->writable());
JS_ASSERT_IF(shape->hasSlot(), entry->isOwnPropertyHit());

View File

@ -213,7 +213,7 @@ EnumerateNativeProperties(JSContext *cx, JSObject *obj_, JSObject *pobj_, unsign
Shape::Range r = pobj->lastProperty()->all();
Shape::Range::AutoRooter root(cx, &r);
for (; !r.empty(); r.popFront()) {
const Shape &shape = r.front();
Shape &shape = r.front();
if (!JSID_IS_DEFAULT_XML_NAMESPACE(shape.propid()) &&
!Enumerate(cx, obj, pobj, shape.propid(), shape.enumerable(), flags, ht, props))
@ -535,7 +535,7 @@ NativeIterator::init(JSObject *obj, unsigned flags, uint32_t slength, uint32_t k
{
this->obj.init(obj);
this->flags = flags;
this->shapes_array = (const Shape **) this->props_end;
this->shapes_array = (Shape **) this->props_end;
this->shapes_length = slength;
this->shapes_key = key;
}
@ -654,7 +654,7 @@ UpdateNativeIterator(NativeIterator *ni, JSObject *obj)
bool
GetIterator(JSContext *cx, HandleObject obj, unsigned flags, Value *vp)
{
Vector<const Shape *, 8> shapes(cx);
Vector<Shape *, 8> shapes(cx);
uint32_t key = 0;
bool keysOnly = (flags == JSITER_ENUMERATE);
@ -719,7 +719,7 @@ GetIterator(JSContext *cx, HandleObject obj, unsigned flags, Value *vp)
shapes.clear();
goto miss;
}
const Shape *shape = pobj->lastProperty();
Shape *shape = pobj->lastProperty();
key = (key + (key << 16)) ^ (uintptr_t(shape) >> 3);
if (!shapes.append((Shape *) shape))
return false;

View File

@ -33,7 +33,7 @@ struct NativeIterator {
HeapPtr<JSFlatString> *props_array;
HeapPtr<JSFlatString> *props_cursor;
HeapPtr<JSFlatString> *props_end;
const Shape **shapes_array;
Shape **shapes_array;
uint32_t shapes_length;
uint32_t shapes_key;
uint32_t flags;

View File

@ -190,7 +190,7 @@ MarkSharpObjects(JSContext *cx, HandleObject obj, JSIdArray **idap, JSSharpInfo
Value &value = valueRoot.get();
Value &setter = setterRoot.get();
if (obj2->isNative()) {
const Shape *shape = (Shape *) prop;
Shape *shape = (Shape *) prop;
hasGetter = shape->hasGetterValue();
hasSetter = shape->hasSetterValue();
if (hasGetter)
@ -476,7 +476,7 @@ obj_toSource(JSContext *cx, unsigned argc, Value *vp)
if (prop) {
bool doGet = true;
if (obj2->isNative()) {
const Shape *shape = (Shape *) prop;
Shape *shape = (Shape *) prop;
unsigned attrs = shape->attributes();
if (attrs & JSPROP_GETTER) {
doGet = false;
@ -1553,7 +1553,7 @@ DefinePropertyOnObject(JSContext *cx, HandleObject obj, HandleId id, const PropD
JS_ASSERT(obj == obj2);
Rooted<const Shape *> shape(cx, reinterpret_cast<Shape *>(current));
Rooted<Shape *> shape(cx, reinterpret_cast<Shape *>(current));
do {
if (desc.isAccessorDescriptor()) {
if (!shape->isAccessorDescriptor())
@ -2502,7 +2502,7 @@ js::NewObjectWithType(JSContext *cx, HandleTypeObject type, JSObject *parent, gc
JSObject *
js::NewReshapedObject(JSContext *cx, HandleTypeObject type, JSObject *parent,
gc::AllocKind kind, const Shape *shape)
gc::AllocKind kind, Shape *shape)
{
RootedObject res(cx, NewObjectWithType(cx, type, parent, kind));
if (!res)
@ -2517,7 +2517,7 @@ js::NewReshapedObject(JSContext *cx, HandleTypeObject type, JSObject *parent,
if (!ids.append(JSID_VOID))
return NULL;
}
const js::Shape *nshape = shape;
js::Shape *nshape = shape;
while (!nshape->isEmptyShape()) {
ids[nshape->slot()] = nshape->propid();
nshape = nshape->previous();
@ -2767,7 +2767,7 @@ JS_CopyPropertiesFrom(JSContext *cx, JSObject *target, JSObject *obj)
size_t n = shapes.length();
while (n > 0) {
const Shape *shape = shapes[--n];
Shape *shape = shapes[--n];
unsigned attrs = shape->attributes();
PropertyOp getter = shape->getter();
StrictPropertyOp setter = shape->setter();
@ -3175,7 +3175,7 @@ DefineStandardSlot(JSContext *cx, JSObject *obj, JSProtoKey key, JSAtom *atom,
JS_ASSERT(obj->isGlobal());
JS_ASSERT(obj->isNative());
const Shape *shape = obj->nativeLookup(cx, id);
Shape *shape = obj->nativeLookup(cx, id);
if (!shape) {
uint32_t slot = 2 * JSProto_LIMIT + key;
obj->setReservedSlot(slot, v);
@ -3456,7 +3456,7 @@ JSObject::updateSlotsForSpan(JSContext *cx, size_t oldSpan, size_t newSpan)
}
bool
JSObject::setLastProperty(JSContext *cx, const js::Shape *shape)
JSObject::setLastProperty(JSContext *cx, js::Shape *shape)
{
JS_ASSERT(!inDictionaryMode());
JS_ASSERT(!shape->inDictionary());
@ -3467,14 +3467,14 @@ JSObject::setLastProperty(JSContext *cx, const js::Shape *shape)
size_t newSpan = shape->slotSpan();
if (oldSpan == newSpan) {
shape_ = const_cast<js::Shape *>(shape);
shape_ = shape;
return true;
}
if (!updateSlotsForSpan(cx, oldSpan, newSpan))
return false;
shape_ = const_cast<js::Shape *>(shape);
shape_ = shape;
return true;
}
@ -3858,7 +3858,7 @@ js_FindClassObject(JSContext *cx, HandleObject start, JSProtoKey protoKey,
{
RootedId id(cx);
JSProperty *prop;
const Shape *shape;
Shape *shape;
RootedObject obj(cx);
@ -3976,7 +3976,7 @@ JSObject::freeSlot(JSContext *cx, uint32_t slot)
static bool
PurgeProtoChain(JSContext *cx, JSObject *obj_, jsid id_)
{
const Shape *shape;
Shape *shape;
RootedObject obj(cx, obj_);
RootedId id(cx, id_);
@ -4093,7 +4093,7 @@ CallAddPropertyHook(JSContext *cx, Class *clasp, HandleObject obj, HandleShape s
namespace js {
const Shape *
Shape *
DefineNativeProperty(JSContext *cx, HandleObject obj, HandleId id, const Value &value_,
PropertyOp getter, StrictPropertyOp setter, unsigned attrs,
unsigned flags, int shortid, unsigned defineHow /* = 0 */)
@ -4271,7 +4271,7 @@ CallResolveOp(JSContext *cx, HandleObject obj, HandleId id, unsigned flags,
}
if (!obj->nativeEmpty()) {
if (const Shape *shape = obj->nativeLookup(cx, id)) {
if (Shape *shape = obj->nativeLookup(cx, id)) {
objp.set(obj);
*propp = (JSProperty *) shape;
}
@ -4287,7 +4287,7 @@ LookupPropertyWithFlagsInline(JSContext *cx, HandleObject obj, HandleId id, unsi
/* Search scopes starting with obj and following the prototype link. */
RootedObject current(cx, obj);
while (true) {
const Shape *shape = current->nativeLookup(cx, id);
Shape *shape = current->nativeLookup(cx, id);
if (shape) {
objp.set(current);
*propp = (JSProperty *) shape;
@ -4536,7 +4536,7 @@ js::FindIdentifierBase(JSContext *cx, HandleObject scopeChain, HandlePropertyNam
static JS_ALWAYS_INLINE JSBool
js_NativeGetInline(JSContext *cx, Handle<JSObject*> receiver, JSObject *obj, JSObject *pobj,
const Shape *shape, unsigned getHow, Value *vp)
Shape *shape, unsigned getHow, Value *vp)
{
JS_ASSERT(pobj->isNative());
@ -4559,7 +4559,7 @@ js_NativeGetInline(JSContext *cx, Handle<JSObject*> receiver, JSObject *obj, JSO
code->accessGetter = true;
}
Rooted<const Shape*> shapeRoot(cx, shape);
Rooted<Shape*> shapeRoot(cx, shape);
RootedObject pobjRoot(cx, pobj);
if (!shape->get(cx, receiver, obj, pobj, vp))
@ -4573,7 +4573,7 @@ js_NativeGetInline(JSContext *cx, Handle<JSObject*> receiver, JSObject *obj, JSO
}
JSBool
js_NativeGet(JSContext *cx, Handle<JSObject*> obj, Handle<JSObject*> pobj, const Shape *shape,
js_NativeGet(JSContext *cx, Handle<JSObject*> obj, Handle<JSObject*> pobj, Shape *shape,
unsigned getHow, Value *vp)
{
return js_NativeGetInline(cx, obj, obj, pobj, shape, getHow, vp);
@ -4581,7 +4581,7 @@ js_NativeGet(JSContext *cx, Handle<JSObject*> obj, Handle<JSObject*> pobj, const
JSBool
js_NativeSet(JSContext *cx, Handle<JSObject*> obj, Handle<JSObject*> receiver,
const Shape *shape, bool added, bool strict, Value *vp)
Shape *shape, bool added, bool strict, Value *vp)
{
AddTypePropertyId(cx, obj, shape->propid(), *vp);
@ -4606,7 +4606,7 @@ js_NativeSet(JSContext *cx, Handle<JSObject*> obj, Handle<JSObject*> receiver,
return js_ReportGetterOnlyAssignment(cx);
}
Rooted<const Shape *> shapeRoot(cx, shape);
Rooted<Shape *> shapeRoot(cx, shape);
int32_t sample = cx->runtime->propertyRemovals;
if (!shapeRoot->set(cx, obj, receiver, strict, vp))
@ -5042,7 +5042,7 @@ baseops::GetAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *a
if (!nobj->isNative())
return nobj->getGenericAttributes(cx, id, attrsp);
const Shape *shape = (Shape *)prop;
Shape *shape = (Shape *)prop;
*attrsp = shape->attributes();
return true;
}
@ -5061,7 +5061,7 @@ baseops::GetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, u
if (!nobj->isNative())
return nobj->getElementAttributes(cx, index, attrsp);
const Shape *shape = (Shape *)prop;
Shape *shape = (Shape *)prop;
*attrsp = shape->attributes();
return true;
}
@ -5098,7 +5098,7 @@ JSBool
baseops::DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, Value *rval, JSBool strict)
{
JSProperty *prop;
const Shape *shape;
Shape *shape;
rval->setBoolean(true);
@ -5166,7 +5166,7 @@ namespace js {
bool
HasDataProperty(JSContext *cx, HandleObject obj, jsid id, Value *vp)
{
if (const Shape *shape = obj->nativeLookup(cx, id)) {
if (Shape *shape = obj->nativeLookup(cx, id)) {
if (shape->hasDefaultGetter() && shape->hasSlot()) {
*vp = obj->nativeGetSlot(shape->slot());
return true;
@ -5306,7 +5306,7 @@ CheckAccess(JSContext *cx, JSObject *obj_, HandleId id, JSAccessMode mode,
{
JSBool writing;
JSProperty *prop;
const Shape *shape;
Shape *shape;
RootedObject obj(cx, obj_), pobj(cx);
@ -5528,7 +5528,7 @@ js_GetObjectSlotName(JSTracer *trc, char *buf, size_t bufsize)
JSObject *obj = (JSObject *)trc->debugPrintArg;
uint32_t slot = uint32_t(trc->debugPrintIndex);
const Shape *shape;
Shape *shape;
if (obj->isNative()) {
shape = obj->lastProperty();
while (shape && (!shape->hasSlot() || shape->slot() != slot))
@ -5562,11 +5562,11 @@ js_GetObjectSlotName(JSTracer *trc, char *buf, size_t bufsize)
}
}
static const Shape *
static Shape *
LastConfigurableShape(JSObject *obj)
{
for (Shape::Range r(obj->lastProperty()->all()); !r.empty(); r.popFront()) {
const Shape *shape = &r.front();
Shape *shape = &r.front();
if (shape->configurable())
return shape;
}
@ -5577,14 +5577,14 @@ bool
js_ClearNative(JSContext *cx, JSObject *obj)
{
/* Remove all configurable properties from obj. */
while (const Shape *shape = LastConfigurableShape(obj)) {
while (Shape *shape = LastConfigurableShape(obj)) {
if (!obj->removeProperty(cx, shape->propid()))
return false;
}
/* Set all remaining writable plain data properties to undefined. */
for (Shape::Range r(obj->lastProperty()->all()); !r.empty(); r.popFront()) {
const Shape *shape = &r.front();
Shape *shape = &r.front();
if (shape->isDataDescriptor() &&
shape->writable() &&
shape->hasDefaultSetter() &&
@ -5692,7 +5692,7 @@ js_DumpId(jsid id)
}
static void
DumpProperty(JSObject *obj, const Shape &shape)
DumpProperty(JSObject *obj, Shape &shape)
{
jsid id = shape.propid();
uint8_t attrs = shape.attributes();
@ -5795,7 +5795,7 @@ JSObject::dump()
if (obj->isNative()) {
fprintf(stderr, "properties:\n");
Vector<const Shape *, 8, SystemAllocPolicy> props;
Vector<Shape *, 8, SystemAllocPolicy> props;
for (Shape::Range r = obj->lastProperty()->all(); !r.empty(); r.popFront())
props.append(&r.front());
for (size_t i = props.length(); i-- != 0;)

View File

@ -274,10 +274,10 @@ struct JSObject : public js::ObjectImpl
* Update the last property, keeping the number of allocated slots in sync
* with the object's new slot span.
*/
bool setLastProperty(JSContext *cx, const js::Shape *shape);
bool setLastProperty(JSContext *cx, js::Shape *shape);
/* As above, but does not change the slot span. */
inline void setLastPropertyInfallible(const js::Shape *shape);
inline void setLastPropertyInfallible(js::Shape *shape);
/* Make a non-array object with the specified initial state. */
static inline JSObject *create(JSContext *cx,
@ -417,7 +417,7 @@ struct JSObject : public js::ObjectImpl
void rollbackProperties(JSContext *cx, uint32_t slotSpan);
inline void nativeSetSlot(unsigned slot, const js::Value &value);
inline void nativeSetSlotWithType(JSContext *cx, const js::Shape *shape, const js::Value &value);
inline void nativeSetSlotWithType(JSContext *cx, js::Shape *shape, const js::Value &value);
inline const js::Value &getReservedSlot(unsigned index) const;
inline js::HeapSlot &getReservedSlotRef(unsigned index);
@ -1145,12 +1145,12 @@ const unsigned DNP_SKIP_TYPE = 8; /* Don't update type information */
/*
* Return successfully added or changed shape or NULL on error.
*/
extern const Shape *
extern Shape *
DefineNativeProperty(JSContext *cx, HandleObject obj, HandleId id, const Value &value,
PropertyOp getter, StrictPropertyOp setter, unsigned attrs,
unsigned flags, int shortid, unsigned defineHow = 0);
inline const Shape *
inline Shape *
DefineNativeProperty(JSContext *cx, HandleObject obj, PropertyName *name, const Value &value,
PropertyOp getter, StrictPropertyOp setter, unsigned attrs,
unsigned flags, int shortid, unsigned defineHow = 0)
@ -1237,11 +1237,11 @@ const unsigned JSGET_CACHE_RESULT = 1; // from a caching interpreter opcode
*/
extern JSBool
js_NativeGet(JSContext *cx, js::Handle<JSObject*> obj, js::Handle<JSObject*> pobj,
const js::Shape *shape, unsigned getHow, js::Value *vp);
js::Shape *shape, unsigned getHow, js::Value *vp);
extern JSBool
js_NativeSet(JSContext *cx, js::Handle<JSObject*> obj, js::Handle<JSObject*> receiver,
const js::Shape *shape, bool added, bool strict, js::Value *vp);
js::Shape *shape, bool added, bool strict, js::Value *vp);
namespace js {

View File

@ -286,7 +286,7 @@ JSObject::dynamicSlotIndex(size_t slot)
}
inline void
JSObject::setLastPropertyInfallible(const js::Shape *shape)
JSObject::setLastPropertyInfallible(js::Shape *shape)
{
JS_ASSERT(!shape->inDictionary());
JS_ASSERT(shape->compartment() == compartment());
@ -294,7 +294,7 @@ JSObject::setLastPropertyInfallible(const js::Shape *shape)
JS_ASSERT(slotSpan() == shape->slotSpan());
JS_ASSERT(numFixedSlots() == shape->numFixedSlots());
shape_ = const_cast<js::Shape *>(shape);
shape_ = shape;
}
inline void
@ -315,7 +315,7 @@ JSObject::canRemoveLastProperty()
* converted to dictionary mode instead. See BaseShape comment in jsscope.h
*/
JS_ASSERT(!inDictionaryMode());
const js::Shape *previous = lastProperty()->previous();
js::Shape *previous = lastProperty()->previous();
return previous->getObjectParent() == lastProperty()->getObjectParent()
&& previous->getObjectFlags() == lastProperty()->getObjectFlags();
}
@ -958,7 +958,7 @@ JSObject::nativeSetSlot(unsigned slot, const js::Value &value)
}
inline void
JSObject::nativeSetSlotWithType(JSContext *cx, const js::Shape *shape, const js::Value &value)
JSObject::nativeSetSlotWithType(JSContext *cx, js::Shape *shape, const js::Value &value)
{
nativeSetSlot(shape->slot(), value);
js::types::AddTypePropertyId(cx, this, shape->propid(), value);
@ -1536,7 +1536,7 @@ CopyInitializerObject(JSContext *cx, HandleObject baseobj)
JSObject *
NewReshapedObject(JSContext *cx, HandleTypeObject type, JSObject *parent,
gc::AllocKind kind, const Shape *shape);
gc::AllocKind kind, Shape *shape);
/*
* As for gc::GetGCObjectKind, where numSlots is a guess at the final size of

View File

@ -423,7 +423,7 @@ ToDisassemblySource(JSContext *cx, jsval v, JSAutoByteString *bytes)
Shape::Range::AutoRooter root(cx, &r);
while (!r.empty()) {
Rooted<const Shape*> shape(cx, &r.front());
Rooted<Shape*> shape(cx, &r.front());
JSAtom *atom = JSID_IS_INT(shape->propid())
? cx->runtime->atomState.emptyAtom
: JSID_TO_ATOM(shape->propid());
@ -1762,7 +1762,7 @@ static const char *
GetLocalInSlot(SprintStack *ss, int i, int slot, JSObject *obj)
{
for (Shape::Range r(obj->lastProperty()); !r.empty(); r.popFront()) {
const Shape &shape = r.front();
Shape &shape = r.front();
if (shape.shortid() == slot) {
/* Ignore the empty destructuring dummy. */
@ -2321,7 +2321,7 @@ GetBlockNames(JSContext *cx, StaticBlockObject &blockObj, AtomVector *atoms)
unsigned i = numAtoms;
for (Shape::Range r = blockObj.lastProperty()->all(); !r.empty(); r.popFront()) {
const Shape &shape = r.front();
Shape &shape = r.front();
LOCAL_ASSERT(shape.hasShortID());
--i;
LOCAL_ASSERT((unsigned)shape.shortid() == i);

View File

@ -16,7 +16,7 @@ using namespace js;
PropertyCacheEntry *
PropertyCache::fill(JSContext *cx, JSObject *obj, unsigned scopeIndex, JSObject *pobj,
const Shape *shape)
Shape *shape)
{
JS_ASSERT(this == &JS_PROPERTY_CACHE(cx));
JS_ASSERT(!cx->runtime->gcRunning);

View File

@ -25,18 +25,18 @@ class PropertyCache;
struct PropertyCacheEntry
{
jsbytecode *kpc; /* pc of cache-testing bytecode */
const Shape *kshape; /* shape of direct (key) object */
const Shape *pshape; /* shape of owning object */
const Shape *prop; /* shape of accessed property */
jsbytecode *kpc; /* pc of cache-testing bytecode */
Shape *kshape; /* shape of direct (key) object */
Shape *pshape; /* shape of owning object */
Shape *prop; /* shape of accessed property */
friend class PropertyCache;
private:
/* Index into scope chain; inapplicable to property lookup entries. */
uint8_t scopeIndex;
uint8_t scopeIndex;
/* Index into the prototype chain from the object for this entry. */
uint8_t protoIndex;
uint8_t protoIndex;
public:
static const size_t MaxScopeIndex = 15;
@ -62,8 +62,8 @@ struct PropertyCacheEntry
*/
bool isPrototypePropertyHit() const { return scopeIndex == 0 && protoIndex == 1; }
void assign(jsbytecode *kpc, const Shape *kshape, const Shape *pshape,
const Shape *prop, unsigned scopeIndex, unsigned protoIndex) {
void assign(jsbytecode *kpc, Shape *kshape, Shape *pshape,
Shape *prop, unsigned scopeIndex, unsigned protoIndex) {
JS_ASSERT(scopeIndex <= MaxScopeIndex);
JS_ASSERT(protoIndex <= MaxProtoIndex);
@ -184,7 +184,7 @@ class PropertyCache
* not possible.
*/
PropertyCacheEntry *fill(JSContext *cx, JSObject *obj, unsigned scopeIndex,
JSObject *pobj, const js::Shape *shape);
JSObject *pobj, js::Shape *shape);
void purge(JSRuntime *rt);

View File

@ -33,7 +33,7 @@ js::PropertyCache::test(JSContext *cx, jsbytecode *pc, JSObject *&obj,
{
JS_ASSERT(this == &JS_PROPERTY_CACHE(cx));
const Shape *kshape = obj->lastProperty();
Shape *kshape = obj->lastProperty();
entry = &table[hash(pc, kshape)];
PCMETER(pctestentry = entry);
PCMETER(tests++);
@ -64,7 +64,7 @@ js::PropertyCache::testForSet(JSContext *cx, jsbytecode *pc, JSObject *obj,
{
JS_ASSERT(this == &JS_PROPERTY_CACHE(cx));
const Shape *kshape = obj->lastProperty();
Shape *kshape = obj->lastProperty();
PropertyCacheEntry *entry = &table[hash(pc, kshape)];
*entryp = entry;
PCMETER(pctestentry = entry);

View File

@ -201,7 +201,7 @@ Shape::finalize(FreeOp *fop)
#ifdef DEBUG
void
KidsPointer::checkConsistency(const Shape *aKid) const
KidsPointer::checkConsistency(Shape *aKid) const
{
if (isShape()) {
JS_ASSERT(toShape() == aKid);

View File

@ -60,7 +60,7 @@ class KidsPointer {
}
#ifdef DEBUG
void checkConsistency(const js::Shape *aKid) const;
void checkConsistency(js::Shape *aKid) const;
#endif
};

View File

@ -58,7 +58,7 @@ ShapeTable::init(JSRuntime *rt, Shape *lastProp)
hashShift = HASH_BITS - sizeLog2;
for (Shape::Range r = lastProp->all(); !r.empty(); r.popFront()) {
const Shape &shape = r.front();
Shape &shape = r.front();
Shape **spp = search(shape.propid(), true);
/*
@ -589,7 +589,7 @@ JSObject::addPropertyInternal(JSContext *cx, jsid id_,
* enforce all restrictions from ECMA-262 v5 8.12.9 [[DefineOwnProperty]].
*/
inline bool
CheckCanChangeAttrs(JSContext *cx, JSObject *obj, const Shape *shape, unsigned *attrsp)
CheckCanChangeAttrs(JSContext *cx, JSObject *obj, Shape *shape, unsigned *attrsp)
{
if (shape->configurable())
return true;
@ -880,7 +880,7 @@ JSObject::removeProperty(JSContext *cx, jsid id_)
* checks not to alter significantly the complexity of the
* delete in debug builds, see bug 534493.
*/
const Shape *aprop = self->lastProperty();
Shape *aprop = self->lastProperty();
for (int n = 50; --n >= 0 && aprop->parent; aprop = aprop->parent)
JS_ASSERT_IF(aprop != shape, self->nativeContains(cx, *aprop));
#endif
@ -1352,7 +1352,7 @@ EmptyShape::insertInitialShape(JSContext *cx, Shape *shape, JSObject *proto)
/* The new shape had better be rooted at the old one. */
#ifdef DEBUG
const Shape *nshape = shape;
Shape *nshape = shape;
while (!nshape->isEmptyShape())
nshape = nshape->previous();
JS_ASSERT(nshape == entry.shape);

View File

@ -559,16 +559,16 @@ struct Shape : public js::gc::Cell
class Range {
protected:
friend struct Shape;
const Shape *cursor;
Shape *cursor;
public:
Range(const Shape *shape) : cursor(shape) { }
Range(Shape *shape) : cursor(shape) { }
bool empty() const {
return cursor->isEmptyShape();
}
const Shape &front() const {
Shape &front() const {
JS_ASSERT(!empty());
return *cursor;
}
@ -598,7 +598,7 @@ struct Shape : public js::gc::Cell
};
};
Range all() const {
Range all() {
return Range(this);
}
@ -700,8 +700,8 @@ struct Shape : public js::gc::Cell
uint32_t aslot, unsigned aattrs, unsigned aflags,
int ashortid) const;
bool get(JSContext* cx, HandleObject receiver, JSObject *obj, JSObject *pobj, js::Value* vp) const;
bool set(JSContext* cx, HandleObject obj, HandleObject receiver, bool strict, js::Value* vp) const;
bool get(JSContext* cx, HandleObject receiver, JSObject *obj, JSObject *pobj, js::Value* vp);
bool set(JSContext* cx, HandleObject obj, HandleObject receiver, bool strict, js::Value* vp);
BaseShape *base() const { return base_; }
@ -847,20 +847,20 @@ struct Shape : public js::gc::Cell
static Shape *setExtensibleParents(JSContext *cx, Shape *shape);
bool extensibleParents() const { return !!(base()->flags & BaseShape::EXTENSIBLE_PARENTS); }
uint32_t entryCount() const {
uint32_t entryCount() {
if (hasTable())
return table().entryCount;
const js::Shape *shape = this;
js::Shape *shape = this;
uint32_t count = 0;
for (js::Shape::Range r = shape->all(); !r.empty(); r.popFront())
++count;
return count;
}
bool isBigEnoughForAShapeTable() const {
bool isBigEnoughForAShapeTable() {
JS_ASSERT(!hasTable());
const js::Shape *shape = this;
js::Shape *shape = this;
uint32_t count = 0;
for (js::Shape::Range r = shape->all(); !r.empty(); r.popFront()) {
++count;
@ -878,15 +878,15 @@ struct Shape : public js::gc::Cell
void finalize(FreeOp *fop);
void removeChild(js::Shape *child);
static inline void writeBarrierPre(const Shape *shape);
static inline void writeBarrierPost(const Shape *shape, void *addr);
static inline void writeBarrierPre(Shape *shape);
static inline void writeBarrierPost(Shape *shape, void *addr);
/*
* All weak references need a read barrier for incremental GC. This getter
* method implements the read barrier. It's used to obtain initial shapes
* from the compartment.
*/
static inline void readBarrier(const Shape *shape);
static inline void readBarrier(Shape *shape);
static inline ThingRootKind rootKind() { return THING_ROOT_SHAPE; }

View File

@ -265,7 +265,7 @@ Shape::getUserId(JSContext *cx, jsid *idp) const
}
inline bool
Shape::get(JSContext* cx, HandleObject receiver, JSObject* obj, JSObject *pobj, Value* vp) const
Shape::get(JSContext* cx, HandleObject receiver, JSObject* obj, JSObject *pobj, Value* vp)
{
JS_ASSERT(!hasDefaultGetter());
@ -274,7 +274,7 @@ Shape::get(JSContext* cx, HandleObject receiver, JSObject* obj, JSObject *pobj,
return InvokeGetterOrSetter(cx, receiver, fval, 0, 0, vp);
}
Rooted<const Shape *> self(cx, this);
Rooted<Shape *> self(cx, this);
RootedId id(cx);
if (!self->getUserId(cx, id.address()))
return false;
@ -283,7 +283,7 @@ Shape::get(JSContext* cx, HandleObject receiver, JSObject* obj, JSObject *pobj,
}
inline bool
Shape::set(JSContext* cx, HandleObject obj, HandleObject receiver, bool strict, Value* vp) const
Shape::set(JSContext* cx, HandleObject obj, HandleObject receiver, bool strict, Value* vp)
{
JS_ASSERT_IF(hasDefaultSetter(), hasGetterValue());
@ -295,7 +295,7 @@ Shape::set(JSContext* cx, HandleObject obj, HandleObject receiver, bool strict,
if (attrs & JSPROP_GETTER)
return js_ReportGetterOnlyAssignment(cx);
Rooted<const Shape *> self(cx, this);
Rooted<Shape *> self(cx, this);
RootedId id(cx);
if (!self->getUserId(cx, id.address()))
return false;
@ -379,7 +379,7 @@ EmptyShape::EmptyShape(UnownedBaseShape *base, uint32_t nfixed)
}
inline void
Shape::writeBarrierPre(const js::Shape *shape)
Shape::writeBarrierPre(Shape *shape)
{
#ifdef JSGC_INCREMENTAL
if (!shape)
@ -395,12 +395,12 @@ Shape::writeBarrierPre(const js::Shape *shape)
}
inline void
Shape::writeBarrierPost(const js::Shape *shape, void *addr)
Shape::writeBarrierPost(Shape *shape, void *addr)
{
}
inline void
Shape::readBarrier(const Shape *shape)
Shape::readBarrier(Shape *shape)
{
#ifdef JSGC_INCREMENTAL
JSCompartment *comp = shape->compartment();

View File

@ -154,13 +154,13 @@ Bindings::callObjectShape(JSContext *cx) const
* to first (i.e., the order we normally have iterate over Shapes). Choose
* the last added property in each set of dups.
*/
Vector<const Shape *> shapes(cx);
Vector<Shape *> shapes(cx);
HashSet<jsid> seen(cx);
if (!seen.init())
return NULL;
for (Shape::Range r = lastShape()->all(); !r.empty(); r.popFront()) {
const Shape &s = r.front();
Shape &s = r.front();
HashSet<jsid>::AddPtr p = seen.lookupForAdd(s.propid());
if (!p) {
if (!seen.add(p, s.propid()))
@ -205,7 +205,7 @@ Bindings::getLocalNameArray(JSContext *cx, BindingNames *namesp)
#endif
for (Shape::Range r = lastBinding->all(); !r.empty(); r.popFront()) {
const Shape &shape = r.front();
Shape &shape = r.front();
unsigned index = uint16_t(shape.shortid());
if (shape.setter() == CallObject::setArgOp) {
@ -234,7 +234,7 @@ Bindings::getLocalNameArray(JSContext *cx, BindingNames *namesp)
return true;
}
const Shape *
Shape *
Bindings::lastVariable() const
{
JS_ASSERT(lastBinding);

View File

@ -209,7 +209,7 @@ class Bindings
* Sometimes iteration order must be from oldest to youngest, however. For
* such cases, use js::Bindings::getLocalNameArray.
*/
const js::Shape *lastVariable() const;
js::Shape *lastVariable() const;
void trace(JSTracer *trc);

View File

@ -115,7 +115,7 @@ WatchpointMap::triggerWatchpoint(JSContext *cx, HandleObject obj, HandleId id, V
Value old;
old.setUndefined();
if (obj->isNative()) {
if (const Shape *shape = obj->nativeLookup(cx, id)) {
if (Shape *shape = obj->nativeLookup(cx, id)) {
if (shape->hasSlot())
old = obj->nativeGetSlot(shape->slot());
}

View File

@ -4768,7 +4768,7 @@ xml_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHandleObj
objp.set(NULL);
*propp = NULL;
} else {
const Shape *shape =
Shape *shape =
js_AddNativeProperty(cx, obj, id, GetProperty, PutProperty,
SHAPE_INVALID_SLOT, JSPROP_ENUMERATE,
0, 0);
@ -4804,7 +4804,7 @@ xml_lookupElement(JSContext *cx, HandleObject obj, uint32_t index, MutableHandle
if (!IndexToId(cx, index, &id))
return false;
const Shape *shape =
Shape *shape =
js_AddNativeProperty(cx, obj, id, GetProperty, PutProperty, SHAPE_INVALID_SLOT,
JSPROP_ENUMERATE, 0, 0);
if (!shape)

View File

@ -160,7 +160,7 @@ static const JSC::MacroAssembler::RegisterID JSParamReg_Argc = JSC::MIPSRegiste
loadPtr(Address(obj, JSObject::offsetOfShape()), shape);
}
Jump guardShape(RegisterID objReg, const Shape *shape) {
Jump guardShape(RegisterID objReg, Shape *shape) {
return branchPtr(NotEqual, Address(objReg, JSObject::offsetOfShape()), ImmPtr(shape));
}
@ -899,7 +899,7 @@ static const JSC::MacroAssembler::RegisterID JSParamReg_Argc = JSC::MIPSRegiste
}
void loadObjProp(JSObject *obj, RegisterID objReg,
const js::Shape *shape,
js::Shape *shape,
RegisterID typeReg, RegisterID dataReg)
{
if (obj->isFixedSlot(shape->slot()))

View File

@ -6285,7 +6285,7 @@ mjit::Compiler::jsop_getgname(uint32_t index)
* then bake its address into the jitcode and guard against future
* reallocation of the global object's slots.
*/
const js::Shape *shape = globalObj->nativeLookup(cx, NameToId(name));
js::Shape *shape = globalObj->nativeLookup(cx, NameToId(name));
if (shape && shape->hasDefaultGetter() && shape->hasSlot()) {
HeapSlot *value = &globalObj->getSlotRef(shape->slot());
if (!value->isUndefined() &&
@ -6408,7 +6408,7 @@ mjit::Compiler::jsop_setgname(PropertyName *name, bool popGuaranteed)
types::TypeSet *types = globalObj->getType(cx)->getProperty(cx, id, false);
if (!types)
return false;
const js::Shape *shape = globalObj->nativeLookup(cx, NameToId(name));
js::Shape *shape = globalObj->nativeLookup(cx, NameToId(name));
if (shape && shape->hasDefaultSetter() &&
shape->writable() && shape->hasSlot() &&
!types->isOwnProperty(cx, globalObj->getType(cx), true)) {

View File

@ -63,7 +63,7 @@ ic::GetGlobalName(VMFrame &f, ic::GetGlobalNameIC *ic)
RecompilationMonitor monitor(f.cx);
const Shape *shape = obj.nativeLookup(f.cx, NameToId(name));
Shape *shape = obj.nativeLookup(f.cx, NameToId(name));
if (monitor.recompiled()) {
stubs::Name(f);
@ -115,14 +115,14 @@ PatchSetFallback(VMFrame &f, ic::SetGlobalNameIC *ic)
}
void
SetGlobalNameIC::patchInlineShapeGuard(Repatcher &repatcher, const Shape *shape)
SetGlobalNameIC::patchInlineShapeGuard(Repatcher &repatcher, Shape *shape)
{
JSC::CodeLocationDataLabelPtr label = fastPathStart.dataLabelPtrAtOffset(shapeOffset);
repatcher.repatch(label, shape);
}
static LookupStatus
UpdateSetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic, JSObject *obj, const Shape *shape)
UpdateSetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic, JSObject *obj, Shape *shape)
{
/* Give globals a chance to appear. */
if (!shape)
@ -159,7 +159,7 @@ ic::SetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic)
RecompilationMonitor monitor(f.cx);
const Shape *shape = obj.nativeLookup(f.cx, NameToId(name));
Shape *shape = obj.nativeLookup(f.cx, NameToId(name));
if (!monitor.recompiled()) {
LookupStatus status = UpdateSetGlobalName(f, ic, &obj, shape);

View File

@ -116,7 +116,7 @@ struct SetGlobalNameIC : public GlobalNameIC
/* SET only. */
ValueRemat vr; /* RHS value. */
void patchInlineShapeGuard(Repatcher &repatcher, const Shape *shape);
void patchInlineShapeGuard(Repatcher &repatcher, Shape *shape);
};
void JS_FASTCALL GetGlobalName(VMFrame &f, ic::GetGlobalNameIC *ic);

View File

@ -189,7 +189,7 @@ class SetPropCompiler : public PICStubCompiler
repatcher.relink(pic.slowPathCall, target);
}
LookupStatus patchInline(const Shape *shape)
LookupStatus patchInline(Shape *shape)
{
JS_ASSERT(!pic.inlinePathPatched);
JaegerSpew(JSpew_PICs, "patch setprop inline at %p\n", pic.fastPathStart.executableAddress());
@ -249,7 +249,7 @@ class SetPropCompiler : public PICStubCompiler
repatcher.relink(label.jumpAtOffset(secondGuardOffset), cs);
}
LookupStatus generateStub(const Shape *initialShape, const Shape *shape, bool adding)
LookupStatus generateStub(Shape *initialShape, Shape *shape, bool adding)
{
if (hadGC())
return Lookup_Uncacheable;
@ -465,7 +465,7 @@ class SetPropCompiler : public PICStubCompiler
/* If the property exists but is on a prototype, treat as addprop. */
if (prop && holder != obj) {
const Shape *shape = (const Shape *) prop;
Shape *shape = (Shape *) prop;
if (!holder->isNative())
return disable("non-native holder");
@ -512,7 +512,7 @@ class SetPropCompiler : public PICStubCompiler
proto = proto->getProto();
}
const Shape *initialShape = obj->lastProperty();
Shape *initialShape = obj->lastProperty();
uint32_t slots = obj->numDynamicSlots();
unsigned flags = 0;
@ -523,7 +523,7 @@ class SetPropCompiler : public PICStubCompiler
* populate the slot to satisfy the method invariant (in case we
* hit an early return below).
*/
const Shape *shape =
Shape *shape =
obj->putProperty(cx, name, getter, clasp->setProperty,
SHAPE_INVALID_SLOT, JSPROP_ENUMERATE, flags, 0);
if (!shape)
@ -575,7 +575,7 @@ class SetPropCompiler : public PICStubCompiler
return generateStub(initialShape, shape, true);
}
const Shape *shape = (const Shape *) prop;
Shape *shape = (Shape *) prop;
if (!shape->writable())
return disable("readonly");
if (shape->hasDefaultSetter()) {
@ -665,7 +665,7 @@ struct GetPropHelper {
// This field is set by |bind| and |lookup| only if they returned
// Lookup_Cacheable, otherwise it is NULL.
const Shape *shape;
Shape *shape;
GetPropHelper(JSContext *cx, JSObject *obj, PropertyName *name, IC &ic, VMFrame &f)
: cx(cx), obj(cx, obj), name(cx, name), ic(ic), f(f), holder(cx), prop(NULL), shape(NULL)
@ -687,7 +687,7 @@ struct GetPropHelper {
return ic.disable(cx, "non-native");
if (!IsCacheableProtoChain(obj, holder))
return ic.disable(cx, "non-native holder");
shape = (const Shape *)prop;
shape = (Shape *)prop;
return Lookup_Cacheable;
}
@ -708,7 +708,7 @@ struct GetPropHelper {
return ic.disable(f, "lookup failed");
if (!IsCacheableProtoChain(obj, holder))
return ic.disable(f, "non-native holder");
shape = (const Shape *)prop;
shape = (Shape *)prop;
return Lookup_Cacheable;
}
@ -984,7 +984,7 @@ class GetPropCompiler : public PICStubCompiler
return Lookup_Cacheable;
}
LookupStatus patchInline(JSObject *holder, const Shape *shape)
LookupStatus patchInline(JSObject *holder, Shape *shape)
{
spew("patch", "inline");
Repatcher repatcher(f.chunk());
@ -1019,7 +1019,7 @@ class GetPropCompiler : public PICStubCompiler
}
/* For JSPropertyOp getters. */
void generateGetterStub(Assembler &masm, const Shape *shape, jsid userid,
void generateGetterStub(Assembler &masm, Shape *shape, jsid userid,
Label start, Vector<Jump, 8> &shapeMismatches)
{
/*
@ -1126,7 +1126,7 @@ class GetPropCompiler : public PICStubCompiler
}
/* For getters backed by a JSNative. */
void generateNativeGetterStub(Assembler &masm, const Shape *shape,
void generateNativeGetterStub(Assembler &masm, Shape *shape,
Label start, Vector<Jump, 8> &shapeMismatches)
{
/*
@ -1217,7 +1217,7 @@ class GetPropCompiler : public PICStubCompiler
linkerEpilogue(linker, start, shapeMismatches);
}
LookupStatus generateStub(JSObject *holder, const Shape *shape)
LookupStatus generateStub(JSObject *holder, Shape *shape)
{
Vector<Jump, 8> shapeMismatches(cx);
@ -1562,7 +1562,7 @@ class ScopeNameCompiler : public PICStubCompiler
JS_ASSERT(getprop.holder != &scopeChain->global());
CallObjPropKind kind;
const Shape *shape = getprop.shape;
Shape *shape = getprop.shape;
if (shape->setterOp() == CallObject::setArgOp) {
kind = ARG;
} else if (shape->setterOp() == CallObject::setVarOp) {
@ -1698,7 +1698,7 @@ class ScopeNameCompiler : public PICStubCompiler
return true;
}
const Shape *shape = getprop.shape;
Shape *shape = getprop.shape;
Rooted<JSObject*> normalized(cx, obj);
if (obj->isWith() && !shape->hasDefaultGetter())
normalized = &obj->asWith().object();
@ -2257,7 +2257,7 @@ GetElementIC::attachGetProp(VMFrame &f, JSObject *obj, const Value &v, PropertyN
}
// Load the value.
const Shape *shape = getprop.shape;
Shape *shape = getprop.shape;
masm.loadObjProp(holder, holderReg, shape, typeReg, objReg);
Jump done = masm.jump();

View File

@ -841,7 +841,7 @@ Debugger::parseResumptionValue(AutoCompartment &ac, bool ok, const Value &rv, Va
/* Check that rv is {return: val} or {throw: val}. */
JSContext *cx = ac.context;
Rooted<JSObject*> obj(cx);
const Shape *shape;
Shape *shape;
jsid returnId = NameToId(cx->runtime->atomState.returnAtom);
jsid throwId = NameToId(cx->runtime->atomState.throwAtom);
bool okResumption = rv.isObject();

View File

@ -40,26 +40,26 @@ Debug_SetSlotRangeToCrashOnTouch(HeapSlot *begin, HeapSlot *end)
} // namespace js
inline const js::Shape *
inline js::Shape *
js::ObjectImpl::nativeLookup(JSContext *cx, PropertyId pid)
{
return nativeLookup(cx, pid.asId());
}
inline const js::Shape *
inline js::Shape *
js::ObjectImpl::nativeLookup(JSContext *cx, PropertyName *name)
{
return nativeLookup(cx, PropertyId(name));
}
#ifdef DEBUG
inline const js::Shape *
inline js::Shape *
js::ObjectImpl::nativeLookupNoAllocation(JSContext *cx, PropertyId pid)
{
return nativeLookupNoAllocation(cx, pid.asId());
}
inline const js::Shape *
inline js::Shape *
js::ObjectImpl::nativeLookupNoAllocation(JSContext *cx, PropertyName *name)
{
return nativeLookupNoAllocation(cx, PropertyId(name));

View File

@ -257,7 +257,7 @@ js::ObjectImpl::slotInRange(uint32_t slot, SentinelAllowed sentinel) const
*/
MOZ_NEVER_INLINE
#endif
const Shape *
Shape *
js::ObjectImpl::nativeLookup(JSContext *cx, jsid id)
{
MOZ_ASSERT(isNative());
@ -266,7 +266,7 @@ js::ObjectImpl::nativeLookup(JSContext *cx, jsid id)
}
#ifdef DEBUG
const Shape *
Shape *
js::ObjectImpl::nativeLookupNoAllocation(JSContext *cx, jsid id)
{
MOZ_ASSERT(isNative());
@ -503,7 +503,7 @@ js::GetOwnProperty(JSContext *cx, Handle<ObjectImpl*> obj, PropertyId pid_, unsi
return false;
}
const Shape *shape = obj->nativeLookup(cx, pid);
Shape *shape = obj->nativeLookup(cx, pid);
if (!shape) {
/* Not found: attempt to resolve it. */
Class *clasp = obj->getClass();

View File

@ -1138,14 +1138,14 @@ class ObjectImpl : public gc::Cell
/* Compute dynamicSlotsCount() for this object. */
inline uint32_t numDynamicSlots() const;
const Shape * nativeLookup(JSContext *cx, jsid id);
inline const Shape * nativeLookup(JSContext *cx, PropertyId pid);
inline const Shape * nativeLookup(JSContext *cx, PropertyName *name);
Shape * nativeLookup(JSContext *cx, jsid id);
inline Shape * nativeLookup(JSContext *cx, PropertyId pid);
inline Shape * nativeLookup(JSContext *cx, PropertyName *name);
#ifdef DEBUG
const Shape * nativeLookupNoAllocation(JSContext *cx, jsid id);
inline const Shape * nativeLookupNoAllocation(JSContext *cx, PropertyId pid);
inline const Shape * nativeLookupNoAllocation(JSContext *cx, PropertyName *name);
Shape * nativeLookupNoAllocation(JSContext *cx, jsid id);
inline Shape * nativeLookupNoAllocation(JSContext *cx, PropertyId pid);
inline Shape * nativeLookupNoAllocation(JSContext *cx, PropertyName *name);
#endif
inline Class *getClass() const;

View File

@ -661,7 +661,7 @@ StaticBlockObject::create(JSContext *cx)
return &obj->asStaticBlock();
}
const Shape *
Shape *
StaticBlockObject::addVar(JSContext *cx, jsid id, int index, bool *redeclared)
{
JS_ASSERT(JSID_IS_ATOM(id) || (JSID_IS_INT(id) && JSID_TO_INT(id) == index));
@ -804,7 +804,7 @@ js::XDRStaticBlockObject(XDRState<mode> *xdr, JSScript *script, StaticBlockObjec
return false;
for (Shape::Range r(obj->lastProperty()); !r.empty(); r.popFront()) {
const Shape *shape = &r.front();
Shape *shape = &r.front();
shapes[shape->shortid()] = shape;
}
@ -813,7 +813,7 @@ js::XDRStaticBlockObject(XDRState<mode> *xdr, JSScript *script, StaticBlockObjec
* properties to XDR, stored as id/shortid pairs.
*/
for (unsigned i = 0; i < count; i++) {
const Shape *shape = shapes[i];
Shape *shape = shapes[i];
JS_ASSERT(shape->hasDefaultGetter());
JS_ASSERT(unsigned(shape->shortid()) == i);
@ -866,7 +866,7 @@ js::CloneStaticBlockObject(JSContext *cx, StaticBlockObject &srcBlock,
for (Shape::Range r = srcBlock.lastProperty()->all(); !r.empty(); r.popFront())
shapes[r.front().shortid()] = &r.front();
for (const Shape **p = shapes.begin(); p != shapes.end(); ++p) {
for (Shape **p = shapes.begin(); p != shapes.end(); ++p) {
jsid id = (*p)->propid();
unsigned i = (*p)->shortid();

View File

@ -262,7 +262,7 @@ class StaticBlockObject : public BlockObject
*/
bool needsClone();
const Shape *addVar(JSContext *cx, jsid id, int index, bool *redeclared);
Shape *addVar(JSContext *cx, jsid id, int index, bool *redeclared);
};
class ClonedBlockObject : public BlockObject