Backed out changeset ef0eeaec74a8 (bug 949183) on the theory that it somehow broke every single b2g test on a CLOSED TREE

This commit is contained in:
Wes Kocher 2013-12-16 18:27:43 -08:00
parent 19db3a26ae
commit a8ec671341
44 changed files with 147 additions and 158 deletions

View File

@ -573,15 +573,15 @@ nsIScriptSecurityManager *nsDOMClassInfo::sSecMan = nullptr;
bool nsDOMClassInfo::sIsInitialized = false;
jsid nsDOMClassInfo::sLocation_id = jsid::voidId();
jsid nsDOMClassInfo::sConstructor_id = jsid::voidId();
jsid nsDOMClassInfo::sLength_id = jsid::voidId();
jsid nsDOMClassInfo::sItem_id = jsid::voidId();
jsid nsDOMClassInfo::sNamedItem_id = jsid::voidId();
jsid nsDOMClassInfo::sEnumerate_id = jsid::voidId();
jsid nsDOMClassInfo::sTop_id = jsid::voidId();
jsid nsDOMClassInfo::sDocument_id = jsid::voidId();
jsid nsDOMClassInfo::sWrappedJSObject_id = jsid::voidId();
jsid nsDOMClassInfo::sLocation_id = JSID_VOID;
jsid nsDOMClassInfo::sConstructor_id = JSID_VOID;
jsid nsDOMClassInfo::sLength_id = JSID_VOID;
jsid nsDOMClassInfo::sItem_id = JSID_VOID;
jsid nsDOMClassInfo::sNamedItem_id = JSID_VOID;
jsid nsDOMClassInfo::sEnumerate_id = JSID_VOID;
jsid nsDOMClassInfo::sTop_id = JSID_VOID;
jsid nsDOMClassInfo::sDocument_id = JSID_VOID;
jsid nsDOMClassInfo::sWrappedJSObject_id = JSID_VOID;
static const JSClass *sObjectClass = nullptr;
@ -1945,14 +1945,14 @@ nsDOMClassInfo::ShutDown()
}
}
sLocation_id = jsid::voidId();
sConstructor_id = jsid::voidId();
sLength_id = jsid::voidId();
sItem_id = jsid::voidId();
sEnumerate_id = jsid::voidId();
sTop_id = jsid::voidId();
sDocument_id = jsid::voidId();
sWrappedJSObject_id = jsid::voidId();
sLocation_id = JSID_VOID;
sConstructor_id = JSID_VOID;
sLength_id = JSID_VOID;
sItem_id = JSID_VOID;
sEnumerate_id = JSID_VOID;
sTop_id = JSID_VOID;
sDocument_id = JSID_VOID;
sWrappedJSObject_id = JSID_VOID;
NS_IF_RELEASE(sXPConnect);
NS_IF_RELEASE(sSecMan);

View File

