Bug 839998 - Replace thisDuringConstruction() with MOZ_THIS_IN_INITIALIZER_LIST(). r=waldo
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Thu, 27 Jun 2013 00:15:53 +0900
changeset 149732 d19ecc13f95a0c7c5d297a1ad5f5196f6cc62dde
parent 149731 6afe0a48ad5e00c8ae35b28c950818c7e31ffecd
child 149733 51e974db88667935dc1e3547869a9837be8413a2
push id382
push userakeybl@mozilla.com
push dateMon, 21 Oct 2013 21:47:13 +0000
treeherdermozilla-release@5f1868ee45cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs839998
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 839998 - Replace thisDuringConstruction() with MOZ_THIS_IN_INITIALIZER_LIST(). r=waldo
js/src/ds/LifoAlloc.h
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/jsobjinlines.h
js/src/jsonparser.h
mfbt/LinkedList.h
--- a/js/src/ds/LifoAlloc.h
+++ b/js/src/ds/LifoAlloc.h
@@ -45,20 +45,18 @@ class BumpChunk
     char        *bump;          // start of the available data
     char        *limit;         // end of the data
     BumpChunk   *next_;         // the next BumpChunk
     size_t      bumpSpaceSize;  // size of the data area
 
     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)
     {
         JS_ASSERT(bump == AlignPtr(bump));
     }
 
     void setBump(void *ptr) {
         JS_ASSERT(bumpBase() <= ptr);
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -1175,17 +1175,17 @@ JSContext::JSContext(JSRuntime *rt)
     exception(UndefinedValue()),
     options_(0),
     reportGranularity(JS_DEFAULT_JITREPORT_GRANULARITY),
     resolvingList(NULL),
     generatingError(false),
     enterCompartmentDepth_(0),
     savedFrameChains_(),
     defaultCompartmentObject_(NULL),
-    cycleDetectorSet(thisDuringConstruction()),
+    cycleDetectorSet(MOZ_THIS_IN_INITIALIZER_LIST()),
     errorReporter(NULL),
     operationCallback(NULL),
     data(NULL),
     data2(NULL),
 #ifdef JS_THREADSAFE
     outstandingRequests(0),
 #endif
     resolveFlags(0),
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -1631,17 +1631,16 @@ struct ThreadSafeContext : js::ContextFr
 };
 
 } /* namespace js */
 
 struct JSContext : js::ThreadSafeContext,
                    public mozilla::LinkedListElement<JSContext>
 {
     explicit JSContext(JSRuntime *rt);
-    JSContext *thisDuringConstruction() { return this; }
     ~JSContext();
 
     JSRuntime *runtime() const { return runtime_; }
     JSCompartment *compartment() const { return compartment_; }
 
     inline JS::Zone *zone() const {
         JS_ASSERT_IF(!compartment(), !zone_);
         JS_ASSERT_IF(compartment(), js::GetCompartmentZone(compartment()) == zone_);
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -1027,31 +1027,29 @@ class AutoPropDescArrayRooter : private 
     PropDescArray descriptors;
     SkipRoot skip;
 };
 
 class AutoPropertyDescriptorRooter : private AutoGCRooter, public PropertyDescriptor
 {
     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;
         getter = (PropertyOp) NULL;
         setter = (StrictPropertyOp) NULL;
         value.setUndefined();
     }
 
     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;
         getter = desc->getter;
         setter = desc->setter;
         value = desc->value;
     }
 
--- a/js/src/jsonparser.h
+++ b/js/src/jsonparser.h
@@ -99,18 +99,16 @@ class MOZ_STACK_CLASS JSONParser : priva
     // unnecessary freeing and allocation.
     Vector<ElementVector*, 5> freeElements;
     Vector<PropertyVector*, 5> freeProperties;
 
 #ifdef DEBUG
     Token lastToken;
 #endif
 
-    JSONParser *thisDuringConstruction() { return this; }
-
   public:
     /* Public API */
 
     /* Create a parser for the provided JSON data. */
     JSONParser(JSContext *cx, JS::StableCharPtr data, size_t length,
                ErrorHandling errorHandling = RaiseError)
       : AutoGCRooter(cx, JSONPARSER),
         cx(cx),
--- a/mfbt/LinkedList.h
+++ b/mfbt/LinkedList.h
@@ -102,22 +102,20 @@ class LinkedListElement
      * lists, and supporting this painlessly was a key design criterion.
      */
 
   private:
     LinkedListElement* next;
     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)
     { }
 
     ~LinkedListElement() {
       if (!isSentinel && isInList())
         remove();
     }
 
@@ -196,18 +194,18 @@ class LinkedListElement
     friend class LinkedList<T>;
 
     enum NodeKind {
       NODE_KIND_NORMAL,
       NODE_KIND_SENTINEL
     };
 
     LinkedListElement(NodeKind nodeKind)
-      : next(thisDuringConstruction()),
-        prev(thisDuringConstruction()),
+      : next(MOZ_THIS_IN_INITIALIZER_LIST()),
+        prev(MOZ_THIS_IN_INITIALIZER_LIST()),
         isSentinel(nodeKind == NODE_KIND_SENTINEL)
     { }
 
     /*
      * Return |this| cast to T* if we're a normal node, or return NULL if we're
      * a sentinel node.
      */
     T* asT() {