Bug 1251529: Provide default constructor for js::AllocationMetadataBuilder, js::SavedStacks::MetadataBuilder. r=shu
authorJim Blandy <jimb@mozilla.com>
Mon, 04 Apr 2016 19:37:54 -0700
changeset 291688 0d06527892bcdb86beec7898b2402d7294354f55
parent 291687 12f6c52e4b4df6527c98593c31840a8c68e2bf5f
child 291689 b7ccb58f645c6e89cc0afe04ff041e8a4e940885
push id30144
push usercbook@mozilla.com
push dateTue, 05 Apr 2016 14:52:26 +0000
treeherdermozilla-central@17a0ded9bb99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1251529
milestone48.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 1251529: Provide default constructor for js::AllocationMetadataBuilder, js::SavedStacks::MetadataBuilder. r=shu
js/src/jsfriendapi.h
js/src/vm/SavedStacks.h
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -2664,16 +2664,18 @@ class MOZ_RAII JS_FRIEND_API(AutoCTypesA
             callback = nullptr;
         }
     }
 };
 
 // Abstract base class for objects that build allocation metadata for JavaScript
 // values.
 struct AllocationMetadataBuilder {
+    AllocationMetadataBuilder() { }
+
     // Return a metadata object for the newly constructed object |obj|, or
     // nullptr if there's no metadata to attach.
     //
     // Implementations should treat all errors as fatal; there is no way to
     // report errors from this callback. In particular, the caller provides an
     // oomUnsafe for overriding implementations to use.
     virtual JSObject* build(JSContext* cx, JS::HandleObject obj,
                             AutoEnterOOMUnsafeRegion& oomUnsafe) const
--- a/js/src/vm/SavedStacks.h
+++ b/js/src/vm/SavedStacks.h
@@ -176,17 +176,18 @@ class SavedStacks {
     // |state1|. One or the other must be non-zero. See the comments for
     // mozilla::non_crypto::XorShift128PlusRNG::setState for details.
     void     setRNGState(uint64_t state0, uint64_t state1) { bernoulli.setRandomState(state0, state1); }
 
     size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf);
 
     // An alloction metadata builder that marks cells with the JavaScript stack
     // at which they were allocated.
-    class MetadataBuilder : public AllocationMetadataBuilder {
+    struct MetadataBuilder : public AllocationMetadataBuilder {
+        MetadataBuilder() : AllocationMetadataBuilder() { }
         virtual JSObject* build(JSContext *cx, HandleObject obj,
                                 AutoEnterOOMUnsafeRegion& oomUnsafe) const override;
     };
 
     static const MetadataBuilder metadataBuilder;
 
   private:
     SavedFrame::Set frames;