Bug 1109702 - Fix more bad implicit constructors in js; r=Waldo
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 13 Dec 2014 10:22:19 -0500
changeset 245478 4c4c162bfc77a46c44729b66b2d5853c698fd137
parent 245477 d13ba6a6b8b97a237f846e89fac4731897d57b19
child 245479 88fbef622ae38da7f8a505ccacf63812ff466c28
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1109702
milestone37.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 1109702 - Fix more bad implicit constructors in js; r=Waldo
js/src/asmjs/AsmJSValidate.cpp
js/src/builtin/AtomicsObject.cpp
js/src/builtin/TypedObject.h
js/src/jit/JitCompartment.h
js/src/jit/JitFrames.cpp
js/src/jit/LIR-Common.h
js/src/jit/MIR.h
js/src/jsgc.h
js/src/jsinfer.h
js/xpconnect/src/XPCWrappedJSClass.cpp
--- a/js/src/asmjs/AsmJSValidate.cpp
+++ b/js/src/asmjs/AsmJSValidate.cpp
@@ -5371,17 +5371,17 @@ SimdToCoercedScalarType(AsmJSSimdType t)
 }
 
 class CheckSimdScalarArgs
 {
     AsmJSSimdType simdType_;
     Type formalType_;
 
   public:
-    CheckSimdScalarArgs(AsmJSSimdType simdType)
+    explicit CheckSimdScalarArgs(AsmJSSimdType simdType)
       : simdType_(simdType), formalType_(SimdToCoercedScalarType(simdType))
     {}
 
     bool operator()(FunctionCompiler &f, ParseNode *arg, unsigned argIndex, Type actualType,
                     MDefinition **def) const
     {
         if (!(actualType <= formalType_)) {
             // As a special case, accept doublelit arguments to float32x4 ops by
--- a/js/src/builtin/AtomicsObject.cpp
+++ b/js/src/builtin/AtomicsObject.cpp
@@ -723,17 +723,17 @@ class FutexWaiter
     FutexWaiter *lower_pri;             // Lower priority nodes in circular doubly-linked list of waiters
     FutexWaiter *back;                  // Other direction
 };
 
 class AutoLockFutexAPI
 {
     JS::PerRuntimeFutexAPI * const fx;
   public:
-    AutoLockFutexAPI(JS::PerRuntimeFutexAPI *fx) : fx(fx) {
+    explicit AutoLockFutexAPI(JS::PerRuntimeFutexAPI *fx) : fx(fx) {
         fx->lock();
     }
     ~AutoLockFutexAPI() {
         fx->unlock();
     }
 };
 
 } // namespace js
--- a/js/src/builtin/TypedObject.h
+++ b/js/src/builtin/TypedObject.h
@@ -1055,17 +1055,17 @@ class LazyArrayBufferTable
     // The map from transparent typed objects to their lazily created buffer.
     // Keys in this map are InlineTransparentTypedObjects and values are
     // ArrayBufferObjects, but we don't enforce this in the type system due to
     // the extra marking code goop that requires.
     typedef WeakMap<PreBarrieredObject, RelocatablePtrObject> Map;
     Map map;
 
   public:
-    LazyArrayBufferTable(JSContext *cx);
+    explicit LazyArrayBufferTable(JSContext *cx);
     ~LazyArrayBufferTable();
 
     ArrayBufferObject *maybeBuffer(InlineTransparentTypedObject *obj);
     bool addBuffer(JSContext *cx, InlineTransparentTypedObject *obj, ArrayBufferObject *buffer);
 
     void trace(JSTracer *trc);
     size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf);
 };
--- a/js/src/jit/JitCompartment.h
+++ b/js/src/jit/JitCompartment.h
@@ -282,17 +282,17 @@ class JitRuntime
     bool hasIonAlloc() const {
         return !!ionAlloc_;
     }
 
     class AutoMutateBackedges
     {
         JitRuntime *jrt_;
       public:
-        AutoMutateBackedges(JitRuntime *jrt) : jrt_(jrt) {
+        explicit AutoMutateBackedges(JitRuntime *jrt) : jrt_(jrt) {
             MOZ_ASSERT(!jrt->mutatingBackedgeList_);
             jrt->mutatingBackedgeList_ = true;
         }
         ~AutoMutateBackedges() {
             MOZ_ASSERT(jrt_->mutatingBackedgeList_);
             jrt_->mutatingBackedgeList_ = false;
         }
     };
--- a/js/src/jit/JitFrames.cpp
+++ b/js/src/jit/JitFrames.cpp
@@ -548,17 +548,17 @@ HandleClosingGeneratorReturn(JSContext *
     }
 
     ForcedReturn(cx, frame, pc, rfe, calledDebugEpilogue);
 }
 
 struct AutoDebuggerHandlingException
 {
     BaselineFrame *frame;
-    AutoDebuggerHandlingException(BaselineFrame *frame)
+    explicit AutoDebuggerHandlingException(BaselineFrame *frame)
       : frame(frame)
     {
         frame->setIsDebuggerHandlingException();
     }
     ~AutoDebuggerHandlingException() {
         frame->unsetIsDebuggerHandlingException();
     }
 };
