Bug 839998 - Replace thisDuringConstruction() with MOZ_THIS_IN_INITIALIZER_LIST(). r=waldo

This commit is contained in:
Masatoshi Kimura 2013-06-27 00:15:53 +09:00
parent f7d20e1769
commit 2b3b31ec7e
6 changed files with 8 additions and 17 deletions

View File

@ -50,10 +50,8 @@ class BumpChunk
char *headerBase() { return reinterpret_cast<char *>(this); }
char *bumpBase() const { return limit - bumpSpaceSize; }
BumpChunk *thisDuringConstruction() { return this; }
explicit BumpChunk(size_t bumpSpaceSize)
: bump(reinterpret_cast<char *>(thisDuringConstruction()) + sizeof(BumpChunk)),
: bump(reinterpret_cast<char *>(MOZ_THIS_IN_INITIALIZER_LIST()) + sizeof(BumpChunk)),
limit(bump + bumpSpaceSize),
next_(NULL), bumpSpaceSize(bumpSpaceSize)
{

View File

@ -1180,7 +1180,7 @@ JSContext::JSContext(JSRuntime *rt)
enterCompartmentDepth_(0),
savedFrameChains_(),
defaultCompartmentObject_(NULL),
cycleDetectorSet(thisDuringConstruction()),
cycleDetectorSet(MOZ_THIS_IN_INITIALIZER_LIST()),
errorReporter(NULL),
operationCallback(NULL),
data(NULL),

View File

@ -1636,7 +1636,6 @@ struct JSContext : js::ThreadSafeContext,
public mozilla::LinkedListElement<JSContext>
{
explicit JSContext(JSRuntime *rt);
JSContext *thisDuringConstruction() { return this; }
~JSContext();
JSRuntime *runtime() const { return runtime_; }

View File

@ -1032,11 +1032,9 @@ class AutoPropertyDescriptorRooter : private AutoGCRooter, public PropertyDescri
{
SkipRoot skip;
AutoPropertyDescriptorRooter *thisDuringConstruction() { return this; }
public:
AutoPropertyDescriptorRooter(JSContext *cx)
: AutoGCRooter(cx, DESCRIPTOR), skip(cx, thisDuringConstruction())
: AutoGCRooter(cx, DESCRIPTOR), skip(cx, MOZ_THIS_IN_INITIALIZER_LIST())
{
obj = NULL;
attrs = 0;
@ -1046,7 +1044,7 @@ class AutoPropertyDescriptorRooter : private AutoGCRooter, public PropertyDescri
}
AutoPropertyDescriptorRooter(JSContext *cx, PropertyDescriptor *desc)
: AutoGCRooter(cx, DESCRIPTOR), skip(cx, thisDuringConstruction())
: AutoGCRooter(cx, DESCRIPTOR), skip(cx, MOZ_THIS_IN_INITIALIZER_LIST())
{
obj = desc->obj;
attrs = desc->attrs;

View File

@ -104,8 +104,6 @@ class MOZ_STACK_CLASS JSONParser : private AutoGCRooter
Token lastToken;
#endif
JSONParser *thisDuringConstruction() { return this; }
public:
/* Public API */

View File

@ -107,12 +107,10 @@ class LinkedListElement
LinkedListElement* prev;
const bool isSentinel;
LinkedListElement* thisDuringConstruction() { return this; }
public:
LinkedListElement()
: next(thisDuringConstruction()),
prev(thisDuringConstruction()),
: next(MOZ_THIS_IN_INITIALIZER_LIST()),
prev(MOZ_THIS_IN_INITIALIZER_LIST()),
isSentinel(false)
{ }
@ -201,8 +199,8 @@ class LinkedListElement
};
LinkedListElement(NodeKind nodeKind)
: next(thisDuringConstruction()),
prev(thisDuringConstruction()),
: next(MOZ_THIS_IN_INITIALIZER_LIST()),
prev(MOZ_THIS_IN_INITIALIZER_LIST()),
isSentinel(nodeKind == NODE_KIND_SENTINEL)
{ }