@ -941,7 +941,7 @@ XrayResolveAttribute(JSContext* cx, JS::Handle<JSObject*> wrapper,
// Set i to be the index into our full list of ids/specs that we're
// looking at now.
size_t i = attributes->specs - attributeSpecs;
for ( ; attributeIds[i] != jsid::voidId(); ++i) {
for ( ; attributeIds[i] != JSID_VOID; ++i) {
if (id == attributeIds[i]) {
const JSPropertySpec& attrSpec = attributeSpecs[i];
// Because of centralization, we need to make sure we fault in the
@ -1020,7 +1020,7 @@ XrayResolveProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
// Set i to be the index into our full list of ids/specs that we're
// looking at now.
size_t i = method->specs - methodsSpecs;
for ( ; methodIds[i] != jsid::voidId(); ++i) {
for ( ; methodIds[i] != JSID_VOID; ++i) {
if (id == methodIds[i]) {
const JSFunctionSpec& methodSpec = methodsSpecs[i];
JSFunction *fun;
@ -1084,7 +1084,7 @@ XrayResolveProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
// Set i to be the index into our full list of ids/specs that we're
// looking at now.
size_t i = constant->specs - nativeProperties->constantSpecs;
for ( ; nativeProperties->constantIds[i] != jsid::voidId(); ++i) {
for ( ; nativeProperties->constantIds[i] != JSID_VOID; ++i) {
if (id == nativeProperties->constantIds[i]) {
desc.setAttributes(JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT);
desc.object().set(wrapper);
@ -1226,7 +1226,7 @@ XrayEnumerateAttributes(JSContext* cx, JS::Handle<JSObject*> wrapper,
// Set i to be the index into our full list of ids/specs that we're
// looking at now.
size_t i = attributes->specs - attributeSpecs;
for ( ; attributeIds[i] != jsid::voidId(); ++i) {
for ( ; attributeIds[i] != JSID_VOID; ++i) {
if (((flags & JSITER_HIDDEN) ||
(attributeSpecs[i].flags & JSPROP_ENUMERATE)) &&
!props.append(attributeIds[i])) {
@ -1264,7 +1264,7 @@ XrayEnumerateProperties(JSContext* cx, JS::Handle<JSObject*> wrapper,
// Set i to be the index into our full list of ids/specs that we're
// looking at now.
size_t i = method->specs - methodsSpecs;
for ( ; methodIds[i] != jsid::voidId(); ++i) {
for ( ; methodIds[i] != JSID_VOID; ++i) {
if (((flags & JSITER_HIDDEN) ||
(methodsSpecs[i].flags & JSPROP_ENUMERATE)) &&
!props.append(methodIds[i])) {
@ -1310,7 +1310,7 @@ XrayEnumerateProperties(JSContext* cx, JS::Handle<JSObject*> wrapper,
// Set i to be the index into our full list of ids/specs that we're
// looking at now.
size_t i = constant->specs - nativeProperties->constantSpecs;
for ( ; nativeProperties->constantIds[i] != jsid::voidId(); ++i) {
for ( ; nativeProperties->constantIds[i] != JSID_VOID; ++i) {
if (!props.append(nativeProperties->constantIds[i])) {
return false;
}

View File

@ -1408,9 +1408,9 @@ InitIds(JSContext* cx, const Prefable<Spec>* prefableSpecs, jsid* ids)
}
} while (++ids, (++spec)->name);
// We ran out of ids for that pref. Put a jsid::voidId() in on the id
// We ran out of ids for that pref. Put a JSID_VOID in on the id
// corresponding to the list terminator for the pref.
*ids = jsid::voidId();
*ids = JSID_VOID;
++ids;
} while ((++prefableSpecs)->specs);

View File

@ -1426,7 +1426,7 @@ class PropertyDefiner:
',\n'.join(prefableSpecs) + "\n" +
"};\n\n") % (specType, name, specType, name))
if doIdArrays:
arrays += ("static jsid %s_ids[%i] = { jsid::voidId() };\n\n" %
arrays += ("static jsid %s_ids[%i] = { JSID_VOID };\n\n" %
(name, len(specs)))
return arrays
@ -1832,14 +1832,14 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
if len(idsToInit) > 1:
initIds = CGWrapper(initIds, pre="(", post=")", reindent=True)
initIds = CGList(
[CGGeneric("%s_ids[0] == jsid::voidId() &&" % idsToInit[0]),
[CGGeneric("%s_ids[0] == JSID_VOID &&" % idsToInit[0]),
CGGeneric("NS_IsMainThread() &&"),
initIds],
"\n")
initIds = CGWrapper(initIds, pre="if (", post=") {", reindent=True)
initIds = CGList(
[initIds,
CGGeneric((" %s_ids[0] = jsid::voidId();\n"
CGGeneric((" %s_ids[0] = JSID_VOID;\n"
" return;") % idsToInit[0]),
CGGeneric("}")],
"\n")
@ -11297,7 +11297,7 @@ class GlobalGenRoots():
classMembers = [ClassMember(m.identifier.name + "_id",
"jsid",
visibility="public",
body="jsid::voidId()") for m in dictMembers]
body="JSID_VOID") for m in dictMembers]
structName = dict.identifier.name + "Atoms"
structs.append((structName,

View File

@ -21,7 +21,7 @@ using namespace JS;
namespace mozilla {
namespace dom {
jsid s_length_id = jsid::voidId();
jsid s_length_id = JSID_VOID;
bool
DefineStaticJSVals(JSContext* cx)

View File

@ -141,7 +141,7 @@ NPStringIdentifierIsPermanent(NPP npp, NPIdentifier id)
return JS_StringHasBeenInterned(cx, NPIdentifierToString(id));
}
#define NPIdentifier_VOID (JSIdToNPIdentifier(jsid::voidId()))
#define NPIdentifier_VOID (JSIdToNPIdentifier(JSID_VOID))
NPObject* NP_CALLBACK
_getwindowobject(NPP npp);

View File

@ -173,7 +173,7 @@ enum {
};
// These are jsids for the main runtime. Only touched on the main thread.
jsid gStringIDs[ID_COUNT] = { jsid::voidId() };
jsid gStringIDs[ID_COUNT] = { JSID_VOID };
const char* gStringChars[] = {
"Worker",
@ -1080,7 +1080,7 @@ ResolveWorkerClasses(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid
JSString* str = JS_InternString(aCx, gStringChars[i]);
if (!str) {
while (i) {
gStringIDs[--i] = jsid::voidId();
gStringIDs[--i] = JSID_VOID;
}
return false;
}

View File

@ -48,7 +48,7 @@ SPECIALID_TO_JSID(const SpecialId &sid);
* (PropertyName, see vm/String.h); and by various special values.
*
* Special values are encoded using SpecialId, which is layout-compatible but
* non-interconvertible with jsid. A SpecialId is used for jsid::voidId(), which
* non-interconvertible with jsid. A SpecialId is used for JSID_VOID, which
* does not occur in JS scripts but may be used to indicate the absence of a
* valid identifier. In the future, a SpecialId may also be an object used by
* Harmony-proposed private names.

View File

@ -10,17 +10,16 @@
// A jsid is an identifier for a property or method of an object which is
// either a 31-bit signed integer, interned string or object.
//
// Also, there is an additional jsid value, jsid::voidId(), which does not occur in
// Also, there is an additional jsid value, JSID_VOID, which does not occur in
// JS scripts but may be used to indicate the absence of a valid jsid. A void
// jsid is not a valid id and only arises as an exceptional API return value,
// such as in JS_NextProperty. Embeddings must not pass jsid::voidId() into JSAPI
// entry points expecting a jsid and do not need to handle jsid::voidId() in hooks
// such as in JS_NextProperty. Embeddings must not pass JSID_VOID into JSAPI
// entry points expecting a jsid and do not need to handle JSID_VOID in hooks
// receiving a jsid except when explicitly noted in the API contract.
//
// A jsid is not implicitly convertible to or from a jsval; JS_ValueToId or
// JS_IdToValue must be used instead.
#include "mozilla/Attributes.h"
#include "mozilla/NullPtr.h"
#include "jstypes.h"
@ -29,35 +28,20 @@
#include "js/TypeDecls.h"
#include "js/Utility.h"
struct jsid
{
size_t asBits;
bool operator==(jsid rhs) const { return asBits == rhs.asBits; }
bool operator!=(jsid rhs) const { return asBits != rhs.asBits; }
};
#define JSID_BITS(id) (id.asBits)
#define JSID_TYPE_STRING 0x0
#define JSID_TYPE_INT 0x1
#define JSID_TYPE_VOID 0x2
#define JSID_TYPE_OBJECT 0x4
#define JSID_TYPE_MASK 0x7
struct jsid
{
size_t asBits;
jsid() {}
#if !defined(_MSC_VER) && !defined(__sparc)
// jsid must be POD so that MSVC and SPARC will pass it and return it by
// value. (See also bug 689101 and bug 737344, for this problem with
// respect to JS::Value, which also has a comment like this next to it.)
private:
#endif
MOZ_CONSTEXPR jsid(size_t bits) : asBits(bits) {}
public:
static MOZ_CONSTEXPR jsid voidId() { return jsid(JSID_TYPE_VOID); }
static MOZ_CONSTEXPR jsid emptyId() { return jsid(JSID_TYPE_OBJECT); }
bool operator==(jsid rhs) const { return asBits == rhs.asBits; }
bool operator!=(jsid rhs) const { return asBits != rhs.asBits; }
};
#define JSID_BITS(id) (id.asBits)
// Avoid using canonical 'id' for jsid parameters since this is a magic word in
// Objective-C++ which, apparently, wants to be able to #include jsapi.h.
#define id iden
@ -164,6 +148,9 @@ JSID_IS_EMPTY(const jsid id)
#undef id
extern JS_PUBLIC_DATA(const jsid) JSID_VOID;
extern JS_PUBLIC_DATA(const jsid) JSID_EMPTY;
extern JS_PUBLIC_DATA(const JS::Handle<jsid>) JSID_VOIDHANDLE;
extern JS_PUBLIC_DATA(const JS::Handle<jsid>) JSID_EMPTYHANDLE;
@ -181,7 +168,7 @@ IsPoisonedId(jsid iden)
template <> struct GCMethods<jsid>
{
static jsid initial() { return jsid::voidId(); }
static jsid initial() { return JSID_VOID; }
static ThingRootKind kind() { return THING_ROOT_ID; }
static bool poisoned(jsid id) { return IsPoisonedId(id); }
static bool needsPostBarrier(jsid id) { return false; }

View File

@ -605,7 +605,7 @@ obj_unwatch(JSContext *cx, unsigned argc, Value *vp)
if (!ValueToId<CanGC>(cx, args[0], &id))
return false;
} else {
id = jsid::voidId();
id = JSID_VOID;
}
if (!JSObject::unwatch(cx, obj, id))

View File

@ -995,7 +995,7 @@ class EncapsulatedId : public BarrieredId
{
public:
explicit EncapsulatedId(jsid id) : BarrieredId(id) {}
explicit EncapsulatedId() : BarrieredId(jsid::voidId()) {}
explicit EncapsulatedId() : BarrieredId(JSID_VOID) {}
EncapsulatedId &operator=(const EncapsulatedId &v) {
if (v.value != value)
@ -1009,7 +1009,7 @@ class EncapsulatedId : public BarrieredId
class RelocatableId : public BarrieredId
{
public:
explicit RelocatableId() : BarrieredId(jsid::voidId()) {}
explicit RelocatableId() : BarrieredId(JSID_VOID) {}
explicit inline RelocatableId(jsid id) : BarrieredId(id) {}
~RelocatableId() { pre(); }
@ -1046,7 +1046,7 @@ class RelocatableId : public BarrieredId
class HeapId : public BarrieredId
{
public:
explicit HeapId() : BarrieredId(jsid::voidId()) {}
explicit HeapId() : BarrieredId(JSID_VOID) {}
explicit HeapId(jsid id)
: BarrieredId(id)

View File

@ -46,7 +46,7 @@ class jsid(object):
elif tag & jsid.TYPE_INT:
body = bits >> 1
elif tag == jsid.TYPE_VOID:
return "jsid::voidId()"
return "JSID_VOID"
elif tag == jsid.TYPE_OBJECT:
body = ((bits & ~jsid.TYPE_MASK)
.cast(self.cache.JSObject_ptr_t))

View File

@ -6,7 +6,7 @@ FRAGMENT(jsid, simple) {
JS::Rooted<JSString *> interned(cx, JS_InternJSString(cx, string));
JS::Rooted<jsid> string_id(cx, INTERNED_STRING_TO_JSID(cx, interned));
jsid int_id = INT_TO_JSID(1729);
jsid void_id = jsid::voidId();
jsid void_id = JSID_VOID;
JS::Rooted<jsid> object_id(cx, OBJECT_TO_JSID(JS::CurrentGlobalOrNull(cx)));
breakpoint();

View File

@ -6,7 +6,7 @@ run_fragment('jsid.simple')
assert_pretty('string_id', '$jsid("moon")')
assert_pretty('int_id', '$jsid(1729)')
assert_pretty('void_id', 'jsid::voidId()')
assert_pretty('void_id', 'JSID_VOID')
assert_pretty('object_id', '$jsid((JSObject *) [object global] delegate)')
run_fragment('jsid.handles')

View File

@ -1469,7 +1469,7 @@ DoTypeUpdateFallback(JSContext *cx, BaselineFrame *frame, ICUpdatedStub *stub, H
case ICStub::SetElem_Dense:
case ICStub::SetElem_DenseAdd: {
JS_ASSERT(obj->isNative());
id = jsid::voidId();
id = JSID_VOID;
types::AddTypePropertyId(cx, obj, id, value);
break;
}

View File

@ -2013,7 +2013,7 @@ AnalyzePoppedThis(JSContext *cx, types::TypeObject *type,
// Don't use GetAtomId here, we need to watch for SETPROP on
// integer properties and bail out. We can't mark the aggregate
// jsid::voidId() type property as being in a definite slot.
// JSID_VOID type property as being in a definite slot.
if (setprop->name() == cx->names().prototype ||
setprop->name() == cx->names().proto ||
setprop->name() == cx->names().constructor)

View File

@ -5522,7 +5522,7 @@ IonBuilder::jsop_initelem_array()
if (!initializer->hasFlags(constraints(), types::OBJECT_FLAG_NON_PACKED))
needStub = true;
} else if (!initializer->unknownProperties()) {
types::HeapTypeSetKey elemTypes = initializer->property(jsid::voidId());
types::HeapTypeSetKey elemTypes = initializer->property(JSID_VOID);
if (!TypeSetIncludes(elemTypes.maybeTypes(), value->type(), value->resultTypeSet())) {
elemTypes.freeze(constraints());
needStub = true;
@ -7627,7 +7627,7 @@ IonBuilder::jsop_setelem_dense(types::TemporaryTypeSet::DoubleConversion convers
}
// Determine whether a write barrier is required.
if (obj->resultTypeSet()->propertyNeedsBarrier(constraints(), jsid::voidId()))
if (obj->resultTypeSet()->propertyNeedsBarrier(constraints(), JSID_VOID))
store->setNeedsBarrier();
if (elementType != MIRType_None && packed)

View File

@ -213,7 +213,7 @@ IonBuilder::inlineArray(CallInfo &callInfo)
types::TypeObjectKey *type = types::TypeObjectKey::get(templateObject);
if (!type->unknownProperties()) {
types::HeapTypeSetKey elemTypes = type->property(jsid::voidId());
types::HeapTypeSetKey elemTypes = type->property(JSID_VOID);
for (uint32_t i = 0; i < initLength; i++) {
MDefinition *value = callInfo.getArg(i);
@ -468,7 +468,7 @@ IonBuilder::inlineArrayConcat(CallInfo &callInfo)
// Constraints modeling this concat have not been generated by inference,
// so check that type information already reflects possible side effects of
// this call.
types::HeapTypeSetKey thisElemTypes = thisType->property(jsid::voidId());
types::HeapTypeSetKey thisElemTypes = thisType->property(JSID_VOID);
types::TemporaryTypeSet *resTypes = getInlineReturnTypeSet();
if (!resTypes->hasType(types::Type::ObjectType(thisType)))
@ -482,7 +482,7 @@ IonBuilder::inlineArrayConcat(CallInfo &callInfo)
if (argType->unknownProperties())
return InliningStatus_NotInlined;
types::HeapTypeSetKey elemTypes = argType->property(jsid::voidId());
types::HeapTypeSetKey elemTypes = argType->property(JSID_VOID);
if (!elemTypes.knownSubset(constraints(), thisElemTypes))
return InliningStatus_NotInlined;
}
@ -958,7 +958,7 @@ IonBuilder::inlineStringSplit(CallInfo &callInfo)
if (retType->unknownProperties())
return InliningStatus_NotInlined;
types::HeapTypeSetKey key = retType->property(jsid::voidId());
types::HeapTypeSetKey key = retType->property(JSID_VOID);
if (!key.maybeTypes())
return InliningStatus_NotInlined;
@ -1178,7 +1178,7 @@ IonBuilder::inlineUnsafeSetDenseArrayElement(CallInfo &callInfo, uint32_t base)
// - arr is a dense array
// - idx < initialized length
// Furthermore, note that inlineUnsafePutElements ensures the type of the
// value is reflected in the jsid::voidId() property of the array.
// value is reflected in the JSID_VOID property of the array.
MDefinition *obj = callInfo.getArg(base + 0);
MDefinition *id = callInfo.getArg(base + 1);

View File

@ -2870,7 +2870,7 @@ jit::DenseNativeElementType(types::CompilerConstraintList *constraints, MDefinit
if (object->unknownProperties())
return MIRType_None;
types::HeapTypeSetKey elementTypes = object->property(jsid::voidId());
types::HeapTypeSetKey elementTypes = object->property(JSID_VOID);
MIRType type = MIRTypeFromValueType(elementTypes.knownTypeTag(constraints));
if (type == MIRType_None)
@ -2899,7 +2899,7 @@ PropertyReadNeedsTypeBarrier(types::CompilerConstraintList *constraints,
if (object->unknownProperties() || observed->empty())
return true;
jsid id = name ? NameToId(name) : jsid::voidId();
jsid id = name ? NameToId(name) : JSID_VOID;
types::HeapTypeSetKey property = object->property(id);
if (property.maybeTypes() && !TypeSetIncludes(observed, MIRType_Value, property.maybeTypes()))
return true;
@ -3073,7 +3073,7 @@ jit::AddObjectsForPropertyRead(MDefinition *obj, PropertyName *name,
if (object->unknownProperties())
return observed->addType(types::Type::AnyObjectType(), alloc);
jsid id = name ? NameToId(name) : jsid::voidId();
jsid id = name ? NameToId(name) : JSID_VOID;
types::HeapTypeSetKey property = object->property(id);
types::HeapTypeSet *types = property.maybeTypes();
if (!types)
@ -3114,7 +3114,7 @@ TryAddTypeBarrierForWrite(TempAllocator &alloc, types::CompilerConstraintList *c
if (object->unknownProperties())
return false;
jsid id = name ? NameToId(name) : jsid::voidId();
jsid id = name ? NameToId(name) : JSID_VOID;
types::HeapTypeSetKey property = object->property(id);
if (!property.maybeTypes())
return false;
@ -3224,7 +3224,7 @@ jit::PropertyWriteNeedsTypeBarrier(TempAllocator &alloc, types::CompilerConstrai
if (IsTypedArrayClass(object->clasp()))
continue;
jsid id = name ? NameToId(name) : jsid::voidId();
jsid id = name ? NameToId(name) : JSID_VOID;
types::HeapTypeSetKey property = object->property(id);
if (!TypeSetIncludes(property.maybeTypes(), (*pvalue)->type(), (*pvalue)->resultTypeSet())) {
// Either pobj or pvalue needs to be modified to filter out the
@ -3256,7 +3256,7 @@ jit::PropertyWriteNeedsTypeBarrier(TempAllocator &alloc, types::CompilerConstrai
if (IsTypedArrayClass(object->clasp()))
continue;
jsid id = name ? NameToId(name) : jsid::voidId();
jsid id = name ? NameToId(name) : JSID_VOID;
types::HeapTypeSetKey property = object->property(id);
if (TypeSetIncludes(property.maybeTypes(), (*pvalue)->type(), (*pvalue)->resultTypeSet()))
continue;

View File

@ -3753,7 +3753,7 @@ JS_NextProperty(JSContext *cx, JSObject *iterobjArg, jsid *idp)
if (!shape->previous()) {
JS_ASSERT(shape->isEmptyShape());
*idp = jsid::voidId();
*idp = JSID_VOID;
} else {
iterobj->setPrivateGCThing(const_cast<Shape *>(shape->previous().get()));
*idp = shape->propid();
@ -3764,7 +3764,7 @@ JS_NextProperty(JSContext *cx, JSObject *iterobjArg, jsid *idp)
JS_ASSERT(i <= ida->length);
STATIC_ASSUME(i <= ida->length);
if (i == 0) {
*idp = jsid::voidId();
*idp = JSID_VOID;
} else {
*idp = ida->vector[--i];
iterobj->setSlot(JSSLOT_ITER_INDEX, Int32Value(i));

View File

@ -1200,7 +1200,7 @@ InitArrayTypes(JSContext *cx, TypeObject *type, const Value *vector, unsigned co
if (cx->typeInferenceEnabled() && !type->unknownProperties()) {
AutoEnterAnalysis enter(cx);
HeapTypeSet *types = type->getProperty(cx, jsid::voidId());
HeapTypeSet *types = type->getProperty(cx, JSID_VOID);
if (!types)
return false;

View File

@ -373,7 +373,7 @@ JSCompartment::wrap(JSContext *cx, MutableHandleObject obj, HandleObject existin
bool
JSCompartment::wrapId(JSContext *cx, jsid *idp)
{
MOZ_ASSERT(*idp != jsid::voidId(), "jsid::voidId() is an out-of-band sentinel value");
MOZ_ASSERT(*idp != JSID_VOID, "JSID_VOID is an out-of-band sentinel value");
if (JSID_IS_INT(*idp))
return true;
RootedValue value(cx, IdToValue(*idp));

View File

@ -1253,7 +1253,7 @@ TypeObjectKey::hasFlags(CompilerConstraintList *constraints, TypeObjectFlags fla
return true;
}
HeapTypeSetKey objectProperty = property(jsid::emptyId());
HeapTypeSetKey objectProperty = property(JSID_EMPTY);
LifoAlloc *alloc = constraints->alloc();
typedef CompilerConstraintInstance<ConstraintDataFreezeObjectFlags> T;
@ -1297,7 +1297,7 @@ TypeObject::initialHeap(CompilerConstraintList *constraints)
if (!canPreTenure())
return gc::DefaultHeap;
HeapTypeSetKey objectProperty = TypeObjectKey::get(this)->property(jsid::emptyId());
HeapTypeSetKey objectProperty = TypeObjectKey::get(this)->property(JSID_EMPTY);
LifoAlloc *alloc = constraints->alloc();
typedef CompilerConstraintInstance<ConstraintDataFreezeObjectFlags> T;
@ -1404,7 +1404,7 @@ class ConstraintDataFreezeObjectForTypedArrayBuffer
void
TypeObjectKey::watchStateChangeForInlinedCall(CompilerConstraintList *constraints)
{
HeapTypeSetKey objectProperty = property(jsid::emptyId());
HeapTypeSetKey objectProperty = property(JSID_EMPTY);
LifoAlloc *alloc = constraints->alloc();
typedef CompilerConstraintInstance<ConstraintDataFreezeObjectForInlinedCall> T;
@ -1415,7 +1415,7 @@ void
TypeObjectKey::watchStateChangeForNewScriptTemplate(CompilerConstraintList *constraints)
{
JSObject *templateObject = asTypeObject()->newScript()->templateObject;
HeapTypeSetKey objectProperty = property(jsid::emptyId());
HeapTypeSetKey objectProperty = property(JSID_EMPTY);
LifoAlloc *alloc = constraints->alloc();
typedef CompilerConstraintInstance<ConstraintDataFreezeObjectForNewScriptTemplate> T;
@ -1427,7 +1427,7 @@ void
TypeObjectKey::watchStateChangeForTypedArrayBuffer(CompilerConstraintList *constraints)
{
void *viewData = asSingleObject()->as<TypedArrayObject>().viewData();
HeapTypeSetKey objectProperty = property(jsid::emptyId());
HeapTypeSetKey objectProperty = property(JSID_EMPTY);
LifoAlloc *alloc = constraints->alloc();
typedef CompilerConstraintInstance<ConstraintDataFreezeObjectForTypedArrayBuffer> T;
@ -1442,7 +1442,7 @@ ObjectStateChange(ExclusiveContext *cxArg, TypeObject *object, bool markingUnkno
return;
/* All constraints listening to state changes are on the empty id. */
HeapTypeSet *types = object->maybeGetProperty(jsid::emptyId());
HeapTypeSet *types = object->maybeGetProperty(JSID_EMPTY);
/* Mark as unknown after getting the types, to avoid assertion. */
if (markingUnknown) {
@ -1554,7 +1554,7 @@ TemporaryTypeSet::convertDoubleElements(CompilerConstraintList *constraints)
continue;
}
HeapTypeSetKey property = type->property(jsid::voidId());
HeapTypeSetKey property = type->property(JSID_VOID);
property.freeze(constraints);
// We can't convert to double elements for objects which do not have
@ -2033,7 +2033,7 @@ PrototypeHasIndexedProperty(CompilerConstraintList *constraints, JSObject *obj)
return true;
if (type->unknownProperties())
return true;
HeapTypeSetKey index = type->property(jsid::voidId());
HeapTypeSetKey index = type->property(JSID_VOID);
if (index.configured(constraints) || index.isOwnProperty(constraints))
return true;
if (!obj->hasTenuredProto())
@ -2364,7 +2364,7 @@ TypeCompartment::setTypeToHomogenousArray(ExclusiveContext *cx,
obj->setType(objType);
if (!objType->unknownProperties())
objType->addPropertyType(cx, jsid::voidId(), elementType);
objType->addPropertyType(cx, JSID_VOID, elementType);
key.proto = objProto;
if (!p.add(*arrayTypeTable, key, objType)) {
@ -2714,7 +2714,7 @@ UpdatePropertyType(ExclusiveContext *cx, HeapTypeSet *types, JSObject *obj, Shap
/*
* Don't add initial undefined types for properties of global objects
* that are not collated into the jsid::voidId() property (see propertySet
* that are not collated into the JSID_VOID property (see propertySet
* comment).
*/
if (indexed || !value.isUndefined() || !CanHaveEmptyPropertyTypesForOwnProperty(obj)) {
@ -2870,7 +2870,7 @@ TypeObject::addPropertyType(ExclusiveContext *cx, jsid id, const Value &value)
void
TypeObject::addPropertyType(ExclusiveContext *cx, const char *name, Type type)
{
jsid id = jsid::voidId();
jsid id = JSID_VOID;
if (name) {
JSAtom *atom = Atomize(cx, name, strlen(name));
if (!atom) {
@ -2917,7 +2917,7 @@ TypeObject::markStateChange(ExclusiveContext *cxArg)
return;
AutoEnterAnalysis enter(cxArg);
HeapTypeSet *types = maybeGetProperty(jsid::emptyId());
HeapTypeSet *types = maybeGetProperty(JSID_EMPTY);
if (types) {
if (JSContext *cx = cxArg->maybeJSContext()) {
TypeConstraint *constraint = types->constraintList;

View File

@ -330,7 +330,7 @@ public:
virtual void newPropertyState(JSContext *cx, TypeSet *source) {}
/*
* For constraints attached to the jsid::emptyId() type set on an object,
* For constraints attached to the JSID_EMPTY type set on an object,
* indicate a change in one of the object's dynamic property flags or other
* state.
*/
@ -731,7 +731,7 @@ inline bool isInlinableCall(jsbytecode *pc);
/* Type information about a property. */
struct Property
{
/* Identifier for this property, jsid::voidId() for the aggregate integer index property. */
/* Identifier for this property, JSID_VOID for the aggregate integer index property. */
HeapId id;
/* Possible types for this property, including types inherited from prototypes. */
@ -1005,8 +1005,8 @@ struct TypeObject : gc::BarrieredCell<TypeObject>
private:
/*
* Properties of this object. This may contain jsid::voidId(), representing the
* types of all integer indexes of the object, and/or jsid::emptyId(), holding
* Properties of this object. This may contain JSID_VOID, representing the
* types of all integer indexes of the object, and/or JSID_EMPTY, holding
* constraints listening to changes to the object's state.
*
* The type sets in the properties of a type object describe the possible
@ -1381,7 +1381,7 @@ class HeapTypeSetKey
public:
HeapTypeSetKey()
: object_(nullptr), id_(jsid::emptyId()), maybeTypes_(nullptr)
: object_(nullptr), id_(JSID_EMPTY), maybeTypes_(nullptr)
{}
TypeObjectKey *object() const { return object_; }

View File

@ -170,7 +170,7 @@ IdToTypeId(jsid id)
* negative integers.
*/
if (JSID_IS_INT(id))
return jsid::voidId();
return JSID_VOID;
/*
* Check for numeric strings, as in js_StringIsIndex, but allow negative
@ -184,12 +184,12 @@ IdToTypeId(jsid id)
if (!JS7_ISDEC(cp[i]))
return id;
}
return jsid::voidId();
return JSID_VOID;
}
return id;
}
return jsid::voidId();
return JSID_VOID;
}
const char * TypeIdStringImpl(jsid id);

View File

@ -153,7 +153,7 @@ JSObject::setShouldConvertDoubleElements()
inline bool
JSObject::setDenseElementIfHasType(uint32_t index, const js::Value &val)
{
if (!js::types::HasTypePropertyId(this, jsid::voidId(), val))
if (!js::types::HasTypePropertyId(this, JSID_VOID, val))
return false;
setDenseElementMaybeConvertDouble(index, val);
return true;
@ -167,7 +167,7 @@ JSObject::setDenseElementWithType(js::ExclusiveContext *cx, uint32_t index,
// of the previous element.
js::types::Type thisType = js::types::GetValueType(val);
if (index == 0 || js::types::GetValueType(elements[index - 1]) != thisType)
js::types::AddTypePropertyId(cx, this, jsid::voidId(), thisType);
js::types::AddTypePropertyId(cx, this, JSID_VOID, thisType);
setDenseElementMaybeConvertDouble(index, val);
}
@ -176,7 +176,7 @@ JSObject::initDenseElementWithType(js::ExclusiveContext *cx, uint32_t index,
const js::Value &val)
{
JS_ASSERT(!shouldConvertDoubleElements());
js::types::AddTypePropertyId(cx, this, jsid::voidId(), val);
js::types::AddTypePropertyId(cx, this, JSID_VOID, val);
initDenseElement(index, val);
}

View File

@ -226,7 +226,7 @@ BaseProxyHandler::set(JSContext *cx, HandleObject proxy, HandleObject receiver,
bool
BaseProxyHandler::keys(JSContext *cx, HandleObject proxy, AutoIdVector &props)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
JS_ASSERT(props.length() == 0);
if (!getOwnPropertyNames(cx, proxy, props))
@ -255,7 +255,7 @@ BaseProxyHandler::keys(JSContext *cx, HandleObject proxy, AutoIdVector &props)
bool
BaseProxyHandler::iterate(JSContext *cx, HandleObject proxy, unsigned flags, MutableHandleValue vp)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
AutoIdVector props(cx);
if ((flags & JSITER_OWNONLY)
@ -318,7 +318,7 @@ BaseProxyHandler::nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl im
bool
BaseProxyHandler::hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
RootedValue val(cx, ObjectValue(*proxy.get()));
js_ReportValueError(cx, JSMSG_BAD_INSTANCEOF_RHS,
JSDVG_SEARCH_STACK, val, NullPtr());
@ -376,7 +376,7 @@ bool
BaseProxyHandler::slice(JSContext *cx, HandleObject proxy, uint32_t begin, uint32_t end,
HandleObject result)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
RootedId id(cx);
RootedValue value(cx);
@ -451,7 +451,7 @@ bool
DirectProxyHandler::getOwnPropertyNames(JSContext *cx, HandleObject proxy,
AutoIdVector &props)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
RootedObject target(cx, proxy->as<ProxyObject>().target());
return GetPropertyNames(cx, target, JSITER_OWNONLY | JSITER_HIDDEN, &props);
}
@ -468,7 +468,7 @@ bool
DirectProxyHandler::enumerate(JSContext *cx, HandleObject proxy,
AutoIdVector &props)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
JS_ASSERT(!hasPrototype()); // Should never be called if there's a prototype.
RootedObject target(cx, proxy->as<ProxyObject>().target());
return GetPropertyNames(cx, target, 0, &props);
@ -477,7 +477,7 @@ DirectProxyHandler::enumerate(JSContext *cx, HandleObject proxy,
bool
DirectProxyHandler::call(JSContext *cx, HandleObject proxy, const CallArgs &args)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
RootedValue target(cx, proxy->as<ProxyObject>().private_());
return Invoke(cx, args.thisv(), target, args.length(), args.array(), args.rval());
}
@ -485,7 +485,7 @@ DirectProxyHandler::call(JSContext *cx, HandleObject proxy, const CallArgs &args
bool
DirectProxyHandler::construct(JSContext *cx, HandleObject proxy, const CallArgs &args)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
RootedValue target(cx, proxy->as<ProxyObject>().private_());
return InvokeConstructor(cx, target, args.length(), args.array(), args.rval().address());
}
@ -507,7 +507,7 @@ bool
DirectProxyHandler::hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,
bool *bp)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
bool b;
RootedObject target(cx, proxy->as<ProxyObject>().target());
if (!JS_HasInstance(cx, target, v, &b))
@ -541,7 +541,7 @@ DirectProxyHandler::objectClassIs(HandleObject proxy, ESClassValue classValue,
const char *
DirectProxyHandler::className(JSContext *cx, HandleObject proxy)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
RootedObject target(cx, proxy->as<ProxyObject>().target());
return JSObject::className(cx, target);
}
@ -550,7 +550,7 @@ JSString *
DirectProxyHandler::fun_toString(JSContext *cx, HandleObject proxy,
unsigned indent)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
RootedObject target(cx, proxy->as<ProxyObject>().target());
return fun_toStringHelper(cx, target, indent);
}
@ -620,7 +620,7 @@ DirectProxyHandler::set(JSContext *cx, HandleObject proxy, HandleObject receiver
bool
DirectProxyHandler::keys(JSContext *cx, HandleObject proxy, AutoIdVector &props)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
RootedObject target(cx, proxy->as<ProxyObject>().target());
return GetPropertyNames(cx, target, JSITER_OWNONLY, &props);
}
@ -629,7 +629,7 @@ bool
DirectProxyHandler::iterate(JSContext *cx, HandleObject proxy, unsigned flags,
MutableHandleValue vp)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
JS_ASSERT(!hasPrototype()); // Should never be called if there's a prototype.
RootedObject target(cx, proxy->as<ProxyObject>().target());
return GetIterator(cx, target, flags, vp);
@ -1046,7 +1046,7 @@ ScriptedIndirectProxyHandler::iterate(JSContext *cx, HandleObject proxy, unsigne
bool
ScriptedIndirectProxyHandler::call(JSContext *cx, HandleObject proxy, const CallArgs &args)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
RootedObject ccHolder(cx, &proxy->as<ProxyObject>().extra(0).toObject());
JS_ASSERT(ccHolder->getClass() == &CallConstructHolder);
RootedValue call(cx, ccHolder->getReservedSlot(0));
@ -1057,7 +1057,7 @@ ScriptedIndirectProxyHandler::call(JSContext *cx, HandleObject proxy, const Call
bool
ScriptedIndirectProxyHandler::construct(JSContext *cx, HandleObject proxy, const CallArgs &args)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
RootedObject ccHolder(cx, &proxy->as<ProxyObject>().extra(0).toObject());
JS_ASSERT(ccHolder->getClass() == &CallConstructHolder);
RootedValue construct(cx, ccHolder->getReservedSlot(1));
@ -1076,7 +1076,7 @@ ScriptedIndirectProxyHandler::nativeCall(JSContext *cx, IsAcceptableThis test, N
JSString *
ScriptedIndirectProxyHandler::fun_toString(JSContext *cx, HandleObject proxy, unsigned indent)
{
assertEnteredPolicy(cx, proxy, jsid::voidId());
assertEnteredPolicy(cx, proxy, JSID_VOID);
if (!proxy->isCallable()) {
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr,
JSMSG_INCOMPATIBLE_PROTO,

View File

@ -130,7 +130,7 @@ class JS_FRIEND_API(BaseProxyHandler)
*
* enter() allows the policy to specify whether the caller may perform |act|
* on the proxy's |id| property. In the case when |act| is CALL, |id| is
* generally jsid::voidId().
* generally JSID_VOID.
*
* The |act| parameter to enter() specifies the action being performed.
* If |bp| is false, the trap suggests that the caller throw (though it

View File

@ -4996,7 +4996,7 @@ DebuggerObject_defineProperties(JSContext *cx, unsigned argc, Value *vp)
ac.construct(cx, obj);
RootedId id(cx);
for (size_t i = 0; i < n; i++) {
if (!rewrappedIds.append(jsid::voidId()) || !rewrappedDescs.append())
if (!rewrappedIds.append(JSID_VOID) || !rewrappedDescs.append())
return false;
id = ids[i];
if (!unwrappedDescs[i].wrapInto(cx, obj, id, &rewrappedIds[i], &rewrappedDescs[i]))

View File

@ -7,9 +7,11 @@
#include "js/Id.h"
#include "js/RootingAPI.h"
static MOZ_CONSTEXPR_VAR jsid voidIdValue = jsid::voidId();
static MOZ_CONSTEXPR_VAR jsid emptyIdValue = jsid::emptyId();
const jsid JSID_VOID = { size_t(JSID_TYPE_VOID) };
const jsid JSID_EMPTY = { size_t(JSID_TYPE_OBJECT) };
static const jsid voidIdValue = JSID_VOID;
static const jsid emptyIdValue = JSID_EMPTY;
const JS::HandleId JSID_VOIDHANDLE = JS::HandleId::fromMarkedLocation(&voidIdValue);
const JS::HandleId JSID_EMPTYHANDLE = JS::HandleId::fromMarkedLocation(&emptyIdValue);

View File

@ -688,7 +688,7 @@ js::NewReshapedObject(JSContext *cx, HandleTypeObject type, JSObject *parent,
js::AutoIdVector ids(cx);
{
for (unsigned i = 0; i <= shape->slot(); i++) {
if (!ids.append(jsid::voidId()))
if (!ids.append(JSID_VOID))
return nullptr;
}
Shape *nshape = shape;

View File

@ -1594,7 +1594,7 @@ Shape::Shape(const StackShape &other, uint32_t nfixed)
inline
Shape::Shape(UnownedBaseShape *base, uint32_t nfixed)
: base_(base),
propid_(jsid::emptyId()),
propid_(JSID_EMPTY),
slotInfo(SHAPE_INVALID_SLOT | (nfixed << FIXED_SLOTS_SHIFT)),
attrs(JSPROP_SHARED),
flags(0),

View File

@ -957,7 +957,7 @@ class StaticStrings
* - uint32_t indexes,
* - PropertyName strings which don't encode uint32_t indexes, and
* - jsspecial special properties (non-ES5 properties like object-valued
* jsids, EmptyId(), VoidId(), and maybe in the future Harmony-proposed
* jsids, JSID_EMPTY, JSID_VOID, and maybe in the future Harmony-proposed
* private names).
*/
class PropertyName : public JSAtom

View File

@ -1456,7 +1456,7 @@ JSStructuredCloneReader::readId(jsid *idp)
return true;
}
if (tag == SCTAG_NULL) {
*idp = jsid::voidId();
*idp = JSID_VOID;
return true;
}
JS_ReportErrorNumber(context(), js_GetErrorMessage, nullptr,

View File

@ -20,7 +20,7 @@ XPCCallContext::XPCCallContext(XPCContext::LangType callerLanguage,
JSContext* cx /* = GetDefaultJSContext() */,
HandleObject obj /* = nullptr */,
HandleObject funobj /* = nullptr */,
HandleId name /* = jsid::voidId() */,
HandleId name /* = JSID_VOID */,
unsigned argc /* = NO_ARGS */,
jsval *argv /* = nullptr */,
jsval *rval /* = nullptr */)

View File

@ -2908,7 +2908,7 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
mJSContextStack(new XPCJSContextStack()),
mCallContext(nullptr),
mAutoRoots(nullptr),
mResolveName(jsid::voidId()),
mResolveName(JSID_VOID),
mResolvingWrapper(nullptr),
mWrappedJSMap(JSObject2WrappedJSMap::newMap(XPC_JS_MAP_SIZE)),
mWrappedJSClassMap(IID2WrappedJSClassMap::newMap(XPC_JS_CLASS_MAP_SIZE)),
@ -2933,7 +2933,7 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
DOM_InitInterfaces();
// these jsids filled in later when we have a JSContext to work with.
mStrIDs[0] = jsid::voidId();
mStrIDs[0] = JSID_VOID;
MOZ_ASSERT(Runtime());
JSRuntime* runtime = Runtime();
@ -3134,7 +3134,7 @@ XPCJSRuntime::OnJSContextNew(JSContext *cx)
for (unsigned i = 0; i < IDX_TOTAL_COUNT; i++) {
str = JS_InternString(cx, mStrings[i]);
if (!str) {
mStrIDs[0] = jsid::voidId();
mStrIDs[0] = JSID_VOID;
return false;
}
mStrIDs[i] = INTERNED_STRING_TO_JSID(cx, str);

View File

@ -209,7 +209,7 @@ GetMethodInfo(JSContext *cx, jsval *vp, const char **ifaceNamep, jsid *memberIdp
MOZ_ASSERT(JS_ObjectIsFunction(cx, funobj),
"JSNative callee should be Function object");
RootedString str(cx, JS_GetFunctionId(JS_GetObjectFunction(funobj)));
RootedId methodId(cx, str ? INTERNED_STRING_TO_JSID(cx, str) : jsid::voidId());
RootedId methodId(cx, str ? INTERNED_STRING_TO_JSID(cx, str) : JSID_VOID);
GetMemberInfo(JSVAL_TO_OBJECT(vp[1]), methodId, ifaceNamep);
*memberIdp = methodId;
}
@ -353,7 +353,7 @@ void
xpc_qsThrowBadArgWithDetails(JSContext *cx, nsresult rv, unsigned paramnum,
const char *ifaceName, const char *memberName)
{
ThrowBadArg(cx, rv, ifaceName, jsid::voidId(), memberName, paramnum);
ThrowBadArg(cx, rv, ifaceName, JSID_VOID, memberName, paramnum);
}
void

View File

@ -196,7 +196,7 @@ def print_cpp_file(fd, conf):
fd.write("\nusing namespace mozilla::idl;\n\n")
for a in attrnames:
fd.write("static jsid %s = jsid::voidId();\n"% get_jsid(a))
fd.write("static jsid %s = JSID_VOID;\n"% get_jsid(a))
fd.write("\n"
"static bool\n"

View File

@ -3448,7 +3448,7 @@ public:
CreateObjectInOptions(JSContext *cx = xpc_GetSafeJSContext(),
JSObject* options = nullptr)
: OptionsBase(cx, options)
, defineAs(cx, jsid::voidId())
, defineAs(cx, JSID_VOID)
{ }
virtual bool Parse() { return ParseId("defineAs", &defineAs); };
@ -3461,7 +3461,7 @@ public:
ExportOptions(JSContext *cx = xpc_GetSafeJSContext(),
JSObject* options = nullptr)
: OptionsBase(cx, options)
, defineAs(cx, jsid::voidId())
, defineAs(cx, JSID_VOID)
{ }
virtual bool Parse() { return ParseId("defineAs", &defineAs); };

View File

@ -217,12 +217,12 @@ AccessCheck::isCrossOriginAccessPermitted(JSContext *cx, JSObject *wrapperArg, j
RootedObject wrapper(cx, wrapperArg);
RootedObject obj(cx, Wrapper::wrappedObject(wrapper));
// Enumerate-like operations pass jsid::voidId() to |enter|, since there isn't
// Enumerate-like operations pass JSID_VOID to |enter|, since there isn't
// another sane value to pass. For XOWs, we generally want to deny such
// operations but fail silently (see CrossOriginAccessiblePropertiesOnly::
// deny). We could just fall through here and rely on the fact that none
// of the whitelisted properties below will match jsid::voidId(), but EIBTI.
if (id == jsid::voidId())
// of the whitelisted properties below will match JSID_VOID, but EIBTI.
if (id == JSID_VOID)
return false;
const char *name;
@ -315,7 +315,7 @@ ExposedPropertiesOnly::check(JSContext *cx, JSObject *wrapperArg, jsid idArg, Wr
return false;
}
if (id == jsid::voidId())
if (id == JSID_VOID)
return true;
RootedValue exposedProps(cx);

View File

@ -178,7 +178,7 @@ ChromeObjectWrapper::enter(JSContext *cx, HandleObject wrapper,
// COWs fail silently for GETs, and that also happens to be the only case
// where we might want to redirect the lookup to the home prototype chain.
*bp = (act == Wrapper::GET);
if (!*bp || id == jsid::voidId())
if (!*bp || id == JSID_VOID)
return false;
// Note that PropIsFromStandardPrototype needs to invoke getPropertyDescriptor

View File

@ -87,7 +87,7 @@ bool
FilteringWrapper<Base, Policy>::getOwnPropertyNames(JSContext *cx, HandleObject wrapper,
AutoIdVector &props)
{
assertEnteredPolicy(cx, wrapper, jsid::voidId());
assertEnteredPolicy(cx, wrapper, JSID_VOID);
return Base::getOwnPropertyNames(cx, wrapper, props) &&
Filter<Policy>(cx, wrapper, props);
}
@ -97,7 +97,7 @@ bool
FilteringWrapper<Base, Policy>::enumerate(JSContext *cx, HandleObject wrapper,
AutoIdVector &props)
{
assertEnteredPolicy(cx, wrapper, jsid::voidId());
assertEnteredPolicy(cx, wrapper, JSID_VOID);
return Base::enumerate(cx, wrapper, props) &&
Filter<Policy>(cx, wrapper, props);
}
@ -107,7 +107,7 @@ bool
FilteringWrapper<Base, Policy>::keys(JSContext *cx, HandleObject wrapper,
AutoIdVector &props)
{
assertEnteredPolicy(cx, wrapper, jsid::voidId());
assertEnteredPolicy(cx, wrapper, JSID_VOID);
return Base::keys(cx, wrapper, props) &&
Filter<Policy>(cx, wrapper, props);
}
@ -117,7 +117,7 @@ bool
FilteringWrapper<Base, Policy>::iterate(JSContext *cx, HandleObject wrapper,
unsigned flags, MutableHandleValue vp)
{
assertEnteredPolicy(cx, wrapper, jsid::voidId());
assertEnteredPolicy(cx, wrapper, JSID_VOID);
// We refuse to trigger the iterator hook across chrome wrappers because
// we don't know how to censor custom iterator objects. Instead we trigger
// the default proxy iterate trap, which will ask enumerate() for the list

View File

@ -1648,7 +1648,7 @@ bool
XrayWrapper<Base, Traits>::getOwnPropertyNames(JSContext *cx, HandleObject wrapper,
AutoIdVector &props)
{
assertEnteredPolicy(cx, wrapper, jsid::voidId());
assertEnteredPolicy(cx, wrapper, JSID_VOID);
return enumerate(cx, wrapper, JSITER_OWNONLY | JSITER_HIDDEN, props);
}
@ -1675,7 +1675,7 @@ bool
XrayWrapper<Base, Traits>::enumerate(JSContext *cx, HandleObject wrapper, unsigned flags,
AutoIdVector &props)
{
assertEnteredPolicy(cx, wrapper, jsid::voidId());
assertEnteredPolicy(cx, wrapper, JSID_VOID);
if (!AccessCheck::wrapperSubsumes(wrapper)) {
JS_ReportError(cx, "Not allowed to enumerate cross origin objects");
return false;
@ -1768,7 +1768,7 @@ template <typename Base, typename Traits>
bool
XrayWrapper<Base, Traits>::call(JSContext *cx, HandleObject wrapper, const JS::CallArgs &args)
{
assertEnteredPolicy(cx, wrapper, jsid::voidId());
assertEnteredPolicy(cx, wrapper, JSID_VOID);
return Traits::call(cx, wrapper, args, Base::singleton);
}
@ -1776,7 +1776,7 @@ template <typename Base, typename Traits>
bool
XrayWrapper<Base, Traits>::construct(JSContext *cx, HandleObject wrapper, const JS::CallArgs &args)
{
assertEnteredPolicy(cx, wrapper, jsid::voidId());
assertEnteredPolicy(cx, wrapper, JSID_VOID);
return Traits::construct(cx, wrapper, args, Base::singleton);
}

View File

@ -785,7 +785,7 @@ struct ClearJSHolder : TraceCallbacks
virtual void Trace(JS::Heap<jsid>* aPtr, const char*, void*) const MOZ_OVERRIDE
{
*aPtr = jsid::voidId();
*aPtr = JSID_VOID;
}
virtual void Trace(JS::Heap<JSObject*>* aPtr, const char*, void*) const MOZ_OVERRIDE