--- a/js/src/jit/LIR-Common.h
+++ b/js/src/jit/LIR-Common.h
@@ -4296,17 +4296,17 @@ class LTypedArrayElements : public LInst
 };
 
 // Load a typed object's descriptor.
 class LTypedObjectDescr : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(TypedObjectDescr)
 
-    LTypedObjectDescr(const LAllocation &object) {
+    explicit LTypedObjectDescr(const LAllocation &object) {
         setOperand(0, object);
     }
     const LAllocation *object() {
         return getOperand(0);
     }
 };
 
 // Load a typed object's elements vector.
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -10502,17 +10502,17 @@ class MSetDOMProperty
 
 class MGetDOMProperty
   : public MVariadicInstruction,
     public ObjectPolicy<0>::Data
 {
     const JSJitInfo *info_;
 
   protected:
-    MGetDOMProperty(const JSJitInfo *jitinfo)
+    explicit MGetDOMProperty(const JSJitInfo *jitinfo)
       : info_(jitinfo)
     {
         MOZ_ASSERT(jitinfo);
         MOZ_ASSERT(jitinfo->type() == JSJitInfo::Getter);
 
         // We are movable iff the jitinfo says we can be.
         if (isDomMovable()) {
             MOZ_ASSERT(jitinfo->aliasSet() != JSJitInfo::AliasEverything);
@@ -10619,17 +10619,17 @@ class MGetDOMProperty
     bool possiblyCalls() const {
         return true;
     }
 };
 
 class MGetDOMMember : public MGetDOMProperty
 {
     // We inherit everything from MGetDOMProperty except our possiblyCalls value
-    MGetDOMMember(const JSJitInfo *jitinfo)
+    explicit MGetDOMMember(const JSJitInfo *jitinfo)
         : MGetDOMProperty(jitinfo)
     {
     }
 
   public:
     INSTRUCTION_HEADER(GetDOMMember)
 
     static MGetDOMMember *New(TempAllocator &alloc, const JSJitInfo *info, MDefinition *obj,
--- a/js/src/jsgc.h
+++ b/js/src/jsgc.h
@@ -633,17 +633,17 @@ class ArenaLists
     // While sweeping type information, these lists save the arenas for the
     // objects which have already been finalized in the foreground (which must
     // happen at the beginning of the GC), so that type sweeping can determine
     // which of the object pointers are marked.
     ArenaList savedObjectArenas[FINALIZE_OBJECT_LIMIT];
     ArenaHeader *savedEmptyObjectArenas;
 
   public:
-    ArenaLists(JSRuntime *rt) : runtime_(rt) {
+    explicit ArenaLists(JSRuntime *rt) : runtime_(rt) {
         for (size_t i = 0; i != FINALIZE_LIMIT; ++i)
             freeLists[i].initAsEmpty();
         for (size_t i = 0; i != FINALIZE_LIMIT; ++i)
             backgroundFinalizeState[i] = BFS_DONE;
         for (size_t i = 0; i != FINALIZE_LIMIT; ++i)
             arenaListsToSweep[i] = nullptr;
         incrementalSweptArenaKind = FINALIZE_LIMIT;
         gcShapeArenasToUpdate = nullptr;
--- a/js/src/jsinfer.h
+++ b/js/src/jsinfer.h
@@ -674,17 +674,17 @@ class TypeSet
 // script information in the zone, the only things whose correctness depends on
 // the type constraints.
 class AutoClearTypeInferenceStateOnOOM
 {
     Zone *zone;
     bool oom;
 
   public:
-    AutoClearTypeInferenceStateOnOOM(Zone *zone)
+    explicit AutoClearTypeInferenceStateOnOOM(Zone *zone)
       : zone(zone), oom(false)
     {}
 
     ~AutoClearTypeInferenceStateOnOOM();
 
     void setOOM() {
         oom = true;
     }
--- a/js/xpconnect/src/XPCWrappedJSClass.cpp
+++ b/js/xpconnect/src/XPCWrappedJSClass.cpp
@@ -81,17 +81,17 @@ bool xpc_IsReportableErrorCode(nsresult 
             return true;
     }
 }
 
 // A little stack-based RAII class to help management of the XPCContext
 // PendingResult.
 class MOZ_STACK_CLASS AutoSavePendingResult {
 public:
-    AutoSavePendingResult(XPCContext *xpcc) :
+    explicit AutoSavePendingResult(XPCContext *xpcc) :
         mXPCContext(xpcc)
     {
         // Save any existing pending result and reset to NS_OK for this invocation.
         mSavedResult = xpcc->GetPendingResult();
         xpcc->SetPendingResult(NS_OK);
     }
     ~AutoSavePendingResult() {
         mXPCContext->SetPendingResult(mSavedResult);