Bug 1144366 - Switch SpiderMonkey and XPConnect style from |T *t| to |T* t|. r=jorendorff
This commit is contained in:
@@ -28,7 +28,7 @@ using namespace js::gc;
|
||||
|
||||
using mozilla::UniquePtr;
|
||||
|
||||
WeakMapBase::WeakMapBase(JSObject *memOf, JSCompartment *c)
|
||||
WeakMapBase::WeakMapBase(JSObject* memOf, JSCompartment* c)
|
||||
: memberOf(memOf),
|
||||
compartment(c),
|
||||
next(WeakMapNotInList),
|
||||
@@ -43,7 +43,7 @@ WeakMapBase::~WeakMapBase()
|
||||
}
|
||||
|
||||
void
|
||||
WeakMapBase::trace(JSTracer *tracer)
|
||||
WeakMapBase::trace(JSTracer* tracer)
|
||||
{
|
||||
MOZ_ASSERT(isInList());
|
||||
if (tracer->isMarkingTracer()) {
|
||||
@@ -68,17 +68,17 @@ WeakMapBase::trace(JSTracer *tracer)
|
||||
}
|
||||
|
||||
void
|
||||
WeakMapBase::unmarkCompartment(JSCompartment *c)
|
||||
WeakMapBase::unmarkCompartment(JSCompartment* c)
|
||||
{
|
||||
for (WeakMapBase *m = c->gcWeakMapList; m; m = m->next)
|
||||
for (WeakMapBase* m = c->gcWeakMapList; m; m = m->next)
|
||||
m->marked = false;
|
||||
}
|
||||
|
||||
void
|
||||
WeakMapBase::markAll(JSCompartment *c, JSTracer *tracer)
|
||||
WeakMapBase::markAll(JSCompartment* c, JSTracer* tracer)
|
||||
{
|
||||
MOZ_ASSERT(tracer->eagerlyTraceWeakMaps() != DoNotTraceWeakMaps);
|
||||
for (WeakMapBase *m = c->gcWeakMapList; m; m = m->next) {
|
||||
for (WeakMapBase* m = c->gcWeakMapList; m; m = m->next) {
|
||||
m->trace(tracer);
|
||||
if (m->memberOf)
|
||||
gc::MarkObject(tracer, &m->memberOf, "memberOf");
|
||||
@@ -86,10 +86,10 @@ WeakMapBase::markAll(JSCompartment *c, JSTracer *tracer)
|
||||
}
|
||||
|
||||
bool
|
||||
WeakMapBase::markCompartmentIteratively(JSCompartment *c, JSTracer *tracer)
|
||||
WeakMapBase::markCompartmentIteratively(JSCompartment* c, JSTracer* tracer)
|
||||
{
|
||||
bool markedAny = false;
|
||||
for (WeakMapBase *m = c->gcWeakMapList; m; m = m->next) {
|
||||
for (WeakMapBase* m = c->gcWeakMapList; m; m = m->next) {
|
||||
if (m->marked && m->markIteratively(tracer))
|
||||
markedAny = true;
|
||||
}
|
||||
@@ -97,9 +97,9 @@ WeakMapBase::markCompartmentIteratively(JSCompartment *c, JSTracer *tracer)
|
||||
}
|
||||
|
||||
bool
|
||||
WeakMapBase::findZoneEdgesForCompartment(JSCompartment *c)
|
||||
WeakMapBase::findZoneEdgesForCompartment(JSCompartment* c)
|
||||
{
|
||||
for (WeakMapBase *m = c->gcWeakMapList; m; m = m->next) {
|
||||
for (WeakMapBase* m = c->gcWeakMapList; m; m = m->next) {
|
||||
if (!m->findZoneEdges())
|
||||
return false;
|
||||
}
|
||||
@@ -107,10 +107,10 @@ WeakMapBase::findZoneEdgesForCompartment(JSCompartment *c)
|
||||
}
|
||||
|
||||
void
|
||||
WeakMapBase::sweepCompartment(JSCompartment *c)
|
||||
WeakMapBase::sweepCompartment(JSCompartment* c)
|
||||
{
|
||||
WeakMapBase **tailPtr = &c->gcWeakMapList;
|
||||
for (WeakMapBase *m = c->gcWeakMapList, *next; m; m = next) {
|
||||
WeakMapBase** tailPtr = &c->gcWeakMapList;
|
||||
for (WeakMapBase* m = c->gcWeakMapList, *next; m; m = next) {
|
||||
next = m->next;
|
||||
if (m->marked) {
|
||||
m->sweep();
|
||||
@@ -125,17 +125,17 @@ WeakMapBase::sweepCompartment(JSCompartment *c)
|
||||
*tailPtr = nullptr;
|
||||
|
||||
#ifdef DEBUG
|
||||
for (WeakMapBase *m = c->gcWeakMapList; m; m = m->next)
|
||||
for (WeakMapBase* m = c->gcWeakMapList; m; m = m->next)
|
||||
MOZ_ASSERT(m->isInList() && m->marked);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
WeakMapBase::traceAllMappings(WeakMapTracer *tracer)
|
||||
WeakMapBase::traceAllMappings(WeakMapTracer* tracer)
|
||||
{
|
||||
JSRuntime *rt = tracer->runtime;
|
||||
JSRuntime* rt = tracer->runtime;
|
||||
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
|
||||
for (WeakMapBase *m = c->gcWeakMapList; m; m = m->next) {
|
||||
for (WeakMapBase* m = c->gcWeakMapList; m; m = m->next) {
|
||||
// The WeakMapTracer callback is not allowed to GC.
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
m->traceMappings(tracer);
|
||||
@@ -144,9 +144,9 @@ WeakMapBase::traceAllMappings(WeakMapTracer *tracer)
|
||||
}
|
||||
|
||||
bool
|
||||
WeakMapBase::saveCompartmentMarkedWeakMaps(JSCompartment *c, WeakMapSet &markedWeakMaps)
|
||||
WeakMapBase::saveCompartmentMarkedWeakMaps(JSCompartment* c, WeakMapSet& markedWeakMaps)
|
||||
{
|
||||
for (WeakMapBase *m = c->gcWeakMapList; m; m = m->next) {
|
||||
for (WeakMapBase* m = c->gcWeakMapList; m; m = m->next) {
|
||||
if (m->marked && !markedWeakMaps.put(m))
|
||||
return false;
|
||||
}
|
||||
@@ -154,10 +154,10 @@ WeakMapBase::saveCompartmentMarkedWeakMaps(JSCompartment *c, WeakMapSet &markedW
|
||||
}
|
||||
|
||||
void
|
||||
WeakMapBase::restoreCompartmentMarkedWeakMaps(WeakMapSet &markedWeakMaps)
|
||||
WeakMapBase::restoreCompartmentMarkedWeakMaps(WeakMapSet& markedWeakMaps)
|
||||
{
|
||||
for (WeakMapSet::Range r = markedWeakMaps.all(); !r.empty(); r.popFront()) {
|
||||
WeakMapBase *map = r.front();
|
||||
WeakMapBase* map = r.front();
|
||||
MOZ_ASSERT(map->compartment->zone()->isGCMarking());
|
||||
MOZ_ASSERT(!map->marked);
|
||||
map->marked = true;
|
||||
@@ -165,10 +165,10 @@ WeakMapBase::restoreCompartmentMarkedWeakMaps(WeakMapSet &markedWeakMaps)
|
||||
}
|
||||
|
||||
void
|
||||
WeakMapBase::removeWeakMapFromList(WeakMapBase *weakmap)
|
||||
WeakMapBase::removeWeakMapFromList(WeakMapBase* weakmap)
|
||||
{
|
||||
JSCompartment *c = weakmap->compartment;
|
||||
for (WeakMapBase **p = &c->gcWeakMapList; *p; p = &(*p)->next) {
|
||||
JSCompartment* c = weakmap->compartment;
|
||||
for (WeakMapBase** p = &c->gcWeakMapList; *p; p = &(*p)->next) {
|
||||
if (*p == weakmap) {
|
||||
*p = (*p)->next;
|
||||
weakmap->next = WeakMapNotInList;
|
||||
@@ -186,18 +186,18 @@ ObjectValueMap::findZoneEdges()
|
||||
* zone.
|
||||
*/
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
Zone *mapZone = compartment->zone();
|
||||
Zone* mapZone = compartment->zone();
|
||||
for (Range r = all(); !r.empty(); r.popFront()) {
|
||||
JSObject *key = r.front().key();
|
||||
JSObject* key = r.front().key();
|
||||
if (key->asTenured().isMarked(BLACK) && !key->asTenured().isMarked(GRAY))
|
||||
continue;
|
||||
JSWeakmapKeyDelegateOp op = key->getClass()->ext.weakmapKeyDelegateOp;
|
||||
if (!op)
|
||||
continue;
|
||||
JSObject *delegate = op(key);
|
||||
JSObject* delegate = op(key);
|
||||
if (!delegate)
|
||||
continue;
|
||||
Zone *delegateZone = delegate->zone();
|
||||
Zone* delegateZone = delegate->zone();
|
||||
if (delegateZone == mapZone)
|
||||
continue;
|
||||
if (!delegateZone->gcZoneGroupEdges.put(key->zone()))
|
||||
@@ -213,7 +213,7 @@ IsWeakMap(HandleValue v)
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_INLINE bool
|
||||
WeakMap_has_impl(JSContext *cx, CallArgs args)
|
||||
WeakMap_has_impl(JSContext* cx, CallArgs args)
|
||||
{
|
||||
MOZ_ASSERT(IsWeakMap(args.thisv()));
|
||||
|
||||
@@ -222,8 +222,8 @@ WeakMap_has_impl(JSContext *cx, CallArgs args)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ObjectValueMap *map = args.thisv().toObject().as<WeakMapObject>().getMap()) {
|
||||
JSObject *key = &args[0].toObject();
|
||||
if (ObjectValueMap* map = args.thisv().toObject().as<WeakMapObject>().getMap()) {
|
||||
JSObject* key = &args[0].toObject();
|
||||
if (map->has(key)) {
|
||||
args.rval().setBoolean(true);
|
||||
return true;
|
||||
@@ -235,20 +235,20 @@ WeakMap_has_impl(JSContext *cx, CallArgs args)
|
||||
}
|
||||
|
||||
bool
|
||||
js::WeakMap_has(JSContext *cx, unsigned argc, Value *vp)
|
||||
js::WeakMap_has(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
return CallNonGenericMethod<IsWeakMap, WeakMap_has_impl>(cx, args);
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_INLINE bool
|
||||
WeakMap_clear_impl(JSContext *cx, CallArgs args)
|
||||
WeakMap_clear_impl(JSContext* cx, CallArgs args)
|
||||
{
|
||||
MOZ_ASSERT(IsWeakMap(args.thisv()));
|
||||
|
||||
// We can't js_delete the weakmap because the data gathered during GC is
|
||||
// used by the Cycle Collector.
|
||||
if (ObjectValueMap *map = args.thisv().toObject().as<WeakMapObject>().getMap())
|
||||
if (ObjectValueMap* map = args.thisv().toObject().as<WeakMapObject>().getMap())
|
||||
map->clear();
|
||||
|
||||
args.rval().setUndefined();
|
||||
@@ -256,14 +256,14 @@ WeakMap_clear_impl(JSContext *cx, CallArgs args)
|
||||
}
|
||||
|
||||
bool
|
||||
js::WeakMap_clear(JSContext *cx, unsigned argc, Value *vp)
|
||||
js::WeakMap_clear(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
return CallNonGenericMethod<IsWeakMap, WeakMap_clear_impl>(cx, args);
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_INLINE bool
|
||||
WeakMap_get_impl(JSContext *cx, CallArgs args)
|
||||
WeakMap_get_impl(JSContext* cx, CallArgs args)
|
||||
{
|
||||
MOZ_ASSERT(IsWeakMap(args.thisv()));
|
||||
|
||||
@@ -272,8 +272,8 @@ WeakMap_get_impl(JSContext *cx, CallArgs args)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ObjectValueMap *map = args.thisv().toObject().as<WeakMapObject>().getMap()) {
|
||||
JSObject *key = &args[0].toObject();
|
||||
if (ObjectValueMap* map = args.thisv().toObject().as<WeakMapObject>().getMap()) {
|
||||
JSObject* key = &args[0].toObject();
|
||||
if (ObjectValueMap::Ptr ptr = map->lookup(key)) {
|
||||
args.rval().set(ptr->value());
|
||||
return true;
|
||||
@@ -285,14 +285,14 @@ WeakMap_get_impl(JSContext *cx, CallArgs args)
|
||||
}
|
||||
|
||||
bool
|
||||
js::WeakMap_get(JSContext *cx, unsigned argc, Value *vp)
|
||||
js::WeakMap_get(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
return CallNonGenericMethod<IsWeakMap, WeakMap_get_impl>(cx, args);
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_INLINE bool
|
||||
WeakMap_delete_impl(JSContext *cx, CallArgs args)
|
||||
WeakMap_delete_impl(JSContext* cx, CallArgs args)
|
||||
{
|
||||
MOZ_ASSERT(IsWeakMap(args.thisv()));
|
||||
|
||||
@@ -301,8 +301,8 @@ WeakMap_delete_impl(JSContext *cx, CallArgs args)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ObjectValueMap *map = args.thisv().toObject().as<WeakMapObject>().getMap()) {
|
||||
JSObject *key = &args[0].toObject();
|
||||
if (ObjectValueMap* map = args.thisv().toObject().as<WeakMapObject>().getMap()) {
|
||||
JSObject* key = &args[0].toObject();
|
||||
if (ObjectValueMap::Ptr ptr = map->lookup(key)) {
|
||||
map->remove(ptr);
|
||||
args.rval().setBoolean(true);
|
||||
@@ -315,14 +315,14 @@ WeakMap_delete_impl(JSContext *cx, CallArgs args)
|
||||
}
|
||||
|
||||
bool
|
||||
js::WeakMap_delete(JSContext *cx, unsigned argc, Value *vp)
|
||||
js::WeakMap_delete(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
return CallNonGenericMethod<IsWeakMap, WeakMap_delete_impl>(cx, args);
|
||||
}
|
||||
|
||||
static bool
|
||||
TryPreserveReflector(JSContext *cx, HandleObject obj)
|
||||
TryPreserveReflector(JSContext* cx, HandleObject obj)
|
||||
{
|
||||
if (obj->getClass()->ext.isWrappedNative ||
|
||||
(obj->getClass()->flags & JSCLASS_IS_DOMJSCLASS) ||
|
||||
@@ -339,7 +339,7 @@ TryPreserveReflector(JSContext *cx, HandleObject obj)
|
||||
}
|
||||
|
||||
static inline void
|
||||
WeakMapPostWriteBarrier(JSRuntime *rt, ObjectValueMap *weakMap, JSObject *key)
|
||||
WeakMapPostWriteBarrier(JSRuntime* rt, ObjectValueMap* weakMap, JSObject* key)
|
||||
{
|
||||
// Strip the barriers from the type before inserting into the store buffer.
|
||||
// This will automatically ensure that barriers do not fire during GC.
|
||||
@@ -348,10 +348,10 @@ WeakMapPostWriteBarrier(JSRuntime *rt, ObjectValueMap *weakMap, JSObject *key)
|
||||
}
|
||||
|
||||
static MOZ_ALWAYS_INLINE bool
|
||||
SetWeakMapEntryInternal(JSContext *cx, Handle<WeakMapObject*> mapObj,
|
||||
SetWeakMapEntryInternal(JSContext* cx, Handle<WeakMapObject*> mapObj,
|
||||
HandleObject key, HandleValue value)
|
||||
{
|
||||
ObjectValueMap *map = mapObj->getMap();
|
||||
ObjectValueMap* map = mapObj->getMap();
|
||||
if (!map) {
|
||||
map = cx->new_<ObjectValueMap>(cx, mapObj.get());
|
||||
if (!map)
|
||||
@@ -385,7 +385,7 @@ SetWeakMapEntryInternal(JSContext *cx, Handle<WeakMapObject*> mapObj,
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_INLINE bool
|
||||
WeakMap_set_impl(JSContext *cx, CallArgs args)
|
||||
WeakMap_set_impl(JSContext* cx, CallArgs args)
|
||||
{
|
||||
MOZ_ASSERT(IsWeakMap(args.thisv()));
|
||||
|
||||
@@ -409,14 +409,14 @@ WeakMap_set_impl(JSContext *cx, CallArgs args)
|
||||
}
|
||||
|
||||
bool
|
||||
js::WeakMap_set(JSContext *cx, unsigned argc, Value *vp)
|
||||
js::WeakMap_set(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
return CallNonGenericMethod<IsWeakMap, WeakMap_set_impl>(cx, args);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_NondeterministicGetWeakMapKeys(JSContext *cx, HandleObject objArg, MutableHandleObject ret)
|
||||
JS_NondeterministicGetWeakMapKeys(JSContext* cx, HandleObject objArg, MutableHandleObject ret)
|
||||
{
|
||||
RootedObject obj(cx, objArg);
|
||||
obj = UncheckedUnwrap(obj);
|
||||
@@ -427,7 +427,7 @@ JS_NondeterministicGetWeakMapKeys(JSContext *cx, HandleObject objArg, MutableHan
|
||||
RootedObject arr(cx, NewDenseEmptyArray(cx));
|
||||
if (!arr)
|
||||
return false;
|
||||
ObjectValueMap *map = obj->as<WeakMapObject>().getMap();
|
||||
ObjectValueMap* map = obj->as<WeakMapObject>().getMap();
|
||||
if (map) {
|
||||
// Prevent GC from mutating the weakmap while iterating.
|
||||
AutoSuppressGC suppress(cx);
|
||||
@@ -445,19 +445,19 @@ JS_NondeterministicGetWeakMapKeys(JSContext *cx, HandleObject objArg, MutableHan
|
||||
}
|
||||
|
||||
static void
|
||||
WeakMap_mark(JSTracer *trc, JSObject *obj)
|
||||
WeakMap_mark(JSTracer* trc, JSObject* obj)
|
||||
{
|
||||
if (ObjectValueMap *map = obj->as<WeakMapObject>().getMap())
|
||||
if (ObjectValueMap* map = obj->as<WeakMapObject>().getMap())
|
||||
map->trace(trc);
|
||||
}
|
||||
|
||||
static void
|
||||
WeakMap_finalize(FreeOp *fop, JSObject *obj)
|
||||
WeakMap_finalize(FreeOp* fop, JSObject* obj)
|
||||
{
|
||||
if (ObjectValueMap *map = obj->as<WeakMapObject>().getMap()) {
|
||||
if (ObjectValueMap* map = obj->as<WeakMapObject>().getMap()) {
|
||||
#ifdef DEBUG
|
||||
map->~ObjectValueMap();
|
||||
memset(static_cast<void *>(map), 0xdc, sizeof(*map));
|
||||
memset(static_cast<void*>(map), 0xdc, sizeof(*map));
|
||||
fop->free_(map);
|
||||
#else
|
||||
fop->delete_(map);
|
||||
@@ -466,25 +466,25 @@ WeakMap_finalize(FreeOp *fop, JSObject *obj)
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS::NewWeakMapObject(JSContext *cx)
|
||||
JS::NewWeakMapObject(JSContext* cx)
|
||||
{
|
||||
return NewBuiltinClassInstance(cx, &WeakMapObject::class_);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS::IsWeakMapObject(JSObject *obj)
|
||||
JS::IsWeakMapObject(JSObject* obj)
|
||||
{
|
||||
return obj->is<WeakMapObject>();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS::GetWeakMapEntry(JSContext *cx, HandleObject mapObj, HandleObject key,
|
||||
JS::GetWeakMapEntry(JSContext* cx, HandleObject mapObj, HandleObject key,
|
||||
MutableHandleValue rval)
|
||||
{
|
||||
CHECK_REQUEST(cx);
|
||||
assertSameCompartment(cx, key);
|
||||
rval.setUndefined();
|
||||
ObjectValueMap *map = mapObj->as<WeakMapObject>().getMap();
|
||||
ObjectValueMap* map = mapObj->as<WeakMapObject>().getMap();
|
||||
if (!map)
|
||||
return true;
|
||||
if (ObjectValueMap::Ptr ptr = map->lookup(key)) {
|
||||
@@ -497,7 +497,7 @@ JS::GetWeakMapEntry(JSContext *cx, HandleObject mapObj, HandleObject key,
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS::SetWeakMapEntry(JSContext *cx, HandleObject mapObj, HandleObject key,
|
||||
JS::SetWeakMapEntry(JSContext* cx, HandleObject mapObj, HandleObject key,
|
||||
HandleValue val)
|
||||
{
|
||||
CHECK_REQUEST(cx);
|
||||
@@ -507,7 +507,7 @@ JS::SetWeakMapEntry(JSContext *cx, HandleObject mapObj, HandleObject key,
|
||||
}
|
||||
|
||||
static bool
|
||||
WeakMap_construct(JSContext *cx, unsigned argc, Value *vp)
|
||||
WeakMap_construct(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
RootedObject obj(cx, NewBuiltinClassInstance(cx, &WeakMapObject::class_));
|
||||
@@ -533,7 +533,7 @@ WeakMap_construct(JSContext *cx, unsigned argc, Value *vp)
|
||||
bool isOriginalAdder = IsNativeFunction(adderVal, WeakMap_set);
|
||||
RootedValue mapVal(cx, ObjectValue(*obj));
|
||||
FastInvokeGuard fig(cx, adderVal);
|
||||
InvokeArgs &args2 = fig.args();
|
||||
InvokeArgs& args2 = fig.args();
|
||||
|
||||
// Steps 7d-e.
|
||||
JS::ForOfIterator iter(cx);
|
||||
@@ -632,8 +632,8 @@ static const JSFunctionSpec weak_map_methods[] = {
|
||||
JS_FS_END
|
||||
};
|
||||
|
||||
static JSObject *
|
||||
InitWeakMapClass(JSContext *cx, HandleObject obj, bool defineMembers)
|
||||
static JSObject*
|
||||
InitWeakMapClass(JSContext* cx, HandleObject obj, bool defineMembers)
|
||||
{
|
||||
MOZ_ASSERT(obj->isNative());
|
||||
|
||||
@@ -661,19 +661,19 @@ InitWeakMapClass(JSContext *cx, HandleObject obj, bool defineMembers)
|
||||
return weakMapProto;
|
||||
}
|
||||
|
||||
JSObject *
|
||||
js::InitWeakMapClass(JSContext *cx, HandleObject obj)
|
||||
JSObject*
|
||||
js::InitWeakMapClass(JSContext* cx, HandleObject obj)
|
||||
{
|
||||
return InitWeakMapClass(cx, obj, true);
|
||||
}
|
||||
|
||||
JSObject *
|
||||
js::InitBareWeakMapCtor(JSContext *cx, HandleObject obj)
|
||||
JSObject*
|
||||
js::InitBareWeakMapCtor(JSContext* cx, HandleObject obj)
|
||||
{
|
||||
return InitWeakMapClass(cx, obj, false);
|
||||
}
|
||||
|
||||
ObjectWeakMap::ObjectWeakMap(JSContext *cx)
|
||||
ObjectWeakMap::ObjectWeakMap(JSContext* cx)
|
||||
: map(cx, nullptr)
|
||||
{
|
||||
if (!map.init())
|
||||
@@ -685,16 +685,16 @@ ObjectWeakMap::~ObjectWeakMap()
|
||||
WeakMapBase::removeWeakMapFromList(&map);
|
||||
}
|
||||
|
||||
JSObject *
|
||||
ObjectWeakMap::lookup(const JSObject *obj)
|
||||
JSObject*
|
||||
ObjectWeakMap::lookup(const JSObject* obj)
|
||||
{
|
||||
if (ObjectValueMap::Ptr p = map.lookup(const_cast<JSObject *>(obj)))
|
||||
if (ObjectValueMap::Ptr p = map.lookup(const_cast<JSObject*>(obj)))
|
||||
return &p->value().toObject();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
ObjectWeakMap::add(JSContext *cx, JSObject *obj, JSObject *target)
|
||||
ObjectWeakMap::add(JSContext* cx, JSObject* obj, JSObject* target)
|
||||
{
|
||||
MOZ_ASSERT(obj && target);
|
||||
|
||||
@@ -714,7 +714,7 @@ ObjectWeakMap::clear()
|
||||
}
|
||||
|
||||
void
|
||||
ObjectWeakMap::trace(JSTracer *trc)
|
||||
ObjectWeakMap::trace(JSTracer* trc)
|
||||
{
|
||||
map.trace(trc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user