Bug 867426 - Remove RawShape typedef; r=jonco

--HG--
extra : rebase_source : fc48e7b49d2dce668685a4f220c8adb1f33aa40a
This commit is contained in:
Terrence Cole 2013-04-30 15:40:09 -07:00
parent d4acfa8dae
commit a2cdb60019
52 changed files with 229 additions and 229 deletions

View File

@ -123,7 +123,7 @@ frontend::LexicalLookup(ContextT *ct, HandleAtom atom, int *slotp, typename Cont
continue;
StaticBlockObject &blockObj = *stmt->blockObj;
RawShape shape = blockObj.nativeLookup(ct->sc->context, id);
Shape *shape = blockObj.nativeLookup(ct->sc->context, id);
if (shape) {
JS_ASSERT(shape->hasShortID());

View File

@ -69,7 +69,7 @@ static inline void
PushMarkStack(GCMarker *gcmarker, RawScript thing);
static inline void
PushMarkStack(GCMarker *gcmarker, RawShape thing);
PushMarkStack(GCMarker *gcmarker, Shape *thing);
static inline void
PushMarkStack(GCMarker *gcmarker, JSString *thing);
@ -82,7 +82,7 @@ namespace gc {
static void MarkChildren(JSTracer *trc, JSString *str);
static void MarkChildren(JSTracer *trc, RawScript script);
static void MarkChildren(JSTracer *trc, RawShape shape);
static void MarkChildren(JSTracer *trc, Shape *shape);
static void MarkChildren(JSTracer *trc, BaseShape *base);
static void MarkChildren(JSTracer *trc, types::TypeObject *type);
static void MarkChildren(JSTracer *trc, ion::IonCode *code);
@ -392,7 +392,7 @@ gc::MarkKind(JSTracer *trc, void **thingp, JSGCTraceKind kind)
MarkInternal(trc, reinterpret_cast<RawScript *>(thingp));
break;
case JSTRACE_SHAPE:
MarkInternal(trc, reinterpret_cast<RawShape *>(thingp));
MarkInternal(trc, reinterpret_cast<Shape **>(thingp));
break;
case JSTRACE_BASE_SHAPE:
MarkInternal(trc, reinterpret_cast<BaseShape **>(thingp));
@ -794,10 +794,10 @@ PushMarkStack(GCMarker *gcmarker, RawScript thing)
}
static void
ScanShape(GCMarker *gcmarker, RawShape shape);
ScanShape(GCMarker *gcmarker, Shape *shape);
static void
PushMarkStack(GCMarker *gcmarker, RawShape thing)
PushMarkStack(GCMarker *gcmarker, Shape *thing)
{
JS_COMPARTMENT_ASSERT(gcmarker->runtime, thing);
JS_ASSERT(!IsInsideNursery(thing->runtime(), thing));
@ -832,7 +832,7 @@ PushMarkStack(GCMarker *gcmarker, BaseShape *thing)
}
static void
ScanShape(GCMarker *gcmarker, RawShape shape)
ScanShape(GCMarker *gcmarker, Shape *shape)
{
restart:
PushMarkStack(gcmarker, shape->base());
@ -999,7 +999,7 @@ gc::MarkChildren(JSTracer *trc, RawScript script)
}
static void
gc::MarkChildren(JSTracer *trc, RawShape shape)
gc::MarkChildren(JSTracer *trc, Shape *shape)
{
shape->markChildren(trc);
}
@ -1059,7 +1059,7 @@ MarkCycleCollectorChildren(JSTracer *trc, BaseShape *base, JSObject **prevParent
* parent pointer will only be marked once.
*/
void
gc::MarkCycleCollectorChildren(JSTracer *trc, RawShape shape)
gc::MarkCycleCollectorChildren(JSTracer *trc, Shape *shape)
{
JSObject *prevParent = NULL;
do {
@ -1400,7 +1400,7 @@ GCMarker::processMarkStackTop(SliceBudget &budget)
types::TypeObject *type = obj->typeFromGC();
PushMarkStack(this, type);
RawShape shape = obj->lastProperty();
Shape *shape = obj->lastProperty();
PushMarkStack(this, shape);
/* Call the trace hook if necessary. */
@ -1503,7 +1503,7 @@ js::TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind)
break;
case JSTRACE_SHAPE:
MarkChildren(trc, static_cast<RawShape>(thing));
MarkChildren(trc, static_cast<Shape *>(thing));
break;
case JSTRACE_IONCODE:

View File

@ -245,7 +245,7 @@ MarkChildren(JSTracer *trc, JSObject *obj);
* JS_TraceShapeCycleCollectorChildren.
*/
void
MarkCycleCollectorChildren(JSTracer *trc, RawShape shape);
MarkCycleCollectorChildren(JSTracer *trc, Shape *shape);
void
PushArena(GCMarker *gcmarker, ArenaHeader *aheader);

View File

@ -1689,7 +1689,7 @@ BaselineCompiler::getScopeCoordinateAddress(Register reg)
for (unsigned i = sc.hops; i; i--)
masm.extractObject(Address(reg, ScopeObject::offsetOfEnclosingScope()), reg);
RawShape shape = ScopeCoordinateToStaticScopeShape(cx, script, pc);
Shape *shape = ScopeCoordinateToStaticScopeShape(cx, script, pc);
Address addr;
if (shape->numFixedSlots() <= sc.slot) {
masm.loadPtr(Address(reg, JSObject::offsetOfSlots()), reg);

View File

@ -2980,7 +2980,7 @@ class ICGetElem_Dense : public ICMonitoredStub
bool generateStubCode(MacroAssembler &masm);
public:
Compiler(JSContext *cx, ICStub *firstMonitorStub, RawShape shape)
Compiler(JSContext *cx, ICStub *firstMonitorStub, Shape *shape)
: ICStubCompiler(cx, ICStub::GetElem_Dense),
firstMonitorStub_(firstMonitorStub),
shape_(cx, shape)
@ -3030,7 +3030,7 @@ class ICGetElem_TypedArray : public ICStub
}
public:
Compiler(JSContext *cx, RawShape shape, uint32_t type)
Compiler(JSContext *cx, Shape *shape, uint32_t type)
: ICStubCompiler(cx, ICStub::GetElem_TypedArray),
shape_(cx, shape),
type_(type)
@ -3171,7 +3171,7 @@ class ICSetElem_Dense : public ICUpdatedStub
bool generateStubCode(MacroAssembler &masm);
public:
Compiler(JSContext *cx, RawShape shape, HandleTypeObject type)
Compiler(JSContext *cx, Shape *shape, HandleTypeObject type)
: ICStubCompiler(cx, ICStub::SetElem_Dense),
shape_(cx, shape),
type_(type)
@ -3338,7 +3338,7 @@ class ICSetElem_TypedArray : public ICStub
}
public:
Compiler(JSContext *cx, RawShape shape, uint32_t type, bool expectOutOfBounds)
Compiler(JSContext *cx, Shape *shape, uint32_t type, bool expectOutOfBounds)
: ICStubCompiler(cx, ICStub::SetElem_TypedArray),
shape_(cx, shape),
type_(type),

View File

@ -42,7 +42,7 @@ BaselineInspector::maybeShapesForPropertyOp(jsbytecode *pc, Vector<Shape *> &sha
ICStub *stub = entry.firstStub();
while (stub->next()) {
RawShape shape;
Shape *shape;
if (stub->isGetProp_Native()) {
shape = stub->toGetProp_Native()->shape();
} else if (stub->isSetProp_Native()) {

View File

@ -939,7 +939,7 @@ CodeGenerator::emitGetPropertyPolymorphic(LInstruction *ins, Register obj, Regis
Label next;
masm.branchPtr(Assembler::NotEqual, scratch, ImmGCPtr(mir->objShape(i)), &next);
RawShape shape = mir->shape(i);
Shape *shape = mir->shape(i);
if (shape->slot() < shape->numFixedSlots()) {
// Fixed slot.
masm.loadTypedOrValue(Address(obj, JSObject::getFixedSlotOffset(shape->slot())),
@ -996,7 +996,7 @@ CodeGenerator::emitSetPropertyPolymorphic(LInstruction *ins, Register obj, Regis
Label next;
masm.branchPtr(Assembler::NotEqual, scratch, ImmGCPtr(mir->objShape(i)), &next);
RawShape shape = mir->shape(i);
Shape *shape = mir->shape(i);
if (shape->slot() < shape->numFixedSlots()) {
// Fixed slot.
Address addr(obj, JSObject::getFixedSlotOffset(shape->slot()));

View File

@ -7100,7 +7100,7 @@ IonBuilder::invalidatedIdempotentCache()
}
bool
IonBuilder::loadSlot(MDefinition *obj, RawShape shape, MIRType rvalType,
IonBuilder::loadSlot(MDefinition *obj, Shape *shape, MIRType rvalType,
bool barrier, types::StackTypeSet *types)
{
JS_ASSERT(shape->hasDefaultGetter());
@ -7127,7 +7127,7 @@ IonBuilder::loadSlot(MDefinition *obj, RawShape shape, MIRType rvalType,
}
bool
IonBuilder::storeSlot(MDefinition *obj, RawShape shape, MDefinition *value, bool needsBarrier)
IonBuilder::storeSlot(MDefinition *obj, Shape *shape, MDefinition *value, bool needsBarrier)
{
JS_ASSERT(shape->hasDefaultSetter());
JS_ASSERT(shape->writable());
@ -7368,7 +7368,7 @@ IonBuilder::getPropTryInlineAccess(bool *emitted, HandlePropertyName name, Handl
return true;
Vector<Shape *> shapes(cx);
if (RawShape objShape = mjit::GetPICSingleShape(cx, script(), pc, info().constructing())) {
if (Shape *objShape = mjit::GetPICSingleShape(cx, script(), pc, info().constructing())) {
if (!shapes.append(objShape))
return false;
} else {
@ -7389,10 +7389,10 @@ IonBuilder::getPropTryInlineAccess(bool *emitted, HandlePropertyName name, Handl
// instructions.
spew("Inlining monomorphic GETPROP");
RawShape objShape = shapes[0];
Shape *objShape = shapes[0];
obj = addShapeGuard(obj, objShape, Bailout_CachedShapeGuard);
RawShape shape = objShape->search(cx, id);
Shape *shape = objShape->search(cx, id);
JS_ASSERT(shape);
if (!loadSlot(obj, shape, rvalType, barrier, types))
@ -7406,8 +7406,8 @@ IonBuilder::getPropTryInlineAccess(bool *emitted, HandlePropertyName name, Handl
current->push(load);
for (size_t i = 0; i < shapes.length(); i++) {
RawShape objShape = shapes[i];
RawShape shape = objShape->search(cx, id);
Shape *objShape = shapes[i];
Shape *shape = objShape->search(cx, id);
JS_ASSERT(shape);
if (!load->addShape(objShape, shape))
return false;
@ -7568,7 +7568,7 @@ IonBuilder::jsop_setprop(HandlePropertyName name)
}
Vector<Shape *> shapes(cx);
if (RawShape objShape = mjit::GetPICSingleShape(cx, script(), pc, info().constructing())) {
if (Shape *objShape = mjit::GetPICSingleShape(cx, script(), pc, info().constructing())) {
if (!shapes.append(objShape))
return false;
} else {
@ -7584,10 +7584,10 @@ IonBuilder::jsop_setprop(HandlePropertyName name)
// long as the shape is not in dictionary mode. We cannot be sure
// that the shape is still a lastProperty, and calling Shape::search
// on dictionary mode shapes that aren't lastProperty is invalid.
RawShape objShape = shapes[0];
Shape *objShape = shapes[0];
obj = addShapeGuard(obj, objShape, Bailout_CachedShapeGuard);
RawShape shape = objShape->search(cx, NameToId(name));
Shape *shape = objShape->search(cx, NameToId(name));
JS_ASSERT(shape);
bool needsBarrier = objTypes->propertyNeedsBarrier(cx, id);
@ -7601,8 +7601,8 @@ IonBuilder::jsop_setprop(HandlePropertyName name)
current->push(value);
for (size_t i = 0; i < shapes.length(); i++) {
RawShape objShape = shapes[i];
RawShape shape = objShape->search(cx, id);
Shape *objShape = shapes[i];
Shape *shape = objShape->search(cx, id);
JS_ASSERT(shape);
if (!ins->addShape(objShape, shape))
return false;
@ -8017,7 +8017,7 @@ IonBuilder::addBoundsCheck(MDefinition *index, MDefinition *length)
}
MInstruction *
IonBuilder::addShapeGuard(MDefinition *obj, const RawShape shape, BailoutKind bailoutKind)
IonBuilder::addShapeGuard(MDefinition *obj, Shape *const shape, BailoutKind bailoutKind)
{
MGuardShape *guard = MGuardShape::New(obj, shape, bailoutKind);
current->add(guard);

View File

@ -321,7 +321,7 @@ class IonBuilder : public MIRGenerator
MInstruction *addConvertElementsToDoubles(MDefinition *elements);
MInstruction *addBoundsCheck(MDefinition *index, MDefinition *length);
MInstruction *addShapeGuard(MDefinition *obj, const RawShape shape, BailoutKind bailoutKind);
MInstruction *addShapeGuard(MDefinition *obj, Shape *const shape, BailoutKind bailoutKind);
JSObject *getNewArrayTemplateObject(uint32_t count);
MDefinition *convertShiftToMaskForStaticTypedArray(MDefinition *id,
@ -329,9 +329,9 @@ class IonBuilder : public MIRGenerator
bool invalidatedIdempotentCache();
bool loadSlot(MDefinition *obj, RawShape shape, MIRType rvalType,
bool loadSlot(MDefinition *obj, Shape *shape, MIRType rvalType,
bool barrier, types::StackTypeSet *types);
bool storeSlot(MDefinition *obj, RawShape shape, MDefinition *value, bool needsBarrier);
bool storeSlot(MDefinition *obj, Shape *shape, MDefinition *value, bool needsBarrier);
// jsop_getprop() helpers.
bool getPropTryArgumentsLength(bool *emitted);

View File

@ -481,7 +481,7 @@ IsCacheableProtoChain(JSObject *obj, JSObject *holder)
}
static bool
IsCacheableGetPropReadSlot(JSObject *obj, JSObject *holder, RawShape shape)
IsCacheableGetPropReadSlot(JSObject *obj, JSObject *holder, Shape *shape)
{
if (!shape || !IsCacheableProtoChain(obj, holder))
return false;
@ -493,7 +493,7 @@ IsCacheableGetPropReadSlot(JSObject *obj, JSObject *holder, RawShape shape)
}
static bool
IsCacheableNoProperty(JSObject *obj, JSObject *holder, RawShape shape, jsbytecode *pc,
IsCacheableNoProperty(JSObject *obj, JSObject *holder, Shape *shape, jsbytecode *pc,
const TypedOrValueRegister &output)
{
if (shape)
@ -544,7 +544,7 @@ IsCacheableNoProperty(JSObject *obj, JSObject *holder, RawShape shape, jsbytecod
}
static bool
IsCacheableGetPropCallNative(JSObject *obj, JSObject *holder, RawShape shape)
IsCacheableGetPropCallNative(JSObject *obj, JSObject *holder, Shape *shape)
{
if (!shape || !IsCacheableProtoChain(obj, holder))
return false;
@ -557,7 +557,7 @@ IsCacheableGetPropCallNative(JSObject *obj, JSObject *holder, RawShape shape)
}
static bool
IsCacheableGetPropCallPropertyOp(JSObject *obj, JSObject *holder, RawShape shape)
IsCacheableGetPropCallPropertyOp(JSObject *obj, JSObject *holder, Shape *shape)
{
if (!shape || !IsCacheableProtoChain(obj, holder))
return false;
@ -1688,7 +1688,7 @@ SetPropertyIC::attachNativeAdding(JSContext *cx, IonScript *ion, JSObject *obj,
JSObject *proto = obj->getProto();
Register protoReg = object();
while (proto) {
RawShape protoShape = proto->lastProperty();
Shape *protoShape = proto->lastProperty();
// load next prototype
masm.loadPtr(Address(protoReg, JSObject::offsetOfType()), protoReg);
@ -1749,7 +1749,7 @@ IsPropertyInlineable(JSObject *obj)
static bool
IsPropertySetInlineable(JSContext *cx, HandleObject obj, HandleId id, MutableHandleShape pshape)
{
RawShape shape = obj->nativeLookup(cx, id);
Shape *shape = obj->nativeLookup(cx, id);
if (!shape)
return false;
@ -1823,7 +1823,7 @@ IsPropertyAddInlineable(JSContext *cx, HandleObject obj, HandleId id, uint32_t o
return false;
// if prototype defines this property in a non-plain way, don't optimize
RawShape protoShape = proto->nativeLookup(cx, id);
Shape *protoShape = proto->nativeLookup(cx, id);
if (protoShape && !protoShape->hasDefaultSetter())
return false;
@ -2216,7 +2216,7 @@ BindNameIC::attachGlobal(JSContext *cx, IonScript *ion, JSObject *scopeChain)
static inline void
GenerateScopeChainGuard(MacroAssembler &masm, JSObject *scopeObj,
Register scopeObjReg, RawShape shape, Label *failures)
Register scopeObjReg, Shape *shape, Label *failures)
{
if (scopeObj->isCall()) {
// We can skip a guard on the call object if the script's bindings are
@ -2452,7 +2452,7 @@ NameIC::attachCallGetter(JSContext *cx, IonScript *ion, JSObject *obj, JSObject
}
static bool
IsCacheableNameCallGetter(JSObject *scopeChain, JSObject *obj, JSObject *holder, RawShape shape)
IsCacheableNameCallGetter(JSObject *scopeChain, JSObject *obj, JSObject *holder, Shape *shape)
{
if (obj != scopeChain)
return false;

View File

@ -2244,7 +2244,7 @@ MGetPropertyPolymorphic::mightAlias(MDefinition *store)
return true;
for (size_t i = 0; i < numShapes(); i++) {
RawShape shape = this->shape(i);
Shape *shape = this->shape(i);
if (shape->slot() < shape->numFixedSlots()) {
// Fixed slot.
uint32_t slot = shape->slot();

View File

@ -5373,10 +5373,10 @@ class MGetPropertyPolymorphic
{
struct Entry {
// The shape to guard against.
RawShape objShape;
Shape *objShape;
// The property to laod.
RawShape shape;
Shape *shape;
};
Vector<Entry, 4, IonAllocPolicy> shapes_;
@ -5412,7 +5412,7 @@ class MGetPropertyPolymorphic
TypePolicy *typePolicy() {
return this;
}
bool addShape(RawShape objShape, RawShape shape) {
bool addShape(Shape *objShape, Shape *shape) {
Entry entry;
entry.objShape = objShape;
entry.shape = shape;
@ -5421,10 +5421,10 @@ class MGetPropertyPolymorphic
size_t numShapes() const {
return shapes_.length();
}
RawShape objShape(size_t i) const {
Shape *objShape(size_t i) const {
return shapes_[i].objShape;
}
RawShape shape(size_t i) const {
Shape *shape(size_t i) const {
return shapes_[i].shape;
}
MDefinition *obj() const {
@ -5445,10 +5445,10 @@ class MSetPropertyPolymorphic
{
struct Entry {
// The shape to guard against.
RawShape objShape;
Shape *objShape;
// The property to laod.
RawShape shape;
Shape *shape;
};
Vector<Entry, 4, IonAllocPolicy> shapes_;
@ -5470,7 +5470,7 @@ class MSetPropertyPolymorphic
TypePolicy *typePolicy() {
return this;
}
bool addShape(RawShape objShape, RawShape shape) {
bool addShape(Shape *objShape, Shape *shape) {
Entry entry;
entry.objShape = objShape;
entry.shape = shape;
@ -5479,10 +5479,10 @@ class MSetPropertyPolymorphic
size_t numShapes() const {
return shapes_.length();
}
RawShape objShape(size_t i) const {
Shape *objShape(size_t i) const {
return shapes_[i].objShape;
}
RawShape shape(size_t i) const {
Shape *shape(size_t i) const {
return shapes_[i].shape;
}
MDefinition *obj() const {
@ -5911,7 +5911,7 @@ class MGuardShape
MDefinition *obj() const {
return getOperand(0);
}
const RawShape shape() const {
const Shape *shape() const {
return shape_;
}
BailoutKind bailoutKind() const {

View File

@ -4490,7 +4490,7 @@ JS_DeleteProperty(JSContext *cx, JSObject *objArg, const char *name)
return JS_DeleteProperty2(cx, objArg, name, &junk);
}
static RawShape
static Shape *
LastConfigurableShape(JSObject *obj)
{
for (Shape::Range<NoGC> r(obj->lastProperty()); !r.empty(); r.popFront()) {
@ -4603,7 +4603,7 @@ prop_iter_trace(JSTracer *trc, RawObject obj)
* barrier here because the pointer is updated via setPrivate, which
* always takes a barrier.
*/
RawShape tmp = static_cast<RawShape>(pdata);
Shape *tmp = static_cast<Shape *>(pdata);
MarkShapeUnbarriered(trc, &tmp, "prop iter shape");
obj->setPrivateUnbarriered(tmp);
} else {
@ -4675,7 +4675,7 @@ JS_NextProperty(JSContext *cx, JSObject *iterobjArg, jsid *idp)
if (i < 0) {
/* Native case: private data is a property tree node pointer. */
JS_ASSERT(iterobj->getParent()->isNative());
RawShape shape = static_cast<RawShape>(iterobj->getPrivate());
Shape *shape = static_cast<Shape *>(iterobj->getPrivate());
while (shape->previous() && !shape->enumerable())
shape = shape->previous();
@ -4684,7 +4684,7 @@ JS_NextProperty(JSContext *cx, JSObject *iterobjArg, jsid *idp)
JS_ASSERT(shape->isEmptyShape());
*idp = JSID_VOID;
} else {
iterobj->setPrivateGCThing(const_cast<RawShape>(shape->previous().get()));
iterobj->setPrivateGCThing(const_cast<Shape *>(shape->previous().get()));
*idp = shape->propid();
}
} else {

View File

@ -133,7 +133,7 @@ js::StringIsArrayIndex(JSLinearString *str, uint32_t *indexp)
return false;
}
RawShape
Shape *
js::GetDenseArrayShape(JSContext *cx, HandleObject globalObj)
{
JS_ASSERT(globalObj);

View File

@ -88,7 +88,7 @@ extern bool
CanonicalizeArrayLengthValue(JSContext *cx, HandleValue v, uint32_t *canonicalized);
/* Get the common shape used by all dense arrays with a prototype at globalObj. */
extern RawShape
extern Shape *
GetDenseArrayShape(JSContext *cx, HandleObject globalObj);
extern JSBool

View File

@ -623,7 +623,7 @@ js::ReportUsageError(JSContext *cx, HandleObject callee, const char *msg)
const char *usageStr = "usage";
PropertyName *usageAtom = Atomize(cx, usageStr, strlen(usageStr))->asPropertyName();
RootedId id(cx, NameToId(usageAtom));
DebugOnly<RawShape> shape = static_cast<RawShape>(callee->nativeLookup(cx, id));
DebugOnly<Shape *> shape = static_cast<Shape *>(callee->nativeLookup(cx, id));
JS_ASSERT(!shape->configurable());
JS_ASSERT(!shape->writable());
JS_ASSERT(shape->hasDefaultGetter());

View File

@ -2256,12 +2256,12 @@ class AutoStringVector : public AutoVectorRooter<RawString>
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};
class AutoShapeVector : public AutoVectorRooter<RawShape>
class AutoShapeVector : public AutoVectorRooter<Shape *>
{
public:
explicit AutoShapeVector(JSContext *cx
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
: AutoVectorRooter<RawShape>(cx, SHAPEVECTOR)
: AutoVectorRooter<Shape *>(cx, SHAPEVECTOR)
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
}

View File

@ -253,7 +253,7 @@ JS_WrapAutoIdVector(JSContext *cx, js::AutoIdVector &props)
JS_FRIEND_API(void)
JS_TraceShapeCycleCollectorChildren(JSTracer *trc, void *shape)
{
MarkCycleCollectorChildren(trc, static_cast<RawShape>(shape));
MarkCycleCollectorChildren(trc, static_cast<Shape *>(shape));
}
static bool

View File

@ -591,7 +591,7 @@ js_NewGCScript(JSContext *cx)
sizeof(JSScript), js::gc::TenuredHeap);
}
inline js::RawShape
inline js::Shape *
js_NewGCShape(JSContext *cx)
{
return js::gc::NewGCThing<js::Shape, js::CanGC>(cx, js::gc::FINALIZE_SHAPE,

View File

@ -950,13 +950,13 @@ HeapTypeSet::addFilterPrimitives(JSContext *cx, TypeSet *target)
}
/* If id is a normal slotful 'own' property of an object, get its shape. */
static inline RawShape
static inline Shape *
GetSingletonShape(JSContext *cx, RawObject obj, RawId idArg)
{
if (!obj->isNative())
return NULL;
RootedId id(cx, idArg);
RawShape shape = obj->nativeLookup(cx, id);
Shape *shape = obj->nativeLookup(cx, id);
if (shape && shape->hasDefaultGetter() && shape->hasSlot())
return shape;
return NULL;
@ -975,7 +975,7 @@ ScriptAnalysis::pruneTypeBarriers(JSContext *cx, uint32_t offset)
}
if (barrier->singleton) {
JS_ASSERT(barrier->type.isPrimitive(JSVAL_TYPE_UNDEFINED));
RawShape 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'
@ -3637,7 +3637,7 @@ TypeObject::getFromPrototypes(JSContext *cx, jsid id, TypeSet *types, bool force
}
static inline void
UpdatePropertyType(JSContext *cx, TypeSet *types, RawObject obj, RawShape shape,
UpdatePropertyType(JSContext *cx, TypeSet *types, RawObject obj, Shape *shape,
bool force)
{
types->setOwnProperty(cx, false);
@ -3700,7 +3700,7 @@ TypeObject::addProperty(JSContext *cx, RawId id, Property **pprop)
}
} else if (!JSID_IS_EMPTY(id)) {
RootedId rootedId(cx, id);
RawShape shape = singleton->nativeLookup(cx, rootedId);
Shape *shape = singleton->nativeLookup(cx, rootedId);
if (shape)
UpdatePropertyType(cx, &base->types, rSingleton, shape, false);
}
@ -3760,7 +3760,7 @@ TypeObject::matchDefiniteProperties(HandleObject obj)
unsigned slot = prop->types.definiteSlot();
bool found = false;
RawShape shape = obj->lastProperty();
Shape *shape = obj->lastProperty();
while (!shape->isEmptyShape()) {
if (shape->slot() == slot && shape->propid() == prop->id) {
found = true;

View File

@ -397,7 +397,7 @@ NativeIterator::allocateIterator(JSContext *cx, uint32_t slength, const AutoIdVe
NativeIterator *ni = (NativeIterator *)
cx->malloc_(sizeof(NativeIterator)
+ plength * sizeof(RawString)
+ slength * sizeof(RawShape));
+ slength * sizeof(Shape *));
if (!ni)
return NULL;
AutoValueVector strings(cx);
@ -583,7 +583,7 @@ js::GetIterator(JSContext *cx, HandleObject obj, unsigned flags, MutableHandleVa
return true;
}
Vector<RawShape, 8> shapes(cx);
Vector<Shape *, 8> shapes(cx);
uint32_t key = 0;
bool keysOnly = (flags == JSITER_ENUMERATE);
@ -644,7 +644,7 @@ js::GetIterator(JSContext *cx, HandleObject obj, unsigned flags, MutableHandleVa
shapes.clear();
goto miss;
}
RawShape shape = pobj->lastProperty();
Shape *shape = pobj->lastProperty();
key = (key + (key << 16)) ^ (uintptr_t(shape) >> 3);
if (!shapes.append(shape))
return false;

View File

@ -221,7 +221,7 @@ StatsCellCallback(JSRuntime *rt, void *data, void *thing, JSGCTraceKind traceKin
}
case JSTRACE_SHAPE: {
RawShape shape = static_cast<RawShape>(thing);
Shape *shape = static_cast<Shape *>(thing);
CompartmentStats *cStats = GetCompartmentStats(shape->compartment());
size_t propTableSize, kidsSize;
shape->sizeOfExcludingThis(rtStats->mallocSizeOf_, &propTableSize, &kidsSize);

View File

@ -1446,7 +1446,7 @@ js::NewReshapedObject(JSContext *cx, HandleTypeObject type, JSObject *parent,
if (!ids.append(JSID_VOID))
return NULL;
}
RawShape nshape = shape;
Shape *nshape = shape;
while (!nshape->isEmptyShape()) {
ids[nshape->slot()] = nshape->propid();
nshape = nshape->previous();
@ -3184,7 +3184,7 @@ js_PurgeScopeChainHelper(JSContext *cx, HandleObject objArg, HandleId id)
return true;
}
RawShape
Shape *
js_AddNativeProperty(JSContext *cx, HandleObject obj, HandleId id,
PropertyOp getter, StrictPropertyOp setter, uint32_t slot,
unsigned attrs, unsigned flags, int shortid)
@ -3197,7 +3197,7 @@ js_AddNativeProperty(JSContext *cx, HandleObject obj, HandleId id,
if (!js_PurgeScopeChain(cx, obj, id))
return NULL;
RawShape shape =
Shape *shape =
JSObject::putProperty(cx, obj, id, getter, setter, slot, attrs, flags, shortid);
if (!shape)
return shape;
@ -3542,7 +3542,7 @@ CallResolveOp(JSContext *cx, HandleObject obj, HandleId id, unsigned flags,
return true;
}
RawShape shape;
Shape *shape;
if (!objp->nativeEmpty() && (shape = objp->nativeLookup(cx, id)))
propp.set(shape);
else
@ -3572,7 +3572,7 @@ LookupPropertyWithFlagsInline(JSContext *cx,
return true;
}
RawShape shape = current->nativeLookup(cx, id);
Shape *shape = current->nativeLookup(cx, id);
if (shape) {
objp.set(current);
propp.set(shape);
@ -4555,7 +4555,7 @@ js::HasDataProperty(JSContext *cx, JSObject *obj, jsid id, Value *vp)
return true;
}
if (RawShape shape = obj->nativeLookup(cx, id)) {
if (Shape *shape = obj->nativeLookup(cx, id)) {
if (shape->hasDefaultGetter() && shape->hasSlot()) {
*vp = obj->nativeGetSlot(shape->slot());
return true;
@ -4910,7 +4910,7 @@ js_GetObjectSlotName(JSTracer *trc, char *buf, size_t bufsize)
JSObject *obj = (JSObject *)trc->debugPrintArg;
uint32_t slot = uint32_t(trc->debugPrintIndex);
RawShape shape;
Shape *shape;
if (obj->isNative()) {
shape = obj->lastProperty();
while (shape && (!shape->hasSlot() || shape->slot() != slot))
@ -5148,7 +5148,7 @@ JSObject::dump()
if (obj->isNative()) {
fprintf(stderr, "properties:\n");
Vector<RawShape, 8, SystemAllocPolicy> props;
Vector<Shape *, 8, SystemAllocPolicy> props;
for (Shape::Range<NoGC> r(obj->lastProperty()); !r.empty(); r.popFront())
props.append(&r.front());
for (size_t i = props.length(); i-- != 0;)

View File

@ -40,7 +40,7 @@ class CallObject;
struct GCMarker;
struct NativeIterator;
class Nursery;
ForwardDeclare(Shape);
class Shape;
struct StackShape;
namespace mjit { class Compiler; }
@ -295,7 +295,7 @@ class JSObject : public js::ObjectImpl
static bool setLastProperty(JSContext *cx, JS::HandleObject obj, js::HandleShape shape);
/* As above, but does not change the slot span. */
inline void setLastPropertyInfallible(js::RawShape shape);
inline void setLastPropertyInfallible(js::Shape *shape);
/*
* Make a non-array object with the specified initial state. This method
@ -731,7 +731,7 @@ class JSObject : public js::ObjectImpl
js::MutableHandleValue vp);
private:
static js::RawShape getChildProperty(JSContext *cx, JS::HandleObject obj,
static js::Shape *getChildProperty(JSContext *cx, JS::HandleObject obj,
js::HandleShape parent, js::StackShape &child);
protected:
@ -742,7 +742,7 @@ class JSObject : public js::ObjectImpl
* 1. getter and setter must be normalized based on flags (see jsscope.cpp).
* 2. !isExtensible() checking must be done by callers.
*/
static js::RawShape addPropertyInternal(JSContext *cx,
static js::Shape *addPropertyInternal(JSContext *cx,
JS::HandleObject obj, JS::HandleId id,
JSPropertyOp getter, JSStrictPropertyOp setter,
uint32_t slot, unsigned attrs,
@ -759,20 +759,20 @@ class JSObject : public js::ObjectImpl
public:
/* Add a property whose id is not yet in this scope. */
static js::RawShape addProperty(JSContext *cx, JS::HandleObject, JS::HandleId id,
static js::Shape *addProperty(JSContext *cx, JS::HandleObject, JS::HandleId id,
JSPropertyOp getter, JSStrictPropertyOp setter,
uint32_t slot, unsigned attrs, unsigned flags,
int shortid, bool allowDictionary = true);
/* Add a data property whose id is not yet in this scope. */
js::RawShape addDataProperty(JSContext *cx, jsid id_, uint32_t slot, unsigned attrs) {
js::Shape *addDataProperty(JSContext *cx, jsid id_, uint32_t slot, unsigned attrs) {
JS_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
JS::RootedObject self(cx, this);
JS::RootedId id(cx, id_);
return addProperty(cx, self, id, NULL, NULL, slot, attrs, 0, 0);
}
js::RawShape addDataProperty(JSContext *cx, js::HandlePropertyName name, uint32_t slot, unsigned attrs) {
js::Shape *addDataProperty(JSContext *cx, js::HandlePropertyName name, uint32_t slot, unsigned attrs) {
JS_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
JS::RootedObject self(cx, this);
JS::RootedId id(cx, NameToId(name));
@ -780,11 +780,11 @@ class JSObject : public js::ObjectImpl
}
/* Add or overwrite a property for id in this scope. */
static js::RawShape putProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
static js::Shape *putProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
JSPropertyOp getter, JSStrictPropertyOp setter,
uint32_t slot, unsigned attrs,
unsigned flags, int shortid);
static js::RawShape putProperty(JSContext *cx, JS::HandleObject obj,
static js::Shape *putProperty(JSContext *cx, JS::HandleObject obj,
js::PropertyName *name,
JSPropertyOp getter, JSStrictPropertyOp setter,
uint32_t slot, unsigned attrs,
@ -795,7 +795,7 @@ class JSObject : public js::ObjectImpl
}
/* Change the given property into a sibling with the same id in this scope. */
static js::RawShape changeProperty(JSContext *cx, js::HandleObject obj,
static js::Shape *changeProperty(JSContext *cx, js::HandleObject obj,
js::HandleShape shape, unsigned attrs, unsigned mask,
JSPropertyOp getter, JSStrictPropertyOp setter);
@ -1156,7 +1156,7 @@ js_FindClassObject(JSContext *cx, JSProtoKey protoKey, js::MutableHandleValue vp
* Find or create a property named by id in obj's scope, with the given getter
* and setter, slot, attributes, and other members.
*/
extern js::RawShape
extern js::Shape *
js_AddNativeProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
JSPropertyOp getter, JSStrictPropertyOp setter, uint32_t slot,
unsigned attrs, unsigned flags, int shortid);

View File

@ -275,7 +275,7 @@ JSObject::dynamicSlotIndex(size_t slot)
}
inline void
JSObject::setLastPropertyInfallible(js::RawShape shape)
JSObject::setLastPropertyInfallible(js::Shape *shape)
{
JS_ASSERT(!shape->inDictionary());
JS_ASSERT(shape->compartment() == compartment());
@ -306,7 +306,7 @@ JSObject::canRemoveLastProperty()
* converted to dictionary mode instead. See BaseShape comment in jsscope.h
*/
JS_ASSERT(!inDictionaryMode());
js::RawShape previous = lastProperty()->previous().get();
js::Shape *previous = lastProperty()->previous().get();
return previous->getObjectParent() == lastProperty()->getObjectParent()
&& previous->getObjectFlags() == lastProperty()->getObjectFlags();
}

View File

@ -33,7 +33,7 @@ js::PropertyCache::test(JSContext *cx, jsbytecode *pc, JSObject **obj,
{
JS_ASSERT(this == &cx->propertyCache());
RawShape 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 == &cx->propertyCache());
RawShape kshape = obj->lastProperty();
Shape *kshape = obj->lastProperty();
PropertyCacheEntry *entry = &table[hash(pc, kshape)];
*entryp = entry;
PCMETER(pctestentry = entry);

View File

@ -31,17 +31,17 @@ ShapeHasher::match(const Key k, const Lookup &l)
return k->matches(l);
}
RawShape
Shape *
PropertyTree::newShape(JSContext *cx)
{
RawShape shape = js_NewGCShape(cx);
Shape *shape = js_NewGCShape(cx);
if (!shape)
JS_ReportOutOfMemory(cx);
return shape;
}
static KidsHash *
HashChildren(RawShape kid1, RawShape kid2)
HashChildren(Shape *kid1, Shape *kid2)
{
KidsHash *hash = js_new<KidsHash>();
if (!hash || !hash->init(2)) {
@ -55,7 +55,7 @@ HashChildren(RawShape kid1, RawShape kid2)
}
bool
PropertyTree::insertChild(JSContext *cx, RawShape parent, RawShape child)
PropertyTree::insertChild(JSContext *cx, Shape *parent, Shape *child)
{
JS_ASSERT(!parent->inDictionary());
JS_ASSERT(!child->parent);
@ -72,7 +72,7 @@ PropertyTree::insertChild(JSContext *cx, RawShape parent, RawShape child)
}
if (kidp->isShape()) {
RawShape shape = kidp->toShape();
Shape *shape = kidp->toShape();
JS_ASSERT(shape != child);
JS_ASSERT(!shape->matches(child));
@ -96,7 +96,7 @@ PropertyTree::insertChild(JSContext *cx, RawShape parent, RawShape child)
}
void
Shape::removeChild(RawShape child)
Shape::removeChild(Shape *child)
{
JS_ASSERT(!child->inDictionary());
JS_ASSERT(child->parent == this);
@ -126,11 +126,11 @@ Shape::removeChild(RawShape child)
}
}
RawShape
Shape *
PropertyTree::getChild(JSContext *cx, Shape *parent_, uint32_t nfixed, const StackShape &child)
{
{
RawShape shape = NULL;
Shape *shape = NULL;
JS_ASSERT(parent_);
@ -144,7 +144,7 @@ PropertyTree::getChild(JSContext *cx, Shape *parent_, uint32_t nfixed, const Sta
*/
KidsPointer *kidp = &parent_->kids;
if (kidp->isShape()) {
RawShape kid = kidp->toShape();
Shape *kid = kidp->toShape();
if (kid->matches(child))
shape = kid;
} else if (kidp->isHash()) {
@ -186,7 +186,7 @@ PropertyTree::getChild(JSContext *cx, Shape *parent_, uint32_t nfixed, const Sta
StackShape::AutoRooter childRoot(cx, &child);
RootedShape parent(cx, parent_);
RawShape shape = newShape(cx);
Shape *shape = newShape(cx);
if (!shape)
return NULL;
@ -240,7 +240,7 @@ Shape::finalize(FreeOp *fop)
#ifdef DEBUG
void
KidsPointer::checkConsistency(RawShape aKid) const
KidsPointer::checkConsistency(Shape *aKid) const
{
if (isShape()) {
JS_ASSERT(toShape() == aKid);
@ -325,13 +325,13 @@ Shape::dumpSubtree(JSContext *cx, int level, FILE *fp) const
if (!kids.isNull()) {
++level;
if (kids.isShape()) {
RawShape kid = kids.toShape();
Shape *kid = kids.toShape();
JS_ASSERT(kid->parent == this);
kid->dumpSubtree(cx, level, fp);
} else {
const KidsHash &hash = *kids.toHash();
for (KidsHash::Range range = hash.all(); !range.empty(); range.popFront()) {
RawShape kid = range.front();
Shape *kid = range.front();
JS_ASSERT(kid->parent == this);
kid->dumpSubtree(cx, level, fp);
@ -365,7 +365,7 @@ js::PropertyTree::dumpShapes(JSRuntime *rt)
typedef JSCompartment::EmptyShapeSet HS;
HS &h = c->emptyShapes;
for (HS::Range r = h.all(); !r.empty(); r.popFront()) {
RawShape empty = r.front();
Shape *empty = r.front();
empty->dumpSubtree(rt, 0, dumpfp);
putc('\n', dumpfp);
}

View File

@ -14,18 +14,18 @@
namespace js {
ForwardDeclare(Shape);
class Shape;
struct StackShape;
struct ShapeHasher {
typedef RawShape Key;
typedef Shape *Key;
typedef StackShape Lookup;
static inline HashNumber hash(const Lookup &l);
static inline bool match(Key k, const Lookup &l);
};
typedef HashSet<RawShape, ShapeHasher, SystemAllocPolicy> KidsHash;
typedef HashSet<Shape *, ShapeHasher, SystemAllocPolicy> KidsHash;
class KidsPointer {
private:
@ -42,14 +42,14 @@ class KidsPointer {
void setNull() { w = 0; }
bool isShape() const { return (w & TAG) == SHAPE && !isNull(); }
RawShape toShape() const {
Shape *toShape() const {
JS_ASSERT(isShape());
return reinterpret_cast<RawShape>(w & ~uintptr_t(TAG));
return reinterpret_cast<Shape *>(w & ~uintptr_t(TAG));
}
void setShape(RawShape shape) {
void setShape(Shape *shape) {
JS_ASSERT(shape);
JS_ASSERT((reinterpret_cast<uintptr_t>(static_cast<RawShape>(shape)) & TAG) == 0);
w = reinterpret_cast<uintptr_t>(static_cast<RawShape>(shape)) | SHAPE;
JS_ASSERT((reinterpret_cast<uintptr_t>(static_cast<Shape *>(shape)) & TAG) == 0);
w = reinterpret_cast<uintptr_t>(static_cast<Shape *>(shape)) | SHAPE;
}
bool isHash() const { return (w & TAG) == HASH; }
@ -64,7 +64,7 @@ class KidsPointer {
}
#ifdef DEBUG
void checkConsistency(RawShape aKid) const;
void checkConsistency(Shape *aKid) const;
#endif
};
@ -74,7 +74,7 @@ class PropertyTree
JSCompartment *compartment;
bool insertChild(JSContext *cx, RawShape parent, RawShape child);
bool insertChild(JSContext *cx, Shape *parent, Shape *child);
PropertyTree();
@ -86,8 +86,8 @@ class PropertyTree
{
}
RawShape newShape(JSContext *cx);
RawShape getChild(JSContext *cx, Shape *parent, uint32_t nfixed, const StackShape &child);
Shape *newShape(JSContext *cx);
Shape *getChild(JSContext *cx, Shape *parent, uint32_t nfixed, const StackShape &child);
#ifdef DEBUG
static void dumpShapes(JSRuntime *rt);

View File

@ -133,7 +133,7 @@ Bindings::initWithTemporaryStorage(JSContext *cx, InternalBindingsHandle self,
unsigned frameIndex = bi.frameIndex();
StackShape child(nbase, id, slot++, 0, attrs, Shape::HAS_SHORTID, frameIndex);
RawShape shape = self->callObjShape_->getChildBinding(cx, child);
Shape *shape = self->callObjShape_->getChildBinding(cx, child);
if (!shape)
return false;

View File

@ -195,7 +195,7 @@ class Bindings
unsigned count() const { return numArgs() + numVars(); }
/* Return the initial shape of call objects created for this scope. */
RawShape callObjShape() const { return callObjShape_; }
Shape *callObjShape() const { return callObjShape_; }
/* Convenience method to get the var index of 'arguments'. */
static unsigned argumentsVarIndex(JSContext *cx, InternalBindingsHandle);
@ -214,7 +214,7 @@ struct RootMethods<Bindings> {
static Bindings initial();
static ThingRootKind kind() { return THING_ROOT_BINDINGS; }
static bool poisoned(const Bindings &bindings) {
return IsPoisonedPtr(static_cast<RawShape>(bindings.callObjShape()));
return IsPoisonedPtr(static_cast<Shape *>(bindings.callObjShape()));
}
};

View File

@ -3491,7 +3491,7 @@ static const JSFunctionSpec string_static_methods[] = {
JS_FS_END
};
RawShape
Shape *
StringObject::assignInitialShape(JSContext *cx)
{
JS_ASSERT(nativeEmpty());

View File

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

View File

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

View File

@ -6108,7 +6108,7 @@ mjit::Compiler::jsop_aliasedVar(ScopeCoordinate sc, bool get, bool poppedAfter)
for (unsigned i = 0; i < sc.hops; i++)
masm.loadPayload(Address(reg, ScopeObject::offsetOfEnclosingScope()), reg);
RawShape shape = ScopeCoordinateToStaticScopeShape(cx, script_, PC);
Shape *shape = ScopeCoordinateToStaticScopeShape(cx, script_, PC);
Address addr;
if (shape->numFixedSlots() <= sc.slot) {
masm.loadPtr(Address(reg, JSObject::offsetOfSlots()), reg);
@ -6256,7 +6256,7 @@ mjit::Compiler::iter(unsigned flags)
masm.loadPtr(Address(T1, offsetof(types::TypeObject, proto)), T1);
masm.loadShape(T1, T1);
masm.loadPtr(Address(nireg, offsetof(NativeIterator, shapes_array)), T2);
masm.loadPtr(Address(T2, sizeof(RawShape)), T2);
masm.loadPtr(Address(T2, sizeof(Shape *)), T2);
Jump mismatchedProto = masm.branchPtr(Assembler::NotEqual, T1, T2);
stubcc.linkExit(mismatchedProto, Uses(1));
@ -6563,7 +6563,7 @@ mjit::Compiler::jsop_getgname(uint32_t index)
* reallocation of the global object's slots.
*/
RootedId id(cx, NameToId(name));
RawShape shape = globalObj->nativeLookup(cx, id);
Shape *shape = globalObj->nativeLookup(cx, id);
if (shape && shape->hasDefaultGetter() && shape->hasSlot()) {
HeapSlot *value = &globalObj->getSlotRef(shape->slot());
if (!value->isUndefined() && !propertyTypes->isOwnProperty(cx, globalType, true)) {

View File

@ -1477,7 +1477,7 @@ mjit::Compiler::jsop_setelem(bool popGuaranteed)
ic.slowPathStart = stubcc.syncExit(Uses(3));
// Guard obj is a dense array.
RawShape shape = GetDenseArrayShape(cx, globalObj);
Shape *shape = GetDenseArrayShape(cx, globalObj);
if (!shape)
return false;
ic.shapeGuard = masm.guardShape(ic.objReg, shape);
@ -2061,7 +2061,7 @@ mjit::Compiler::jsop_getelem()
}
// Guard obj is a dense array.
RawShape shape = GetDenseArrayShape(cx, globalObj);
Shape *shape = GetDenseArrayShape(cx, globalObj);
if (!shape)
return false;
ic.shapeGuard = masm.guardShape(ic.objReg, shape);

View File

@ -1402,7 +1402,7 @@ GetPIC(JSContext *cx, JSScript *script, jsbytecode *pc, bool constructing)
return NULL;
}
RawShape
Shape *
mjit::GetPICSingleShape(JSContext *cx, JSScript *script, jsbytecode *pc, bool constructing)
{
ic::PICInfo *pic = GetPIC(cx, script, pc, constructing);

View File

@ -1036,7 +1036,7 @@ IsLowerableFunCallOrApply(jsbytecode *pc)
#endif
}
RawShape
Shape *
GetPICSingleShape(JSContext *cx, JSScript *script, jsbytecode *pc, bool constructing);
static inline void

View File

@ -115,14 +115,14 @@ PatchSetFallback(VMFrame &f, ic::SetGlobalNameIC *ic)
}
void
SetGlobalNameIC::patchInlineShapeGuard(Repatcher &repatcher, RawShape 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, RawShape shape)
UpdateSetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic, JSObject *obj, Shape *shape)
{
/* Give globals a chance to appear. */
if (!shape)
@ -160,7 +160,7 @@ ic::SetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic)
{
RootedId id(f.cx, NameToId(name));
RawShape shape = obj->nativeLookup(f.cx, id);
Shape *shape = obj->nativeLookup(f.cx, id);
if (!monitor.recompiled()) {
LookupStatus status = UpdateSetGlobalName(f, ic, obj, shape);

View File

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

View File

@ -191,7 +191,7 @@ class SetPropCompiler : public PICStubCompiler
repatcher.relink(pic.slowPathCall, target);
}
LookupStatus patchInline(RawShape shape)
LookupStatus patchInline(Shape *shape)
{
JS_ASSERT(!pic.inlinePathPatched);
JaegerSpew(JSpew_PICs, "patch setprop inline at %p\n", pic.fastPathStart.executableAddress());
@ -1010,7 +1010,7 @@ class GetPropCompiler : public PICStubCompiler
return Lookup_Cacheable;
}
LookupStatus patchInline(JSObject *holder, RawShape shape)
LookupStatus patchInline(JSObject *holder, Shape *shape)
{
spew("patch", "inline");
Repatcher repatcher(f.chunk());
@ -1045,7 +1045,7 @@ class GetPropCompiler : public PICStubCompiler
}
/* For JSPropertyOp getters. */
void generateGetterStub(Assembler &masm, RawShape shape, jsid userid,
void generateGetterStub(Assembler &masm, Shape *shape, jsid userid,
Label start, Vector<Jump, 8> &shapeMismatches)
{
/*
@ -1155,7 +1155,7 @@ class GetPropCompiler : public PICStubCompiler
}
/* For getters backed by a JSNative. */
void generateNativeGetterStub(Assembler &masm, RawShape shape,
void generateNativeGetterStub(Assembler &masm, Shape *shape,
Label start, Vector<Jump, 8> &shapeMismatches)
{
/*
@ -1657,7 +1657,7 @@ class ScopeNameCompiler : public PICStubCompiler
JS_ASSERT(obj == getprop.holder);
JS_ASSERT(getprop.holder != &scopeChain->global());
RawShape shape = getprop.shape;
Shape *shape = getprop.shape;
if (!shape->hasDefaultGetter())
return disable("unhandled callobj sprop getter");

View File

@ -487,12 +487,12 @@ struct PICInfo : public BasePolyIC {
public:
void purge(Repatcher &repatcher);
void setInlinePathShape(RawShape shape) {
void setInlinePathShape(Shape *shape) {
JS_ASSERT(!inlinePathShape_);
inlinePathShape_ = shape;
}
RawShape getSingleShape() {
Shape *getSingleShape() {
if (disabled || hadUncacheable || stubsGenerated > 0)
return NULL;
return inlinePathShape_;

View File

@ -52,13 +52,13 @@ js::ObjectImpl::getTaggedProto() const
return TaggedProto(getProto());
}
inline js::RawShape
inline js::Shape *
js::ObjectImpl::nativeLookup(JSContext *cx, PropertyId pid)
{
return nativeLookup(cx, pid.asId());
}
inline js::RawShape
inline js::Shape *
js::ObjectImpl::nativeLookup(JSContext *cx, PropertyName *name)
{
return nativeLookup(cx, NameToId(name));

View File

@ -196,8 +196,8 @@ js::ObjectImpl::checkShapeConsistency()
MOZ_ASSERT(isNative());
RawShape shape = lastProperty();
RawShape prev = NULL;
Shape *shape = lastProperty();
Shape *prev = NULL;
if (inDictionaryMode()) {
MOZ_ASSERT(shape->hasTable());
@ -294,7 +294,7 @@ js::ObjectImpl::slotInRange(uint32_t slot, SentinelAllowed sentinel) const
*/
MOZ_NEVER_INLINE
#endif
RawShape
Shape *
js::ObjectImpl::nativeLookup(JSContext *cx, jsid id)
{
MOZ_ASSERT(isNative());

View File

@ -25,7 +25,7 @@ namespace js {
class Debugger;
class ObjectImpl;
class Nursery;
ForwardDeclare(Shape);
class Shape;
class AutoPropDescArrayRooter;
@ -364,7 +364,7 @@ class ElementsHeader
} dense;
class {
friend class SparseElementsHeader;
RawShape shape;
Shape *shape;
} sparse;
class {
friend class ArrayBufferElementsHeader;
@ -455,7 +455,7 @@ class DenseElementsHeader : public ElementsHeader
class SparseElementsHeader : public ElementsHeader
{
public:
RawShape shape() {
Shape *shape() {
MOZ_ASSERT(ElementsHeader::isSparseElements());
return sparse.shape;
}
@ -1317,9 +1317,9 @@ class ObjectImpl : public gc::Cell
/* Compute dynamicSlotsCount() for this object. */
inline uint32_t numDynamicSlots() const;
RawShape nativeLookup(JSContext *cx, jsid id);
inline RawShape nativeLookup(JSContext *cx, PropertyId pid);
inline RawShape 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);
inline bool nativeContains(JSContext *cx, jsid id);
inline bool nativeContains(JSContext *cx, PropertyName* name);

View File

@ -265,7 +265,7 @@ RegExpObject::createShared(JSContext *cx, RegExpGuard *g)
return true;
}
RawShape
Shape *
RegExpObject::assignInitialShape(JSContext *cx)
{
JS_ASSERT(isRegExp());

View File

@ -355,7 +355,7 @@ class RegExpObject : public JSObject
* encoding their initial properties. Return the shape after
* changing this regular expression object's last property to it.
*/
RawShape assignInitialShape(JSContext *cx);
Shape *assignInitialShape(JSContext *cx);
bool init(JSContext *cx, HandleAtom source, RegExpFlag flags);

View File

@ -63,7 +63,7 @@ StaticScopeIter::hasDynamicScopeObject() const
: obj->toFunction()->isHeavyweight();
}
RawShape
Shape *
StaticScopeIter::scopeShape() const
{
JS_ASSERT(hasDynamicScopeObject());
@ -97,7 +97,7 @@ StaticScopeIter::funScript() const
/*****************************************************************************/
RawShape
Shape *
js::ScopeCoordinateToStaticScopeShape(JSContext *cx, JSScript *script, jsbytecode *pc)
{
JS_ASSERT(pc >= script->code && pc < script->code + script->length);
@ -682,7 +682,7 @@ StaticBlockObject::create(JSContext *cx)
return &obj->asStaticBlock();
}
/* static */ RawShape
/* static */ Shape *
StaticBlockObject::addVar(JSContext *cx, Handle<StaticBlockObject*> block, HandleId id,
int index, bool *redeclared)
{
@ -1223,7 +1223,7 @@ class DebugScopeProxy : public BaseProxyHandler
/* Handle unaliased let and catch bindings at block scope. */
if (scope->isClonedBlock()) {
Rooted<ClonedBlockObject *> block(cx, &scope->asClonedBlock());
RawShape shape = block->lastProperty()->search(cx, id);
Shape *shape = block->lastProperty()->search(cx, id);
if (!shape)
return false;

View File

@ -66,7 +66,7 @@ class StaticScopeIter
/* Return whether this static scope will be on the dynamic scope chain. */
bool hasDynamicScopeObject() const;
RawShape scopeShape() const;
Shape *scopeShape() const;
enum Type { BLOCK, FUNCTION, NAMED_LAMBDA };
Type type() const;
@ -99,7 +99,7 @@ struct ScopeCoordinate
* Return a shape representing the static scope containing the variable
* accessed by the ALIASEDVAR op at 'pc'.
*/
extern RawShape
extern Shape *
ScopeCoordinateToStaticScopeShape(JSContext *cx, JSScript *script, jsbytecode *pc);
/* Return the name being accessed by the given ALIASEDVAR op. */
@ -347,7 +347,7 @@ class StaticBlockObject : public BlockObject
void initPrevBlockChainFromParser(StaticBlockObject *prev);
void resetPrevBlockChainFromParser();
static RawShape addVar(JSContext *cx, Handle<StaticBlockObject*> block, HandleId id,
static Shape *addVar(JSContext *cx, Handle<StaticBlockObject*> block, HandleId id,
int index, bool *redeclared);
};

View File

@ -131,7 +131,7 @@ BaseShape::matchesGetterSetter(PropertyOp rawGetter, StrictPropertyOp rawSetter)
}
inline
StackBaseShape::StackBaseShape(RawShape shape)
StackBaseShape::StackBaseShape(Shape *shape)
: flags(shape->getObjectFlags()),
clasp(shape->getObjectClass()),
parent(shape->getObjectParent()),
@ -244,7 +244,7 @@ StackShape::hash() const
}
inline bool
Shape::matches(const RawShape other) const
Shape::matches(const Shape *other) const
{
return propid_.get() == other->propid_.get() &&
matchesParamsAfterId(other->base(), other->maybeSlot(), other->attrs,
@ -339,7 +339,7 @@ Shape::set(JSContext* cx, HandleObject obj, HandleObject receiver, bool strict,
}
inline void
Shape::setParent(RawShape p)
Shape::setParent(Shape *p)
{
JS_ASSERT_IF(p && !p->hasMissingSlot() && !inDictionary(),
p->maybeSlot() <= maybeSlot());
@ -405,7 +405,7 @@ EmptyShape::EmptyShape(UnownedBaseShape *base, uint32_t nfixed)
}
inline void
Shape::writeBarrierPre(RawShape shape)
Shape::writeBarrierPre(Shape *shape)
{
#ifdef JSGC_INCREMENTAL
if (!shape || !shape->runtime()->needsBarrier())
@ -413,7 +413,7 @@ Shape::writeBarrierPre(RawShape shape)
JS::Zone *zone = shape->zone();
if (zone->needsBarrier()) {
RawShape tmp = shape;
Shape *tmp = shape;
MarkShapeUnbarriered(zone->barrierTracer(), &tmp, "write barrier");
JS_ASSERT(tmp == shape);
}
@ -421,17 +421,17 @@ Shape::writeBarrierPre(RawShape shape)
}
inline void
Shape::writeBarrierPost(RawShape shape, void *addr)
Shape::writeBarrierPost(Shape *shape, void *addr)
{
}
inline void
Shape::readBarrier(RawShape shape)
Shape::readBarrier(Shape *shape)
{
#ifdef JSGC_INCREMENTAL
JS::Zone *zone = shape->zone();
if (zone->needsBarrier()) {
RawShape tmp = shape;
Shape *tmp = shape;
MarkShapeUnbarriered(zone->barrierTracer(), &tmp, "read barrier");
JS_ASSERT(tmp == shape);
}

View File

@ -41,7 +41,7 @@ using mozilla::DebugOnly;
using mozilla::PodZero;
bool
ShapeTable::init(JSRuntime *rt, RawShape lastProp)
ShapeTable::init(JSRuntime *rt, Shape *lastProp)
{
/*
* Either we're creating a table for a large scope that was populated
@ -96,7 +96,7 @@ Shape::makeOwnBaseShape(JSContext *cx)
}
void
Shape::handoffTableTo(RawShape shape)
Shape::handoffTableTo(Shape *shape)
{
JS_ASSERT(inDictionary() && shape->inDictionary());
@ -275,7 +275,7 @@ ShapeTable::grow(JSContext *cx)
return true;
}
RawShape
Shape *
Shape::getChildBinding(JSContext *cx, const StackShape &child)
{
JS_ASSERT(!inDictionary());
@ -288,7 +288,7 @@ Shape::getChildBinding(JSContext *cx, const StackShape &child)
return cx->propertyTree().getChild(cx, this, nfixed, child);
}
/* static */ RawShape
/* static */ Shape *
Shape::replaceLastProperty(JSContext *cx, const StackBaseShape &base,
TaggedProto proto, HandleShape shape)
{
@ -320,7 +320,7 @@ Shape::replaceLastProperty(JSContext *cx, const StackBaseShape &base,
* which must be lastProperty() if inDictionaryMode(), else parent must be
* one of lastProperty() or lastProperty()->parent.
*/
/* static */ RawShape
/* static */ Shape *
JSObject::getChildProperty(JSContext *cx, HandleObject obj, HandleShape parent, StackShape &child)
{
/*
@ -395,7 +395,7 @@ js::ObjectImpl::toDictionaryMode(JSContext *cx)
while (shape) {
JS_ASSERT(!shape->inDictionary());
RawShape dprop = js_NewGCShape(cx);
Shape *dprop = js_NewGCShape(cx);
if (!dprop) {
js_ReportOutOfMemory(cx);
return false;
@ -450,7 +450,7 @@ NormalizeGetterAndSetter(JSObject *obj,
return true;
}
/* static */ RawShape
/* static */ Shape *
JSObject::addProperty(JSContext *cx, HandleObject obj, HandleId id,
PropertyOp getter, StrictPropertyOp setter,
uint32_t slot, unsigned attrs,
@ -473,7 +473,7 @@ JSObject::addProperty(JSContext *cx, HandleObject obj, HandleId id,
spp, allowDictionary);
}
/* static */ RawShape
/* static */ Shape *
JSObject::addPropertyInternal(JSContext *cx, HandleObject obj, HandleId id,
PropertyOp getter, StrictPropertyOp setter,
uint32_t slot, unsigned attrs,
@ -540,7 +540,7 @@ JSObject::addPropertyInternal(JSContext *cx, HandleObject obj, HandleId id,
if (table) {
/* Store the tree node pointer in the table entry for id. */
SHAPE_STORE_PRESERVING_COLLISION(spp, static_cast<RawShape>(shape));
SHAPE_STORE_PRESERVING_COLLISION(spp, static_cast<Shape *>(shape));
++table->entryCount;
/* Pass the table along to the new last property, namely shape. */
@ -580,7 +580,7 @@ CheckCanChangeAttrs(JSContext *cx, JSObject *obj, Shape *shape, unsigned *attrsp
return true;
}
/* static */ RawShape
/* static */ Shape *
JSObject::putProperty(JSContext *cx, HandleObject obj, HandleId id,
PropertyOp getter, StrictPropertyOp setter,
uint32_t slot, unsigned attrs,
@ -712,7 +712,7 @@ JSObject::putProperty(JSContext *cx, HandleObject obj, HandleId id,
/* Find or create a property tree node labeled by our arguments. */
StackShape child(nbase, id, slot, obj->numFixedSlots(), attrs, flags, shortid);
RootedShape parent(cx, shape->parent);
RawShape newShape = JSObject::getChildProperty(cx, obj, parent, child);
Shape *newShape = JSObject::getChildProperty(cx, obj, parent, child);
if (!newShape) {
obj->checkShapeConsistency();
@ -739,7 +739,7 @@ JSObject::putProperty(JSContext *cx, HandleObject obj, HandleId id,
return shape;
}
/* static */ RawShape
/* static */ Shape *
JSObject::changeProperty(JSContext *cx, HandleObject obj, HandleShape shape, unsigned attrs,
unsigned mask, PropertyOp getter, StrictPropertyOp setter)
{
@ -773,7 +773,7 @@ JSObject::changeProperty(JSContext *cx, HandleObject obj, HandleShape shape, uns
* putProperty won't re-allocate it.
*/
RootedId propid(cx, shape->propid());
RawShape newShape = putProperty(cx, obj, propid, getter, setter, shape->maybeSlot(),
Shape *newShape = putProperty(cx, obj, propid, getter, setter, shape->maybeSlot(),
attrs, shape->flags, shape->maybeShortid());
obj->checkShapeConsistency();
@ -860,7 +860,7 @@ JSObject::removeProperty(JSContext *cx, jsid id_)
* checks not to alter significantly the complexity of the
* delete in debug builds, see bug 534493.
*/
RawShape 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
@ -868,7 +868,7 @@ JSObject::removeProperty(JSContext *cx, jsid id_)
{
/* Remove shape from its non-circular doubly linked list. */
RawShape oldLastProp = self->lastProperty();
Shape *oldLastProp = self->lastProperty();
shape->removeFromDictionary(self);
/* Hand off table from the old to new last property. */
@ -1016,7 +1016,7 @@ JSObject::setParent(JSContext *cx, HandleObject obj, HandleObject parent)
return true;
}
RawShape newShape = Shape::setObjectParent(cx, parent, obj->getTaggedProto(), obj->shape_);
Shape *newShape = Shape::setObjectParent(cx, parent, obj->getTaggedProto(), obj->shape_);
if (!newShape)
return false;
@ -1024,7 +1024,7 @@ JSObject::setParent(JSContext *cx, HandleObject obj, HandleObject parent)
return true;
}
/* static */ RawShape
/* static */ Shape *
Shape::setObjectParent(JSContext *cx, JSObject *parent, TaggedProto proto, Shape *last)
{
if (last->getObjectParent() == parent)
@ -1095,7 +1095,7 @@ js::ObjectImpl::setFlag(JSContext *cx, /*BaseShape::Flag*/ uint32_t flag_,
return true;
}
RawShape newShape =
Shape *newShape =
Shape::setObjectFlag(cx, flag, self->getTaggedProto(), self->lastProperty());
if (!newShape)
return false;
@ -1122,7 +1122,7 @@ js::ObjectImpl::clearFlag(JSContext *cx, /*BaseShape::Flag*/ uint32_t flag)
return true;
}
/* static */ RawShape
/* static */ Shape *
Shape::setObjectFlag(JSContext *cx, BaseShape::Flag flag, TaggedProto proto, Shape *last)
{
if (last->getObjectFlags() & flag)
@ -1273,7 +1273,7 @@ EmptyShape::getInitialShape(JSContext *cx, Class *clasp, TaggedProto proto, JSOb
if (!nbase)
return NULL;
RawShape shape = cx->propertyTree().newShape(cx);
Shape *shape = cx->propertyTree().newShape(cx);
if (!shape)
return NULL;
new (shape) EmptyShape(nbase, nfixed);
@ -1330,7 +1330,7 @@ EmptyShape::insertInitialShape(JSContext *cx, HandleShape shape, HandleObject pr
/* The new shape had better be rooted at the old one. */
#ifdef DEBUG
RawShape nshape = shape;
Shape *nshape = shape;
while (!nshape->isEmptyShape())
nshape = nshape->previous();
JS_ASSERT(nshape == entry.shape);
@ -1381,7 +1381,7 @@ JSCompartment::sweepInitialShapeTable()
if (initialShapes.initialized()) {
for (InitialShapeSet::Enum e(initialShapes); !e.empty(); e.popFront()) {
const InitialShapeEntry &entry = e.front();
RawShape shape = entry.shape;
Shape *shape = entry.shape;
JSObject *proto = entry.proto.raw();
if (IsShapeAboutToBeFinalized(&shape) || (entry.proto.isObject() && IsObjectAboutToBeFinalized(&proto))) {
e.removeFront();

View File

@ -137,7 +137,7 @@ struct ShapeTable {
uint32_t capacity() const { return JS_BIT(HASH_BITS - hashShift); }
/* Computes the size of the entries array for a given capacity. */
static size_t sizeOfEntries(size_t cap) { return cap * sizeof(RawShape); }
static size_t sizeOfEntries(size_t cap) { return cap * sizeof(Shape *); }
/*
* This counts the ShapeTable object itself (which must be
@ -165,7 +165,7 @@ struct ShapeTable {
* cope or ignore. They do however use JSRuntime's calloc_ method in order
* to update the malloc counter on success.
*/
bool init(JSRuntime *rt, RawShape lastProp);
bool init(JSRuntime *rt, Shape *lastProp);
bool change(int log2Delta, JSContext *cx);
Shape **search(jsid id, bool adding);
};
@ -223,8 +223,8 @@ struct ShapeTable {
* an earlier property, however.
*/
class Shape;
class UnownedBaseShape;
ForwardDeclare(Shape);
struct StackBaseShape;
class BaseShape : public js::gc::Cell
@ -417,7 +417,7 @@ struct StackBaseShape
compartment(comp)
{}
inline StackBaseShape(RawShape shape);
inline StackBaseShape(Shape *shape);
inline void updateGetterSetter(uint8_t attrs,
PropertyOp rawGetter,
@ -514,7 +514,7 @@ class Shape : public js::gc::Cell
last, else to obj->shape_ */
};
static inline RawShape search(JSContext *cx, Shape *start, jsid id,
static inline Shape *search(JSContext *cx, Shape *start, jsid id,
Shape ***pspp, bool adding = false);
static inline Shape *searchNoHashify(Shape *start, jsid id);
@ -524,16 +524,16 @@ class Shape : public js::gc::Cell
inline void initDictionaryShape(const StackShape &child, uint32_t nfixed,
HeapPtrShape *dictp);
RawShape getChildBinding(JSContext *cx, const StackShape &child);
Shape *getChildBinding(JSContext *cx, const StackShape &child);
/* Replace the base shape of the last shape in a non-dictionary lineage with base. */
static RawShape replaceLastProperty(JSContext *cx, const StackBaseShape &base,
static Shape *replaceLastProperty(JSContext *cx, const StackBaseShape &base,
TaggedProto proto, HandleShape shape);
static bool hashify(JSContext *cx, Shape *shape);
void handoffTableTo(RawShape newShape);
void handoffTableTo(Shape *newShape);
inline void setParent(RawShape p);
inline void setParent(Shape *p);
bool ensureOwnBaseShape(JSContext *cx) {
if (base()->isOwned())
@ -597,8 +597,8 @@ class Shape : public js::gc::Cell
Class *getObjectClass() const { return base()->clasp; }
JSObject *getObjectParent() const { return base()->parent; }
static RawShape setObjectParent(JSContext *cx, JSObject *obj, TaggedProto proto, Shape *last);
static RawShape setObjectFlag(JSContext *cx, BaseShape::Flag flag, TaggedProto proto, Shape *last);
static Shape *setObjectParent(JSContext *cx, JSObject *obj, TaggedProto proto, Shape *last);
static Shape *setObjectFlag(JSContext *cx, BaseShape::Flag flag, TaggedProto proto, Shape *last);
uint32_t getObjectFlags() const { return base()->getObjectFlags(); }
bool hasObjectFlag(BaseShape::Flag flag) const {
@ -686,7 +686,7 @@ class Shape : public js::gc::Cell
void update(PropertyOp getter, StrictPropertyOp setter, uint8_t attrs);
inline bool matches(const RawShape other) const;
inline bool matches(const Shape *other) const;
inline bool matches(const StackShape &other) const;
inline bool matchesParamsAfterId(BaseShape *base,
uint32_t aslot, unsigned aattrs, unsigned aflags,
@ -797,7 +797,7 @@ class Shape : public js::gc::Cell
if (hasTable())
return table().entryCount;
RawShape shape = this;
Shape *shape = this;
uint32_t count = 0;
for (Shape::Range<NoGC> r(shape); !r.empty(); r.popFront())
++count;
@ -806,7 +806,7 @@ class Shape : public js::gc::Cell
bool isBigEnoughForAShapeTable() {
JS_ASSERT(!hasTable());
RawShape shape = this;
Shape *shape = this;
uint32_t count = 0;
for (Shape::Range<NoGC> r(shape); !r.empty(); r.popFront()) {
++count;
@ -823,25 +823,25 @@ class Shape : public js::gc::Cell
void sweep();
void finalize(FreeOp *fop);
void removeChild(RawShape child);
void removeChild(Shape *child);
JS::Zone *zone() const { return tenuredZone(); }
static inline void writeBarrierPre(RawShape shape);
static inline void writeBarrierPost(RawShape 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(RawShape shape);
static inline void readBarrier(Shape *shape);
static inline ThingRootKind rootKind() { return THING_ROOT_SHAPE; }
inline void markChildren(JSTracer *trc);
inline RawShape search(JSContext *cx, jsid id) {
inline Shape *search(JSContext *cx, jsid id) {
Shape **_;
return search(cx, this, id, &_);
}
@ -990,7 +990,7 @@ struct StackShape
JS_ASSERT(slot <= SHAPE_INVALID_SLOT);
}
StackShape(const RawShape &shape)
StackShape(Shape *const &shape)
: base(shape->base()->unowned()),
propid(shape->propidRef()),
slot_(shape->slotInfo & Shape::SLOT_MASK),
@ -1040,26 +1040,26 @@ struct StackShape
/* js::Shape pointer tag bit indicating a collision. */
#define SHAPE_COLLISION (uintptr_t(1))
#define SHAPE_REMOVED ((RawShape) SHAPE_COLLISION)
#define SHAPE_REMOVED ((Shape *) SHAPE_COLLISION)
/* Macros to get and set shape pointer values and collision flags. */
#define SHAPE_IS_FREE(shape) ((shape) == NULL)
#define SHAPE_IS_REMOVED(shape) ((shape) == SHAPE_REMOVED)
#define SHAPE_IS_LIVE(shape) ((shape) > SHAPE_REMOVED)
#define SHAPE_FLAG_COLLISION(spp,shape) (*(spp) = (RawShape) \
#define SHAPE_FLAG_COLLISION(spp,shape) (*(spp) = (Shape *) \
(uintptr_t(shape) | SHAPE_COLLISION))
#define SHAPE_HAD_COLLISION(shape) (uintptr_t(shape) & SHAPE_COLLISION)
#define SHAPE_FETCH(spp) SHAPE_CLEAR_COLLISION(*(spp))
#define SHAPE_CLEAR_COLLISION(shape) \
((RawShape) (uintptr_t(shape) & ~SHAPE_COLLISION))
((Shape *) (uintptr_t(shape) & ~SHAPE_COLLISION))
#define SHAPE_STORE_PRESERVING_COLLISION(spp, shape) \
(*(spp) = (RawShape) (uintptr_t(shape) | SHAPE_HAD_COLLISION(*(spp))))
(*(spp) = (Shape *) (uintptr_t(shape) | SHAPE_HAD_COLLISION(*(spp))))
namespace js {
inline RawShape
inline Shape *
Shape::search(JSContext *cx, Shape *start, jsid id, Shape ***pspp, bool adding)
{
if (start->inDictionary()) {
@ -1090,7 +1090,7 @@ Shape::search(JSContext *cx, Shape *start, jsid id, Shape ***pspp, bool adding)
start->incrementNumLinearSearches();
}
for (RawShape shape = start; shape; shape = shape->parent) {
for (Shape *shape = start; shape; shape = shape->parent) {
if (shape->propidRef() == id)
return shape;
}

View File

@ -59,7 +59,7 @@ class StringObject : public JSObject
* encodes the initial length property. Return the shape after changing
* this String object's last property to it.
*/
RawShape assignInitialShape(JSContext *cx);
Shape *assignInitialShape(JSContext *cx);
};
} // namespace js