Skip to content

Commit

Permalink
some pointer style for better patching
Browse files Browse the repository at this point in the history
  • Loading branch information
rmottola committed Mar 28, 2019
1 parent 90cdbc3 commit 608e1a6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions js/src/builtin/TypedObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1470,8 +1470,8 @@ OutlineTypedObject::setOwnerAndData(JSObject* owner, uint8_t* data)
}

/*static*/ OutlineTypedObject*
OutlineTypedObject::createUnattachedWithClass(JSContext* cx,
const Class* clasp,
OutlineTypedObject::createUnattachedWithClass(JSContext *cx,
const Class *clasp,
HandleTypeDescr descr,
int32_t length,
gc::InitialHeap heap)
Expand All @@ -1486,7 +1486,7 @@ OutlineTypedObject::createUnattachedWithClass(JSContext* cx,
return nullptr;

NewObjectKind newKind = (heap == gc::TenuredHeap) ? MaybeSingletonObject : GenericObject;
OutlineTypedObject* obj = NewObjectWithGroup<OutlineTypedObject>(cx, group, cx->global(),
OutlineTypedObject *obj = NewObjectWithGroup<OutlineTypedObject>(cx, group, cx->global(),
gc::FINALIZE_OBJECT0, newKind);
if (!obj)
return nullptr;
Expand Down
22 changes: 11 additions & 11 deletions js/src/jsobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ js::NewObjectWithClassProtoCommon(ExclusiveContext* cxArg, const Class* clasp,
}

static bool
NewObjectWithGroupIsCachable(JSContext* cx, HandleObjectGroup group, HandleObject parent,
NewObjectWithGroupIsCachable(JSContext *cx, HandleObjectGroup group, HandleObject parent,
NewObjectKind newKind)
{
return group->proto().isObject() &&
Expand All @@ -1443,8 +1443,8 @@ NewObjectWithGroupIsCachable(JSContext* cx, HandleObjectGroup group, HandleObjec
* Create a plain object with the specified group. This bypasses getNewGroup to
* avoid losing creation site information for objects made by scripted 'new'.
*/
JSObject*
js::NewObjectWithGroupCommon(JSContext* cx, HandleObjectGroup group, HandleObject parent,
JSObject *
js::NewObjectWithGroupCommon(JSContext *cx, HandleObjectGroup group, HandleObject parent,
gc::AllocKind allocKind, NewObjectKind newKind)
{
MOZ_ASSERT(parent);
Expand All @@ -1455,17 +1455,17 @@ js::NewObjectWithGroupCommon(JSContext* cx, HandleObjectGroup group, HandleObjec

bool isCachable = NewObjectWithGroupIsCachable(cx, group, parent, newKind);
if (isCachable) {
NewObjectCache& cache = cx->runtime()->newObjectCache;
NewObjectCache &cache = cx->runtime()->newObjectCache;
NewObjectCache::EntryIndex entry = -1;
if (cache.lookupGroup(group, allocKind, &entry)) {
JSObject* obj = cache.newObjectFromHit(cx, entry,
JSObject *obj = cache.newObjectFromHit(cx, entry,
GetInitialHeap(newKind, group->clasp()));
if (obj)
return obj;
}
}

JSObject* obj = NewObject(cx, group, parent, allocKind, newKind);
JSObject *obj = NewObject(cx, group, parent, allocKind, newKind);
if (!obj)
return nullptr;

Expand Down Expand Up @@ -1573,8 +1573,8 @@ CreateThisForFunctionWithGroup(JSContext *cx, HandleObjectGroup group,
return NewObjectWithGroup<PlainObject>(cx, group, cx->global(), allocKind, newKind);
}

JSObject*
js::CreateThisForFunctionWithProto(JSContext* cx, HandleObject callee, HandleObject proto,
JSObject *
js::CreateThisForFunctionWithProto(JSContext *cx, HandleObject callee, HandleObject proto,
NewObjectKind newKind /* = GenericObject */)
{
RootedObject res(cx);
Expand Down Expand Up @@ -2152,10 +2152,10 @@ template bool
js::XDRObjectLiteral(XDRState<XDR_ENCODE>* xdr, MutableHandleNativeObject obj);

template bool
js::XDRObjectLiteral(XDRState<XDR_DECODE>* xdr, MutableHandleNativeObject obj);
js::XDRObjectLiteral(XDRState<XDR_DECODE> *xdr, MutableHandleNativeObject obj);

JSObject*
js::CloneObjectLiteral(JSContext* cx, HandleObject parent, HandleObject srcObj)
JSObject *
js::CloneObjectLiteral(JSContext *cx, HandleObject parent, HandleObject srcObj)
{
if (srcObj->is<PlainObject>()) {
AllocKind kind = GetBackgroundAllocKind(GuessObjectGCKind(srcObj->as<PlainObject>().numFixedSlots()));
Expand Down
8 changes: 4 additions & 4 deletions js/src/jsobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -1275,13 +1275,13 @@ ToObjectFromStack(JSContext* cx, HandleValue vp)

template<XDRMode mode>
bool
XDRObjectLiteral(XDRState<mode>* xdr, MutableHandleNativeObject obj);
XDRObjectLiteral(XDRState<mode> *xdr, MutableHandleNativeObject obj);

extern JSObject*
CloneObjectLiteral(JSContext* cx, HandleObject parent, HandleObject srcObj);
extern JSObject *
CloneObjectLiteral(JSContext *cx, HandleObject parent, HandleObject srcObj);

extern void
GetObjectSlotName(JSTracer* trc, char* buf, size_t bufsize);
GetObjectSlotName(JSTracer *trc, char *buf, size_t bufsize);

extern bool
ReportGetterOnlyAssignment(JSContext* cx, bool strict);
Expand Down
16 changes: 8 additions & 8 deletions js/src/jsobjinlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -736,24 +736,24 @@ NewBuiltinClassInstance(ExclusiveContext* cx, gc::AllocKind allocKind, NewObject

// Used to optimize calls to (new Object())
bool
NewObjectScriptedCall(JSContext* cx, MutableHandleObject obj);
NewObjectScriptedCall(JSContext *cx, MutableHandleObject obj);

JSObject*
NewObjectWithGroupCommon(JSContext* cx, HandleObjectGroup group, HandleObject parent,
JSObject *
NewObjectWithGroupCommon(JSContext *cx, HandleObjectGroup group, HandleObject parent,
gc::AllocKind allocKind, NewObjectKind newKind);

template <typename T>
inline T*
NewObjectWithGroup(JSContext* cx, HandleObjectGroup group, HandleObject parent,
inline T *
NewObjectWithGroup(JSContext *cx, HandleObjectGroup group, HandleObject parent,
gc::AllocKind allocKind, NewObjectKind newKind = GenericObject)
{
JSObject* obj = NewObjectWithGroupCommon(cx, group, parent, allocKind, newKind);
JSObject *obj = NewObjectWithGroupCommon(cx, group, parent, allocKind, newKind);
return obj ? &obj->as<T>() : nullptr;
}

template <typename T>
inline T*
NewObjectWithGroup(JSContext* cx, HandleObjectGroup group, HandleObject parent,
inline T *
NewObjectWithGroup(JSContext *cx, HandleObjectGroup group, HandleObject parent,
NewObjectKind newKind = GenericObject)
{
gc::AllocKind allocKind = gc::GetGCObjectKind(group->clasp());
Expand Down

0 comments on commit 608e1a6

Please sign in to comment.