зеркало из https://github.com/mozilla/gecko-dev.git
Bug 867426 - Remove RawId typedef; r=jonco
--HG-- extra : rebase_source : c7037a278958ca4cc7467ce6ad0905f8f379c950
This commit is contained in:
Родитель
d8275d0a9b
Коммит
4b5e15caee
|
@ -318,7 +318,6 @@ namespace js {
|
|||
* rooted.
|
||||
*/
|
||||
typedef JSObject * RawObject;
|
||||
typedef jsid RawId;
|
||||
|
||||
/*
|
||||
* InternalHandle is a handle to an internal pointer into a gcthing. Use
|
||||
|
|
|
@ -1268,7 +1268,7 @@ ICTypeMonitor_TypeObject::Compiler::generateStubCode(MacroAssembler &masm)
|
|||
|
||||
bool
|
||||
ICUpdatedStub::addUpdateStubForValue(JSContext *cx, HandleScript script, HandleObject obj,
|
||||
RawId id, HandleValue val)
|
||||
jsid id, HandleValue val)
|
||||
{
|
||||
if (numOptimizedStubs_ >= MAX_OPTIMIZED_STUBS) {
|
||||
// TODO: if the TypeSet becomes unknown or has the AnyObject type,
|
||||
|
|
|
@ -915,7 +915,7 @@ class ICUpdatedStub : public ICStub
|
|||
public:
|
||||
bool initUpdatingChain(JSContext *cx, ICStubSpace *space);
|
||||
|
||||
bool addUpdateStubForValue(JSContext *cx, HandleScript script, HandleObject obj, RawId id,
|
||||
bool addUpdateStubForValue(JSContext *cx, HandleScript script, HandleObject obj, jsid id,
|
||||
HandleValue val);
|
||||
|
||||
void addOptimizedUpdateStub(ICStub *stub) {
|
||||
|
|
|
@ -6766,7 +6766,7 @@ GetDefiniteSlot(JSContext *cx, types::StackTypeSet *types, JSAtom *atom)
|
|||
if (!type || type->unknownProperties())
|
||||
return NULL;
|
||||
|
||||
RawId id = AtomToId(atom);
|
||||
jsid id = AtomToId(atom);
|
||||
if (id != types::IdToTypeId(id))
|
||||
return NULL;
|
||||
|
||||
|
@ -6959,7 +6959,7 @@ IonBuilder::TestCommonPropFunc(JSContext *cx, types::StackTypeSet *types, Handle
|
|||
if (obj != foundProto) {
|
||||
// Walk the prototype chain. Everyone has to have the property, since we
|
||||
// just checked, so propSet cannot be NULL.
|
||||
RawId typeId = types::IdToTypeId(id);
|
||||
jsid typeId = types::IdToTypeId(id);
|
||||
while (true) {
|
||||
types::HeapTypeSet *propSet = curType->getProperty(cx, typeId, false);
|
||||
// This assert is now assured, since we have faulted them in
|
||||
|
|
|
@ -1317,7 +1317,7 @@ JSID_TO_GCTHING(jsid id)
|
|||
*/
|
||||
|
||||
static JS_ALWAYS_INLINE JSBool
|
||||
JSID_IS_VOID(const js::RawId id)
|
||||
JSID_IS_VOID(const jsid id)
|
||||
{
|
||||
JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
|
||||
JSID_BITS(id) == JSID_TYPE_VOID);
|
||||
|
@ -1325,7 +1325,7 @@ JSID_IS_VOID(const js::RawId id)
|
|||
}
|
||||
|
||||
static JS_ALWAYS_INLINE JSBool
|
||||
JSID_IS_EMPTY(const js::RawId id)
|
||||
JSID_IS_EMPTY(const jsid id)
|
||||
{
|
||||
return ((size_t)JSID_BITS(id) == JSID_TYPE_OBJECT);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ id_caller(JSContext *cx) {
|
|||
|
||||
#ifdef DEBUG
|
||||
const char *
|
||||
types::TypeIdStringImpl(RawId id)
|
||||
types::TypeIdStringImpl(jsid id)
|
||||
{
|
||||
if (JSID_IS_VOID(id))
|
||||
return "(index)";
|
||||
|
@ -683,9 +683,9 @@ class TypeConstraintProp : public TypeConstraint
|
|||
StackTypeSet *target;
|
||||
|
||||
/* Property being accessed. This is unrooted. */
|
||||
RawId id;
|
||||
jsid id;
|
||||
|
||||
TypeConstraintProp(JSScript *script, jsbytecode *pc, StackTypeSet *target, RawId id)
|
||||
TypeConstraintProp(JSScript *script, jsbytecode *pc, StackTypeSet *target, jsid id)
|
||||
: script_(script), pc(pc), target(target), id(id)
|
||||
{
|
||||
JS_ASSERT(script && pc && target);
|
||||
|
@ -702,7 +702,7 @@ typedef TypeConstraintProp<PROPERTY_READ_EXISTING> TypeConstraintGetPropertyExis
|
|||
|
||||
void
|
||||
StackTypeSet::addGetProperty(JSContext *cx, JSScript *script, jsbytecode *pc,
|
||||
StackTypeSet *target, RawId id)
|
||||
StackTypeSet *target, jsid id)
|
||||
{
|
||||
/*
|
||||
* GetProperty constraints are normally used with property read input type
|
||||
|
@ -715,14 +715,14 @@ StackTypeSet::addGetProperty(JSContext *cx, JSScript *script, jsbytecode *pc,
|
|||
|
||||
void
|
||||
StackTypeSet::addSetProperty(JSContext *cx, JSScript *script, jsbytecode *pc,
|
||||
StackTypeSet *target, RawId id)
|
||||
StackTypeSet *target, jsid id)
|
||||
{
|
||||
add(cx, cx->analysisLifoAlloc().new_<TypeConstraintSetProperty>(script, pc, target, id));
|
||||
}
|
||||
|
||||
void
|
||||
HeapTypeSet::addGetProperty(JSContext *cx, JSScript *script, jsbytecode *pc,
|
||||
StackTypeSet *target, RawId id)
|
||||
StackTypeSet *target, jsid id)
|
||||
{
|
||||
JS_ASSERT(!target->purged());
|
||||
add(cx, cx->typeLifoAlloc().new_<TypeConstraintGetProperty>(script, pc, target, id));
|
||||
|
@ -951,7 +951,7 @@ HeapTypeSet::addFilterPrimitives(JSContext *cx, TypeSet *target)
|
|||
|
||||
/* If id is a normal slotful 'own' property of an object, get its shape. */
|
||||
static inline Shape *
|
||||
GetSingletonShape(JSContext *cx, RawObject obj, RawId idArg)
|
||||
GetSingletonShape(JSContext *cx, RawObject obj, jsid idArg)
|
||||
{
|
||||
if (!obj->isNative())
|
||||
return NULL;
|
||||
|
@ -1203,7 +1203,7 @@ GetSingletonPropertyType(JSContext *cx, RawObject rawObjArg, HandleId id)
|
|||
template <PropertyAccessKind access>
|
||||
static inline void
|
||||
PropertyAccess(JSContext *cx, JSScript *script, jsbytecode *pc, TypeObject *object,
|
||||
StackTypeSet *target, RawId idArg)
|
||||
StackTypeSet *target, jsid idArg)
|
||||
{
|
||||
RootedId id(cx, idArg);
|
||||
|
||||
|
@ -2299,7 +2299,7 @@ HeapTypeSet::needsBarrier(JSContext *cx)
|
|||
}
|
||||
|
||||
bool
|
||||
StackTypeSet::propertyNeedsBarrier(JSContext *cx, RawId id)
|
||||
StackTypeSet::propertyNeedsBarrier(JSContext *cx, jsid id)
|
||||
{
|
||||
RootedId typeId(cx, IdToTypeId(id));
|
||||
|
||||
|
@ -2636,7 +2636,7 @@ TypeCompartment::addAllocationSiteTypeObject(JSContext *cx, AllocationSiteKey ke
|
|||
return res;
|
||||
}
|
||||
|
||||
static inline RawId
|
||||
static inline jsid
|
||||
GetAtomId(JSContext *cx, JSScript *script, const jsbytecode *pc, unsigned offset)
|
||||
{
|
||||
PropertyName *name = script->getName(GET_UINT32_INDEX(pc + offset));
|
||||
|
@ -3662,7 +3662,7 @@ UpdatePropertyType(JSContext *cx, TypeSet *types, RawObject obj, Shape *shape,
|
|||
}
|
||||
|
||||
bool
|
||||
TypeObject::addProperty(JSContext *cx, RawId id, Property **pprop)
|
||||
TypeObject::addProperty(JSContext *cx, jsid id, Property **pprop)
|
||||
{
|
||||
JS_ASSERT(!*pprop);
|
||||
Property *base = cx->typeLifoAlloc().new_<Property>(id);
|
||||
|
@ -3734,7 +3734,7 @@ TypeObject::addDefiniteProperties(JSContext *cx, JSObject *obj)
|
|||
|
||||
RootedShape shape(cx, obj->lastProperty());
|
||||
while (!shape->isEmptyShape()) {
|
||||
RawId id = IdToTypeId(shape->propid());
|
||||
jsid id = IdToTypeId(shape->propid());
|
||||
if (!JSID_IS_VOID(id) && obj->isFixedSlot(shape->slot()) &&
|
||||
shape->slot() <= (TYPE_FLAG_DEFINITE_MASK >> TYPE_FLAG_DEFINITE_SHIFT)) {
|
||||
TypeSet *types = getProperty(cx, id, true);
|
||||
|
@ -3807,7 +3807,7 @@ TypeObject::addPropertyType(JSContext *cx, jsid id, const Value &value)
|
|||
void
|
||||
TypeObject::addPropertyType(JSContext *cx, const char *name, Type type)
|
||||
{
|
||||
RawId id = JSID_VOID;
|
||||
jsid id = JSID_VOID;
|
||||
if (name) {
|
||||
JSAtom *atom = Atomize(cx, name, strlen(name));
|
||||
if (!atom) {
|
||||
|
@ -4295,7 +4295,7 @@ ScriptAnalysis::analyzeTypesBytecode(JSContext *cx, unsigned offset, TypeInferen
|
|||
|
||||
case JSOP_GETGNAME:
|
||||
case JSOP_CALLGNAME: {
|
||||
RawId id = GetAtomId(cx, script, pc, 0);
|
||||
jsid id = GetAtomId(cx, script, pc, 0);
|
||||
|
||||
StackTypeSet *seen = bytecodeTypes(pc);
|
||||
seen->addSubset(cx, &pushed[0]);
|
||||
|
|
|
@ -566,9 +566,9 @@ class StackTypeSet : public TypeSet
|
|||
|
||||
void addSubset(JSContext *cx, TypeSet *target);
|
||||
void addGetProperty(JSContext *cx, JSScript *script, jsbytecode *pc,
|
||||
StackTypeSet *target, RawId id);
|
||||
StackTypeSet *target, jsid id);
|
||||
void addSetProperty(JSContext *cx, JSScript *script, jsbytecode *pc,
|
||||
StackTypeSet *target, RawId id);
|
||||
StackTypeSet *target, jsid id);
|
||||
void addSetElement(JSContext *cx, JSScript *script, jsbytecode *pc,
|
||||
StackTypeSet *objectTypes, StackTypeSet *valueTypes);
|
||||
void addCall(JSContext *cx, TypeCallsite *site);
|
||||
|
@ -631,7 +631,7 @@ class StackTypeSet : public TypeSet
|
|||
RawObject getSingleton();
|
||||
|
||||
/* Whether any objects in the type set needs a barrier on id. */
|
||||
bool propertyNeedsBarrier(JSContext *cx, RawId id);
|
||||
bool propertyNeedsBarrier(JSContext *cx, jsid id);
|
||||
|
||||
/*
|
||||
* Whether this set contains all types in other, except (possibly) the
|
||||
|
@ -680,7 +680,7 @@ class HeapTypeSet : public TypeSet
|
|||
|
||||
void addSubset(JSContext *cx, TypeSet *target);
|
||||
void addGetProperty(JSContext *cx, JSScript *script, jsbytecode *pc,
|
||||
StackTypeSet *target, RawId id);
|
||||
StackTypeSet *target, jsid id);
|
||||
void addCallProperty(JSContext *cx, JSScript *script, jsbytecode *pc, jsid id);
|
||||
void addFilterPrimitives(JSContext *cx, TypeSet *target);
|
||||
void addSubsetBarrier(JSContext *cx, JSScript *script, jsbytecode *pc, TypeSet *target);
|
||||
|
@ -859,7 +859,7 @@ struct Property
|
|||
inline Property(jsid id);
|
||||
inline Property(const Property &o);
|
||||
|
||||
static uint32_t keyBits(RawId id) { return uint32_t(JSID_BITS(id)); }
|
||||
static uint32_t keyBits(jsid id) { return uint32_t(JSID_BITS(id)); }
|
||||
static jsid getKey(Property *p) { return p->id; }
|
||||
};
|
||||
|
||||
|
@ -1047,10 +1047,10 @@ struct TypeObject : gc::Cell
|
|||
* assignment, and the own types of the property will be used instead of
|
||||
* aggregate types.
|
||||
*/
|
||||
inline HeapTypeSet *getProperty(JSContext *cx, RawId id, bool own);
|
||||
inline HeapTypeSet *getProperty(JSContext *cx, jsid id, bool own);
|
||||
|
||||
/* Get a property only if it already exists. */
|
||||
inline HeapTypeSet *maybeGetProperty(RawId id, JSContext *cx);
|
||||
inline HeapTypeSet *maybeGetProperty(jsid id, JSContext *cx);
|
||||
|
||||
inline unsigned getPropertyCount();
|
||||
inline Property *getProperty(unsigned i);
|
||||
|
@ -1063,7 +1063,7 @@ struct TypeObject : gc::Cell
|
|||
|
||||
/* Helpers */
|
||||
|
||||
bool addProperty(JSContext *cx, RawId id, Property **pprop);
|
||||
bool addProperty(JSContext *cx, jsid id, Property **pprop);
|
||||
bool addDefiniteProperties(JSContext *cx, JSObject *obj);
|
||||
bool matchDefiniteProperties(HandleObject obj);
|
||||
void addPrototype(JSContext *cx, TypeObject *proto);
|
||||
|
|
|
@ -277,8 +277,8 @@ TypeFlagPrimitive(TypeFlags flags)
|
|||
* maintains the constraint that if two different jsids map to the same property
|
||||
* in JS (e.g. 3 and "3"), they have the same type representation.
|
||||
*/
|
||||
inline RawId
|
||||
IdToTypeId(RawId id)
|
||||
inline jsid
|
||||
IdToTypeId(jsid id)
|
||||
{
|
||||
JS_ASSERT(!JSID_IS_EMPTY(id));
|
||||
|
||||
|
@ -313,7 +313,7 @@ const char * TypeIdStringImpl(jsid id);
|
|||
|
||||
/* Convert an id for printing during debug. */
|
||||
static inline const char *
|
||||
TypeIdString(RawId id)
|
||||
TypeIdString(jsid id)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
return TypeIdStringImpl(id);
|
||||
|
@ -597,7 +597,7 @@ TypeMonitorCall(JSContext *cx, const js::CallArgs &args, bool constructing)
|
|||
}
|
||||
|
||||
inline bool
|
||||
TrackPropertyTypes(JSContext *cx, RawObject obj, RawId id)
|
||||
TrackPropertyTypes(JSContext *cx, RawObject obj, jsid id)
|
||||
{
|
||||
if (!cx->typeInferenceEnabled() || obj->hasLazyType() || obj->type()->unknownProperties())
|
||||
return false;
|
||||
|
@ -609,7 +609,7 @@ TrackPropertyTypes(JSContext *cx, RawObject obj, RawId id)
|
|||
}
|
||||
|
||||
inline void
|
||||
EnsureTrackPropertyTypes(JSContext *cx, RawObject obj, RawId id)
|
||||
EnsureTrackPropertyTypes(JSContext *cx, RawObject obj, jsid id)
|
||||
{
|
||||
JS_ASSERT(!obj->hasLazyType());
|
||||
|
||||
|
@ -690,7 +690,7 @@ MarkTypeObjectUnknownProperties(JSContext *cx, TypeObject *obj,
|
|||
* have a getter/setter.
|
||||
*/
|
||||
inline void
|
||||
MarkTypePropertyConfigured(JSContext *cx, HandleObject obj, RawId id)
|
||||
MarkTypePropertyConfigured(JSContext *cx, HandleObject obj, jsid id)
|
||||
{
|
||||
if (cx->typeInferenceEnabled())
|
||||
id = IdToTypeId(id);
|
||||
|
@ -1599,7 +1599,7 @@ TypeObject::setBasePropertyCount(uint32_t count)
|
|||
}
|
||||
|
||||
inline HeapTypeSet *
|
||||
TypeObject::getProperty(JSContext *cx, RawId id, bool own)
|
||||
TypeObject::getProperty(JSContext *cx, jsid id, bool own)
|
||||
{
|
||||
JS_ASSERT(cx->compartment->activeAnalysis);
|
||||
|
||||
|
@ -1648,13 +1648,13 @@ TypeObject::getProperty(JSContext *cx, RawId id, bool own)
|
|||
}
|
||||
|
||||
inline HeapTypeSet *
|
||||
TypeObject::maybeGetProperty(RawId id, JSContext *cx)
|
||||
TypeObject::maybeGetProperty(jsid id, JSContext *cx)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_VOID(id) || JSID_IS_EMPTY(id) || JSID_IS_STRING(id));
|
||||
JS_ASSERT_IF(!JSID_IS_EMPTY(id), id == IdToTypeId(id));
|
||||
JS_ASSERT(!unknownProperties());
|
||||
|
||||
Property *prop = HashSetLookup<RawId,Property,Property>
|
||||
Property *prop = HashSetLookup<jsid,Property,Property>
|
||||
(propertySet, basePropertyCount(), id);
|
||||
|
||||
return prop ? &prop->types : NULL;
|
||||
|
|
|
@ -4471,7 +4471,7 @@ baseops::SetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, u
|
|||
if (nobj->isNative() && IsImplicitDenseElement(shape)) {
|
||||
if (!JSObject::sparsifyDenseElement(cx, obj, index))
|
||||
return false;
|
||||
RawId id = INT_TO_JSID(index);
|
||||
jsid id = INT_TO_JSID(index);
|
||||
shape = obj->nativeLookup(cx, HandleId::fromMarkedLocation(&id)); // not a gcthing
|
||||
}
|
||||
return nobj->isNative()
|
||||
|
|
|
@ -848,7 +848,7 @@ LoopState::invariantLength(const CrossSSAValue &obj)
|
|||
}
|
||||
|
||||
FrameEntry *
|
||||
LoopState::invariantProperty(const CrossSSAValue &obj, RawId id)
|
||||
LoopState::invariantProperty(const CrossSSAValue &obj, jsid id)
|
||||
{
|
||||
if (skipAnalysis)
|
||||
return NULL;
|
||||
|
@ -1598,7 +1598,7 @@ LoopState::analyzeLoopBody(unsigned frame)
|
|||
|
||||
case JSOP_SETPROP: {
|
||||
PropertyName *name = script->getName(GET_UINT32_INDEX(pc));
|
||||
RawId id = IdToTypeId(NameToId(name));
|
||||
jsid id = IdToTypeId(NameToId(name));
|
||||
|
||||
TypeSet *objTypes = analysis->poppedTypes(pc, 1);
|
||||
if (objTypes->unknownObject()) {
|
||||
|
|
|
@ -270,7 +270,7 @@ class LoopState : public MacroAssemblerTypedefs
|
|||
FrameEntry *invariantArguments();
|
||||
|
||||
FrameEntry *invariantLength(const analyze::CrossSSAValue &obj);
|
||||
FrameEntry *invariantProperty(const analyze::CrossSSAValue &obj, RawId id);
|
||||
FrameEntry *invariantProperty(const analyze::CrossSSAValue &obj, jsid id);
|
||||
|
||||
/* Whether a binary or inc/dec op's result cannot overflow. */
|
||||
bool cannotIntegerOverflow(const analyze::CrossSSAValue &pushed);
|
||||
|
|
|
@ -970,7 +970,7 @@ struct StackShape
|
|||
{
|
||||
/* For performance, StackShape only roots when absolutely necessary. */
|
||||
UnownedBaseShape *base;
|
||||
RawId propid;
|
||||
jsid propid;
|
||||
uint32_t slot_;
|
||||
uint8_t attrs;
|
||||
uint8_t flags;
|
||||
|
|
|
@ -853,7 +853,7 @@ class PropertyName : public JSAtom
|
|||
|
||||
JS_STATIC_ASSERT(sizeof(PropertyName) == sizeof(JSString));
|
||||
|
||||
static JS_ALWAYS_INLINE RawId
|
||||
static JS_ALWAYS_INLINE jsid
|
||||
NameToId(PropertyName *name)
|
||||
{
|
||||
return NON_INTEGER_ATOM_TO_JSID(name);
|
||||
|
|
Загрузка…
Ссылка в новой задаче