Bug 1013663 - Fix some bad implicit conversion constructors in the JS engine; r=jorendorff,jandem
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 25 May 2014 21:46:24 -0400
changeset 204330 5021d1337fa9bb5cca83ae0800c6ca1902167d2b
parent 204329 fdf86352fdb6edd301581cad786c9b37dd439801
child 204331 da30172fbf7699698110536648747816916c9c15
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff, jandem
bugs1013663
milestone32.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 1013663 - Fix some bad implicit conversion constructors in the JS engine; r=jorendorff,jandem
content/base/src/nsFrameMessageManager.cpp
ipc/nfc/Nfc.cpp
ipc/testshell/TestShellParent.cpp
js/public/CharacterEncoding.h
js/public/GCAPI.h
js/public/HashTable.h
js/public/MemoryMetrics.h
js/public/OldDebugAPI.h
js/public/RootingAPI.h
js/public/SliceBudget.h
js/public/Value.h
js/public/Vector.h
js/src/assembler/assembler/AbstractMacroAssembler.h
js/src/assembler/assembler/CodeLocation.h
js/src/assembler/assembler/MacroAssemblerARM.h
js/src/assembler/assembler/MacroAssemblerX86Common.h
js/src/assembler/assembler/MacroAssemblerX86_64.h
js/src/assembler/assembler/X86Assembler.h
js/src/builtin/Eval.cpp
js/src/builtin/MapObject.cpp
js/src/builtin/TypedObject.cpp
js/src/ctypes/CTypes.h
js/src/ds/IdValuePair.h
js/src/ds/InlineMap.h
js/src/ds/LifoAlloc.h
js/src/ds/PriorityQueue.h
js/src/ds/SplayTree.h
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/BytecodeEmitter.h
js/src/frontend/ParseNode.h
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
js/src/frontend/SharedContext.h
js/src/frontend/TokenStream.h
js/src/gc/Barrier.h
js/src/gc/FindSCCs.h
js/src/gc/GCInternals.h
js/src/gc/GCRuntime.h
js/src/gc/Marking.cpp
js/src/gc/Statistics.cpp
js/src/gc/Statistics.h
js/src/gc/Tracer.h
js/src/gc/Zone.h
js/src/gdb/tests/test-Root.cpp
js/src/irregexp/RegExpInterpreter.cpp
js/src/jit/AliasAnalysis.cpp
js/src/jit/AsmJS.cpp
js/src/jit/AsmJSLink.cpp
js/src/jit/AsmJSLink.h
js/src/jit/AsmJSModule.cpp
js/src/jit/AsmJSModule.h
js/src/jit/AsmJSSignalHandlers.cpp
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineDebugModeOSR.cpp
js/src/jit/BaselineIC.cpp
js/src/jit/BaselineIC.h
js/src/jit/BaselineInspector.h
js/src/jit/BaselineJIT.cpp
js/src/jit/BitSet.h
js/src/jit/CodeGenerator.cpp
js/src/jit/CompactBuffer.h
js/src/jit/CompileWrappers.h
js/src/jit/CompilerRoot.h
js/src/jit/EffectiveAddressAnalysis.h
js/src/jit/InlineList.h
js/src/jit/Ion.cpp
js/src/jit/Ion.h
js/src/jit/IonAllocPolicy.h
js/src/jit/IonAnalysis.h
js/src/jit/IonBuilder.cpp
js/src/jit/IonCaches.cpp
js/src/jit/IonCode.h
js/src/jit/IonFrames.cpp
js/src/jit/IonLinker.h
js/src/jit/IonMacroAssembler.cpp
js/src/jit/IonMacroAssembler.h
js/src/jit/JitFrameIterator.h
js/src/jit/LIR-Common.h
js/src/jit/LIR.h
js/src/jit/LinearScan.h
js/src/jit/LiveRangeAllocator.h
js/src/jit/MIR.h
js/src/jit/MIRGraph.h
js/src/jit/ParallelSafetyAnalysis.cpp
js/src/jit/RangeAnalysis.h
js/src/jit/Recover.h
js/src/jit/RegisterAllocator.h
js/src/jit/RegisterSets.h
js/src/jit/RematerializedFrame.cpp
js/src/jit/Safepoints.cpp
js/src/jit/Snapshots.h
js/src/jit/TypePolicy.h
js/src/jit/VMFunctions.h
js/src/jit/arm/MacroAssembler-arm.cpp
js/src/jit/arm/MacroAssembler-arm.h
js/src/jit/shared/Assembler-shared.h
js/src/jit/shared/BaselineCompiler-shared.cpp
js/src/jit/shared/CodeGenerator-shared.h
js/src/jit/shared/CodeGenerator-x86-shared.cpp
js/src/jit/shared/CodeGenerator-x86-shared.h
js/src/jit/shared/LIR-x86-shared.h
js/src/jit/shared/Lowering-shared-inl.h
js/src/jit/shared/Lowering-shared.cpp
js/src/jit/shared/MoveEmitter-x86-shared.h
js/src/jit/x64/Assembler-x64.cpp
js/src/jit/x64/Assembler-x64.h
js/src/jit/x64/CodeGenerator-x64.cpp
js/src/jit/x64/LIR-x64.h
js/src/jit/x64/MacroAssembler-x64.h
js/src/jit/x86/Assembler-x86.h
js/src/jit/x86/CodeGenerator-x86.cpp
js/src/jsalloc.h
js/src/jsapi-tests/testChromeBuffer.cpp
js/src/jsapi-tests/testCloneScript.cpp
js/src/jsapi-tests/testDebugger.cpp
js/src/jsapi-tests/testLooselyEqual.cpp
js/src/jsapi-tests/testParseJSON.cpp
js/src/jsapi-tests/testPersistentRooted.cpp
js/src/jsapi-tests/testResolveRecursion.cpp
js/src/jsapi-tests/tests.cpp
js/src/jsapi-tests/tests.h
js/src/jsapi.cpp
js/src/jsapi.h
js/src/jsarray.cpp
js/src/jsatom.h
js/src/jscntxt.h
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jscompartmentinlines.h
js/src/jscrashformat.h
js/src/jscrashreport.cpp
js/src/jscrashreport.h
js/src/jsexn.cpp
js/src/jsfriendapi.cpp
js/src/jsfriendapi.h
js/src/jsgc.cpp
js/src/jsgc.h
js/src/jsgcinlines.h
js/src/jsinfer.cpp
js/src/jsinfer.h
js/src/jsinferinlines.h
js/src/jsiter.cpp
js/src/jsobj.cpp
js/src/jsobjinlines.h
js/src/jsonparser.h
js/src/jspropertytree.cpp
js/src/jspropertytree.h
js/src/jspubtd.h
js/src/jsscript.cpp
js/src/jsscript.h
js/src/jsstr.cpp
js/src/jsworkers.cpp
js/src/jsworkers.h
js/src/jswrapper.cpp
js/src/jswrapper.h
js/src/perf/jsperf.h
js/src/shell/js.cpp
js/src/shell/jsheaptools.cpp
js/src/vm/ArgumentsObject.cpp
js/src/vm/ArrayBufferObject.h
js/src/vm/Debugger.cpp
js/src/vm/ForkJoin.cpp
js/src/vm/ForkJoin.h
js/src/vm/Interpreter.cpp
js/src/vm/MatchPairs.h
js/src/vm/MemoryMetrics.cpp
js/src/vm/Monitor.h
js/src/vm/OldDebugAPI.cpp
js/src/vm/PIC.h
js/src/vm/RegExpObject.cpp
js/src/vm/RegExpObject.h
js/src/vm/Runtime.h
js/src/vm/SPSProfiler.h
js/src/vm/ScopeObject.cpp
js/src/vm/ScopeObject.h
js/src/vm/SelfHosting.cpp
js/src/vm/Shape.cpp
js/src/vm/Shape.h
js/src/vm/Stack-inl.h
js/src/vm/Stack.h
js/src/vm/String.h
js/src/vm/StructuredClone.cpp
js/src/vm/ThreadPool.h
js/src/vm/TypedArrayObject.cpp
js/src/vm/Xdr.h
js/xpconnect/src/XPCComponents.cpp
js/xpconnect/src/XPCWrappedJSClass.cpp
xpcom/base/nsCycleCollector.cpp
--- a/content/base/src/nsFrameMessageManager.cpp
+++ b/content/base/src/nsFrameMessageManager.cpp
@@ -1064,17 +1064,17 @@ nsFrameMessageManager::ReceiveMessage(ns
       {
         JS::Rooted<JSObject*> thisObject(cx, thisValue.toObjectOrNull());
 
         JSAutoCompartment tac(cx, thisObject);
         if (!JS_WrapValue(cx, &argv)) {
           return NS_ERROR_UNEXPECTED;
         }
 
-        if (!JS_CallFunctionValue(cx, thisObject, funval, argv, &rval)) {
+        if (!JS_CallFunctionValue(cx, thisObject, funval, JS::HandleValueArray(argv), &rval)) {
           nsJSUtils::ReportPendingException(cx);
           continue;
         }
         if (aJSONRetVal) {
           nsString json;
           if (!JS_Stringify(cx, &rval, JS::NullPtr(), JS::NullHandleValue,
                            JSONCreator, &json)) {
             nsJSUtils::ReportPendingException(cx);
--- a/ipc/nfc/Nfc.cpp
+++ b/ipc/nfc/Nfc.cpp
@@ -163,17 +163,17 @@ DispatchNFCEvent::RunTask(JSContext* aCx
     JSObject* array = JS_NewUint8Array(aCx, mMessage->mSize);
     if (!array) {
         return false;
     }
     JS::Rooted<JS::Value> arrayVal(aCx, JS::ObjectValue(*array));
 
     memcpy(JS_GetArrayBufferViewData(array), mMessage->mData, mMessage->mSize);
     JS::Rooted<JS::Value> rval(aCx);
-    return JS_CallFunctionName(aCx, obj, "onNfcMessage", arrayVal, &rval);
+    return JS_CallFunctionName(aCx, obj, "onNfcMessage", JS::HandleValueArray(arrayVal), &rval);
 }
 
 class NfcConnector : public mozilla::ipc::UnixSocketConnector
 {
 public:
     NfcConnector()
     {}
 
--- a/ipc/testshell/TestShellParent.cpp
+++ b/ipc/testshell/TestShellParent.cpp
@@ -75,17 +75,17 @@ TestShellCommandParent::RunCallback(cons
 
   JSString* str = JS_NewUCStringCopyN(mCx, aResponse.get(), aResponse.Length());
   NS_ENSURE_TRUE(str, false);
 
   JS::Rooted<JS::Value> strVal(mCx, JS::StringValue(str));
 
   JS::Rooted<JS::Value> rval(mCx);
   JS::Rooted<JS::Value> callback(mCx, mCallback);
-  bool ok = JS_CallFunctionValue(mCx, global, callback, strVal, &rval);
+  bool ok = JS_CallFunctionValue(mCx, global, callback, JS::HandleValueArray(strVal), &rval);
   NS_ENSURE_TRUE(ok, false);
 
   return true;
 }
 
 void
 TestShellCommandParent::ReleaseCallback()
 {
--- a/js/public/CharacterEncoding.h
+++ b/js/public/CharacterEncoding.h
@@ -146,17 +146,17 @@ typedef mozilla::RangedPtr<const jschar>
 
 /*
  * Like TwoByteChars, but the chars are const.
  */
 class ConstTwoByteChars : public mozilla::RangedPtr<const jschar>
 {
   public:
     ConstTwoByteChars(const ConstTwoByteChars &s) : ConstCharPtr(s) {}
-    ConstTwoByteChars(const mozilla::RangedPtr<const jschar> &s) : ConstCharPtr(s) {}
+    MOZ_IMPLICIT ConstTwoByteChars(const mozilla::RangedPtr<const jschar> &s) : ConstCharPtr(s) {}
     ConstTwoByteChars(const jschar *s, size_t len) : ConstCharPtr(s, len) {}
     ConstTwoByteChars(const jschar *pos, const jschar *start, size_t len)
       : ConstCharPtr(pos, start, len)
     {}
 
     using ConstCharPtr::operator=;
 };
 
--- a/js/public/GCAPI.h
+++ b/js/public/GCAPI.h
@@ -244,17 +244,17 @@ enum GCProgress {
     GC_SLICE_BEGIN,
     GC_SLICE_END,
     GC_CYCLE_END
 };
 
 struct JS_FRIEND_API(GCDescription) {
     bool isCompartment_;
 
-    GCDescription(bool isCompartment)
+    explicit GCDescription(bool isCompartment)
       : isCompartment_(isCompartment) {}
 
     jschar *formatMessage(JSRuntime *rt) const;
     jschar *formatJSON(JSRuntime *rt, uint64_t timestamp) const;
 };
 
 typedef void
 (* GCSliceCallback)(JSRuntime *rt, GCProgress progress, const GCDescription &desc);
@@ -336,17 +336,17 @@ WasIncrementalGC(JSRuntime *rt);
 class JS_FRIEND_API(AutoDisableGenerationalGC)
 {
     js::gc::GCRuntime *gc;
 #if defined(JSGC_GENERATIONAL) && defined(JS_GC_ZEAL)
     bool restartVerifier;
 #endif
 
   public:
-    AutoDisableGenerationalGC(JSRuntime *rt);
+    explicit AutoDisableGenerationalGC(JSRuntime *rt);
     ~AutoDisableGenerationalGC();
 };
 
 /*
  * Returns true if generational allocation and collection is currently enabled
  * on the given runtime.
  */
 extern JS_FRIEND_API(bool)
@@ -390,28 +390,28 @@ class JS_PUBLIC_API(AutoAssertNoGC)
   public:
     AutoAssertNoGC();
     AutoAssertNoGC(JSRuntime *rt);
     ~AutoAssertNoGC();
 #else
   public:
     /* Prevent unreferenced local warnings in opt builds. */
     AutoAssertNoGC() {}
-    AutoAssertNoGC(JSRuntime *) {}
+    explicit AutoAssertNoGC(JSRuntime *) {}
 #endif
 };
 
 class JS_PUBLIC_API(ObjectPtr)
 {
     Heap<JSObject *> value;
 
   public:
     ObjectPtr() : value(nullptr) {}
 
-    ObjectPtr(JSObject *obj) : value(obj) {}
+    explicit ObjectPtr(JSObject *obj) : value(obj) {}
 
     /* Always call finalize before the destructor. */
     ~ObjectPtr() { MOZ_ASSERT(!value); }
 
     void finalize(JSRuntime *rt) {
         if (IsIncrementalBarrierNeeded(rt))
             IncrementalObjectBarrier(value);
         value = nullptr;
--- a/js/public/HashTable.h
+++ b/js/public/HashTable.h
@@ -68,17 +68,17 @@ class HashMap
     Impl impl;
 
   public:
     typedef typename HashPolicy::Lookup Lookup;
     typedef TableEntry Entry;
 
     // HashMap construction is fallible (due to OOM); thus the user must call
     // init after constructing a HashMap and check the return value.
-    HashMap(AllocPolicy a = AllocPolicy()) : impl(a)  {}
+    explicit HashMap(AllocPolicy a = AllocPolicy()) : impl(a)  {}
     bool init(uint32_t len = 16)                      { return impl.init(len); }
     bool initialized() const                          { return impl.initialized(); }
 
     // Return whether the given lookup value is present in the map. E.g.:
     //
     //   typedef HashMap<int,char> HM;
     //   HM h;
     //   if (HM::Ptr p = h.lookup(3)) {
@@ -309,17 +309,17 @@ class HashSet
     Impl impl;
 
   public:
     typedef typename HashPolicy::Lookup Lookup;
     typedef T Entry;
 
     // HashSet construction is fallible (due to OOM); thus the user must call
     // init after constructing a HashSet and check the return value.
-    HashSet(AllocPolicy a = AllocPolicy()) : impl(a)  {}
+    explicit HashSet(AllocPolicy a = AllocPolicy()) : impl(a)  {}
     bool init(uint32_t len = 16)                      { return impl.init(len); }
     bool initialized() const                          { return impl.initialized(); }
 
     // Return whether the given lookup value is present in the map. E.g.:
     //
     //   typedef HashSet<int> HS;
     //   HS h;
     //   if (HS::Ptr p = h.lookup(3)) {
@@ -1057,17 +1057,17 @@ class HashTable : private AllocPolicy
     static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32_t capacity)
     {
         for (Entry *e = oldTable, *end = e + capacity; e < end; ++e)
             e->destroyIfLive();
         alloc.free_(oldTable);
     }
 
   public:
-    HashTable(AllocPolicy ap)
+    explicit HashTable(AllocPolicy ap)
       : AllocPolicy(ap),
         hashShift(sHashBits),
         entryCount(0),
         gen(0),
         removedCount(0),
         table(nullptr),
         entered(false),
         mutationCount(0)
--- a/js/public/MemoryMetrics.h
+++ b/js/public/MemoryMetrics.h
@@ -562,17 +562,17 @@ struct RuntimeStats
 #define FOR_EACH_SIZE(macro) \
     macro(_, _, gcHeapChunkTotal) \
     macro(_, _, gcHeapDecommittedArenas) \
     macro(_, _, gcHeapUnusedChunks) \
     macro(_, _, gcHeapUnusedArenas) \
     macro(_, _, gcHeapChunkAdmin) \
     macro(_, _, gcHeapGCThings) \
 
-    RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)
+    explicit RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)
       : FOR_EACH_SIZE(ZERO_SIZE)
         runtime(),
         cTotals(),
         zTotals(),
         compartmentStatsVector(),
         zoneStatsVector(),
         currZoneStats(nullptr),
         mallocSizeOf_(mallocSizeOf)
@@ -625,17 +625,17 @@ class ObjectPrivateVisitor
     // that has an nsISupports pointer.
     virtual size_t sizeOfIncludingThis(nsISupports *aSupports) = 0;
 
     // A callback that gets a JSObject's nsISupports pointer, if it has one.
     // Note: this function does *not* addref |iface|.
     typedef bool(*GetISupportsFun)(JSObject *obj, nsISupports **iface);
     GetISupportsFun getISupports_;
 
-    ObjectPrivateVisitor(GetISupportsFun getISupports)
+    explicit ObjectPrivateVisitor(GetISupportsFun getISupports)
       : getISupports_(getISupports)
     {}
 };
 
 extern JS_PUBLIC_API(bool)
 CollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisitor *opv);
 
 extern JS_PUBLIC_API(size_t)
--- a/js/public/OldDebugAPI.h
+++ b/js/public/OldDebugAPI.h
@@ -439,17 +439,17 @@ class JS_PUBLIC_API(JSNullFramePtr) : pu
  * To find the calling script and line number, use JS_DescribeSciptedCaller.
  * To summarize the call stack, use JS::DescribeStack.
  */
 class JS_PUBLIC_API(JSBrokenFrameIterator)
 {
     void *data_;
 
   public:
-    JSBrokenFrameIterator(JSContext *cx);
+    explicit JSBrokenFrameIterator(JSContext *cx);
     ~JSBrokenFrameIterator();
 
     bool done() const;
     JSBrokenFrameIterator& operator++();
 
     JSAbstractFramePtr abstractFramePtr() const;
     jsbytecode *pc() const;
 
--- a/js/public/RootingAPI.h
+++ b/js/public/RootingAPI.h
@@ -409,30 +409,30 @@ class MOZ_NONHEAP_CLASS Handle : public 
            typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0)
     {
         static_assert(sizeof(Handle<T>) == sizeof(T *),
                       "Handle must be binary compatible with T*.");
         ptr = reinterpret_cast<const T *>(handle.address());
     }
 
     /* Create a handle for a nullptr pointer. */
-    Handle(js::NullPtr) {
+    MOZ_IMPLICIT Handle(js::NullPtr) {
         static_assert(mozilla::IsPointer<T>::value,
                       "js::NullPtr overload not valid for non-pointer types");
         ptr = reinterpret_cast<const T *>(&js::NullPtr::constNullValue);
     }
 
     /* Create a handle for a nullptr pointer. */
-    Handle(JS::NullPtr) {
+    MOZ_IMPLICIT Handle(JS::NullPtr) {
         static_assert(mozilla::IsPointer<T>::value,
                       "JS::NullPtr overload not valid for non-pointer types");
         ptr = reinterpret_cast<const T *>(&JS::NullPtr::constNullValue);
     }
 
-    Handle(MutableHandle<T> handle) {
+    MOZ_IMPLICIT Handle(MutableHandle<T> handle) {
         ptr = handle.address();
     }
 
     /*
      * Take care when calling this method!
      *
      * This creates a Handle from the raw location of a T.
      *
@@ -504,18 +504,18 @@ class MOZ_NONHEAP_CLASS Handle : public 
  * If you want to add additional methods to MutableHandle for a specific
  * specialization, define a MutableHandleBase<T> specialization containing
  * them.
  */
 template <typename T>
 class MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T>
 {
   public:
-    inline MutableHandle(Rooted<T> *root);
-    inline MutableHandle(PersistentRooted<T> *root);
+    inline MOZ_IMPLICIT MutableHandle(Rooted<T> *root);
+    inline MOZ_IMPLICIT MutableHandle(PersistentRooted<T> *root);
 
   private:
     // Disallow true nullptr and emulated nullptr (gcc 4.4/4.5, __null, appears
     // as int/long [32/64-bit]) for overloading purposes.
     template<typename N>
     MutableHandle(N,
                   typename mozilla::EnableIf<mozilla::IsNullPointer<N>::value ||
                                              mozilla::IsSame<N, int>::value ||
@@ -620,17 +620,17 @@ class InternalHandle<T*>
      * Create an InternalHandle to something that is not a pointer to a
      * gcthing, and so does not need to be rooted in the first place. Use these
      * InternalHandles to pass pointers into functions that also need to accept
      * regular InternalHandles to gcthing fields.
      *
      * Make this private to prevent accidental misuse; this is only for
      * fromMarkedLocation().
      */
-    InternalHandle(T *field)
+    explicit InternalHandle(T *field)
       : holder(reinterpret_cast<void * const *>(&js::NullPtr::constNullValue)),
         offset(uintptr_t(field))
     {}
 
     void operator=(InternalHandle<T*> other) MOZ_DELETE;
 };
 
 /*
@@ -706,18 +706,18 @@ class MOZ_STACK_CLASS Rooted : public js
         this->prev = *stack;
         *stack = reinterpret_cast<Rooted<void*>*>(this);
 
         MOZ_ASSERT(!js::GCMethods<T>::poisoned(ptr));
 #endif
     }
 
   public:
-    Rooted(JSContext *cx
-           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+    explicit Rooted(JSContext *cx
+                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : ptr(js::GCMethods<T>::initial())
     {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 #ifdef JS_DEBUG
         MOZ_ASSERT(js::IsInRequest(cx));
 #endif
         init(js::ContextFriendFields::get(cx));
     }
@@ -728,50 +728,50 @@ class MOZ_STACK_CLASS Rooted : public js
     {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 #ifdef JS_DEBUG
         MOZ_ASSERT(js::IsInRequest(cx));
 #endif
         init(js::ContextFriendFields::get(cx));
     }
 
-    Rooted(js::ContextFriendFields *cx
-           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+    explicit Rooted(js::ContextFriendFields *cx
+                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : ptr(js::GCMethods<T>::initial())
     {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
         init(cx);
     }
 
     Rooted(js::ContextFriendFields *cx, T initial
            MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : ptr(initial)
     {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
         init(cx);
     }
 
-    Rooted(js::PerThreadDataFriendFields *pt
-           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+    explicit Rooted(js::PerThreadDataFriendFields *pt
+                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : ptr(js::GCMethods<T>::initial())
     {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
         init(pt);
     }
 
     Rooted(js::PerThreadDataFriendFields *pt, T initial
            MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : ptr(initial)
     {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
         init(pt);
     }
 
-    Rooted(JSRuntime *rt
-           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+    explicit Rooted(JSRuntime *rt
+                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : ptr(js::GCMethods<T>::initial())
     {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
         init(js::PerThreadDataFriendFields::getMainThread(rt));
     }
 
     Rooted(JSRuntime *rt, T initial
            MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
@@ -881,17 +881,17 @@ class RootedBase<JSObject*>
  * method.
  */
 template <typename GCType>
 class JS_PUBLIC_API(RootedGeneric)
 {
   public:
     JS::Rooted<GCType> rooter;
 
-    RootedGeneric(js::ContextFriendFields *cx)
+    explicit RootedGeneric(js::ContextFriendFields *cx)
         : rooter(cx)
     {
     }
 
     RootedGeneric(js::ContextFriendFields *cx, const GCType &initial)
         : rooter(cx, initial)
     {
     }
@@ -969,21 +969,21 @@ class FakeRooted : public RootedBase<T>
     FakeRooted(const FakeRooted &) MOZ_DELETE;
 };
 
 /* Interface substitute for MutableHandle<T> which is not required to point to rooted memory. */
 template <typename T>
 class FakeMutableHandle : public js::MutableHandleBase<T>
 {
   public:
-    FakeMutableHandle(T *t) {
+    MOZ_IMPLICIT FakeMutableHandle(T *t) {
         ptr = t;
     }
 
-    FakeMutableHandle(FakeRooted<T> *root) {
+    MOZ_IMPLICIT FakeMutableHandle(FakeRooted<T> *root) {
         ptr = root->address();
     }
 
     void set(T v) {
         MOZ_ASSERT(!js::GCMethods<T>::poisoned(v));
         *ptr = v;
     }
 
@@ -1140,27 +1140,27 @@ class PersistentRooted : private mozilla
     friend class js::gc::PersistentRootedMarker<T>;
 
     void registerWithRuntime(JSRuntime *rt) {
         JS::shadow::Runtime *srt = JS::shadow::Runtime::asShadowRuntime(rt);
         srt->getPersistentRootedList<T>().insertBack(this);
     }
 
   public:
-    PersistentRooted(JSContext *cx) : ptr(js::GCMethods<T>::initial())
+    explicit PersistentRooted(JSContext *cx) : ptr(js::GCMethods<T>::initial())
     {
         registerWithRuntime(js::GetRuntime(cx));
     }
 
     PersistentRooted(JSContext *cx, T initial) : ptr(initial)
     {
         registerWithRuntime(js::GetRuntime(cx));
     }
 
-    PersistentRooted(JSRuntime *rt) : ptr(js::GCMethods<T>::initial())
+    explicit PersistentRooted(JSRuntime *rt) : ptr(js::GCMethods<T>::initial())
     {
         registerWithRuntime(rt);
     }
 
     PersistentRooted(JSRuntime *rt, T initial) : ptr(initial)
     {
         registerWithRuntime(rt);
     }
@@ -1214,17 +1214,17 @@ class PersistentRooted : private mozilla
 } /* namespace JS */
 
 namespace js {
 
 /* Base class for automatic read-only object rooting during compilation. */
 class CompilerRootNode
 {
   protected:
-    CompilerRootNode(js::gc::Cell *ptr) : next(nullptr), ptr_(ptr) {}
+    explicit CompilerRootNode(js::gc::Cell *ptr) : next(nullptr), ptr_(ptr) {}
 
   public:
     void **address() { return (void **)&ptr_; }
 
   public:
     CompilerRootNode *next;
 
   protected:
--- a/js/public/SliceBudget.h
+++ b/js/public/SliceBudget.h
@@ -27,17 +27,17 @@ struct JS_PUBLIC_API(SliceBudget)
     static const int64_t Unlimited = 0;
     static int64_t TimeBudget(int64_t millis);
     static int64_t WorkBudget(int64_t work);
 
     /* Equivalent to SliceBudget(UnlimitedBudget). */
     SliceBudget();
 
     /* Instantiate as SliceBudget(Time/WorkBudget(n)). */
-    SliceBudget(int64_t budget);
+    explicit SliceBudget(int64_t budget);
 
     void reset() {
         deadline = unlimitedDeadline;
         counter = unlimitedStartCounter;
     }
 
     void step(intptr_t amt = 1) {
         counter -= amt;
--- a/js/public/Value.h
+++ b/js/public/Value.h
@@ -1246,17 +1246,17 @@ class Value
   // precisely, we don't want Value return values compiled as out params.
   private:
 #endif
 
     jsval_layout data;
 
   private:
 #if defined(JS_VALUE_IS_CONSTEXPR)
-    JS_VALUE_CONSTEXPR Value(jsval_layout layout) : data(layout) {}
+    MOZ_IMPLICIT JS_VALUE_CONSTEXPR Value(jsval_layout layout) : data(layout) {}
 #endif
 
     void staticAssertions() {
         JS_STATIC_ASSERT(sizeof(JSValueType) == 1);
         JS_STATIC_ASSERT(sizeof(JSValueTag) == 4);
         JS_STATIC_ASSERT(sizeof(JSWhyMagic) <= 4);
         JS_STATIC_ASSERT(sizeof(Value) == 8);
     }
--- a/js/public/Vector.h
+++ b/js/public/Vector.h
@@ -49,17 +49,17 @@ class Vector
   : public mozilla::VectorBase<T,
                                MinInlineCapacity,
                                AllocPolicy,
                                Vector<T, MinInlineCapacity, AllocPolicy> >
 {
     typedef typename mozilla::VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;
 
   public:
-    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}
+    explicit Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}
     Vector(Vector &&vec) : Base(mozilla::Move(vec)) {}
     Vector &operator=(Vector &&vec) {
         return Base::operator=(mozilla::Move(vec));
     }
 };
 
 } // namespace js
 
--- a/js/src/assembler/assembler/AbstractMacroAssembler.h
+++ b/js/src/assembler/assembler/AbstractMacroAssembler.h
@@ -113,23 +113,23 @@ public:
     // addresses to be implicitly constructed, e.g. the two calls:
     //
     //     load32(Address(addrReg), destReg);
     //     load32(addrReg, destReg);
     //
     // Are equivalent, and the explicit wrapping of the Address in the former
     // is unnecessary.
     struct ImplicitAddress {
-        ImplicitAddress(RegisterID base)
+        explicit ImplicitAddress(RegisterID base)
             : base(base)
             , offset(0)
         {
         }
 
-        ImplicitAddress(Address address)
+        MOZ_IMPLICIT ImplicitAddress(Address address)
             : base(address.base)
             , offset(address.offset)
         {
         }
 
         RegisterID base;
         int32_t offset;
     };
@@ -280,17 +280,17 @@ public:
         friend class MacroAssemblerCodeRef;
         friend class LinkBuffer;
 
     public:
         Label()
         {
         }
 
-        Label(AbstractMacroAssembler<AssemblerType>* masm)
+        explicit Label(AbstractMacroAssembler<AssemblerType>* masm)
             : m_label(masm->m_assembler.label())
         {
         }
 
         bool isUsed() const { return m_label.isUsed(); }
         void used() { m_label.used(); }
         bool isSet() const { return m_label.isValid(); }
     private:
@@ -305,17 +305,17 @@ public:
         template<class TemplateAssemblerType>
         friend class AbstractMacroAssembler;
         friend class LinkBuffer;
     public:
         DataLabelPtr()
         {
         }
 
-        DataLabelPtr(AbstractMacroAssembler<AssemblerType>* masm)
+        explicit DataLabelPtr(AbstractMacroAssembler<AssemblerType>* masm)
             : m_label(masm->m_assembler.label())
         {
         }
 
         bool isSet() const { return m_label.isValid(); }
 
     private:
         JmpDst m_label;
@@ -329,17 +329,17 @@ public:
         template<class TemplateAssemblerType>
         friend class AbstractMacroAssembler;
         friend class LinkBuffer;
     public:
         DataLabel32()
         {
         }
 
-        DataLabel32(AbstractMacroAssembler<AssemblerType>* masm)
+        explicit DataLabel32(AbstractMacroAssembler<AssemblerType>* masm)
             : m_label(masm->m_assembler.label())
         {
         }
 
     private:
         JmpDst m_label;
     };
 
@@ -398,17 +398,17 @@ public:
         friend class AbstractMacroAssembler;
         friend class Call;
         friend class LinkBuffer;
     public:
         Jump()
         {
         }
 
-        Jump(JmpSrc jmp)
+        explicit Jump(JmpSrc jmp)
             : m_jmp(jmp)
         {
         }
 
         void link(AbstractMacroAssembler<AssemblerType>* masm) const
         {
             masm->m_assembler.linkJump(m_jmp, masm->m_assembler.label());
         }
--- a/js/src/assembler/assembler/CodeLocation.h
+++ b/js/src/assembler/assembler/CodeLocation.h
@@ -66,17 +66,17 @@ public:
     CodeLocationDataLabelPtr dataLabelPtrAtOffset(int offset);
     CodeLocationDataLabel32 dataLabel32AtOffset(int offset);
 
 protected:
     CodeLocationCommon()
     {
     }
 
-    CodeLocationCommon(MacroAssemblerCodePtr location)
+    explicit CodeLocationCommon(MacroAssemblerCodePtr location)
         : MacroAssemblerCodePtr(location)
     {
     }
 };
 
 class CodeLocationInstruction : public CodeLocationCommon {
 public:
     CodeLocationInstruction() {}
--- a/js/src/assembler/assembler/MacroAssemblerARM.h
+++ b/js/src/assembler/assembler/MacroAssemblerARM.h
@@ -722,17 +722,17 @@ public:
         return jump();
     }
 
     Jump branch16(Condition cond, BaseIndex left, Imm32 right)
     {
         load16(left, ARMRegisters::S0);
         move(right, ARMRegisters::S1);
         m_assembler.cmp_r(ARMRegisters::S0, ARMRegisters::S1);
-        return m_assembler.jmp(ARMCondition(cond));
+        return Jump(m_assembler.jmp(ARMCondition(cond)));
     }
 
     Jump branchTest8(Condition cond, Address address, Imm32 mask = Imm32(-1))
     {
         load8(address, ARMRegisters::S1);
         return branchTest32(cond, ARMRegisters::S1, mask);
     }
 
--- a/js/src/assembler/assembler/MacroAssemblerX86Common.h
+++ b/js/src/assembler/assembler/MacroAssemblerX86Common.h
@@ -720,18 +720,18 @@ public:
         m_assembler.cvttsd2si_rr(src, dest);
 
         // If the result is zero, it might have been -0.0, and the double comparison won't catch this!
         failureCases.append(branchTest32(Zero, dest));
 
         // Convert the integer result back to float & compare to the original value - if not equal or unordered (NaN) then jump.
         convertInt32ToDouble(dest, fpTemp);
         m_assembler.ucomisd_rr(fpTemp, src);
-        failureCases.append(m_assembler.jp());
-        failureCases.append(m_assembler.jne());
+        failureCases.append(Jump(m_assembler.jp()));
+        failureCases.append(Jump(m_assembler.jne()));
     }
 
     void zeroDouble(FPRegisterID srcDest)
     {
         ASSERT(isSSE2Present());
         m_assembler.xorpd_rr(srcDest, srcDest);
     }
 
--- a/js/src/assembler/assembler/MacroAssemblerX86_64.h
+++ b/js/src/assembler/assembler/MacroAssemblerX86_64.h
@@ -94,17 +94,17 @@ public:
             move(ImmPtr(address), scratchRegister);
             load32(ImplicitAddress(scratchRegister), dest);
         }
     }
 
     DataLabelPtr loadDouble(const void* address, FPRegisterID dest)
     {
         DataLabelPtr label = moveWithPatch(ImmPtr(address), scratchRegister);
-        loadDouble(scratchRegister, dest);
+        loadDouble(ImplicitAddress(scratchRegister), dest);
         return label;
     }
 
     void convertInt32ToDouble(AbsoluteAddress src, FPRegisterID dest)
     {
         move(Imm32(*static_cast<const int32_t*>(src.m_ptr)), scratchRegister);
         m_assembler.cvtsi2sd_rr(scratchRegister, dest);
     }
--- a/js/src/assembler/assembler/X86Assembler.h
+++ b/js/src/assembler/assembler/X86Assembler.h
@@ -390,17 +390,17 @@ public:
         friend class X86Assembler;
         friend class X86InstructionFormatter;
     public:
         JmpSrc()
             : m_offset(-1)
         {
         }
 
-        JmpSrc(int offset)
+        explicit JmpSrc(int offset)
             : m_offset(offset)
         {
         }
 
         int offset() const {
             return m_offset;
         }
 
@@ -421,17 +421,17 @@ public:
             , m_used(false)
         {
         }
 
         bool isUsed() const { return m_used; }
         void used() { m_used = true; }
         bool isValid() const { return m_offset != -1; }
 
-        JmpDst(int offset)
+        explicit JmpDst(int offset)
             : m_offset(offset)
             , m_used(false)
         {
             ASSERT(m_offset == offset);
         }
         int offset() const {
             return m_offset;
         }
--- a/js/src/builtin/Eval.cpp
+++ b/js/src/builtin/Eval.cpp
@@ -85,17 +85,17 @@ class EvalScriptGuard
 
     /* These fields are only valid if lookup_.str is non-nullptr. */
     EvalCacheLookup lookup_;
     EvalCache::AddPtr p_;
 
     Rooted<JSLinearString*> lookupStr_;
 
   public:
-    EvalScriptGuard(JSContext *cx)
+    explicit EvalScriptGuard(JSContext *cx)
         : cx_(cx), script_(cx), lookup_(cx), lookupStr_(cx) {}
 
     ~EvalScriptGuard() {
         if (script_) {
             CallDestroyScriptHook(cx_->runtime()->defaultFreeOp(), script_);
             script_->cacheForEval();
             EvalCacheEntry cacheEntry = {script_, lookup_.callerScript, lookup_.pc};
             lookup_.str = lookupStr_;
--- a/js/src/builtin/MapObject.cpp
+++ b/js/src/builtin/MapObject.cpp
@@ -95,17 +95,17 @@ class OrderedHashTable
     uint32_t dataLength;        // number of constructed elements in data
     uint32_t dataCapacity;      // size of data, in elements
     uint32_t liveCount;         // dataLength less empty (removed) entries
     uint32_t hashShift;         // multiplicative hash shift
     Range *ranges;              // list of all live Ranges on this table
     AllocPolicy alloc;
 
   public:
-    OrderedHashTable(AllocPolicy &ap)
+    explicit OrderedHashTable(AllocPolicy &ap)
         : hashTable(nullptr), data(nullptr), dataLength(0), ranges(nullptr), alloc(ap) {}
 
     bool init() {
         MOZ_ASSERT(!hashTable, "init must be called at most once");
 
         uint32_t buckets = initialBuckets();
         Data **tableAlloc = static_cast<Data **>(alloc.malloc_(buckets * sizeof(Data *)));
         if (!tableAlloc)
@@ -326,17 +326,17 @@ class OrderedHashTable
          */
         Range **prevp;
         Range *next;
 
         /*
          * Create a Range over all the entries in ht.
          * (This is private on purpose. End users must use ht.all().)
          */
-        Range(OrderedHashTable &ht) : ht(ht), i(0), count(0), prevp(&ht.ranges), next(ht.ranges) {
+        explicit Range(OrderedHashTable &ht) : ht(ht), i(0), count(0), prevp(&ht.ranges), next(ht.ranges) {
             *prevp = this;
             if (next)
                 next->prevp = &next;
             seek();
         }
 
       public:
         Range(const Range &other)
@@ -712,17 +712,17 @@ class OrderedHashMap
     };
 
     typedef detail::OrderedHashTable<Entry, MapOps, AllocPolicy> Impl;
     Impl impl;
 
   public:
     typedef typename Impl::Range Range;
 
-    OrderedHashMap(AllocPolicy ap = AllocPolicy()) : impl(ap) {}
+    explicit OrderedHashMap(AllocPolicy ap = AllocPolicy()) : impl(ap) {}
     bool init()                                     { return impl.init(); }
     uint32_t count() const                          { return impl.count(); }
     bool has(const Key &key) const                  { return impl.has(key); }
     Range all()                                     { return impl.all(); }
     const Entry *get(const Key &key) const          { return impl.get(key); }
     Entry *get(const Key &key)                      { return impl.get(key); }
     bool put(const Key &key, const Value &value)    { return impl.put(Entry(key, value)); }
     bool remove(const Key &key, bool *foundp)       { return impl.remove(key, foundp); }
@@ -748,17 +748,17 @@ class OrderedHashSet
     };
 
     typedef detail::OrderedHashTable<T, SetOps, AllocPolicy> Impl;
     Impl impl;
 
   public:
     typedef typename Impl::Range Range;
 
-    OrderedHashSet(AllocPolicy ap = AllocPolicy()) : impl(ap) {}
+    explicit OrderedHashSet(AllocPolicy ap = AllocPolicy()) : impl(ap) {}
     bool init()                                     { return impl.init(); }
     uint32_t count() const                          { return impl.count(); }
     bool has(const T &value) const                  { return impl.has(value); }
     Range all()                                     { return impl.all(); }
     bool put(const T &value)                        { return impl.put(value); }
     bool remove(const T &value, bool *foundp)       { return impl.remove(value, foundp); }
     bool clear()                                    { return impl.clear(); }
 
--- a/js/src/builtin/TypedObject.cpp
+++ b/js/src/builtin/TypedObject.cpp
@@ -3149,17 +3149,17 @@ visitReferences(SizedTypeDescr &descr,
 ///////////////////////////////////////////////////////////////////////////
 // Initializing instances
 
 namespace js {
 class MemoryInitVisitor {
     const JSRuntime *rt_;
 
   public:
-    MemoryInitVisitor(const JSRuntime *rt)
+    explicit MemoryInitVisitor(const JSRuntime *rt)
       : rt_(rt)
     {}
 
     void visitReference(ReferenceTypeDescr &descr, uint8_t *mem);
 };
 } // namespace js
 
 void
@@ -3217,17 +3217,17 @@ SizedTypeDescr::initInstances(const JSRu
 // Tracing instances
 
 namespace js {
 class MemoryTracingVisitor {
     JSTracer *trace_;
 
   public:
 
-    MemoryTracingVisitor(JSTracer *trace)
+    explicit MemoryTracingVisitor(JSTracer *trace)
       : trace_(trace)
     {}
 
     void visitReference(ReferenceTypeDescr &descr, uint8_t *mem);
 };
 } // namespace js
 
 void
--- a/js/src/ctypes/CTypes.h
+++ b/js/src/ctypes/CTypes.h
@@ -296,17 +296,17 @@ struct ClosureInfo
   JS::Heap<JSObject*> typeObj;     // FunctionType describing the C function
   JS::Heap<JSObject*> thisObj;     // 'this' object to use for the JS function call
   JS::Heap<JSObject*> jsfnObj;     // JS function
   void* errResult;                 // Result that will be returned if the closure throws
   ffi_closure* closure;            // The C closure itself
 
   // Anything conditionally freed in the destructor should be initialized to
   // nullptr here.
-  ClosureInfo(JSRuntime* runtime)
+  explicit ClosureInfo(JSRuntime* runtime)
     : rt(runtime)
     , errResult(nullptr)
     , closure(nullptr)
   {}
 
   ~ClosureInfo() {
     if (closure)
       ffi_closure_free(closure);
--- a/js/src/ds/IdValuePair.h
+++ b/js/src/ds/IdValuePair.h
@@ -14,16 +14,16 @@
 namespace js {
 
 struct IdValuePair
 {
     jsid id;
     Value value;
 
     IdValuePair() {}
-    IdValuePair(jsid idArg)
+    explicit IdValuePair(jsid idArg)
       : id(idArg), value(UndefinedValue())
     {}
 };
 
 } /* namespace js */
 
 #endif /* ds_IdValuePair_h */
--- a/js/src/ds/InlineMap.h
+++ b/js/src/ds/InlineMap.h
@@ -152,17 +152,17 @@ class InlineMap
         bool            isInlinePtr;
         /* Indicates whether inlAddPtr is a found result or an add pointer. */
         bool            inlPtrFound;
 
         AddPtr(InlineElem *ptr, bool found)
           : inlAddPtr(ptr), isInlinePtr(true), inlPtrFound(found)
         {}
 
-        AddPtr(const WordMapAddPtr &p) : mapAddPtr(p), isInlinePtr(false) {}
+        explicit AddPtr(const WordMapAddPtr &p) : mapAddPtr(p), isInlinePtr(false) {}
 
         void operator==(const AddPtr &other);
 
         typedef AddPtr ******* ConvertibleToBool;
 
       public:
         AddPtr() {}
 
--- a/js/src/ds/LifoAlloc.h
+++ b/js/src/ds/LifoAlloc.h
@@ -418,17 +418,17 @@ class LifoAlloc
                 position_ = static_cast<char *>(chunk_->start());
             } else {
                 position_ = aligned;
             }
             JS_ASSERT(uintptr_t(position_) + size <= uintptr_t(chunk_->end()));
         }
 
       public:
-        Enum(LifoAlloc &alloc)
+        explicit Enum(LifoAlloc &alloc)
           : alloc_(&alloc),
             chunk_(alloc.first),
             position_(static_cast<char *>(alloc.first ? alloc.first->start() : nullptr))
         {}
 
         // Return true if there are no more bytes to enumerate.
         bool empty() {
             return !chunk_ || (chunk_ == alloc_->latest && position_ >= chunk_->mark());
@@ -508,17 +508,17 @@ enum Fallibility {
 };
 
 template <Fallibility fb>
 class LifoAllocPolicy
 {
     LifoAlloc &alloc_;
 
   public:
-    LifoAllocPolicy(LifoAlloc &alloc)
+    MOZ_IMPLICIT LifoAllocPolicy(LifoAlloc &alloc)
       : alloc_(alloc)
     {}
     void *malloc_(size_t bytes) {
         return fb == Fallible ? alloc_.alloc(bytes) : alloc_.allocInfallible(bytes);
     }
     void *calloc_(size_t bytes) {
         void *p = malloc_(bytes);
         if (fb == Fallible && !p)
--- a/js/src/ds/PriorityQueue.h
+++ b/js/src/ds/PriorityQueue.h
@@ -26,17 +26,17 @@ class PriorityQueue
 {
     Vector<T, MinInlineCapacity, AllocPolicy> heap;
 
     PriorityQueue(const PriorityQueue &) MOZ_DELETE;
     PriorityQueue &operator=(const PriorityQueue &) MOZ_DELETE;
 
   public:
 
-    PriorityQueue(AllocPolicy ap = AllocPolicy())
+    explicit PriorityQueue(AllocPolicy ap = AllocPolicy())
       : heap(ap)
     {}
 
     bool reserve(size_t capacity) {
         return heap.reserve(capacity);
     }
 
     size_t length() const {
--- a/js/src/ds/SplayTree.h
+++ b/js/src/ds/SplayTree.h
@@ -22,30 +22,30 @@ namespace js {
  */
 template <class T, class C>
 class SplayTree
 {
     struct Node {
         T item;
         Node *left, *right, *parent;
 
-        Node(const T &item)
+        explicit Node(const T &item)
           : item(item), left(nullptr), right(nullptr), parent(nullptr)
         {}
     };
 
     LifoAlloc *alloc;
     Node *root, *freeList;
 
     SplayTree(const SplayTree &) MOZ_DELETE;
     SplayTree &operator=(const SplayTree &) MOZ_DELETE;
 
   public:
 
-    SplayTree(LifoAlloc *alloc = nullptr)
+    explicit SplayTree(LifoAlloc *alloc = nullptr)
       : alloc(alloc), root(nullptr), freeList(nullptr)
     {}
 
     void setAllocator(LifoAlloc *alloc) {
         this->alloc = alloc;
     }
 
     bool empty() const {
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -55,17 +55,17 @@ struct frontend::StmtInfoBCE : public St
     StmtInfoBCE     *down;          /* info for enclosing statement */
     StmtInfoBCE     *downScope;     /* next enclosing lexical scope */
 
     ptrdiff_t       update;         /* loop update offset (top if none) */
     ptrdiff_t       breaks;         /* offset of last break in loop */
     ptrdiff_t       continues;      /* offset of last continue in loop */
     uint32_t        blockScopeIndex; /* index of scope in BlockScopeArray */
 
-    StmtInfoBCE(ExclusiveContext *cx) : StmtInfoBase(cx) {}
+    explicit StmtInfoBCE(ExclusiveContext *cx) : StmtInfoBase(cx) {}
 
     /*
      * To reuse space, alias two of the ptrdiff_t fields for use during
      * try/catch/finally code generation and backpatching.
      *
      * Only a loop, switch, or label statement info record can have breaks and
      * continues, and only a for loop has an update backpatch chain, so it's
      * safe to overlay these for the "trying" StmtTypes.
@@ -88,17 +88,17 @@ namespace {
 struct LoopStmtInfo : public StmtInfoBCE
 {
     int32_t         stackDepth;     // Stack depth when this loop was pushed.
     uint32_t        loopDepth;      // Loop depth.
 
     // Can we OSR into Ion from here?  True unless there is non-loop state on the stack.
     bool            canIonOsr;
 
-    LoopStmtInfo(ExclusiveContext *cx) : StmtInfoBCE(cx) {}
+    explicit LoopStmtInfo(ExclusiveContext *cx) : StmtInfoBCE(cx) {}
 
     static LoopStmtInfo* fromStmtInfo(StmtInfoBCE *stmt) {
         JS_ASSERT(stmt->isLoop());
         return static_cast<LoopStmtInfo*>(stmt);
     }
 };
 
 } // anonymous namespace
@@ -3926,17 +3926,17 @@ JS_STATIC_ASSERT(JSOP_NOP_LENGTH == 1);
 JS_STATIC_ASSERT(JSOP_POP_LENGTH == 1);
 
 namespace {
 
 class EmitLevelManager
 {
     BytecodeEmitter *bce;
   public:
-    EmitLevelManager(BytecodeEmitter *bce) : bce(bce) { bce->emitLevel++; }
+    explicit EmitLevelManager(BytecodeEmitter *bce) : bce(bce) { bce->emitLevel++; }
     ~EmitLevelManager() { bce->emitLevel--; }
 };
 
 } /* anonymous namespace */
 
 static bool
 EmitCatch(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
 {
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -26,17 +26,17 @@ class ObjectBox;
 class ParseNode;
 template <typename ParseHandler> class Parser;
 class SharedContext;
 class TokenStream;
 
 class CGConstList {
     Vector<Value> list;
   public:
-    CGConstList(ExclusiveContext *cx) : list(cx) {}
+    explicit CGConstList(ExclusiveContext *cx) : list(cx) {}
     bool append(Value v) { JS_ASSERT_IF(v.isString(), v.toString()->isAtom()); return list.append(v); }
     size_t length() const { return list.length(); }
     void finish(ConstArray *array);
 };
 
 struct CGObjectList {
     uint32_t            length;     /* number of emitted so far objects */
     ObjectBox           *lastbox;   /* last emitted object */
@@ -46,26 +46,26 @@ struct CGObjectList {
     unsigned add(ObjectBox *objbox);
     unsigned indexOf(JSObject *obj);
     void finish(ObjectArray *array);
     ObjectBox* find(uint32_t index);
 };
 
 struct CGTryNoteList {
     Vector<JSTryNote> list;
-    CGTryNoteList(ExclusiveContext *cx) : list(cx) {}
+    explicit CGTryNoteList(ExclusiveContext *cx) : list(cx) {}
 
     bool append(JSTryNoteKind kind, uint32_t stackDepth, size_t start, size_t end);
     size_t length() const { return list.length(); }
     void finish(TryNoteArray *array);
 };
 
 struct CGBlockScopeList {
     Vector<BlockScopeNote> list;
-    CGBlockScopeList(ExclusiveContext *cx) : list(cx) {}
+    explicit CGBlockScopeList(ExclusiveContext *cx) : list(cx) {}
 
     bool append(uint32_t scopeObject, uint32_t offset, uint32_t parent);
     uint32_t findEnclosingScope(uint32_t index);
     void recordEnd(uint32_t index, uint32_t offset);
     size_t length() const { return list.length(); }
     void finish(BlockScopeArray *array);
 };
 
--- a/js/src/frontend/ParseNode.h
+++ b/js/src/frontend/ParseNode.h
@@ -1130,17 +1130,17 @@ class ContinueStatement : public LoopCon
         JS_ASSERT_IF(match, node.isOp(JSOP_NOP));
         return match;
     }
 };
 
 class DebuggerStatement : public ParseNode
 {
   public:
-    DebuggerStatement(const TokenPos &pos)
+    explicit DebuggerStatement(const TokenPos &pos)
       : ParseNode(PNK_DEBUGGER, JSOP_NOP, PN_NULLARY, pos)
     { }
 };
 
 class ConditionalExpression : public ParseNode
 {
   public:
     ConditionalExpression(ParseNode *condition, ParseNode *thenExpr, ParseNode *elseExpr)
@@ -1173,23 +1173,23 @@ class ConditionalExpression : public Par
         JS_ASSERT_IF(match, node.isOp(JSOP_NOP));
         return match;
     }
 };
 
 class ThisLiteral : public ParseNode
 {
   public:
-    ThisLiteral(const TokenPos &pos) : ParseNode(PNK_THIS, JSOP_THIS, PN_NULLARY, pos) { }
+    explicit ThisLiteral(const TokenPos &pos) : ParseNode(PNK_THIS, JSOP_THIS, PN_NULLARY, pos) { }
 };
 
 class NullLiteral : public ParseNode
 {
   public:
-    NullLiteral(const TokenPos &pos) : ParseNode(PNK_NULL, JSOP_NULL, PN_NULLARY, pos) { }
+    explicit NullLiteral(const TokenPos &pos) : ParseNode(PNK_NULL, JSOP_NULL, PN_NULLARY, pos) { }
 };
 
 class BooleanLiteral : public ParseNode
 {
   public:
     BooleanLiteral(bool b, const TokenPos &pos)
       : ParseNode(b ? PNK_TRUE : PNK_FALSE, b ? JSOP_TRUE : JSOP_FALSE, PN_NULLARY, pos)
     { }
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -1197,29 +1197,29 @@ Parser<FullParseHandler>::makeDefIntoUse
  * simple variable declaration parsers.  In the destructuring case, the binder
  * function is called indirectly from the variable declaration parser by way
  * of CheckDestructuring and its friends.
  */
 
 template <typename ParseHandler>
 struct BindData
 {
-    BindData(ExclusiveContext *cx) : let(cx) {}
+    explicit BindData(ExclusiveContext *cx) : let(cx) {}
 
     typedef bool
     (*Binder)(BindData *data, HandlePropertyName name, Parser<ParseHandler> *parser);
 
     /* name node for definition processing and error source coordinates */
     typename ParseHandler::Node pn;
 
     JSOp            op;         /* prolog bytecode or nop */
     Binder          binder;     /* binder, discriminates u */
 
     struct LetData {
-        LetData(ExclusiveContext *cx) : blockObj(cx) {}
+        explicit LetData(ExclusiveContext *cx) : blockObj(cx) {}
         VarContext varContext;
         RootedStaticBlockObject blockObj;
         unsigned   overflow;
     } let;
 
     void initLet(VarContext varContext, StaticBlockObject &blockObj, unsigned overflow) {
         this->pn = ParseHandler::null();
         this->op = JSOP_NOP;
@@ -3222,17 +3222,17 @@ Parser<ParseHandler>::pushLexicalScope(S
 
     return pushLexicalScope(blockObj, stmt);
 }
 
 struct AddLetDecl
 {
     uint32_t blockid;
 
-    AddLetDecl(uint32_t blockid) : blockid(blockid) {}
+    explicit AddLetDecl(uint32_t blockid) : blockid(blockid) {}
 
     bool operator()(TokenStream &ts, ParseContext<FullParseHandler> *pc,
                     HandleStaticBlockObject blockObj, const Shape &shape, JSAtom *)
     {
         ParseNode *def = (ParseNode *) blockObj->getSlot(shape.slot()).toPrivate();
         def->pn_blockid = blockid;
         RootedPropertyName name(ts.context(), def->name());
         return pc->define(ts, name, def, Definition::LET);
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -25,17 +25,17 @@ namespace frontend {
 
 struct StmtInfoPC : public StmtInfoBase {
     StmtInfoPC      *down;          /* info for enclosing statement */
     StmtInfoPC      *downScope;     /* next enclosing lexical scope */
 
     uint32_t        blockid;        /* for simplified dominance computation */
     uint32_t        innerBlockScopeDepth; /* maximum depth of nested block scopes, in slots */
 
-    StmtInfoPC(ExclusiveContext *cx) : StmtInfoBase(cx), innerBlockScopeDepth(0) {}
+    explicit StmtInfoPC(ExclusiveContext *cx) : StmtInfoBase(cx), innerBlockScopeDepth(0) {}
 };
 
 typedef HashSet<JSAtom *> FuncStmtSet;
 class SharedContext;
 
 typedef Vector<Definition *, 16> DeclVector;
 
 struct GenericParseContext
--- a/js/src/frontend/SharedContext.h
+++ b/js/src/frontend/SharedContext.h
@@ -405,17 +405,17 @@ struct StmtInfoBase {
 
     // Block label.
     RootedAtom      label;
 
     // Compile-time scope chain node for this scope.  Only set if
     // isNestedScope.
     Rooted<NestedScopeObject *> staticScope;
 
-    StmtInfoBase(ExclusiveContext *cx)
+    explicit StmtInfoBase(ExclusiveContext *cx)
         : isBlockScope(false), isNestedScope(false), isForLetBlock(false),
           label(cx), staticScope(cx)
     {}
 
     bool maybeScope() const {
         return STMT_BLOCK <= type && type <= STMT_SUBROUTINE && type != STMT_WITH;
     }
 
--- a/js/src/frontend/TokenStream.h
+++ b/js/src/frontend/TokenStream.h
@@ -592,17 +592,17 @@ class MOZ_STACK_CLASS TokenStream
       public:
         // The Token fields may contain pointers to atoms, so for correct
         // rooting we must ensure collection of atoms is disabled while objects
         // of this class are live.  Do this by requiring a dummy AutoKeepAtoms
         // reference in the constructor.
         //
         // This class is explicity ignored by the analysis, so don't add any
         // more pointers to GC things here!
-        Position(AutoKeepAtoms&) { }
+        explicit Position(AutoKeepAtoms&) { }
       private:
         Position(const Position&) MOZ_DELETE;
         friend class TokenStream;
         const jschar *buf;
         Flags flags;
         unsigned lineno;
         const jschar *linebase;
         const jschar *prevLinebase;
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -407,17 +407,17 @@ class BarrieredBaseMixins {};
  * Base class for barriered pointer types.
  */
 template <class T>
 class BarrieredBase : public BarrieredBaseMixins<T>
 {
   protected:
     T value;
 
-    BarrieredBase(T v) : value(v) {}
+    explicit BarrieredBase(T v) : value(v) {}
     ~BarrieredBase() { pre(); }
 
   public:
     void init(T v) {
         JS_ASSERT(!GCMethods<T>::poisoned(v));
         this->value = v;
     }
 
@@ -463,17 +463,20 @@ class BarrieredBaseMixins<JS::Value> : p
  * should be used in all cases that do not require explicit low-level control
  * of moving behavior, e.g. for HashMap keys.
  */
 template <class T>
 class PreBarriered : public BarrieredBase<T>
 {
   public:
     PreBarriered() : BarrieredBase<T>(GCMethods<T>::initial()) {}
-    PreBarriered(T v) : BarrieredBase<T>(v) {}
+    /*
+     * Allow implicit construction for use in generic contexts, such as DebuggerWeakMap::markKeys.
+     */
+    MOZ_IMPLICIT PreBarriered(T v) : BarrieredBase<T>(v) {}
     explicit PreBarriered(const PreBarriered<T> &v)
       : BarrieredBase<T>(v.value) {}
 
     /* Use to set the pointer to nullptr. */
     void clear() {
         this->pre();
         this->value = nullptr;
     }
@@ -730,18 +733,18 @@ struct DefaultHasher< PreBarriered<T> > 
  */
 template <class T>
 class ReadBarriered
 {
     T value;
 
   public:
     ReadBarriered() : value(nullptr) {}
-    ReadBarriered(T value) : value(value) {}
-    ReadBarriered(const Rooted<T> &rooted) : value(rooted) {}
+    explicit ReadBarriered(T value) : value(value) {}
+    explicit ReadBarriered(const Rooted<T> &rooted) : value(rooted) {}
 
     T get() const {
         if (!InternalGCMethods<T>::isMarkable(value))
             return GCMethods<T>::initial();
         InternalGCMethods<T>::readBarrier(value);
         return value;
     }
 
@@ -909,17 +912,17 @@ HeapValueify(Value *v)
     return (HeapValue *)v;
 }
 
 class HeapSlotArray
 {
     HeapSlot *array;
 
   public:
-    HeapSlotArray(HeapSlot *array) : array(array) {}
+    explicit HeapSlotArray(HeapSlot *array) : array(array) {}
 
     operator const Value *() const { return Valueify(array); }
     operator HeapSlot *() const { return array; }
 
     HeapSlotArray operator +(int offset) const { return HeapSlotArray(array + offset); }
     HeapSlotArray operator +(uint32_t offset) const { return HeapSlotArray(array + offset); }
 };
 
--- a/js/src/gc/FindSCCs.h
+++ b/js/src/gc/FindSCCs.h
@@ -59,17 +59,17 @@ struct GraphNodeBase
  *
  * ComponentFinder<MyGraphNode> finder;
  * finder.addNode(v);
  */
 template<class Node>
 class ComponentFinder
 {
   public:
-    ComponentFinder(uintptr_t sl)
+    explicit ComponentFinder(uintptr_t sl)
       : clock(1),
         stack(nullptr),
         firstComponent(nullptr),
         cur(nullptr),
         stackLimit(sl),
         stackFull(false)
     {}
 
--- a/js/src/gc/GCInternals.h
+++ b/js/src/gc/GCInternals.h
@@ -26,27 +26,27 @@ class AutoCopyFreeListToArenas
 
   public:
     AutoCopyFreeListToArenas(JSRuntime *rt, ZoneSelector selector);
     ~AutoCopyFreeListToArenas();
 };
 
 struct AutoFinishGC
 {
-    AutoFinishGC(JSRuntime *rt);
+    explicit AutoFinishGC(JSRuntime *rt);
 };
 
 /*
  * This class should be used by any code that needs to exclusive access to the
  * heap in order to trace through it...
  */
 class AutoTraceSession
 {
   public:
-    AutoTraceSession(JSRuntime *rt, HeapState state = Tracing);
+    explicit AutoTraceSession(JSRuntime *rt, HeapState state = Tracing);
     ~AutoTraceSession();
 
   protected:
     AutoLockForExclusiveAccess lock;
     JSRuntime *runtime;
 
   private:
     AutoTraceSession(const AutoTraceSession&) MOZ_DELETE;
@@ -63,17 +63,17 @@ struct AutoPrepareForTracing
 
     AutoPrepareForTracing(JSRuntime *rt, ZoneSelector selector);
 };
 
 class IncrementalSafety
 {
     const char *reason_;
 
-    IncrementalSafety(const char *reason) : reason_(reason) {}
+    explicit IncrementalSafety(const char *reason) : reason_(reason) {}
 
   public:
     static IncrementalSafety Safe() { return IncrementalSafety(nullptr); }
     static IncrementalSafety Unsafe(const char *reason) { return IncrementalSafety(reason); }
 
     typedef void (IncrementalSafety::* ConvertibleToBool)();
     void nonNull() {}
 
--- a/js/src/gc/GCRuntime.h
+++ b/js/src/gc/GCRuntime.h
@@ -99,17 +99,17 @@ struct Callback {
 };
 
 template<typename F>
 class CallbackVector : public Vector<Callback<F>, 4, SystemAllocPolicy> {};
 
 class GCRuntime
 {
   public:
-    GCRuntime(JSRuntime *rt);
+    explicit GCRuntime(JSRuntime *rt);
     bool init(uint32_t maxbytes);
     void finish();
 
     void setGCZeal(uint8_t zeal, uint32_t frequency);
     template <typename T> bool addRoot(T *rp, const char *name, JSGCRootType rootType);
     void removeRoot(void *rp);
     void setMarkStackLimit(size_t limit);
 
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -1689,17 +1689,17 @@ static void
 UnmarkGrayChildren(JSTracer *trc, void **thingp, JSGCTraceKind kind);
 
 struct UnmarkGrayTracer : public JSTracer
 {
     /*
      * We set eagerlyTraceWeakMaps to false because the cycle collector will fix
      * up any color mismatches involving weakmaps when it runs.
      */
-    UnmarkGrayTracer(JSRuntime *rt)
+    explicit UnmarkGrayTracer(JSRuntime *rt)
       : JSTracer(rt, UnmarkGrayChildren, DoNotTraceWeakMaps),
         tracingShape(false),
         previousShape(nullptr),
         unmarkedAny(false)
     {}
 
     UnmarkGrayTracer(JSTracer *trc, bool tracingShape)
       : JSTracer(trc->runtime(), UnmarkGrayChildren, DoNotTraceWeakMaps),
--- a/js/src/gc/Statistics.cpp
+++ b/js/src/gc/Statistics.cpp
@@ -40,17 +40,17 @@ class gcstats::StatisticsSerializer
     static const int MaxFieldValueLength = 128;
 
   public:
     enum Mode {
         AsJSON = true,
         AsText = false
     };
 
-    StatisticsSerializer(Mode asJSON)
+    explicit StatisticsSerializer(Mode asJSON)
       : buf_(), asJSON_(asJSON), needComma_(false), oom_(false)
     {}
 
     bool isJSON() { return asJSON_; }
 
     bool isOOM() { return oom_; }
 
     void endLine() {
--- a/js/src/gc/Statistics.h
+++ b/js/src/gc/Statistics.h
@@ -70,17 +70,17 @@ enum Stat {
     STAT_MINOR_GC,
 
     STAT_LIMIT
 };
 
 class StatisticsSerializer;
 
 struct Statistics {
-    Statistics(JSRuntime *rt);
+    explicit Statistics(JSRuntime *rt);
     ~Statistics();
 
     void beginPhase(Phase phase);
     void endPhase(Phase phase);
 
     void beginSlice(int collectedCount, int zoneCount, int compartmentCount, JS::gcreason::Reason reason);
     void endSlice();
 
--- a/js/src/gc/Tracer.h
+++ b/js/src/gc/Tracer.h
@@ -49,17 +49,17 @@ class MarkStack
     uintptr_t *tos_;
     uintptr_t *end_;
 
     // The capacity we start with and reset() to.
     size_t baseCapacity_;
     size_t maxCapacity_;
 
   public:
-    MarkStack(size_t maxCapacity)
+    explicit MarkStack(size_t maxCapacity)
       : stack_(nullptr),
         tos_(nullptr),
         end_(nullptr),
         baseCapacity_(0),
         maxCapacity_(maxCapacity)
     {}
 
     ~MarkStack() {
--- a/js/src/gc/Zone.h
+++ b/js/src/gc/Zone.h
@@ -88,17 +88,17 @@ namespace JS {
 // We always guarantee that a zone has at least one live compartment by refusing
 // to delete the last compartment in a live zone. (This could happen, for
 // example, if the conservative scanner marks a string in an otherwise dead
 // zone.)
 struct Zone : public JS::shadow::Zone,
               public js::gc::GraphNodeBase<JS::Zone>,
               public js::MallocProvider<JS::Zone>
 {
-    Zone(JSRuntime *rt);
+    explicit Zone(JSRuntime *rt);
     ~Zone();
     bool init();
 
     void findOutgoingEdges(js::gc::ComponentFinder<JS::Zone> &finder);
 
     void discardJitCode(js::FreeOp *fop);
 
     void addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf,
--- a/js/src/gdb/tests/test-Root.cpp
+++ b/js/src/gdb/tests/test-Root.cpp
@@ -24,17 +24,17 @@ void callee(JS::Handle<JSObject *> obj, 
 FRAGMENT(Root, handle) {
   JS::Rooted<JSObject *> global(cx, JS::CurrentGlobalOrNull(cx));
   callee(global, &global);
   (void) global;
 }
 
 FRAGMENT(Root, HeapSlot) {
   JS::Rooted<jsval> plinth(cx, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, "plinth")));
-  JS::Rooted<JSObject *> array(cx, JS_NewArrayObject(cx, plinth));
+  JS::Rooted<JSObject *> array(cx, JS_NewArrayObject(cx, JS::HandleValueArray(plinth)));
 
   breakpoint();
 
   (void) plinth;
   (void) array;
 }
 
 FRAGMENT(Root, barriers) {
--- a/js/src/irregexp/RegExpInterpreter.cpp
+++ b/js/src/irregexp/RegExpInterpreter.cpp
@@ -38,17 +38,17 @@ using namespace js;
 using namespace js::irregexp;
 
 static const size_t kBitsPerByte = 8;
 static const size_t kBitsPerByteLog2 = 3;
 
 class MOZ_STACK_CLASS RegExpStackCursor
 {
   public:
-    RegExpStackCursor(JSContext *cx)
+    explicit RegExpStackCursor(JSContext *cx)
       : cx(cx), cursor(base())
     {}
 
     bool push(int32_t value) {
         *cursor++ = value;
         if (cursor >= stack().limit()) {
             int32_t pos = position();
             if (!stack().grow()) {
--- a/js/src/jit/AliasAnalysis.cpp
+++ b/js/src/jit/AliasAnalysis.cpp
@@ -59,17 +59,17 @@ namespace {
 // Iterates over the flags in an AliasSet.
 class AliasSetIterator
 {
   private:
     uint32_t flags;
     unsigned pos;
 
   public:
-    AliasSetIterator(AliasSet set)
+    explicit AliasSetIterator(AliasSet set)
       : flags(set.flags()), pos(0)
     {
         while (flags && (flags & 1) == 0) {
             flags >>= 1;
             pos++;
         }
     }
     AliasSetIterator& operator ++(int) {
--- a/js/src/jit/AsmJS.cpp
+++ b/js/src/jit/AsmJS.cpp
@@ -382,17 +382,17 @@ class Type
         Void
     };
 
   private:
     Which which_;
 
   public:
     Type() : which_(Which(-1)) {}
-    Type(Which w) : which_(w) {}
+    MOZ_IMPLICIT Type(Which w) : which_(w) {}
 
     bool operator==(Type rhs) const { return which_ == rhs.which_; }
     bool operator!=(Type rhs) const { return which_ != rhs.which_; }
 
     bool isSigned() const {
         return which_ == Signed || which_ == Fixnum;
     }
 
@@ -493,18 +493,18 @@ class RetType
         Float = Type::Float
     };
 
   private:
     Which which_;
 
   public:
     RetType() : which_(Which(-1)) {}
-    RetType(Which w) : which_(w) {}
-    RetType(AsmJSCoercion coercion) {
+    MOZ_IMPLICIT RetType(Which w) : which_(w) {}
+    MOZ_IMPLICIT RetType(AsmJSCoercion coercion) {
         switch (coercion) {
           case AsmJS_ToInt32: which_ = Signed; break;
           case AsmJS_ToNumber: which_ = Double; break;
           case AsmJS_FRound: which_ = Float; break;
         }
     }
     Which which() const {
         return which_;
@@ -567,19 +567,19 @@ class VarType
     };
 
   private:
     Which which_;
 
   public:
     VarType()
       : which_(Which(-1)) {}
-    VarType(Which w)
+    MOZ_IMPLICIT VarType(Which w)
       : which_(w) {}
-    VarType(AsmJSCoercion coercion) {
+    MOZ_IMPLICIT VarType(AsmJSCoercion coercion) {
         switch (coercion) {
           case AsmJS_ToInt32: which_ = Int; break;
           case AsmJS_ToNumber: which_ = Double; break;
           case AsmJS_FRound: which_ = Float; break;
         }
     }
     Which which() const {
         return which_;
@@ -642,17 +642,17 @@ class ABIArgIter
 {
     ABIArgGenerator gen_;
     const VecT &types_;
     unsigned i_;
 
     void settle() { if (!done()) gen_.next(ToMIRType(types_[i_])); }
 
   public:
-    ABIArgIter(const VecT &types) : types_(types), i_(0) { settle(); }
+    explicit ABIArgIter(const VecT &types) : types_(types), i_(0) { settle(); }
     void operator++(int) { JS_ASSERT(!done()); i_++; settle(); }
     bool done() const { return i_ == types_.length(); }
 
     ABIArg *operator->() { JS_ASSERT(!done()); return &gen_.current(); }
     ABIArg &operator*() { JS_ASSERT(!done()); return gen_.current(); }
 
     unsigned index() const { JS_ASSERT(!done()); return i_; }
     MIRType mirType() const { JS_ASSERT(!done()); return ToMIRType(types_[i_]); }
@@ -666,17 +666,17 @@ typedef js::Vector<VarType, 8, LifoAlloc
 typedef ABIArgIter<VarTypeVector> ABIArgTypeIter;
 
 class Signature
 {
     VarTypeVector argTypes_;
     RetType retType_;
 
   public:
-    Signature(LifoAlloc &alloc)
+    explicit Signature(LifoAlloc &alloc)
       : argTypes_(alloc) {}
     Signature(LifoAlloc &alloc, RetType retType)
       : argTypes_(alloc), retType_(retType) {}
     Signature(VarTypeVector &&argTypes, RetType retType)
       : argTypes_(Move(argTypes)), retType_(Move(retType)) {}
     Signature(Signature &&rhs)
       : argTypes_(Move(rhs.argTypes_)), retType_(Move(rhs.retType_)) {}
 
@@ -876,17 +876,17 @@ class MOZ_STACK_CLASS ModuleCompiler
             uint32_t ffiIndex_;
             ArrayBufferView::ViewType viewType_;
             AsmJSMathBuiltinFunction mathBuiltinFunc_;
         } u;
 
         friend class ModuleCompiler;
         friend class js::LifoAlloc;
 
-        Global(Which which) : which_(which) {}
+        explicit Global(Which which) : which_(which) {}
 
       public:
         Which which() const {
             return which_;
         }
         VarType varOrConstType() const {
             JS_ASSERT(which_ == Variable || which_ == ConstantLiteral || which_ == ConstantImport);
             return VarType(u.varOrConst.type_);
@@ -993,20 +993,20 @@ class MOZ_STACK_CLASS ModuleCompiler
         Kind kind;
 
         union {
             double cst;
             AsmJSMathBuiltinFunction func;
         } u;
 
         MathBuiltin() : kind(Kind(-1)) {}
-        MathBuiltin(double cst) : kind(Constant) {
+        explicit MathBuiltin(double cst) : kind(Constant) {
             u.cst = cst;
         }
-        MathBuiltin(AsmJSMathBuiltinFunction func) : kind(Function) {
+        explicit MathBuiltin(AsmJSMathBuiltinFunction func) : kind(Function) {
             u.func = func;
         }
     };
 
   private:
     struct SlowFunction
     {
         PropertyName *name;
@@ -1615,17 +1615,17 @@ class MOZ_STACK_CLASS ModuleCompiler
             masm_.patchAsmJSGlobalAccess(a.patchAt, code, module_->globalData(), a.globalDataOffset);
         }
 #endif
 
         // Absolute links
         for (size_t i = 0; i < masm_.numAsmJSAbsoluteLinks(); i++) {
             AsmJSAbsoluteLink src = masm_.asmJSAbsoluteLink(i);
             AsmJSModule::AbsoluteLink link;
-            link.patchAt = masm_.actualOffset(src.patchAt.offset());
+            link.patchAt = CodeOffsetLabel(masm_.actualOffset(src.patchAt.offset()));
             link.target = src.target;
             if (!module_->addAbsoluteLink(link))
                 return false;
         }
 
         *module = module_.forget();
         return true;
     }
@@ -2020,17 +2020,17 @@ class FunctionCompiler
         const JitCompileOptions options;
         mirGen_ = lifo_.new_<MIRGenerator>(CompileCompartment::get(cx()->compartment()),
                                            options, alloc_,
                                            graph_, info_, optimizationInfo);
 
         if (!newBlock(/* pred = */ nullptr, &curBlock_, fn_))
             return false;
 
-        for (ABIArgTypeIter i = argTypes; !i.done(); i++) {
+        for (ABIArgTypeIter i(argTypes); !i.done(); i++) {
             MAsmJSParameter *ins = MAsmJSParameter::New(alloc(), *i, i.mirType());
             curBlock_->add(ins);
             curBlock_->initSlot(info().localSlot(i.index()), ins);
             if (!mirGen_->ensureBallast())
                 return false;
         }
         unsigned firstLocalSlot = argTypes.length();
         for (unsigned i = 0; i < varInitializers_.length(); i++) {
@@ -5611,17 +5611,17 @@ ParallelCompilationEnabled(ExclusiveCont
 
 // State of compilation as tracked and updated by the main thread.
 struct ParallelGroupState
 {
     js::Vector<AsmJSParallelTask> &tasks;
     int32_t outstandingJobs; // Good work, jobs!
     uint32_t compiledJobs;
 
-    ParallelGroupState(js::Vector<AsmJSParallelTask> &tasks)
+    explicit ParallelGroupState(js::Vector<AsmJSParallelTask> &tasks)
       : tasks(tasks), outstandingJobs(0), compiledJobs(0)
     { }
 };
 
 // Block until a worker-assigned LifoAlloc becomes finished.
 static AsmJSParallelTask *
 GetFinishedCompilation(ModuleCompiler &m, ParallelGroupState &group)
 {
@@ -5987,17 +5987,17 @@ static const RegisterSet NonVolatileRegs
 static const RegisterSet NonVolatileRegs =
     RegisterSet(GeneralRegisterSet(Registers::NonVolatileMask),
                 FloatRegisterSet(FloatRegisters::NonVolatileMask));
 #endif
 
 static void
 LoadAsmJSActivationIntoRegister(MacroAssembler &masm, Register reg)
 {
-    masm.movePtr(AsmJSImm_Runtime, reg);
+    masm.movePtr(AsmJSImmPtr(AsmJSImm_Runtime), reg);
     size_t offset = offsetof(JSRuntime, mainThread) +
                     PerThreadData::offsetOfAsmJSActivationStackReadOnly();
     masm.loadPtr(Address(reg, offset), reg);
 }
 
 static void
 LoadJSContextFromActivation(MacroAssembler &masm, Register activation, Register dest)
 {
@@ -6383,26 +6383,26 @@ GenerateFFIInterpreterExit(ModuleCompile
     }
     i++;
     JS_ASSERT(i.done());
 
     // Make the call, test whether it succeeded, and extract the return value.
     AssertStackAlignment(masm);
     switch (exit.sig().retType().which()) {
       case RetType::Void:
-        masm.callExit(AsmJSImm_InvokeFromAsmJS_Ignore, i.stackBytesConsumedSoFar());
+        masm.callExit(AsmJSImmPtr(AsmJSImm_InvokeFromAsmJS_Ignore), i.stackBytesConsumedSoFar());
         masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
         break;
       case RetType::Signed:
-        masm.callExit(AsmJSImm_InvokeFromAsmJS_ToInt32, i.stackBytesConsumedSoFar());
+        masm.callExit(AsmJSImmPtr(AsmJSImm_InvokeFromAsmJS_ToInt32), i.stackBytesConsumedSoFar());
         masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
         masm.unboxInt32(argv, ReturnReg);
         break;
       case RetType::Double:
-        masm.callExit(AsmJSImm_InvokeFromAsmJS_ToNumber, i.stackBytesConsumedSoFar());
+        masm.callExit(AsmJSImmPtr(AsmJSImm_InvokeFromAsmJS_ToNumber), i.stackBytesConsumedSoFar());
         masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
         masm.loadDouble(argv, ReturnFloatReg);
         break;
       case RetType::Float:
         MOZ_ASSUME_UNREACHABLE("Float32 shouldn't be returned from a FFI");
         break;
     }
 
@@ -6458,22 +6458,22 @@ GenerateOOLConvert(ModuleCompiler &m, Re
     }
     i++;
     JS_ASSERT(i.done());
 
     // Call
     AssertStackAlignment(masm);
     switch (retType.which()) {
       case RetType::Signed:
-        masm.callExit(AsmJSImm_CoerceInPlace_ToInt32, i.stackBytesConsumedSoFar());
+        masm.callExit(AsmJSImmPtr(AsmJSImm_CoerceInPlace_ToInt32), i.stackBytesConsumedSoFar());
         masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
         masm.unboxInt32(Address(StackPointer, offsetToArgv), ReturnReg);
         break;
       case RetType::Double:
-        masm.callExit(AsmJSImm_CoerceInPlace_ToNumber, i.stackBytesConsumedSoFar());
+        masm.callExit(AsmJSImmPtr(AsmJSImm_CoerceInPlace_ToNumber), i.stackBytesConsumedSoFar());
         masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
         masm.loadDouble(Address(StackPointer, offsetToArgv), ReturnFloatReg);
         break;
       default:
         MOZ_ASSUME_UNREACHABLE("Unsupported convert type");
     }
 }
 
@@ -6532,20 +6532,20 @@ GenerateFFIIonExit(ModuleCompiler &m, co
     // 2. Callee
     Register callee = ABIArgGenerator::NonArgReturnVolatileReg0;
     Register scratch = ABIArgGenerator::NonArgReturnVolatileReg1;
 
     // 2.1. Get ExitDatum
     unsigned globalDataOffset = m.module().exitIndexToGlobalDataOffset(exitIndex);
 #if defined(JS_CODEGEN_X64)
     CodeOffsetLabel label2 = masm.leaRipRelative(callee);
-    m.masm().append(AsmJSGlobalAccess(label2.offset(), globalDataOffset));
+    m.masm().append(AsmJSGlobalAccess(CodeOffsetLabel(label2.offset()), globalDataOffset));
 #elif defined(JS_CODEGEN_X86)
     CodeOffsetLabel label2 = masm.movlWithPatch(Imm32(0), callee);
-    m.masm().append(AsmJSGlobalAccess(label2.offset(), globalDataOffset));
+    m.masm().append(AsmJSGlobalAccess(CodeOffsetLabel(label2.offset()), globalDataOffset));
 #else
     masm.lea(Operand(GlobalReg, globalDataOffset), callee);
 #endif
 
     // 2.2. Get callee
     masm.loadPtr(Address(callee, offsetof(AsmJSModule::ExitDatum, fun)), callee);
 
     // 2.3. Save callee
@@ -6766,17 +6766,17 @@ GenerateStackOverflowExit(ModuleCompiler
         LoadJSContextFromActivation(masm, activation, activation);
         masm.storePtr(activation, Address(StackPointer, i->offsetFromArgBase()));
     }
     i++;
 
     JS_ASSERT(i.done());
 
     AssertStackAlignment(masm);
-    masm.callExit(AsmJSImm_ReportOverRecursed, i.stackBytesConsumedSoFar());
+    masm.callExit(AsmJSImmPtr(AsmJSImm_ReportOverRecursed), i.stackBytesConsumedSoFar());
 
     // Don't worry about restoring the stack; throwLabel will pop everything.
     masm.jump(throwLabel);
     return !masm.oom();
 }
 
 // The operation-callback exit is called from arbitrarily-interrupted asm.js
 // code. That means we must first save *all* registers and restore *all*
@@ -6824,17 +6824,17 @@ GenerateInterruptExit(ModuleCompiler &m,
     // argument 0: cx
 #if defined(JS_CODEGEN_X86)
     LoadJSContextFromActivation(masm, activation, scratch);
     masm.storePtr(scratch, Address(StackPointer, 0));
 #elif defined(JS_CODEGEN_X64)
     LoadJSContextFromActivation(masm, activation, IntArgReg0);
 #endif
 
-    masm.call(AsmJSImm_HandleExecutionInterrupt);
+    masm.call(AsmJSImmPtr(AsmJSImm_HandleExecutionInterrupt));
     masm.branchIfFalseBool(ReturnReg, throwLabel);
 
     // Restore the StackPointer to it's position before the call.
     masm.mov(ABIArgGenerator::NonVolatileReg, StackPointer);
 
     // Restore the machine state to before the interrupt.
     masm.PopRegsInMask(AllRegsExceptSP); // restore all GP/FP registers (except SP)
     masm.popFlags();              // after this, nothing that sets conditions
--- a/js/src/jit/AsmJSLink.cpp
+++ b/js/src/jit/AsmJSLink.cpp
@@ -62,17 +62,17 @@ AsmJSFrameIterator::AsmJSFrameIterator(c
 #endif
 
     settle();
 }
 
 struct GetCallSite
 {
     const AsmJSModule &module;
-    GetCallSite(const AsmJSModule &module) : module(module) {}
+    explicit GetCallSite(const AsmJSModule &module) : module(module) {}
     uint32_t operator[](size_t index) const {
         return module.callSite(index).returnAddressOffset();
     }
 };
 
 void
 AsmJSFrameIterator::popFrame()
 {
--- a/js/src/jit/AsmJSLink.h
+++ b/js/src/jit/AsmJSLink.h
@@ -24,17 +24,17 @@ class AsmJSFrameIterator
     const jit::CallSite *callsite_;
     uint8_t *sp_;
     uint8_t *returnAddress_;
 
     void popFrame();
     void settle();
 
   public:
-    AsmJSFrameIterator(const AsmJSActivation *activation);
+    explicit AsmJSFrameIterator(const AsmJSActivation *activation);
     void operator++() { popFrame(); settle(); }
     bool done() const { return !callsite_; }
     JSAtom *functionDisplayAtom() const;
     unsigned computeLine(uint32_t *column) const;
 };
 
 #ifdef JS_ION
 
--- a/js/src/jit/AsmJSModule.cpp
+++ b/js/src/jit/AsmJSModule.cpp
@@ -272,17 +272,17 @@ AddressOf(AsmJSImmKind kind, ExclusiveCo
 void
 AsmJSModule::restoreToInitialState(ArrayBufferObject *maybePrevBuffer, ExclusiveContext *cx)
 {
 #ifdef DEBUG
     // Put the absolute links back to -1 so patchDataWithValueCheck assertions
     // in staticallyLink are valid.
     for (size_t i = 0; i < staticLinkData_.absoluteLinks.length(); i++) {
         AbsoluteLink link = staticLinkData_.absoluteLinks[i];
-        Assembler::patchDataWithValueCheck(code_ + link.patchAt.offset(),
+        Assembler::patchDataWithValueCheck(CodeLocationLabel(code_ + link.patchAt.offset()),
                                            PatchedImmPtr((void*)-1),
                                            PatchedImmPtr(AddressOf(link.target, cx)));
     }
 #endif
 
     if (maybePrevBuffer) {
 #if defined(JS_CODEGEN_X86)
         // Subtract out the base-pointer added by AsmJSModule::initHeap.
@@ -313,17 +313,17 @@ AsmJSModule::staticallyLink(ExclusiveCon
 
     for (size_t i = 0; i < staticLinkData_.relativeLinks.length(); i++) {
         RelativeLink link = staticLinkData_.relativeLinks[i];
         *(void **)(code_ + link.patchAtOffset) = code_ + link.targetOffset;
     }
 
     for (size_t i = 0; i < staticLinkData_.absoluteLinks.length(); i++) {
         AbsoluteLink link = staticLinkData_.absoluteLinks[i];
-        Assembler::patchDataWithValueCheck(code_ + link.patchAt.offset(),
+        Assembler::patchDataWithValueCheck(CodeLocationLabel(code_ + link.patchAt.offset()),
                                            PatchedImmPtr(AddressOf(link.target, cx)),
                                            PatchedImmPtr((void*)-1));
     }
 
     // Initialize global data segment
 
     for (size_t i = 0; i < exits_.length(); i++) {
         exitIndexToGlobalDatum(i).exit = interpExitTrampoline(exits_[i]);
@@ -1074,17 +1074,17 @@ class MachineId
 
 struct PropertyNameWrapper
 {
     PropertyName *name;
 
     PropertyNameWrapper()
       : name(nullptr)
     {}
-    PropertyNameWrapper(PropertyName *name)
+    explicit PropertyNameWrapper(PropertyName *name)
       : name(name)
     {}
     size_t serializedSize() const {
         return SerializedNameSize(name);
     }
     uint8_t *serialize(uint8_t *cursor) const {
         return SerializeName(cursor, name);
     }
@@ -1300,17 +1300,17 @@ js::StoreAsmJSModuleInCache(AsmJSParser 
 
 struct ScopedCacheEntryOpenedForRead
 {
     ExclusiveContext *cx;
     size_t serializedSize;
     const uint8_t *memory;
     intptr_t handle;
 
-    ScopedCacheEntryOpenedForRead(ExclusiveContext *cx)
+    explicit ScopedCacheEntryOpenedForRead(ExclusiveContext *cx)
       : cx(cx), serializedSize(0), memory(nullptr), handle(0)
     {}
 
     ~ScopedCacheEntryOpenedForRead() {
         if (memory)
             cx->asmJSCacheOps().closeEntryForRead(serializedSize, memory, handle);
     }
 };
--- a/js/src/jit/AsmJSModule.h
+++ b/js/src/jit/AsmJSModule.h
@@ -294,17 +294,17 @@ class AsmJSModule
         bool clone(ExclusiveContext *cx, ExportedFunction *out) const;
     };
 
     class Name
     {
         PropertyName *name_;
       public:
         Name() : name_(nullptr) {}
-        Name(PropertyName *name) : name_(name) {}
+        MOZ_IMPLICIT Name(PropertyName *name) : name_(name) {}
         PropertyName *name() const { return name_; }
         PropertyName *&name() { return name_; }
         size_t serializedSize() const;
         uint8_t *serialize(uint8_t *cursor) const;
         const uint8_t *deserialize(ExclusiveContext *cx, const uint8_t *cursor);
         bool clone(ExclusiveContext *cx, Name *out) const;
     };
 
--- a/js/src/jit/AsmJSSignalHandlers.cpp
+++ b/js/src/jit/AsmJSSignalHandlers.cpp
@@ -170,17 +170,17 @@ RuntimeForCurrentThread()
 // report dialog via Breakpad. To guard against this we watch for such
 // recursion and fall through to the next handler immediately rather than
 // trying to handle it.
 class AutoSetHandlingSignal
 {
     JSRuntime *rt;
 
   public:
-    AutoSetHandlingSignal(JSRuntime *rt)
+    explicit AutoSetHandlingSignal(JSRuntime *rt)
       : rt(rt)
     {
         JS_ASSERT(!rt->handlingSignal);
         rt->handlingSignal = true;
     }
 
     ~AutoSetHandlingSignal()
     {
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -345,17 +345,17 @@ BaselineCompiler::emitPrologue()
     masm.movePtr(ImmPtr(logger), loggerReg);
     masm.tracelogStart(loggerReg, TraceLogCreateTextId(logger, script));
     masm.tracelogStart(loggerReg, TraceLogger::Baseline);
     masm.Pop(loggerReg);
 #endif
 
     // Record the offset of the prologue, because Ion can bailout before
     // the scope chain is initialized.
-    prologueOffset_ = masm.currentOffset();
+    prologueOffset_ = CodeOffsetLabel(masm.currentOffset());
 
     // Initialize the scope chain before any operation that may
     // call into the VM and trigger a GC.
     if (!initScopeChain())
         return false;
 
     if (!emitStackCheck())
         return false;
@@ -375,17 +375,17 @@ BaselineCompiler::emitPrologue()
     return true;
 }
 
 bool
 BaselineCompiler::emitEpilogue()
 {
     // Record the offset of the epilogue, so we can do early return from
     // Debugger handlers during on-stack recompile.
-    epilogueOffset_ = masm.currentOffset();
+    epilogueOffset_ = CodeOffsetLabel(masm.currentOffset());
 
     masm.bind(&return_);
 
 #ifdef JS_TRACE_LOGGING
     TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
     Register loggerReg = RegisterSet::Volatile().takeGeneral();
     masm.Push(loggerReg);
     masm.movePtr(ImmPtr(logger), loggerReg);
@@ -449,17 +449,17 @@ bool
 BaselineCompiler::emitIC(ICStub *stub, ICEntry::Kind kind)
 {
     ICEntry *entry = allocateICEntry(stub, kind);
     if (!entry)
         return false;
 
     CodeOffsetLabel patchOffset;
     EmitCallIC(&patchOffset, masm);
-    entry->setReturnOffset(masm.currentOffset());
+    entry->setReturnOffset(CodeOffsetLabel(masm.currentOffset()));
     if (!addICLoadLabel(patchOffset))
         return false;
 
     return true;
 }
 
 typedef bool (*CheckOverRecursedWithExtraFn)(JSContext *, BaselineFrame *, uint32_t, uint32_t);
 static const VMFunction CheckOverRecursedWithExtraInfo =
@@ -545,17 +545,17 @@ BaselineCompiler::emitDebugPrologue()
         masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, &done);
         {
             masm.loadValue(frame.addressOfReturnValue(), JSReturnOperand);
             masm.jump(&return_);
         }
         masm.bind(&done);
     }
 
-    postDebugPrologueOffset_ = masm.currentOffset();
+    postDebugPrologueOffset_ = CodeOffsetLabel(masm.currentOffset());
 
     return true;
 }
 
 typedef bool (*StrictEvalPrologueFn)(JSContext *, BaselineFrame *);
 static const VMFunction StrictEvalPrologueInfo =
     FunctionInfo<StrictEvalPrologueFn>(jit::StrictEvalPrologue);
 
@@ -721,17 +721,17 @@ BaselineCompiler::emitDebugTrap()
 #ifdef DEBUG
     // Patchable call offset has to match the pc mapping offset.
     PCMappingEntry &entry = pcMappingEntries_.back();
     JS_ASSERT((&offset)->offset() == entry.nativeOffset);
 #endif
 
     // Add an IC entry for the return offset -> pc mapping.
     ICEntry icEntry(script->pcToOffset(pc), ICEntry::Kind_DebugTrap);
-    icEntry.setReturnOffset(masm.currentOffset());
+    icEntry.setReturnOffset(CodeOffsetLabel(masm.currentOffset()));
     if (!icEntries_.append(icEntry))
         return false;
 
     return true;
 }
 
 bool
 BaselineCompiler::emitSPSPush()
--- a/js/src/jit/BaselineDebugModeOSR.cpp
+++ b/js/src/jit/BaselineDebugModeOSR.cpp
@@ -23,17 +23,17 @@ struct DebugModeOSREntry
     JSScript *script;
     BaselineScript *oldBaselineScript;
     ICStub *oldStub;
     ICStub *newStub;
     BaselineDebugModeOSRInfo *recompInfo;
     uint32_t pcOffset;
     ICEntry::Kind frameKind;
 
-    DebugModeOSREntry(JSScript *script)
+    explicit DebugModeOSREntry(JSScript *script)
       : script(script),
         oldBaselineScript(script->baselineScript()),
         oldStub(nullptr),
         newStub(nullptr),
         recompInfo(nullptr),
         pcOffset(uint32_t(-1)),
         frameKind(ICEntry::Kind_NonOp)
     { }
@@ -737,17 +737,17 @@ JitRuntime::generateBaselineDebugModeOSR
     Register temp = regs.takeAny();
     Register syncedStackStart = regs.takeAny();
 
     // Pop the frame reg.
     masm.pop(BaselineFrameReg);
 
     // Not all patched baseline frames are returning from a situation where
     // the frame reg is already fixed up.
-    CodeOffsetLabel noFrameRegPopOffset = masm.currentOffset();
+    CodeOffsetLabel noFrameRegPopOffset(masm.currentOffset());
 
     // Record the stack pointer for syncing.
     masm.movePtr(StackPointer, syncedStackStart);
     masm.push(BaselineFrameReg);
 
     // Call a stub to fully initialize the info.
     masm.setupUnalignedABICall(3, temp);
     masm.loadBaselineFramePtr(BaselineFrameReg, temp);
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -167,24 +167,24 @@ ICStub::trace(JSTracer *trc)
     markCode(trc, "baseline-stub-jitcode");
 
     // If the stub is a monitored fallback stub, then mark the monitor ICs hanging
     // off of that stub.  We don't need to worry about the regular monitored stubs,
     // because the regular monitored stubs will always have a monitored fallback stub
     // that references the same stub chain.
     if (isMonitoredFallback()) {
         ICTypeMonitor_Fallback *lastMonStub = toMonitoredFallbackStub()->fallbackMonitorStub();
-        for (ICStubConstIterator iter = lastMonStub->firstMonitorStub(); !iter.atEnd(); iter++) {
+        for (ICStubConstIterator iter(lastMonStub->firstMonitorStub()); !iter.atEnd(); iter++) {
             JS_ASSERT_IF(iter->next() == nullptr, *iter == lastMonStub);
             iter->trace(trc);
         }
     }
 
     if (isUpdated()) {
-        for (ICStubConstIterator iter = toUpdatedStub()->firstUpdateStub(); !iter.atEnd(); iter++) {
+        for (ICStubConstIterator iter(toUpdatedStub()->firstUpdateStub()); !iter.atEnd(); iter++) {
             JS_ASSERT_IF(iter->next() == nullptr, iter->isTypeUpdate_Fallback());
             iter->trace(trc);
         }
     }
 
     switch (kind()) {
       case ICStub::Call_Scripted: {
         ICCall_Scripted *callStub = toCall_Scripted();
@@ -1165,17 +1165,17 @@ ICTypeMonitor_Fallback::addMonitorStubFo
     }
 
     if (val.isPrimitive()) {
         JS_ASSERT(!val.isMagic());
         JSValueType type = val.isDouble() ? JSVAL_TYPE_DOUBLE : val.extractNonDoubleType();
 
         // Check for existing TypeMonitor stub.
         ICTypeMonitor_PrimitiveSet *existingStub = nullptr;
-        for (ICStubConstIterator iter = firstMonitorStub(); !iter.atEnd(); iter++) {
+        for (ICStubConstIterator iter(firstMonitorStub()); !iter.atEnd(); iter++) {
             if (iter->isTypeMonitor_PrimitiveSet()) {
                 existingStub = iter->toTypeMonitor_PrimitiveSet();
                 if (existingStub->containsType(type))
                     return true;
             }
         }
 
         ICTypeMonitor_PrimitiveSet::Compiler compiler(cx, existingStub, type);
@@ -1193,17 +1193,17 @@ ICTypeMonitor_Fallback::addMonitorStubFo
             JS_ASSERT(!hasStub(TypeMonitor_PrimitiveSet));
             addOptimizedMonitorStub(stub);
         }
 
     } else if (val.toObject().hasSingletonType()) {
         RootedObject obj(cx, &val.toObject());
 
         // Check for existing TypeMonitor stub.
-        for (ICStubConstIterator iter = firstMonitorStub(); !iter.atEnd(); iter++) {
+        for (ICStubConstIterator iter(firstMonitorStub()); !iter.atEnd(); iter++) {
             if (iter->isTypeMonitor_SingleObject() &&
                 iter->toTypeMonitor_SingleObject()->object() == obj)
             {
                 return true;
             }
         }
 
         ICTypeMonitor_SingleObject::Compiler compiler(cx, obj);
@@ -1217,17 +1217,17 @@ ICTypeMonitor_Fallback::addMonitorStubFo
                 stub, obj.get());
 
         addOptimizedMonitorStub(stub);
 
     } else {
         RootedTypeObject type(cx, val.toObject().type());
 
         // Check for existing TypeMonitor stub.
-        for (ICStubConstIterator iter = firstMonitorStub(); !iter.atEnd(); iter++) {
+        for (ICStubConstIterator iter(firstMonitorStub()); !iter.atEnd(); iter++) {
             if (iter->isTypeMonitor_TypeObject() &&
                 iter->toTypeMonitor_TypeObject()->type() == type)
             {
                 return true;
             }
         }
 
         ICTypeMonitor_TypeObject::Compiler compiler(cx, type);
@@ -1245,17 +1245,17 @@ ICTypeMonitor_Fallback::addMonitorStubFo
 
     bool firstMonitorStubAdded = wasDetachedMonitorChain && (numOptimizedMonitorStubs_ > 0);
 
     if (firstMonitorStubAdded) {
         // Was an empty monitor chain before, but a new stub was added.  This is the
         // only time that any main stubs' firstMonitorStub fields need to be updated to
         // refer to the newly added monitor stub.
         ICStub *firstStub = mainFallbackStub_->icEntry()->firstStub();
-        for (ICStubConstIterator iter = firstStub; !iter.atEnd(); iter++) {
+        for (ICStubConstIterator iter(firstStub); !iter.atEnd(); iter++) {
             // Non-monitored stubs are used if the result has always the same type,
             // e.g. a StringLength stub will always return int32.
             if (!iter->isMonitored())
                 continue;
 
             // Since we just added the first optimized monitoring stub, any
             // existing main stub's |firstMonitorStub| MUST be pointing to the fallback
             // monitor stub (i.e. this stub).
@@ -1417,17 +1417,17 @@ ICUpdatedStub::addUpdateStubForValue(JSC
     if (val.isUndefined() && types::CanHaveEmptyPropertyTypesForOwnProperty(obj))
         types::AddTypePropertyId(cx, obj, id, val);
 
     if (val.isPrimitive()) {
         JSValueType type = val.isDouble() ? JSVAL_TYPE_DOUBLE : val.extractNonDoubleType();
 
         // Check for existing TypeUpdate stub.
         ICTypeUpdate_PrimitiveSet *existingStub = nullptr;
-        for (ICStubConstIterator iter = firstUpdateStub_; !iter.atEnd(); iter++) {
+        for (ICStubConstIterator iter(firstUpdateStub_); !iter.atEnd(); iter++) {
             if (iter->isTypeUpdate_PrimitiveSet()) {
                 existingStub = iter->toTypeUpdate_PrimitiveSet();
                 if (existingStub->containsType(type))
                     return true;
             }
         }
 
         ICTypeUpdate_PrimitiveSet::Compiler compiler(cx, existingStub, type);
@@ -1442,17 +1442,17 @@ ICUpdatedStub::addUpdateStubForValue(JSC
 
         IonSpew(IonSpew_BaselineIC, "  %s TypeUpdate stub %p for primitive type %d",
                 existingStub ? "Modified existing" : "Created new", stub, type);
 
     } else if (val.toObject().hasSingletonType()) {
         RootedObject obj(cx, &val.toObject());
 
         // Check for existing TypeUpdate stub.
-        for (ICStubConstIterator iter = firstUpdateStub_; !iter.atEnd(); iter++) {
+        for (ICStubConstIterator iter(firstUpdateStub_); !iter.atEnd(); iter++) {
             if (iter->isTypeUpdate_SingleObject() &&
                 iter->toTypeUpdate_SingleObject()->object() == obj)
             {
                 return true;
             }
         }
 
         ICTypeUpdate_SingleObject::Compiler compiler(cx, obj);
@@ -1463,17 +1463,17 @@ ICUpdatedStub::addUpdateStubForValue(JSC
         IonSpew(IonSpew_BaselineIC, "  Added TypeUpdate stub %p for singleton %p", stub, obj.get());
 
         addOptimizedUpdateStub(stub);
 
     } else {
         RootedTypeObject type(cx, val.toObject().type());
 
         // Check for existing TypeUpdate stub.
-        for (ICStubConstIterator iter = firstUpdateStub_; !iter.atEnd(); iter++) {
+        for (ICStubConstIterator iter(firstUpdateStub_); !iter.atEnd(); iter++) {
             if (iter->isTypeUpdate_TypeObject() &&
                 iter->toTypeUpdate_TypeObject()->type() == type)
             {
                 return true;
             }
         }
 
         ICTypeUpdate_TypeObject::Compiler compiler(cx, type);
@@ -7315,17 +7315,17 @@ DoSetPropFallback(JSContext *cx, Baselin
         MOZ_ASSERT(name != cx->names().proto, "should have used JSOP_MUTATEPROTO");
         MOZ_ASSERT(obj->is<JSObject>());
         if (!DefineNativeProperty(cx, obj, id, rhs, nullptr, nullptr, JSPROP_ENUMERATE))
             return false;
     } else if (op == JSOP_SETNAME || op == JSOP_SETGNAME) {
         if (!SetNameOperation(cx, script, pc, obj, rhs))
             return false;
     } else if (op == JSOP_SETALIASEDVAR) {
-        obj->as<ScopeObject>().setAliasedVar(cx, pc, name, rhs);
+        obj->as<ScopeObject>().setAliasedVar(cx, ScopeCoordinate(pc), name, rhs);
     } else {
         MOZ_ASSERT(op == JSOP_SETPROP);
         if (script->strict()) {
             if (!js::SetProperty<true>(cx, obj, id, rhs))
                 return false;
         } else {
             if (!js::SetProperty<false>(cx, obj, id, rhs))
                 return false;
--- a/js/src/jit/BaselineIC.h
+++ b/js/src/jit/BaselineIC.h
@@ -468,17 +468,17 @@ class ICStubConstIterator
 {
     friend class ICStub;
     friend class ICFallbackStub;
 
   private:
     ICStub *currentStub_;
 
   public:
-    ICStubConstIterator(ICStub *currentStub) : currentStub_(currentStub) {}
+    explicit ICStubConstIterator(ICStub *currentStub) : currentStub_(currentStub) {}
 
     static ICStubConstIterator StartingAt(ICStub *stub) {
         return ICStubConstIterator(stub);
     }
     static ICStubConstIterator End(ICStub *stub) {
         return ICStubConstIterator(nullptr);
     }
 
@@ -529,17 +529,17 @@ class ICStubIterator
 
   private:
     ICEntry *icEntry_;
     ICFallbackStub *fallbackStub_;
     ICStub *previousStub_;
     ICStub *currentStub_;
     bool unlinked_;
 
-    ICStubIterator(ICFallbackStub *fallbackStub, bool end=false);
+    explicit ICStubIterator(ICFallbackStub *fallbackStub, bool end=false);
   public:
 
     bool operator ==(const ICStubIterator &other) const {
         // == should only ever be called on stubs from the same chain.
         JS_ASSERT(icEntry_ == other.icEntry_);
         JS_ASSERT(fallbackStub_ == other.fallbackStub_);
         return currentStub_ == other.currentStub_;
     }
@@ -1175,67 +1175,67 @@ class ICMultiStubCompiler : public ICStu
 
 // UseCount_Fallback
 
 // A UseCount IC chain has only the fallback stub.
 class ICUseCount_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICUseCount_Fallback(JitCode *stubCode)
+    explicit ICUseCount_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::UseCount_Fallback, stubCode)
     { }
 
   public:
     static inline ICUseCount_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICUseCount_Fallback>(code);
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::UseCount_Fallback)
         { }
 
         ICUseCount_Fallback *getStub(ICStubSpace *space) {
             return ICUseCount_Fallback::New(space, getStubCode());
         }
     };
 };
 
 // Profiler_Fallback
 
 class ICProfiler_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICProfiler_Fallback(JitCode *stubCode)
+    explicit ICProfiler_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::Profiler_Fallback, stubCode)
     { }
 
   public:
     static inline ICProfiler_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICProfiler_Fallback>(code);
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::Profiler_Fallback)
         { }
 
         ICProfiler_Fallback *getStub(ICStubSpace *space) {
             return ICProfiler_Fallback::New(space, getStubCode());
         }
     };
 };
@@ -1679,34 +1679,34 @@ class ICTypeMonitor_TypeObject : public 
 extern const VMFunction DoTypeUpdateFallbackInfo;
 
 // The TypeUpdate fallback is not a regular fallback, since it just
 // forwards to a different entry point in the main fallback stub.
 class ICTypeUpdate_Fallback : public ICStub
 {
     friend class ICStubSpace;
 
-    ICTypeUpdate_Fallback(JitCode *stubCode)
+    explicit ICTypeUpdate_Fallback(JitCode *stubCode)
       : ICStub(ICStub::TypeUpdate_Fallback, stubCode)
     {}
 
   public:
     static inline ICTypeUpdate_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICTypeUpdate_Fallback>(code);
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::TypeUpdate_Fallback)
         { }
 
         ICTypeUpdate_Fallback *getStub(ICStubSpace *space) {
             return ICTypeUpdate_Fallback::New(space, getStubCode());
         }
     };
 };
@@ -1840,33 +1840,33 @@ class ICTypeUpdate_TypeObject : public I
 
 // This
 //      JSOP_THIS
 
 class ICThis_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICThis_Fallback(JitCode *stubCode)
+    explicit ICThis_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::This_Fallback, stubCode) {}
 
   public:
     static inline ICThis_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICThis_Fallback>(code);
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::This_Fallback) {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICThis_Fallback::New(space, getStubCode());
         }
     };
 };
 
@@ -1949,17 +1949,17 @@ class ICNewObject_Fallback : public ICFa
 // Compare
 //      JSOP_LT
 //      JSOP_GT
 
 class ICCompare_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICCompare_Fallback(JitCode *stubCode)
+    explicit ICCompare_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::Compare_Fallback, stubCode) {}
 
   public:
     static const uint32_t MAX_OPTIMIZED_STUBS = 8;
 
     static inline ICCompare_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
@@ -1967,30 +1967,30 @@ class ICCompare_Fallback : public ICFall
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::Compare_Fallback) {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICCompare_Fallback::New(space, getStubCode());
         }
     };
 };
 
 class ICCompare_Int32 : public ICStub
 {
     friend class ICStubSpace;
 
-    ICCompare_Int32(JitCode *stubCode)
+    explicit ICCompare_Int32(JitCode *stubCode)
       : ICStub(ICStub::Compare_Int32, stubCode) {}
 
   public:
     static inline ICCompare_Int32 *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICCompare_Int32>(code);
     }
@@ -2009,17 +2009,17 @@ class ICCompare_Int32 : public ICStub
         }
     };
 };
 
 class ICCompare_Double : public ICStub
 {
     friend class ICStubSpace;
 
-    ICCompare_Double(JitCode *stubCode)
+    explicit ICCompare_Double(JitCode *stubCode)
       : ICStub(ICStub::Compare_Double, stubCode)
     {}
 
   public:
     static inline ICCompare_Double *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICCompare_Double>(code);
@@ -2084,17 +2084,17 @@ class ICCompare_NumberWithUndefined : pu
         }
     };
 };
 
 class ICCompare_String : public ICStub
 {
     friend class ICStubSpace;
 
-    ICCompare_String(JitCode *stubCode)
+    explicit ICCompare_String(JitCode *stubCode)
       : ICStub(ICStub::Compare_String, stubCode)
     {}
 
   public:
     static inline ICCompare_String *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICCompare_String>(code);
@@ -2114,17 +2114,17 @@ class ICCompare_String : public ICStub
         }
     };
 };
 
 class ICCompare_Boolean : public ICStub
 {
     friend class ICStubSpace;
 
-    ICCompare_Boolean(JitCode *stubCode)
+    explicit ICCompare_Boolean(JitCode *stubCode)
       : ICStub(ICStub::Compare_Boolean, stubCode)
     {}
 
   public:
     static inline ICCompare_Boolean *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICCompare_Boolean>(code);
@@ -2144,17 +2144,17 @@ class ICCompare_Boolean : public ICStub
         }
     };
 };
 
 class ICCompare_Object : public ICStub
 {
     friend class ICStubSpace;
 
-    ICCompare_Object(JitCode *stubCode)
+    explicit ICCompare_Object(JitCode *stubCode)
       : ICStub(ICStub::Compare_Object, stubCode)
     {}
 
   public:
     static inline ICCompare_Object *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICCompare_Object>(code);
@@ -2174,17 +2174,17 @@ class ICCompare_Object : public ICStub
         }
     };
 };
 
 class ICCompare_ObjectWithUndefined : public ICStub
 {
     friend class ICStubSpace;
 
-    ICCompare_ObjectWithUndefined(JitCode *stubCode)
+    explicit ICCompare_ObjectWithUndefined(JitCode *stubCode)
       : ICStub(ICStub::Compare_ObjectWithUndefined, stubCode)
     {}
 
   public:
     static inline ICCompare_ObjectWithUndefined *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICCompare_ObjectWithUndefined>(code);
@@ -2267,17 +2267,17 @@ class ICCompare_Int32WithBoolean : publi
 
 // ToBool
 //      JSOP_IFNE
 
 class ICToBool_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICToBool_Fallback(JitCode *stubCode)
+    explicit ICToBool_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::ToBool_Fallback, stubCode) {}
 
   public:
     static const uint32_t MAX_OPTIMIZED_STUBS = 8;
 
     static inline ICToBool_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
@@ -2285,194 +2285,194 @@ class ICToBool_Fallback : public ICFallb
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::ToBool_Fallback) {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICToBool_Fallback::New(space, getStubCode());
         }
     };
 };
 
 class ICToBool_Int32 : public ICStub
 {
     friend class ICStubSpace;
 
-    ICToBool_Int32(JitCode *stubCode)
+    explicit ICToBool_Int32(JitCode *stubCode)
       : ICStub(ICStub::ToBool_Int32, stubCode) {}
 
   public:
     static inline ICToBool_Int32 *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICToBool_Int32>(code);
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::ToBool_Int32) {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICToBool_Int32::New(space, getStubCode());
         }
     };
 };
 
 class ICToBool_String : public ICStub
 {
     friend class ICStubSpace;
 
-    ICToBool_String(JitCode *stubCode)
+    explicit ICToBool_String(JitCode *stubCode)
       : ICStub(ICStub::ToBool_String, stubCode) {}
 
   public:
     static inline ICToBool_String *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICToBool_String>(code);
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::ToBool_String) {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICToBool_String::New(space, getStubCode());
         }
     };
 };
 
 class ICToBool_NullUndefined : public ICStub
 {
     friend class ICStubSpace;
 
-    ICToBool_NullUndefined(JitCode *stubCode)
+    explicit ICToBool_NullUndefined(JitCode *stubCode)
       : ICStub(ICStub::ToBool_NullUndefined, stubCode) {}
 
   public:
     static inline ICToBool_NullUndefined *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICToBool_NullUndefined>(code);
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::ToBool_NullUndefined) {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICToBool_NullUndefined::New(space, getStubCode());
         }
     };
 };
 
 class ICToBool_Double : public ICStub
 {
     friend class ICStubSpace;
 
-    ICToBool_Double(JitCode *stubCode)
+    explicit ICToBool_Double(JitCode *stubCode)
       : ICStub(ICStub::ToBool_Double, stubCode) {}
 
   public:
     static inline ICToBool_Double *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICToBool_Double>(code);
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::ToBool_Double) {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICToBool_Double::New(space, getStubCode());
         }
     };
 };
 
 class ICToBool_Object : public ICStub
 {
     friend class ICStubSpace;
 
-    ICToBool_Object(JitCode *stubCode)
+    explicit ICToBool_Object(JitCode *stubCode)
       : ICStub(ICStub::ToBool_Object, stubCode) {}
 
   public:
     static inline ICToBool_Object *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICToBool_Object>(code);
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::ToBool_Object) {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICToBool_Object::New(space, getStubCode());
         }
     };
 };
 
 // ToNumber
 //     JSOP_POS
 
 class ICToNumber_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICToNumber_Fallback(JitCode *stubCode)
+    explicit ICToNumber_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::ToNumber_Fallback, stubCode) {}
 
   public:
     static inline ICToNumber_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICToNumber_Fallback>(code);
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::ToNumber_Fallback) {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICToNumber_Fallback::New(space, getStubCode());
         }
     };
 };
 
@@ -2480,17 +2480,17 @@ class ICToNumber_Fallback : public ICFal
 //      JSOP_ADD
 //      JSOP_BITAND, JSOP_BITXOR, JSOP_BITOR
 //      JSOP_LSH, JSOP_RSH, JSOP_URSH
 
 class ICBinaryArith_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICBinaryArith_Fallback(JitCode *stubCode)
+    explicit ICBinaryArith_Fallback(JitCode *stubCode)
       : ICFallbackStub(BinaryArith_Fallback, stubCode)
     {
         extra_ = 0;
     }
 
     static const uint16_t SAW_DOUBLE_RESULT_BIT = 0x1;
     static const uint16_t UNOPTIMIZABLE_OPERANDS_BIT = 0x2;
 
@@ -2517,17 +2517,17 @@ class ICBinaryArith_Fallback : public IC
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::BinaryArith_Fallback) {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICBinaryArith_Fallback::New(space, getStubCode());
         }
     };
 };
 
@@ -2575,33 +2575,33 @@ class ICBinaryArith_Int32 : public ICStu
         }
     };
 };
 
 class ICBinaryArith_StringConcat : public ICStub
 {
     friend class ICStubSpace;
 
-    ICBinaryArith_StringConcat(JitCode *stubCode)
+    explicit ICBinaryArith_StringConcat(JitCode *stubCode)
       : ICStub(BinaryArith_StringConcat, stubCode)
     {}
 
   public:
     static inline ICBinaryArith_StringConcat *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICBinaryArith_StringConcat>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::BinaryArith_StringConcat)
         {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICBinaryArith_StringConcat::New(space, getStubCode());
         }
     };
 };
@@ -2648,17 +2648,17 @@ class ICBinaryArith_StringObjectConcat :
         }
     };
 };
 
 class ICBinaryArith_Double : public ICStub
 {
     friend class ICStubSpace;
 
-    ICBinaryArith_Double(JitCode *stubCode)
+    explicit ICBinaryArith_Double(JitCode *stubCode)
       : ICStub(BinaryArith_Double, stubCode)
     {}
 
   public:
     static inline ICBinaryArith_Double *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICBinaryArith_Double>(code);
@@ -2787,17 +2787,17 @@ class ICBinaryArith_DoubleWithInt32 : pu
 // UnaryArith
 //     JSOP_BITNOT
 //     JSOP_NEG
 
 class ICUnaryArith_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICUnaryArith_Fallback(JitCode *stubCode)
+    explicit ICUnaryArith_Fallback(JitCode *stubCode)
       : ICFallbackStub(UnaryArith_Fallback, stubCode)
     {
         extra_ = 0;
     }
 
   public:
     static const uint32_t MAX_OPTIMIZED_STUBS = 8;
 
@@ -2815,31 +2815,31 @@ class ICUnaryArith_Fallback : public ICF
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::UnaryArith_Fallback)
         {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICUnaryArith_Fallback::New(space, getStubCode());
         }
     };
 };
 
 class ICUnaryArith_Int32 : public ICStub
 {
     friend class ICStubSpace;
 
-    ICUnaryArith_Int32(JitCode *stubCode)
+    explicit ICUnaryArith_Int32(JitCode *stubCode)
       : ICStub(UnaryArith_Int32, stubCode)
     {}
 
   public:
     static inline ICUnaryArith_Int32 *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICUnaryArith_Int32>(code);
@@ -2859,17 +2859,17 @@ class ICUnaryArith_Int32 : public ICStub
         }
     };
 };
 
 class ICUnaryArith_Double : public ICStub
 {
     friend class ICStubSpace;
 
-    ICUnaryArith_Double(JitCode *stubCode)
+    explicit ICUnaryArith_Double(JitCode *stubCode)
       : ICStub(UnaryArith_Double, stubCode)
     {}
 
   public:
     static inline ICUnaryArith_Double *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICUnaryArith_Double>(code);
@@ -2892,17 +2892,17 @@ class ICUnaryArith_Double : public ICStu
 
 // GetElem
 //      JSOP_GETELEM
 
 class ICGetElem_Fallback : public ICMonitoredFallbackStub
 {
     friend class ICStubSpace;
 
-    ICGetElem_Fallback(JitCode *stubCode)
+    explicit ICGetElem_Fallback(JitCode *stubCode)
       : ICMonitoredFallbackStub(ICStub::GetElem_Fallback, stubCode)
     { }
 
     static const uint16_t EXTRA_NON_NATIVE = 0x1;
     static const uint16_t EXTRA_NEGATIVE_INDEX = 0x2;
 
   public:
     static const uint32_t MAX_OPTIMIZED_STUBS = 16;
@@ -2928,17 +2928,17 @@ class ICGetElem_Fallback : public ICMoni
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::GetElem_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             ICGetElem_Fallback *stub = ICGetElem_Fallback::New(space, getStubCode());
             if (!stub)
                 return nullptr;
             if (!stub->initMonitoringChain(cx, space))
@@ -3303,33 +3303,33 @@ class ICGetElemNativeCompiler : public I
         return nullptr;
     }
 };
 
 class ICGetElem_String : public ICStub
 {
     friend class ICStubSpace;
 
-    ICGetElem_String(JitCode *stubCode)
+    explicit ICGetElem_String(JitCode *stubCode)
       : ICStub(ICStub::GetElem_String, stubCode) {}
 
   public:
     static inline ICGetElem_String *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICGetElem_String>(code);
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::GetElem_String) {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICGetElem_String::New(space, getStubCode());
         }
     };
 };
 
@@ -3505,17 +3505,17 @@ class ICGetElem_Arguments : public ICMon
 // SetElem
 //      JSOP_SETELEM
 //      JSOP_INITELEM
 
 class ICSetElem_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICSetElem_Fallback(JitCode *stubCode)
+    explicit ICSetElem_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::SetElem_Fallback, stubCode)
     { }
 
   public:
     static const uint32_t MAX_OPTIMIZED_STUBS = 8;
 
     static inline ICSetElem_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
@@ -3531,17 +3531,17 @@ class ICSetElem_Fallback : public ICFall
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::SetElem_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICSetElem_Fallback::New(space, getStubCode());
         }
     };
 };
@@ -3771,50 +3771,50 @@ class ICSetElem_TypedArray : public ICSt
 };
 
 // In
 //      JSOP_IN
 class ICIn_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICIn_Fallback(JitCode *stubCode)
+    explicit ICIn_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::In_Fallback, stubCode)
     { }
 
   public:
     static inline ICIn_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICIn_Fallback>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::In_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICIn_Fallback::New(space, getStubCode());
         }
     };
 };
 
 // GetName
 //      JSOP_NAME
 //      JSOP_GETGNAME
 class ICGetName_Fallback : public ICMonitoredFallbackStub
 {
     friend class ICStubSpace;
 
-    ICGetName_Fallback(JitCode *stubCode)
+    explicit ICGetName_Fallback(JitCode *stubCode)
       : ICMonitoredFallbackStub(ICStub::GetName_Fallback, stubCode)
     { }
 
   public:
     static const uint32_t MAX_OPTIMIZED_STUBS = 8;
 
     static inline ICGetName_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
@@ -3822,17 +3822,17 @@ class ICGetName_Fallback : public ICMoni
         return space->allocate<ICGetName_Fallback>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::GetName_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             ICGetName_Fallback *stub = ICGetName_Fallback::New(space, getStubCode());
             if (!stub || !stub->initMonitoringChain(cx, space))
                 return nullptr;
             return stub;
@@ -3967,65 +3967,65 @@ class ICGetName_Scope : public ICMonitor
 };
 
 // BindName
 //      JSOP_BINDNAME
 class ICBindName_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICBindName_Fallback(JitCode *stubCode)
+    explicit ICBindName_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::BindName_Fallback, stubCode)
     { }
 
   public:
     static inline ICBindName_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICBindName_Fallback>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::BindName_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICBindName_Fallback::New(space, getStubCode());
         }
     };
 };
 
 // GetIntrinsic
 //      JSOP_GETINTRINSIC
 class ICGetIntrinsic_Fallback : public ICMonitoredFallbackStub
 {
     friend class ICStubSpace;
 
-    ICGetIntrinsic_Fallback(JitCode *stubCode)
+    explicit ICGetIntrinsic_Fallback(JitCode *stubCode)
       : ICMonitoredFallbackStub(ICStub::GetIntrinsic_Fallback, stubCode)
     { }
 
   public:
     static inline ICGetIntrinsic_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICGetIntrinsic_Fallback>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::GetIntrinsic_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             ICGetIntrinsic_Fallback *stub = ICGetIntrinsic_Fallback::New(space, getStubCode());
             if (!stub || !stub->initMonitoringChain(cx, space))
                 return nullptr;
             return stub;
@@ -4075,17 +4075,17 @@ class ICGetIntrinsic_Constant : public I
         }
     };
 };
 
 class ICGetProp_Fallback : public ICMonitoredFallbackStub
 {
     friend class ICStubSpace;
 
-    ICGetProp_Fallback(JitCode *stubCode)
+    explicit ICGetProp_Fallback(JitCode *stubCode)
       : ICMonitoredFallbackStub(ICStub::GetProp_Fallback, stubCode)
     { }
 
   public:
     static const uint32_t MAX_OPTIMIZED_STUBS = 8;
 
     static inline ICGetProp_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
@@ -4112,17 +4112,17 @@ class ICGetProp_Fallback : public ICMoni
 
     class Compiler : public ICStubCompiler {
       protected:
         uint32_t returnOffset_;
         bool generateStubCode(MacroAssembler &masm);
         bool postGenerateStubCode(MacroAssembler &masm, Handle<JitCode *> code);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::GetProp_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             ICGetProp_Fallback *stub = ICGetProp_Fallback::New(space, getStubCode());
             if (!stub || !stub->initMonitoringChain(cx, space))
                 return nullptr;
             return stub;
@@ -4130,62 +4130,62 @@ class ICGetProp_Fallback : public ICMoni
     };
 };
 
 // Stub for accessing a dense array's length.
 class ICGetProp_ArrayLength : public ICStub
 {
     friend class ICStubSpace;
 
-    ICGetProp_ArrayLength(JitCode *stubCode)
+    explicit ICGetProp_ArrayLength(JitCode *stubCode)
       : ICStub(GetProp_ArrayLength, stubCode)
     {}
 
   public:
     static inline ICGetProp_ArrayLength *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICGetProp_ArrayLength>(code);
     }
 
     class Compiler : public ICStubCompiler {
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::GetProp_ArrayLength)
         {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICGetProp_ArrayLength::New(space, getStubCode());
         }
     };
 };
 
 // Stub for accessing a typed array's length.
 class ICGetProp_TypedArrayLength : public ICStub
 {
     friend class ICStubSpace;
 
-    ICGetProp_TypedArrayLength(JitCode *stubCode)
+    explicit ICGetProp_TypedArrayLength(JitCode *stubCode)
       : ICStub(GetProp_TypedArrayLength, stubCode)
     {}
 
   public:
     static inline ICGetProp_TypedArrayLength *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICGetProp_TypedArrayLength>(code);
     }
 
     class Compiler : public ICStubCompiler {
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::GetProp_TypedArrayLength)
         {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICGetProp_TypedArrayLength::New(space, getStubCode());
         }
     };
 };
@@ -4261,32 +4261,32 @@ class ICGetProp_Primitive : public ICMon
     };
 };
 
 // Stub for accessing a string's length.
 class ICGetProp_StringLength : public ICStub
 {
     friend class ICStubSpace;
 
-    ICGetProp_StringLength(JitCode *stubCode)
+    explicit ICGetProp_StringLength(JitCode *stubCode)
       : ICStub(GetProp_StringLength, stubCode)
     {}
 
   public:
     static inline ICGetProp_StringLength *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICGetProp_StringLength>(code);
     }
 
     class Compiler : public ICStubCompiler {
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::GetProp_StringLength)
         {}
 
         ICStub *getStub(ICStubSpace *space) {
             return ICGetProp_StringLength::New(space, getStubCode());
         }
     };
 };
@@ -4962,17 +4962,17 @@ class ICGetProp_DOMProxyShadowed : publi
 
 class ICGetProp_ArgumentsLength : public ICStub
 {
   friend class ICStubSpace;
   public:
     enum Which { Normal, Strict, Magic };
 
   protected:
-    ICGetProp_ArgumentsLength(JitCode *stubCode)
+    explicit ICGetProp_ArgumentsLength(JitCode *stubCode)
       : ICStub(ICStub::GetProp_ArgumentsLength, stubCode)
     { }
 
   public:
     static inline ICGetProp_ArgumentsLength *New(ICStubSpace *space, JitCode *code)
     {
         if (!code)
             return nullptr;
@@ -5006,17 +5006,17 @@ class ICGetProp_ArgumentsLength : public
 //     JSOP_SETNAME
 //     JSOP_SETGNAME
 //     JSOP_INITPROP
 
 class ICSetProp_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICSetProp_Fallback(JitCode *stubCode)
+    explicit ICSetProp_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::SetProp_Fallback, stubCode)
     { }
 
   public:
     static const uint32_t MAX_OPTIMIZED_STUBS = 8;
 
     static inline ICSetProp_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
@@ -5034,17 +5034,17 @@ class ICSetProp_Fallback : public ICFall
 
     class Compiler : public ICStubCompiler {
       protected:
         uint32_t returnOffset_;
         bool generateStubCode(MacroAssembler &masm);
         bool postGenerateStubCode(MacroAssembler &masm, Handle<JitCode *> code);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::SetProp_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICSetProp_Fallback::New(space, getStubCode());
         }
     };
 };
@@ -5912,110 +5912,110 @@ class ICTableSwitch : public ICStub
     };
 };
 
 // IC for constructing an iterator from an input value.
 class ICIteratorNew_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICIteratorNew_Fallback(JitCode *stubCode)
+    explicit ICIteratorNew_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::IteratorNew_Fallback, stubCode)
     { }
 
   public:
     static inline ICIteratorNew_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICIteratorNew_Fallback>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::IteratorNew_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICIteratorNew_Fallback::New(space, getStubCode());
         }
     };
 };
 
 // IC for testing if there are more values in an iterator.
 class ICIteratorMore_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICIteratorMore_Fallback(JitCode *stubCode)
+    explicit ICIteratorMore_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::IteratorMore_Fallback, stubCode)
     { }
 
   public:
     static inline ICIteratorMore_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICIteratorMore_Fallback>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::IteratorMore_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICIteratorMore_Fallback::New(space, getStubCode());
         }
     };
 };
 
 // IC for testing if there are more values in a native iterator.
 class ICIteratorMore_Native : public ICStub
 {
     friend class ICStubSpace;
 
-    ICIteratorMore_Native(JitCode *stubCode)
+    explicit ICIteratorMore_Native(JitCode *stubCode)
       : ICStub(ICStub::IteratorMore_Native, stubCode)
     { }
 
   public:
     static inline ICIteratorMore_Native *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICIteratorMore_Native>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::IteratorMore_Native)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICIteratorMore_Native::New(space, getStubCode());
         }
     };
 };
 
 // IC for getting the next value in an iterator.
 class ICIteratorNext_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICIteratorNext_Fallback(JitCode *stubCode)
+    explicit ICIteratorNext_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::IteratorNext_Fallback, stubCode)
     { }
 
   public:
     static inline ICIteratorNext_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICIteratorNext_Fallback>(code);
@@ -6029,144 +6029,144 @@ class ICIteratorNext_Fallback : public I
         return extra_;
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::IteratorNext_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICIteratorNext_Fallback::New(space, getStubCode());
         }
     };
 };
 
 // IC for getting the next value in a native iterator.
 class ICIteratorNext_Native : public ICStub
 {
     friend class ICStubSpace;
 
-    ICIteratorNext_Native(JitCode *stubCode)
+    explicit ICIteratorNext_Native(JitCode *stubCode)
       : ICStub(ICStub::IteratorNext_Native, stubCode)
     { }
 
   public:
     static inline ICIteratorNext_Native *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICIteratorNext_Native>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::IteratorNext_Native)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICIteratorNext_Native::New(space, getStubCode());
         }
     };
 };
 
 // IC for closing an iterator.
 class ICIteratorClose_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICIteratorClose_Fallback(JitCode *stubCode)
+    explicit ICIteratorClose_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::IteratorClose_Fallback, stubCode)
     { }
 
   public:
     static inline ICIteratorClose_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICIteratorClose_Fallback>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::IteratorClose_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICIteratorClose_Fallback::New(space, getStubCode());
         }
     };
 };
 
 // InstanceOf
 //      JSOP_INSTANCEOF
 class ICInstanceOf_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICInstanceOf_Fallback(JitCode *stubCode)
+    explicit ICInstanceOf_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::InstanceOf_Fallback, stubCode)
     { }
 
   public:
     static inline ICInstanceOf_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICInstanceOf_Fallback>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::InstanceOf_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICInstanceOf_Fallback::New(space, getStubCode());
         }
     };
 };
 
 // TypeOf
 //      JSOP_TYPEOF
 //      JSOP_TYPEOFEXPR
 class ICTypeOf_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICTypeOf_Fallback(JitCode *stubCode)
+    explicit ICTypeOf_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::TypeOf_Fallback, stubCode)
     { }
 
   public:
     static inline ICTypeOf_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
             return nullptr;
         return space->allocate<ICTypeOf_Fallback>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::TypeOf_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICTypeOf_Fallback::New(space, getStubCode());
         }
     };
 };
@@ -6257,17 +6257,17 @@ class ICRest_Fallback : public ICFallbac
     };
 };
 
 // Stub for JSOP_RETSUB ("returning" from a |finally| block).
 class ICRetSub_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
 
-    ICRetSub_Fallback(JitCode *stubCode)
+    explicit ICRetSub_Fallback(JitCode *stubCode)
       : ICFallbackStub(ICStub::RetSub_Fallback, stubCode)
     { }
 
   public:
     static const uint32_t MAX_OPTIMIZED_STUBS = 8;
 
     static inline ICRetSub_Fallback *New(ICStubSpace *space, JitCode *code) {
         if (!code)
@@ -6275,17 +6275,17 @@ class ICRetSub_Fallback : public ICFallb
         return space->allocate<ICRetSub_Fallback>(code);
     }
 
     class Compiler : public ICStubCompiler {
       protected:
         bool generateStubCode(MacroAssembler &masm);
 
       public:
-        Compiler(JSContext *cx)
+        explicit Compiler(JSContext *cx)
           : ICStubCompiler(cx, ICStub::RetSub_Fallback)
         { }
 
         ICStub *getStub(ICStubSpace *space) {
             return ICRetSub_Fallback::New(space, getStubCode());
         }
     };
 };
--- a/js/src/jit/BaselineInspector.h
+++ b/js/src/jit/BaselineInspector.h
@@ -45,17 +45,17 @@ class SetElemICInspector : public ICInsp
 
 class BaselineInspector
 {
   private:
     JSScript *script;
     ICEntry *prevLookedUpEntry;
 
   public:
-    BaselineInspector(JSScript *script)
+    explicit BaselineInspector(JSScript *script)
       : script(script), prevLookedUpEntry(nullptr)
     {
         JS_ASSERT(script);
     }
 
     bool hasBaselineScript() const {
         return script->hasBaselineScript();
     }
--- a/js/src/jit/BaselineJIT.cpp
+++ b/js/src/jit/BaselineJIT.cpp
@@ -778,17 +778,17 @@ BaselineScript::toggleDebugTraps(JSScrip
 
             scanner.advanceTo(script->pcToOffset(curPC));
 
             if (!pc || pc == curPC) {
                 bool enabled = (script->stepModeEnabled() && scanner.isLineHeader()) ||
                     script->hasBreakpointsAt(curPC);
 
                 // Patch the trap.
-                CodeLocationLabel label(method(), nativeOffset);
+                CodeLocationLabel label(method(), CodeOffsetLabel(nativeOffset));
                 Assembler::ToggleCall(label, enabled);
             }
 
             curPC += GetBytecodeLength(curPC);
         }
     }
 }
 
--- a/js/src/jit/BitSet.h
+++ b/js/src/jit/BitSet.h
@@ -23,17 +23,17 @@ class BitSet : private TempObject
   public:
     static const size_t BitsPerWord = 8 * sizeof(uint32_t);
 
     static size_t RawLengthForBits(size_t bits) {
         return (bits + BitsPerWord - 1) / BitsPerWord;
     }
 
   private:
-    BitSet(unsigned int numBits) :
+    explicit BitSet(unsigned int numBits) :
         bits_(nullptr),
         numBits_(numBits) {}
 
     uint32_t *bits_;
     const unsigned int numBits_;
 
     static inline uint32_t bitForValue(unsigned int value) {
         return 1l << uint32_t(value % BitsPerWord);
@@ -139,17 +139,17 @@ class BitSet::Iterator
         int numZeros = mozilla::CountTrailingZeroes32(value_);
         index_ += numZeros;
         value_ >>= numZeros;
 
         JS_ASSERT_IF(index_ < set_.numBits_, set_.contains(index_));
     }
 
   public:
-    Iterator(BitSet &set) :
+    explicit Iterator(BitSet &set) :
       set_(set),
       index_(0),
       word_(0),
       value_(set.bits_[0])
     {
         skipEmpty();
     }
 
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -2861,17 +2861,17 @@ CodeGenerator::generateArgumentsChecks(b
 }
 
 // Out-of-line path to report over-recursed error and fail.
 class CheckOverRecursedFailure : public OutOfLineCodeBase<CodeGenerator>
 {
     LCheckOverRecursed *lir_;
 
   public:
-    CheckOverRecursedFailure(LCheckOverRecursed *lir)
+    explicit CheckOverRecursedFailure(LCheckOverRecursed *lir)
       : lir_(lir)
     { }
 
     bool accept(CodeGenerator *codegen) {
         return codegen->visitCheckOverRecursedFailure(this);
     }
 
     LCheckOverRecursed *lir() const {
@@ -2968,17 +2968,17 @@ CodeGenerator::visitCheckOverRecursedFai
 }
 
 // Out-of-line path to report over-recursed error and fail.
 class CheckOverRecursedFailurePar : public OutOfLineCodeBase<CodeGenerator>
 {
     LCheckOverRecursedPar *lir_;
 
   public:
-    CheckOverRecursedFailurePar(LCheckOverRecursedPar *lir)
+    explicit CheckOverRecursedFailurePar(LCheckOverRecursedPar *lir)
       : lir_(lir)
     { }
 
     bool accept(CodeGenerator *codegen) {
         return codegen->visitCheckOverRecursedFailurePar(this);
     }
 
     LCheckOverRecursedPar *lir() const {
@@ -3042,17 +3042,17 @@ CodeGenerator::visitCheckOverRecursedFai
 }
 
 // Out-of-line path to report over-recursed error and fail.
 class OutOfLineInterruptCheckPar : public OutOfLineCodeBase<CodeGenerator>
 {
   public:
     LInterruptCheckPar *const lir;
 
-    OutOfLineInterruptCheckPar(LInterruptCheckPar *lir)
+    explicit OutOfLineInterruptCheckPar(LInterruptCheckPar *lir)
       : lir(lir)
     { }
 
     bool accept(CodeGenerator *codegen) {
         return codegen->visitOutOfLineInterruptCheckPar(this);
     }
 };
 
@@ -3445,17 +3445,17 @@ CodeGenerator::generateBody()
 }
 
 // Out-of-line object allocation for LNewArray.
 class OutOfLineNewArray : public OutOfLineCodeBase<CodeGenerator>
 {
     LNewArray *lir_;
 
   public:
-    OutOfLineNewArray(LNewArray *lir)
+    explicit OutOfLineNewArray(LNewArray *lir)
       : lir_(lir)
     { }
 
     bool accept(CodeGenerator *codegen) {
         return codegen->visitOutOfLineNewArray(this);
     }
 
     LNewArray *lir() const {
@@ -3578,17 +3578,17 @@ CodeGenerator::visitOutOfLineNewArray(Ou
 }
 
 // Out-of-line object allocation for JSOP_NEWOBJECT.
 class OutOfLineNewObject : public OutOfLineCodeBase<CodeGenerator>
 {
     LNewObject *lir_;
 
   public:
-    OutOfLineNewObject(LNewObject *lir)
+    explicit OutOfLineNewObject(LNewObject *lir)
       : lir_(lir)
     { }
 
     bool accept(CodeGenerator *codegen) {
         return codegen->visitOutOfLineNewObject(this);
     }
 
     LNewObject *lir() const {
@@ -5588,17 +5588,17 @@ CodeGenerator::visitBoundsCheckLower(LBo
 }
 
 class OutOfLineStoreElementHole : public OutOfLineCodeBase<CodeGenerator>
 {
     LInstruction *ins_;
     Label rejoinStore_;
 
   public:
-    OutOfLineStoreElementHole(LInstruction *ins)
+    explicit OutOfLineStoreElementHole(LInstruction *ins)
       : ins_(ins)
     {
         JS_ASSERT(ins->isStoreElementHoleV() || ins->isStoreElementHoleT());
     }
 
     bool accept(CodeGenerator *codegen) {
         return codegen->visitOutOfLineStoreElementHole(this);
     }
@@ -6729,17 +6729,17 @@ CodeGenerator::link(JSContext *cx, types
 }
 
 // An out-of-line path to convert a boxed int32 to either a float or double.
 class OutOfLineUnboxFloatingPoint : public OutOfLineCodeBase<CodeGenerator>
 {
     LUnboxFloatingPoint *unboxFloatingPoint_;
 
   public:
-    OutOfLineUnboxFloatingPoint(LUnboxFloatingPoint *unboxFloatingPoint)
+    explicit OutOfLineUnboxFloatingPoint(LUnboxFloatingPoint *unboxFloatingPoint)
       : unboxFloatingPoint_(unboxFloatingPoint)
     { }
 
     bool accept(CodeGenerator *codegen) {
         return codegen->visitOutOfLineUnboxFloatingPoint(this);
     }
 
     LUnboxFloatingPoint *unboxFloatingPoint() const {
@@ -7519,17 +7519,17 @@ CodeGenerator::visitBitOpV(LBitOpV *lir)
     MOZ_ASSUME_UNREACHABLE("unexpected bitop");
 }
 
 class OutOfLineTypeOfV : public OutOfLineCodeBase<CodeGenerator>
 {
     LTypeOfV *ins_;
 
   public:
-    OutOfLineTypeOfV(LTypeOfV *ins)
+    explicit OutOfLineTypeOfV(LTypeOfV *ins)
       : ins_(ins)
     { }
 
     bool accept(CodeGenerator *codegen) {
         return codegen->visitOutOfLineTypeOfV(this);
     }
     LTypeOfV *ins() const {
         return ins_;
@@ -8480,17 +8480,17 @@ CodeGenerator::visitAsmJSCall(LAsmJSCall
     switch (callee.which()) {
       case MAsmJSCall::Callee::Internal:
         masm.call(mir->desc(), callee.internal());
         break;
       case MAsmJSCall::Callee::Dynamic:
         masm.call(mir->desc(), ToRegister(ins->getOperand(mir->dynamicCalleeOperandIndex())));
         break;
       case MAsmJSCall::Callee::Builtin:
-        masm.call(mir->desc(), callee.builtin());
+        masm.call(mir->desc(), AsmJSImmPtr(callee.builtin()));
         break;
     }
 
     if (mir->spIncrement())
         masm.reserveStack(mir->spIncrement());
 
     postAsmJSCall(ins);
     return true;
--- a/js/src/jit/CompactBuffer.h
+++ b/js/src/jit/CompactBuffer.h
@@ -46,17 +46,17 @@ class CompactBufferReader
         MOZ_ASSUME_UNREACHABLE("unreachable");
     }
 
   public:
     CompactBufferReader(const uint8_t *start, const uint8_t *end)
       : buffer_(start),
         end_(end)
     { }
-    inline CompactBufferReader(const CompactBufferWriter &writer);
+    inline explicit CompactBufferReader(const CompactBufferWriter &writer);
     uint8_t readByte() {
         JS_ASSERT(buffer_ < end_);
         return *buffer_++;
     }
     uint32_t readFixedUint32_t() {
         uint32_t b0 = readByte();
         uint32_t b1 = readByte();
         uint32_t b2 = readByte();
--- a/js/src/jit/CompileWrappers.h
+++ b/js/src/jit/CompileWrappers.h
@@ -123,17 +123,17 @@ class CompileCompartment
     // Mirror CompartmentOptions.
     void setSingletonsAsValues();
 };
 
 class JitCompileOptions
 {
   public:
     JitCompileOptions();
-    JitCompileOptions(JSContext *cx);
+    explicit JitCompileOptions(JSContext *cx);
 
     bool cloneSingletons() const {
         return cloneSingletons_;
     }
 
     bool spsSlowAssertionsEnabled() const {
         return spsSlowAssertionsEnabled_;
     }
--- a/js/src/jit/CompilerRoot.h
+++ b/js/src/jit/CompilerRoot.h
@@ -20,17 +20,17 @@ namespace jit {
 
 // Roots a read-only GCThing for the lifetime of a single compilation.
 // Each root is maintained in a linked list that is walked over during tracing.
 // The CompilerRoot must be heap-allocated and may not go out of scope.
 template <typename T>
 class CompilerRoot : public CompilerRootNode
 {
   public:
-    CompilerRoot(T ptr)
+    explicit CompilerRoot(T ptr)
       : CompilerRootNode(nullptr)
     {
         if (ptr) {
             JS_ASSERT(!GetIonContext()->runtime->isInsideNursery(ptr));
             setRoot(ptr);
         }
     }
 
--- a/js/src/jit/EffectiveAddressAnalysis.h
+++ b/js/src/jit/EffectiveAddressAnalysis.h
@@ -12,17 +12,17 @@ namespace jit {
 
 class MIRGraph;
 
 class EffectiveAddressAnalysis
 {
     MIRGraph &graph_;
 
   public:
-    EffectiveAddressAnalysis(MIRGraph &graph)
+    explicit EffectiveAddressAnalysis(MIRGraph &graph)
       : graph_(graph)
     {}
 
     bool analyze();
 };
 
 } /* namespace jit */
 } /* namespace js */
--- a/js/src/jit/InlineList.h
+++ b/js/src/jit/InlineList.h
@@ -15,17 +15,17 @@ template <typename T> class InlineForwar
 template <typename T> class InlineForwardListIterator;
 
 template <typename T>
 class InlineForwardListNode
 {
   public:
     InlineForwardListNode() : next(nullptr)
     { }
-    InlineForwardListNode(InlineForwardListNode<T> *n) : next(n)
+    explicit InlineForwardListNode(InlineForwardListNode<T> *n) : next(n)
     { }
 
   protected:
     friend class InlineForwardList<T>;
     friend class InlineForwardListIterator<T>;
 
     InlineForwardListNode<T> *next;
 };
@@ -150,17 +150,17 @@ class InlineForwardList : protected Inli
 template <typename T>
 class InlineForwardListIterator
 {
 private:
     friend class InlineForwardList<T>;
 
     typedef InlineForwardListNode<T> Node;
 
-    InlineForwardListIterator<T>(const InlineForwardList<T> *owner)
+    explicit InlineForwardListIterator<T>(const InlineForwardList<T> *owner)
       : prev(const_cast<Node *>(static_cast<const Node *>(owner))),
         iter(owner ? owner->next : nullptr)
 #ifdef DEBUG
       , owner_(owner),
         modifyCount_(owner ? owner->modifyCount_ : 0)
 #endif
     { }
 
@@ -323,17 +323,17 @@ class InlineList : protected InlineListN
 template <typename T>
 class InlineListIterator
 {
   private:
     friend class InlineList<T>;
 
     typedef InlineListNode<T> Node;
 
-    InlineListIterator(const Node *iter)
+    explicit InlineListIterator(const Node *iter)
       : iter(const_cast<Node *>(iter))
     { }
 
   public:
     InlineListIterator<T> & operator ++() {
         iter = static_cast<Node *>(iter->next);
         return *this;
     }
@@ -367,17 +367,17 @@ class InlineListIterator
 template <typename T>
 class InlineListReverseIterator
 {
   private:
     friend class InlineList<T>;
 
     typedef InlineListNode<T> Node;
 
-    InlineListReverseIterator(const Node *iter)
+    explicit InlineListReverseIterator(const Node *iter)
       : iter(const_cast<Node *>(iter))
     { }
 
   public:
     InlineListReverseIterator<T> & operator ++() {
         iter = iter->prev;
         return *this;
     }
@@ -453,17 +453,17 @@ class InlineConcatList
 template <typename T>
 class InlineConcatListIterator
 {
   private:
     friend class InlineConcatList<T>;
 
     typedef InlineConcatList<T> Node;
 
-    InlineConcatListIterator(const Node *iter)
+    explicit InlineConcatListIterator(const Node *iter)
       : iter(const_cast<Node *>(iter))
     { }
 
   public:
     InlineConcatListIterator<T> & operator ++() {
         iter = iter->next;
         return *iter;
     }
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -491,24 +491,24 @@ JitCompartment::initialize(JSContext *cx
 
     return true;
 }
 
 bool
 JitCompartment::ensureIonStubsExist(JSContext *cx)
 {
     if (!stringConcatStub_) {
-        stringConcatStub_ = generateStringConcatStub(cx, SequentialExecution);
+        stringConcatStub_.set(generateStringConcatStub(cx, SequentialExecution));
         if (!stringConcatStub_)
             return false;
     }
 
 #ifdef JS_THREADSAFE
     if (!parallelStringConcatStub_) {
-        parallelStringConcatStub_ = generateStringConcatStub(cx, ParallelExecution);
+        parallelStringConcatStub_.set(generateStringConcatStub(cx, ParallelExecution));
         if (!parallelStringConcatStub_)
             return false;
     }
 #endif
 
     return true;
 }
 
@@ -640,20 +640,20 @@ JitCompartment::sweep(FreeOp *fop)
         baselineCallReturnAddr_ = nullptr;
     // Similarly for the ICGetProp_Fallback stub.
     if (!stubCodes_->lookup(static_cast<uint32_t>(ICStub::GetProp_Fallback)))
         baselineGetPropReturnAddr_ = nullptr;
     if (!stubCodes_->lookup(static_cast<uint32_t>(ICStub::SetProp_Fallback)))
         baselineSetPropReturnAddr_ = nullptr;
 
     if (stringConcatStub_ && !IsJitCodeMarked(stringConcatStub_.unsafeGet()))
-        stringConcatStub_ = nullptr;
+        stringConcatStub_.set(nullptr);
 
     if (parallelStringConcatStub_ && !IsJitCodeMarked(parallelStringConcatStub_.unsafeGet()))
-        parallelStringConcatStub_ = nullptr;
+        parallelStringConcatStub_.set(nullptr);
 
     if (activeParallelEntryScripts_) {
         for (ScriptSet::Enum e(*activeParallelEntryScripts_); !e.empty(); e.popFront()) {
             JSScript *script = e.front();
             if (!IsScriptMarked(&script))
                 e.removeFront();
             else
                 MOZ_ASSERT(script == e.front());
@@ -773,17 +773,17 @@ JitCode::finalize(FreeOp *fop)
 void
 JitCode::togglePreBarriers(bool enabled)
 {
     uint8_t *start = code_ + preBarrierTableOffset();
     CompactBufferReader reader(start, start + preBarrierTableBytes_);
 
     while (reader.more()) {
         size_t offset = reader.readUnsigned();
-        CodeLocationLabel loc(this, offset);
+        CodeLocationLabel loc(this, CodeOffsetLabel(offset));
         if (enabled)
             Assembler::ToggleToCmp(loc);
         else
             Assembler::ToggleToJmp(loc);
     }
 }
 
 IonScript::IonScript()
@@ -2629,17 +2629,17 @@ InvalidateActivation(FreeOp *fop, uint8_
         // a uint32, which is checked during safepoint index
         // construction.
         CodeLocationLabel dataLabelToMunge(it.returnAddressToFp());
         ptrdiff_t delta = ionScript->invalidateEpilogueDataOffset() -
                           (it.returnAddressToFp() - ionCode->raw());
         Assembler::patchWrite_Imm32(dataLabelToMunge, Imm32(delta));
 
         CodeLocationLabel osiPatchPoint = SafepointReader::InvalidationPatchPoint(ionScript, si);
-        CodeLocationLabel invalidateEpilogue(ionCode, ionScript->invalidateEpilogueOffset());
+        CodeLocationLabel invalidateEpilogue(ionCode, CodeOffsetLabel(ionScript->invalidateEpilogueOffset()));
 
         IonSpew(IonSpew_Invalidate, "   ! Invalidate ionScript %p (ref %u) -> patching osipoint %p",
                 ionScript, ionScript->refcount(), (void *) osiPatchPoint.raw());
         Assembler::patchWrite_NearCall(osiPatchPoint, invalidateEpilogue);
     }
 
     IonSpew(IonSpew_Invalidate, "END invalidating activation");
 }
--- a/js/src/jit/Ion.h
+++ b/js/src/jit/Ion.h
@@ -45,17 +45,17 @@ enum AbortReason {
 // will not be nullptr.
 
 class IonContext
 {
   public:
     IonContext(JSContext *cx, TempAllocator *temp);
     IonContext(ExclusiveContext *cx, TempAllocator *temp);
     IonContext(CompileRuntime *rt, CompileCompartment *comp, TempAllocator *temp);
-    IonContext(CompileRuntime *rt);
+    explicit IonContext(CompileRuntime *rt);
     ~IonContext();
 
     // Running context when executing on the main thread. Not available during
     // compilation.
     JSContext *cx;
 
     // Allocator for temporary memory during compilation.
     TempAllocator *temp;
--- a/js/src/jit/IonAllocPolicy.h
+++ b/js/src/jit/IonAllocPolicy.h
@@ -22,17 +22,17 @@ namespace jit {
 class TempAllocator
 {
     LifoAllocScope lifoScope_;
 
     // Linked list of GCThings rooted by this allocator.
     CompilerRootNode *rootList_;
 
   public:
-    TempAllocator(LifoAlloc *lifoAlloc)
+    explicit TempAllocator(LifoAlloc *lifoAlloc)
       : lifoScope_(lifoAlloc),
         rootList_(nullptr)
     { }
 
     void *allocateInfallible(size_t bytes)
     {
         return lifoScope_.alloc().allocInfallible(bytes);
     }
@@ -92,17 +92,17 @@ class AutoTempAllocatorRooter : private 
     MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 class IonAllocPolicy
 {
     TempAllocator &alloc_;
 
   public:
-    IonAllocPolicy(TempAllocator &alloc)
+    MOZ_IMPLICIT IonAllocPolicy(TempAllocator &alloc)
       : alloc_(alloc)
     {}
     void *malloc_(size_t bytes) {
         return alloc_.allocate(bytes);
     }
     void *calloc_(size_t bytes) {
         void *p = alloc_.allocate(bytes);
         if (p)
--- a/js/src/jit/IonAnalysis.h
+++ b/js/src/jit/IonAnalysis.h
@@ -94,17 +94,17 @@ struct LinearTerm
     {
     }
 };
 
 // General linear sum of the form 'x1*n1 + x2*n2 + ... + n'
 class LinearSum
 {
   public:
-    LinearSum(TempAllocator &alloc)
+    explicit LinearSum(TempAllocator &alloc)
       : terms_(alloc),
         constant_(0)
     {
     }
 
     LinearSum(const LinearSum &other)
       : terms_(other.terms_.allocPolicy()),
         constant_(other.constant_)
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -40,17 +40,17 @@ class jit::BaselineFrameInspector
 {
   public:
     types::Type thisType;
     JSObject *singletonScopeChain;
 
     Vector<types::Type, 4, IonAllocPolicy> argTypes;
     Vector<types::Type, 4, IonAllocPolicy> varTypes;
 
-    BaselineFrameInspector(TempAllocator *temp)
+    explicit BaselineFrameInspector(TempAllocator *temp)
       : thisType(types::Type::UndefinedType()),
         singletonScopeChain(nullptr),
         argTypes(*temp),
         varTypes(*temp)
     {}
 };
 
 BaselineFrameInspector *
@@ -8371,17 +8371,17 @@ IonBuilder::freezePropertiesForCommonPro
 
         while (true) {
             types::HeapTypeSetKey property = type->property(NameToId(name));
             JS_ALWAYS_TRUE(!property.isOwnProperty(constraints()));
 
             // Don't mark the proto. It will be held down by the shape
             // guard. This allows us to use properties found on prototypes
             // with properties unknown to TI.
-            if (type->proto() == foundProto)
+            if (type->proto() == TaggedProto(foundProto))
                 break;
             type = types::TypeObjectKey::get(type->proto().toObjectOrNull());
         }
     }
 }
 
 inline MDefinition *
 IonBuilder::testCommonGetterSetter(types::TemporaryTypeSet *types, PropertyName *name,
--- a/js/src/jit/IonCaches.cpp
+++ b/js/src/jit/IonCaches.cpp
@@ -167,17 +167,17 @@ class IonCache::StubAttacher
     bool hasStubCodePatchOffset_ : 1;
 
     CodeLocationLabel rejoinLabel_;
     CodeOffsetJump nextStubOffset_;
     CodeOffsetJump rejoinOffset_;
     CodeOffsetLabel stubCodePatchOffset_;
 
   public:
-    StubAttacher(CodeLocationLabel rejoinLabel)
+    explicit StubAttacher(CodeLocationLabel rejoinLabel)
       : hasNextStubOffset_(false),
         hasStubCodePatchOffset_(false),
         rejoinLabel_(rejoinLabel),
         nextStubOffset_(),
         rejoinOffset_(),
         stubCodePatchOffset_()
     { }
 
@@ -256,17 +256,17 @@ class IonCache::StubAttacher
 
 const ImmPtr IonCache::StubAttacher::STUB_ADDR = ImmPtr((void*)0xdeadc0de);
 
 class RepatchIonCache::RepatchStubAppender : public IonCache::StubAttacher
 {
     RepatchIonCache &cache_;
 
   public:
-    RepatchStubAppender(RepatchIonCache &cache)
+    explicit RepatchStubAppender(RepatchIonCache &cache)
       : StubAttacher(cache.rejoinLabel()),
         cache_(cache)
     {
     }
 
     void patchNextStubJump(MacroAssembler &masm, JitCode *code) {
         // Patch the previous nextStubJump of the last stub, or the jump from the
         // codeGen, to jump into the newly allocated code.
@@ -316,17 +316,17 @@ RepatchIonCache::updateBaseAddress(JitCo
     lastJump_.repoint(code, &masm);
 }
 
 class DispatchIonCache::DispatchStubPrepender : public IonCache::StubAttacher
 {
     DispatchIonCache &cache_;
 
   public:
-    DispatchStubPrepender(DispatchIonCache &cache)
+    explicit DispatchStubPrepender(DispatchIonCache &cache)
       : StubAttacher(cache.rejoinLabel_),
         cache_(cache)
     {
     }
 
     void patchNextStubJump(MacroAssembler &masm, JitCode *code) {
         JS_ASSERT(hasNextStubOffset_);
 
--- a/js/src/jit/IonCode.h
+++ b/js/src/jit/IonCode.h
@@ -785,17 +785,17 @@ struct AutoFlushICache
     AutoFlushICache *prev_;
 #endif
 
   public:
     static void setRange(uintptr_t p, size_t len);
     static void flush(uintptr_t p, size_t len);
     static void setInhibit();
     ~AutoFlushICache();
-    AutoFlushICache(const char *nonce, bool inhibit=false);
+    explicit AutoFlushICache(const char *nonce, bool inhibit=false);
 };
 
 } // namespace jit
 
 namespace gc {
 
 inline bool
 IsMarked(const jit::VMFunction *)
--- a/js/src/jit/IonFrames.cpp
+++ b/js/src/jit/IonFrames.cpp
@@ -552,17 +552,17 @@ HandleExceptionBaseline(JSContext *cx, c
         }
     }
 
 }
 
 struct AutoDeleteDebugModeOSRInfo
 {
     BaselineFrame *frame;
-    AutoDeleteDebugModeOSRInfo(BaselineFrame *frame) : frame(frame) { MOZ_ASSERT(frame); }
+    explicit AutoDeleteDebugModeOSRInfo(BaselineFrame *frame) : frame(frame) { MOZ_ASSERT(frame); }
     ~AutoDeleteDebugModeOSRInfo() { frame->deleteDebugModeOSRInfo(); }
 };
 
 void
 HandleException(ResumeFromException *rfe)
 {
     JSContext *cx = GetJSContextFromJitCode();
 
@@ -1859,17 +1859,17 @@ JitFrameIterator::numActualArgs() const
 
 void
 SnapshotIterator::warnUnreadableAllocation()
 {
     fprintf(stderr, "Warning! Tried to access unreadable value allocation (possible f.arguments).\n");
 }
 
 struct DumpOp {
-    DumpOp(unsigned int i) : i_(i) {}
+    explicit DumpOp(unsigned int i) : i_(i) {}
 
     unsigned int i_;
     void operator()(const Value& v) {
         fprintf(stderr, "  actual (arg %d): ", i_);
 #ifdef DEBUG
         js_DumpValue(v);
 #else
         fprintf(stderr, "?\n");
--- a/js/src/jit/IonLinker.h
+++ b/js/src/jit/IonLinker.h
@@ -65,17 +65,17 @@ class Linker
 #ifdef JSGC_GENERATIONAL
         if (masm.embedsNurseryPointers())
             cx->runtime()->gc.storeBuffer.putWholeCellFromMainThread(code);
 #endif
         return code;
     }
 
   public:
-    Linker(MacroAssembler &masm)
+    explicit Linker(MacroAssembler &masm)
       : masm(masm)
     {
         masm.finish();
     }
 
     template <AllowGC allowGC>
     JitCode *newCode(JSContext *cx, JSC::CodeKind kind) {
         return newCode<allowGC>(cx, cx->runtime()->jitRuntime()->execAlloc(), kind);
--- a/js/src/jit/IonMacroAssembler.cpp
+++ b/js/src/jit/IonMacroAssembler.cpp
@@ -34,17 +34,17 @@ using JS::GenericNaN;
 namespace {
 
 // Emulate a TypeSet logic from a Type object to avoid duplicating the guard
 // logic.
 class TypeWrapper {
     types::Type t_;
 
   public:
-    TypeWrapper(types::Type t) : t_(t) {}
+    explicit TypeWrapper(types::Type t) : t_(t) {}
 
     inline bool unknown() const {
         return t_.isUnknown();
     }
     inline bool hasType(types::Type t) const {
         if (t == types::Type::Int32Type())
             return t == t_ || t_ == types::Type::DoubleType();
         return t == t_;
--- a/js/src/jit/IonMacroAssembler.h
+++ b/js/src/jit/IonMacroAssembler.h
@@ -219,18 +219,18 @@ class MacroAssembler : public MacroAssem
 #ifdef JS_CODEGEN_ARM
         initWithAllocator();
         m_buffer.id = icx->getNextAssemblerId();
 #endif
     }
 
     // This constructor should only be used when there is no IonContext active
     // (for example, Trampoline-$(ARCH).cpp and IonCaches.cpp).
-    MacroAssembler(JSContext *cx, IonScript *ion = nullptr,
-                   JSScript *script = nullptr, jsbytecode *pc = nullptr)
+    explicit MacroAssembler(JSContext *cx, IonScript *ion = nullptr,
+                            JSScript *script = nullptr, jsbytecode *pc = nullptr)
       : enoughMemory_(true),
         embedsNurseryPointers_(false),
         sps_(nullptr)
     {
         constructRoot(cx);
         ionContext_.construct(cx, (js::jit::TempAllocator *)nullptr);
         alloc_.construct(cx);
         moveResolver_.setAllocator(*ionContext_.ref().temp);
@@ -248,17 +248,17 @@ class MacroAssembler : public MacroAssem
                 sps_ = spsInstrumentation_.addr();
                 sps_->setPushed(script);
             }
         }
     }
 
     // asm.js compilation handles its own IonContet-pushing
     struct AsmJSToken {};
-    MacroAssembler(AsmJSToken)
+    explicit MacroAssembler(AsmJSToken)
       : enoughMemory_(true),
         embedsNurseryPointers_(false),
         sps_(nullptr)
     {
 #ifdef JS_CODEGEN_ARM
         initWithAllocator();
         m_buffer.id = 0;
 #endif
@@ -1389,17 +1389,17 @@ class MacroAssembler : public MacroAssem
                                   Label *fail)
     {
         convertTypedOrValueToInt(src, temp, output, fail, IntConversion_ClampToUint8);
     }
 
   public:
     class AfterICSaveLive {
         friend class MacroAssembler;
-        AfterICSaveLive(uint32_t initialStack)
+        explicit AfterICSaveLive(uint32_t initialStack)
 #ifdef JS_DEBUG
           : initialStack(initialStack)
 #endif
         {}
 
 #ifdef JS_DEBUG
       public:
         uint32_t initialStack;
--- a/js/src/jit/JitFrameIterator.h
+++ b/js/src/jit/JitFrameIterator.h
@@ -362,18 +362,18 @@ class SnapshotIterator
     }
 
   public:
     // Connect all informations about the current script in order to recover the
     // content of baseline frames.
 
     SnapshotIterator(IonScript *ionScript, SnapshotOffset snapshotOffset,
                      IonJSFrameLayout *fp, const MachineState &machine);
-    SnapshotIterator(const JitFrameIterator &iter);
-    SnapshotIterator(const IonBailoutIterator &iter);
+    explicit SnapshotIterator(const JitFrameIterator &iter);
+    explicit SnapshotIterator(const IonBailoutIterator &iter);
     SnapshotIterator();
 
     Value read() {
         return allocationValue(readAllocation());
     }
     Value maybeRead(bool silentFailure = false) {
         RValueAllocation a = readAllocation();
         if (allocationReadable(a))
--- a/js/src/jit/LIR-Common.h
+++ b/js/src/jit/LIR-Common.h
@@ -96,17 +96,17 @@ class LMove
         return type_;
     }
 };
 
 class LMoveGroup : public LInstructionHelper<0, 0, 0>
 {
     js::Vector<LMove, 2, IonAllocPolicy> moves_;
 
-    LMoveGroup(TempAllocator &alloc)
+    explicit LMoveGroup(TempAllocator &alloc)
       : moves_(alloc)
     { }
 
   public:
     LIR_HEADER(MoveGroup)
 
     static LMoveGroup *New(TempAllocator &alloc) {
         return new(alloc) LMoveGroup(alloc);
@@ -131,17 +131,17 @@ class LMoveGroup : public LInstructionHe
 // Constant 32-bit integer.
 class LInteger : public LInstructionHelper<1, 0, 0>
 {
     int32_t i32_;
 
   public:
     LIR_HEADER(Integer)
 
-    LInteger(int32_t i32)
+    explicit LInteger(int32_t i32)
       : i32_(i32)
     { }
 
     int32_t getValue() const {
         return i32_;
     }
 };
 
@@ -156,17 +156,17 @@ class LPointer : public LInstructionHelp
 
   private:
     void *ptr_;
     Kind kind_;
 
   public:
     LIR_HEADER(Pointer)
 
-    LPointer(gc::Cell *ptr)
+    explicit LPointer(gc::Cell *ptr)
       : ptr_(ptr), kind_(GC_THING)
     { }
 
     LPointer(void *ptr, Kind kind)
       : ptr_(ptr), kind_(kind)
     { }
 
     void *ptr() const {
@@ -187,64 +187,64 @@ class LPointer : public LInstructionHelp
 
 // Constant double.
 class LDouble : public LInstructionHelper<1, 0, 0>
 {
     double d_;
   public:
     LIR_HEADER(Double);
 
-    LDouble(double d) : d_(d)
+    explicit LDouble(double d) : d_(d)
     { }
     double getDouble() const {
         return d_;
     }
 };
 
 // Constant float32.
 class LFloat32 : public LInstructionHelper<1, 0, 0>
 {
     float f_;
   public:
     LIR_HEADER(Float32);
 
-    LFloat32(float f)
+    explicit LFloat32(float f)
       : f_(f)
     { }
 
     float getFloat() const {
         return f_;
     }
 };
 
 // A constant Value.
 class LValue : public LInstructionHelper<BOX_PIECES, 0, 0>
 {
     Value v_;
 
   public:
     LIR_HEADER(Value)
 
-    LValue(const Value &v)
+    explicit LValue(const Value &v)
       : v_(v)
     { }
 
     Value value() const {
         return v_;
     }
 };
 
 // Clone an object literal such as we are not modifying the object contained in
 // the sources.
 class LCloneLiteral : public LCallInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(CloneLiteral)
 
-    LCloneLiteral(const LAllocation &obj)
+    explicit LCloneLiteral(const LAllocation &obj)
     {
         setOperand(0, obj);
     }
 
     const LAllocation *getObjectLiteral() {
         return getOperand(0);
     }
 
@@ -287,32 +287,32 @@ class LControlInstructionHelper : public
 };
 
 // Jumps to the start of a basic block.
 class LGoto : public LControlInstructionHelper<1, 0, 0>
 {
   public:
     LIR_HEADER(Goto)
 
-    LGoto(MBasicBlock *block)
+    explicit LGoto(MBasicBlock *block)
     {
          setSuccessor(0, block);
     }
 
     MBasicBlock *target() const {
         return getSuccessor(0);
     }
 };
 
 class LNewArray : public LInstructionHelper<1, 0, 1>
 {
   public:
     LIR_HEADER(NewArray)
 
-    LNewArray(const LDefinition &temp) {
+    explicit LNewArray(const LDefinition &temp) {
         setTemp(0, temp);
     }
 
     const char *extraName() const {
         return mir()->shouldUseVM() ? "VMCall" : nullptr;
     }
 
     const LDefinition *temp() {
@@ -324,17 +324,17 @@ class LNewArray : public LInstructionHel
     }
 };
 
 class LNewObject : public LInstructionHelper<1, 0, 1>
 {
   public:
     LIR_HEADER(NewObject)
 
-    LNewObject(const LDefinition &temp) {
+    explicit LNewObject(const LDefinition &temp) {
         setTemp(0, temp);
     }
 
     const char *extraName() const {
         return mir()->shouldUseVM() ? "VMCall" : nullptr;
     }
 
     const LDefinition *temp() {
@@ -420,17 +420,17 @@ class LNewDenseArrayPar : public LCallIn
 //   (1) An inline allocation of the call object is attempted.
 //   (2) Otherwise, a callVM create a new object.
 //
 class LNewDeclEnvObject : public LInstructionHelper<1, 0, 1>
 {
   public:
     LIR_HEADER(NewDeclEnvObject);
 
-    LNewDeclEnvObject(const LDefinition &temp) {
+    explicit LNewDeclEnvObject(const LDefinition &temp) {
         setTemp(0, temp);
     }
 
     const LDefinition *temp() {
         return getTemp(0);
     }
 
     MNewDeclEnvObject *mir() const {
@@ -445,17 +445,17 @@ class LNewDeclEnvObject : public LInstru
 //       call object.
 //   (2) Otherwise, an inline allocation of the call object is attempted.
 //
 class LNewCallObject : public LInstructionHelper<1, 0, 1>
 {
   public:
     LIR_HEADER(NewCallObject)
 
-    LNewCallObject(const LDefinition &temp) {
+    explicit LNewCallObject(const LDefinition &temp) {
         setTemp(0, temp);
     }
 
     const LDefinition *temp() {
         return getTemp(0);
     }
 
 
@@ -471,17 +471,17 @@ class LNewCallObject : public LInstructi
 //       call object.
 //   (2) Otherwise, an inline allocation of the call object is attempted.
 //
 class LNewSingletonCallObject : public LInstructionHelper<1, 0, 1>
 {
   public:
     LIR_HEADER(NewSingletonCallObject)
 
-    LNewSingletonCallObject(const LDefinition &temp) {
+    explicit LNewSingletonCallObject(const LDefinition &temp) {
         setTemp(0, temp);
     }
 
     const LDefinition *temp() {
         return getTemp(0);
     }
 
     MNewCallObjectBase *mir() const {
@@ -577,17 +577,17 @@ class LAbortPar : public LInstructionHel
     LIR_HEADER(AbortPar);
 };
 
 class LInitElem : public LCallInstructionHelper<0, 1 + 2*BOX_PIECES, 0>
 {
   public:
     LIR_HEADER(InitElem)
 
-    LInitElem(const LAllocation &object) {
+    explicit LInitElem(const LAllocation &object) {
         setOperand(0, object);
     }
 
     static const size_t IdIndex = 1;
     static const size_t ValueIndex = 1 + BOX_PIECES;
 
     const LAllocation *getObject() {
         return getOperand(0);
@@ -621,17 +621,17 @@ class LInitElemGetterSetter : public LCa
 };
 
 // Takes in an Object and a Value.
 class LMutateProto : public LCallInstructionHelper<0, 1 + BOX_PIECES, 0>
 {
   public:
     LIR_HEADER(MutateProto)
 
-    LMutateProto(const LAllocation &object) {
+    explicit LMutateProto(const LAllocation &object) {
         setOperand(0, object);
     }
 
     static const size_t ValueIndex = 1;
 
     const LAllocation *getObject() {
         return getOperand(0);
     }
@@ -641,17 +641,17 @@ class LMutateProto : public LCallInstruc
 };
 
 // Takes in an Object and a Value.
 class LInitProp : public LCallInstructionHelper<0, 1 + BOX_PIECES, 0>
 {
   public:
     LIR_HEADER(InitProp)
 
-    LInitProp(const LAllocation &object) {
+    explicit LInitProp(const LAllocation &object) {
         setOperand(0, object);
     }
 
     static const size_t ValueIndex = 1;
 
     const LAllocation *getObject() {
         return getOperand(0);
     }
@@ -756,17 +756,17 @@ class LInterruptCheckPar : public LInstr
     }
 };
 
 class LDefVar : public LCallInstructionHelper<0, 1, 0>
 {
   public:
     LIR_HEADER(DefVar)
 
-    LDefVar(const LAllocation &scopeChain)
+    explicit LDefVar(const LAllocation &scopeChain)
     {
         setOperand(0, scopeChain);
     }
 
     const LAllocation *scopeChain() {
         return getOperand(0);
     }
     MDefVar *mir() const {
@@ -774,17 +774,17 @@ class LDefVar : public LCallInstructionH
     }
 };
 
 class LDefFun : public LCallInstructionHelper<0, 1, 0>
 {
   public:
     LIR_HEADER(DefFun)
 
-    LDefFun(const LAllocation &scopeChain)
+    explicit LDefFun(const LAllocation &scopeChain)
     {
         setOperand(0, scopeChain);
     }
 
     const LAllocation *scopeChain() {
         return getOperand(0);
     }
     MDefFun *mir() const {
@@ -792,17 +792,17 @@ class LDefFun : public LCallInstructionH
     }
 };
 
 class LTypeOfV : public LInstructionHelper<1, BOX_PIECES, 1>
 {
   public:
     LIR_HEADER(TypeOfV)
 
-    LTypeOfV(const LDefinition &tempToUnbox) {
+    explicit LTypeOfV(const LDefinition &tempToUnbox) {
         setTemp(0, tempToUnbox);
     }
 
     static const size_t Input = 0;
 
     const LDefinition *tempToUnbox() {
         return getTemp(0);
     }
@@ -812,17 +812,17 @@ class LTypeOfV : public LInstructionHelp
     }
 };
 
 class LToIdV : public LInstructionHelper<BOX_PIECES, 2 * BOX_PIECES, 1>
 {
   public:
     LIR_HEADER(ToIdV)
 
-    LToIdV(const LDefinition &temp)
+    explicit LToIdV(const LDefinition &temp)
     {
         setTemp(0, temp);
     }
 
     static const size_t Object = 0;
     static const size_t Index = BOX_PIECES;
 
     MToId *mir() const {
@@ -836,17 +836,17 @@ class LToIdV : public LInstructionHelper
 
 // Allocate an object for |new| on the caller-side,
 // when there is no templateObject or prototype known
 class LCreateThis : public LCallInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
     LIR_HEADER(CreateThis)
 
-    LCreateThis(const LAllocation &callee)
+    explicit LCreateThis(const LAllocation &callee)
     {
         setOperand(0, callee);
     }
 
     const LAllocation *getCallee() {
         return getOperand(0);
     }
 
@@ -882,17 +882,17 @@ class LCreateThisWithProto : public LCal
 
 // Allocate an object for |new| on the caller-side.
 // Always performs object initialization with a fast path.
 class LCreateThisWithTemplate : public LInstructionHelper<1, 0, 1>
 {
   public:
     LIR_HEADER(CreateThisWithTemplate)
 
-    LCreateThisWithTemplate(const LDefinition &temp) {
+    explicit LCreateThisWithTemplate(const LDefinition &temp) {
         setTemp(0, temp);
     }
 
     MCreateThisWithTemplate *mir() const {
         return mir_->toCreateThisWithTemplate();
     }
 
     const LDefinition *temp() {
@@ -967,17 +967,17 @@ class LSetArgumentsObjectArg : public LI
 
 // If the Value is an Object, return unbox(Value).
 // Otherwise, return the other Object.
 class LReturnFromCtor : public LInstructionHelper<1, BOX_PIECES + 1, 0>
 {
   public:
     LIR_HEADER(ReturnFromCtor)
 
-    LReturnFromCtor(const LAllocation &object)
+    explicit LReturnFromCtor(const LAllocation &object)
     {
         // Value set by useBox() during lowering.
         setOperand(LReturnFromCtor::ObjectIndex, object);
     }
 
     const LAllocation *getObject() {
         return getOperand(LReturnFromCtor::ObjectIndex);
     }
@@ -1000,17 +1000,17 @@ class LComputeThis : public LInstruction
     MComputeThis *mir() const {
         return mir_->toComputeThis();
     }
 };
 
 class LLoadArrowThis : public LInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
-    LLoadArrowThis(const LAllocation &callee) {
+    explicit LLoadArrowThis(const LAllocation &callee) {
         setOperand(0, callee);
     }
 
     LIR_HEADER(LoadArrowThis)
 
     const LAllocation *callee() {
         return getOperand(0);
     }
@@ -1045,17 +1045,17 @@ class LStackArgT : public LInstructionHe
 // Writes an untyped argument for a function call to the frame's argument vector.
 class LStackArgV : public LInstructionHelper<0, BOX_PIECES, 0>
 {
     uint32_t argslot_; // Index into frame-scope argument vector.
 
   public:
     LIR_HEADER(StackArgV)
 
-    LStackArgV(uint32_t argslot)
+    explicit LStackArgV(uint32_t argslot)
       : argslot_(argslot)
     { }
 
     uint32_t argslot() const {
         return argslot_;
     }
 };
 
@@ -1249,17 +1249,17 @@ class LGetDOMProperty : public LDOMPrope
         return mir_->toGetDOMProperty();
     }
 };
 
 class LGetDOMMember : public LInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
     LIR_HEADER(GetDOMMember);
-    LGetDOMMember(const LAllocation &object) {
+    explicit LGetDOMMember(const LAllocation &object) {
         setOperand(0, object);
     }
 
     const LAllocation *object() {
         return getOperand(0);
     }
 
     MGetDOMMember *mir() const {
@@ -1476,17 +1476,17 @@ class LCallDirectEvalS : public LCallIns
     }
 };
 
 class LCallDirectEvalV : public LCallInstructionHelper<BOX_PIECES, 1 + (2 * BOX_PIECES), 0>
 {
   public:
     LIR_HEADER(CallDirectEvalV)
 
-    LCallDirectEvalV(const LAllocation &scopeChain)
+    explicit LCallDirectEvalV(const LAllocation &scopeChain)
     {
         setOperand(0, scopeChain);
     }
 
     static const size_t Argument = 1;
     static const size_t ThisValue = 1 + BOX_PIECES;
 
     MCallDirectEval *mir() const {
@@ -1644,17 +1644,17 @@ class LTestVAndBranch : public LControlI
 class LFunctionDispatch : public LInstructionHelper<0, 1, 0>
 {
     // Dispatch is performed based on a function -> block map
     // stored in the MIR.
 
   public:
     LIR_HEADER(FunctionDispatch);
 
-    LFunctionDispatch(const LAllocation &in) {
+    explicit LFunctionDispatch(const LAllocation &in) {
         setOperand(0, in);
     }
 
     MFunctionDispatch *mir() {
         return mir_->toFunctionDispatch();
     }
 };
 
@@ -1916,17 +1916,17 @@ class LCompareStrictS : public LInstruct
 // Used for strict-equality comparisons where one side is a boolean
 // and the other is a value. Note that CompareI is used to compare
 // two booleans.
 class LCompareB : public LInstructionHelper<1, BOX_PIECES + 1, 0>
 {
   public:
     LIR_HEADER(CompareB)
 
-    LCompareB(const LAllocation &rhs) {
+    explicit LCompareB(const LAllocation &rhs) {
         setOperand(BOX_PIECES, rhs);
     }
 
     static const size_t Lhs = 0;
 
     const LAllocation *rhs() {
         return getOperand(BOX_PIECES);
     }
@@ -2121,17 +2121,17 @@ class LIsNullOrLikeUndefinedAndBranch : 
 // Takes an object and tests whether it emulates |undefined|, as determined by
 // the JSCLASS_EMULATES_UNDEFINED class flag on unwrapped objects.  See also
 // js::EmulatesUndefined.
 class LEmulatesUndefined : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(EmulatesUndefined)
 
-    LEmulatesUndefined(const LAllocation &input)
+    explicit LEmulatesUndefined(const LAllocation &input)
     {
         setOperand(0, input);
     }
 
     MCompare *mir() {
         return mir_->toCompare();
     }
 };
@@ -2172,58 +2172,58 @@ class LEmulatesUndefinedAndBranch : publ
 };
 
 // Not operation on an integer.
 class LNotI : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(NotI)
 
-    LNotI(const LAllocation &input) {
+    explicit LNotI(const LAllocation &input) {
         setOperand(0, input);
     }
 };
 
 // Not operation on a double.
 class LNotD : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(NotD)
 
-    LNotD(const LAllocation &input) {
+    explicit LNotD(const LAllocation &input) {
         setOperand(0, input);
     }
 
     MNot *mir() {
         return mir_->toNot();
     }
 };
 
 // Not operation on a float32.
 class LNotF : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(NotF)
 
-    LNotF(const LAllocation &input) {
+    explicit LNotF(const LAllocation &input) {
         setOperand(0, input);
     }
 
     MNot *mir() {
         return mir_->toNot();
     }
 };
 
 // Boolean complement operation on an object.
 class LNotO : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(NotO)
 
-    LNotO(const LAllocation &input)
+    explicit LNotO(const LAllocation &input)
     {
         setOperand(0, input);
     }
 
     MNot *mir() {
         return mir_->toNot();
     }
 };
@@ -2280,17 +2280,17 @@ class LBitNotV : public LCallInstruction
 // a 32-bit integer result as an output.
 class LBitOpI : public LInstructionHelper<1, 2, 0>
 {
     JSOp op_;
 
   public:
     LIR_HEADER(BitOpI)
 
-    LBitOpI(JSOp op)
+    explicit LBitOpI(JSOp op)
       : op_(op)
     { }
 
     const char *extraName() const {
         if (bitop() == JSOP_URSH && mir_->toUrsh()->bailoutsDisabled())
             return "ursh:BailoutsDisabled";
         return js_CodeName[op_];
     }
@@ -2303,17 +2303,17 @@ class LBitOpI : public LInstructionHelpe
 // Call a VM function to perform a bitwise operation.
 class LBitOpV : public LCallInstructionHelper<1, 2 * BOX_PIECES, 0>
 {
     JSOp jsop_;
 
   public:
     LIR_HEADER(BitOpV)
 
-    LBitOpV(JSOp jsop)
+    explicit LBitOpV(JSOp jsop)
       : jsop_(jsop)
     { }
 
     JSOp jsop() const {
         return jsop_;
     }
 
     const char *extraName() const {
@@ -2328,17 +2328,17 @@ class LBitOpV : public LCallInstructionH
 // a 32-bit integer result as an output.
 class LShiftI : public LBinaryMath<0>
 {
     JSOp op_;
 
   public:
     LIR_HEADER(ShiftI)
 
-    LShiftI(JSOp op)
+    explicit LShiftI(JSOp op)
       : op_(op)
     { }
 
     JSOp bitop() {
         return op_;
     }
 
     MInstruction *mir() {
@@ -2435,87 +2435,87 @@ class LMinMaxD : public LInstructionHelp
     }
 };
 
 // Negative of an integer
 class LNegI : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(NegI);
-    LNegI(const LAllocation &num) {
+    explicit LNegI(const LAllocation &num) {
         setOperand(0, num);
     }
 };
 
 // Negative of a double.
 class LNegD : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(NegD)
-    LNegD(const LAllocation &num) {
+    explicit LNegD(const LAllocation &num) {
         setOperand(0, num);
     }
 };
 
 // Negative of a float32.
 class LNegF : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(NegF)
-    LNegF(const LAllocation &num) {
+    explicit LNegF(const LAllocation &num) {
         setOperand(0, num);
     }
 };
 
 // Absolute value of an integer.
 class LAbsI : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(AbsI)
-    LAbsI(const LAllocation &num) {
+    explicit LAbsI(const LAllocation &num) {
         setOperand(0, num);
     }
 };
 
 // Absolute value of a double.
 class LAbsD : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(AbsD)
-    LAbsD(const LAllocation &num) {
+    explicit LAbsD(const LAllocation &num) {
         setOperand(0, num);
     }
 };
 
 // Absolute value of a float32.
 class LAbsF : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(AbsF)
-    LAbsF(const LAllocation &num) {
+    explicit LAbsF(const LAllocation &num) {
         setOperand(0, num);
     }
 };
 
 // Square root of a double.
 class LSqrtD : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(SqrtD)
-    LSqrtD(const LAllocation &num) {
+    explicit LSqrtD(const LAllocation &num) {
         setOperand(0, num);
     }
 };
 
 // Square root of a float32.
 class LSqrtF : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(SqrtF)
-    LSqrtF(const LAllocation &num) {
+    explicit LSqrtF(const LAllocation &num) {
         setOperand(0, num);
     }
 };
 
 class LAtan2D : public LCallInstructionHelper<1, 2, 1>
 {
   public:
     LIR_HEADER(Atan2D)
@@ -2721,17 +2721,17 @@ class LSubI : public LBinaryMath<0>
 // Performs an add, sub, mul, or div on two double values.
 class LMathD : public LBinaryMath<0>
 {
     JSOp jsop_;
 
   public:
     LIR_HEADER(MathD)
 
-    LMathD(JSOp jsop)
+    explicit LMathD(JSOp jsop)
       : jsop_(jsop)
     { }
 
     JSOp jsop() const {
         return jsop_;
     }
 
     const char *extraName() const {
@@ -2742,17 +2742,17 @@ class LMathD : public LBinaryMath<0>
 // Performs an add, sub, mul, or div on two double values.
 class LMathF: public LBinaryMath<0>
 {
     JSOp jsop_;
 
   public:
     LIR_HEADER(MathF)
 
-    LMathF(JSOp jsop)
+    explicit LMathF(JSOp jsop)
       : jsop_(jsop)
     { }
 
     JSOp jsop() const {
         return jsop_;
     }
 
     const char *extraName() const {
@@ -2781,17 +2781,17 @@ class LModD : public LBinaryMath<1>
 // Call a VM function to perform a binary operation.
 class LBinaryV : public LCallInstructionHelper<BOX_PIECES, 2 * BOX_PIECES, 0>
 {
     JSOp jsop_;
 
   public:
     LIR_HEADER(BinaryV)
 
-    LBinaryV(JSOp jsop)
+    explicit LBinaryV(JSOp jsop)
       : jsop_(jsop)
     { }
 
     JSOp jsop() const {
         return jsop_;
     }
 
     const char *extraName() const {
@@ -2905,17 +2905,17 @@ class LCharCodeAt : public LInstructionH
 };
 
 // Convert uint16 character code to a string.
 class LFromCharCode : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(FromCharCode)
 
-    LFromCharCode(const LAllocation &code) {
+    explicit LFromCharCode(const LAllocation &code) {
         setOperand(0, code);
     }
 
     const LAllocation *code() {
         return this->getOperand(0);
     }
 };
 
@@ -2940,50 +2940,50 @@ class LStringSplit : public LCallInstruc
 };
 
 // Convert a 32-bit integer to a double.
 class LInt32ToDouble : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(Int32ToDouble)
 
-    LInt32ToDouble(const LAllocation &input) {
+    explicit LInt32ToDouble(const LAllocation &input) {
         setOperand(0, input);
     }
 };
 
 // Convert a 32-bit float to a double.
 class LFloat32ToDouble : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(Float32ToDouble)
 
-    LFloat32ToDouble(const LAllocation &input) {
+    explicit LFloat32ToDouble(const LAllocation &input) {
         setOperand(0, input);
     }
 };
 
 // Convert a double to a 32-bit float.
 class LDoubleToFloat32 : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(DoubleToFloat32)
 
-    LDoubleToFloat32(const LAllocation &input) {
+    explicit LDoubleToFloat32(const LAllocation &input) {
         setOperand(0, input);
     }
 };
 
 // Convert a 32-bit integer to a float32.
 class LInt32ToFloat32 : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(Int32ToFloat32)
 
-    LInt32ToFloat32(const LAllocation &input) {
+    explicit LInt32ToFloat32(const LAllocation &input) {
         setOperand(0, input);
     }
 };
 
 // Convert a value to a double.
 class LValueToDouble : public LInstructionHelper<1, BOX_PIECES, 0>
 {
   public:
@@ -3064,17 +3064,17 @@ class LValueToInt32 : public LInstructio
 //   Input: floating-point register
 //   Output: 32-bit integer
 //   Bailout: if the double cannot be converted to an integer.
 class LDoubleToInt32 : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(DoubleToInt32)
 
-    LDoubleToInt32(const LAllocation &in) {
+    explicit LDoubleToInt32(const LAllocation &in) {
         setOperand(0, in);
     }
 
     MToInt32 *mir() const {
         return mir_->toToInt32();
     }
 };
 
@@ -3082,17 +3082,17 @@ class LDoubleToInt32 : public LInstructi
 //   Input: floating-point register
 //   Output: 32-bit integer
 //   Bailout: if the float32 cannot be converted to an integer.
 class LFloat32ToInt32 : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(Float32ToInt32)
 
-    LFloat32ToInt32(const LAllocation &in) {
+    explicit LFloat32ToInt32(const LAllocation &in) {
         setOperand(0, in);
     }
 
     MToInt32 *mir() const {
         return mir_->toToInt32();
     }
 };
 
@@ -3133,32 +3133,32 @@ class LTruncateFToInt32 : public LInstru
 };
 
 // Convert a boolean value to a string.
 class LBooleanToString : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(BooleanToString)
 
-    LBooleanToString(const LAllocation &input) {
+    explicit LBooleanToString(const LAllocation &input) {
         setOperand(0, input);
     }
 
     const MToString *mir() {
         return mir_->toToString();
     }
 };
 
 // Convert an integer hosted on one definition to a string with a function call.
 class LIntToString : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(IntToString)
 
-    LIntToString(const LAllocation &input) {
+    explicit LIntToString(const LAllocation &input) {
         setOperand(0, input);
     }
 
     const MToString *mir() {
         return mir_->toToString();
     }
 };
 
@@ -3182,17 +3182,17 @@ class LDoubleToString : public LInstruct
 };
 
 // Convert a primitive to a string with a function call.
 class LPrimitiveToString : public LInstructionHelper<1, BOX_PIECES, 1>
 {
   public:
     LIR_HEADER(PrimitiveToString)
 
-    LPrimitiveToString(const LDefinition &tempToUnbox)
+    explicit LPrimitiveToString(const LDefinition &tempToUnbox)
     {
         setTemp(0, tempToUnbox);
     }
 
     static const size_t Input = 0;
 
     const MToString *mir() {
         return mir_->toToString();
@@ -3240,65 +3240,65 @@ class LOsrEntry : public LInstructionHel
 };
 
 // Materialize a Value stored in an interpreter frame for OSR.
 class LOsrValue : public LInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
     LIR_HEADER(OsrValue)
 
-    LOsrValue(const LAllocation &entry)
+    explicit LOsrValue(const LAllocation &entry)
     {
         setOperand(0, entry);
     }
 
     const MOsrValue *mir() {
         return mir_->toOsrValue();
     }
 };
 
 // Materialize a JSObject scope chain stored in an interpreter frame for OSR.
 class LOsrScopeChain : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(OsrScopeChain)
 
-    LOsrScopeChain(const LAllocation &entry)
+    explicit LOsrScopeChain(const LAllocation &entry)
     {
         setOperand(0, entry);
     }
 
     const MOsrScopeChain *mir() {
         return mir_->toOsrScopeChain();
     }
 };
 
 // Materialize a JSObject scope chain stored in an interpreter frame for OSR.
 class LOsrReturnValue : public LInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
     LIR_HEADER(OsrReturnValue)
 
-    LOsrReturnValue(const LAllocation &entry)
+    explicit LOsrReturnValue(const LAllocation &entry)
     {
         setOperand(0, entry);
     }
 
     const MOsrReturnValue *mir() {
         return mir_->toOsrReturnValue();
     }
 };
 
 // Materialize a JSObject ArgumentsObject stored in an interpreter frame for OSR.
 class LOsrArgumentsObject : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(OsrArgumentsObject)
 
-    LOsrArgumentsObject(const LAllocation &entry)
+    explicit LOsrArgumentsObject(const LAllocation &entry)
     {
         setOperand(0, entry);
     }
 
     const MOsrArgumentsObject *mir() {
         return mir_->toOsrArgumentsObject();
     }
 };
@@ -3414,17 +3414,17 @@ class LStringReplace: public LStrReplace
     }
 };
 
 class LLambdaForSingleton : public LCallInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(LambdaForSingleton)
 
-    LLambdaForSingleton(const LAllocation &scopeChain)
+    explicit LLambdaForSingleton(const LAllocation &scopeChain)
     {
         setOperand(0, scopeChain);
     }
     const LAllocation *scopeChain() {
         return getOperand(0);
     }
     const MLambda *mir() const {
         return mir_->toLambda();
@@ -3504,17 +3504,17 @@ class LLambdaPar : public LInstructionHe
 };
 
 // Determines the implicit |this| value for function calls.
 class LImplicitThis : public LInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
     LIR_HEADER(ImplicitThis)
 
-    LImplicitThis(const LAllocation &callee) {
+    explicit LImplicitThis(const LAllocation &callee) {
         setOperand(0, callee);
     }
 
     const MImplicitThis *mir() const {
         return mir_->toImplicitThis();
     }
     const LAllocation *callee() {
         return getOperand(0);
@@ -3524,49 +3524,49 @@ class LImplicitThis : public LInstructio
 // Load the "slots" member out of a JSObject.
 //   Input: JSObject pointer
 //   Output: slots pointer
 class LSlots : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(Slots)
 
-    LSlots(const LAllocation &object) {
+    explicit LSlots(const LAllocation &object) {
         setOperand(0, object);
     }
 
     const LAllocation *object() {
         return getOperand(0);
     }
 };
 
 // Load the "elements" member out of a JSObject.
 //   Input: JSObject pointer
 //   Output: elements pointer
 class LElements : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(Elements)
 
-    LElements(const LAllocation &object) {
+    explicit LElements(const LAllocation &object) {
         setOperand(0, object);
     }
 
     const LAllocation *object() {
         return getOperand(0);
     }
 };
 
 // If necessary, convert any int32 elements in a vector into doubles.
 class LConvertElementsToDoubles : public LInstructionHelper<0, 1, 0>
 {
   public:
     LIR_HEADER(ConvertElementsToDoubles)
 
-    LConvertElementsToDoubles(const LAllocation &elements) {
+    explicit LConvertElementsToDoubles(const LAllocation &elements) {
         setOperand(0, elements);
     }
 
     const LAllocation *elements() {
         return getOperand(0);
     }
 };
 
@@ -3596,17 +3596,17 @@ class LMaybeToDoubleElement : public LIn
 };
 
 // Load the initialized length from an elements header.
 class LInitializedLength : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(InitializedLength)
 
-    LInitializedLength(const LAllocation &elements) {
+    explicit LInitializedLength(const LAllocation &elements) {
         setOperand(0, elements);
     }
 
     const LAllocation *elements() {
         return getOperand(0);
     }
 };
 
@@ -3631,17 +3631,17 @@ class LSetInitializedLength : public LIn
 };
 
 // Load the length from an elements header.
 class LArrayLength : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(ArrayLength)
 
-    LArrayLength(const LAllocation &elements) {
+    explicit LArrayLength(const LAllocation &elements) {
         setOperand(0, elements);
     }
 
     const LAllocation *elements() {
         return getOperand(0);
     }
 };
 
@@ -3666,46 +3666,46 @@ class LSetArrayLength : public LInstruct
 };
 
 // Read the length of a typed array.
 class LTypedArrayLength : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(TypedArrayLength)
 
-    LTypedArrayLength(const LAllocation &obj) {
+    explicit LTypedArrayLength(const LAllocation &obj) {
         setOperand(0, obj);
     }
 
     const LAllocation *object() {
         return getOperand(0);
     }
 };
 
 // Load a typed array's elements vector.
 class LTypedArrayElements : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(TypedArrayElements)
 
-    LTypedArrayElements(const LAllocation &object) {
+    explicit LTypedArrayElements(const LAllocation &object) {
         setOperand(0, object);
     }
     const LAllocation *object() {
         return getOperand(0);
     }
 };
 
 // Load a typed array's elements vector.
 class LTypedObjectElements : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(TypedObjectElements)
 
-    LTypedObjectElements(const LAllocation &object) {
+    explicit LTypedObjectElements(const LAllocation &object) {
         setOperand(0, object);
     }
     const LAllocation *object() {
         return getOperand(0);
     }
     const MTypedObjectElements *mir() const {
         return mir_->toTypedObjectElements();
     }
@@ -3800,17 +3800,17 @@ class LBoundsCheckRange : public LInstru
 };
 
 // Bailout if index < minimum.
 class LBoundsCheckLower : public LInstructionHelper<0, 1, 0>
 {
   public:
     LIR_HEADER(BoundsCheckLower)
 
-    LBoundsCheckLower(const LAllocation &index)
+    explicit LBoundsCheckLower(const LAllocation &index)
     {
         setOperand(0, index);
     }
     MBoundsCheckLower *mir() const {
         return mir_->toBoundsCheckLower();
     }
     const LAllocation *index() {
         return getOperand(0);
@@ -4235,17 +4235,17 @@ class LLoadTypedArrayElementHole : publi
         return getOperand(1);
     }
 };
 
 class LLoadTypedArrayElementStatic : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(LoadTypedArrayElementStatic);
-    LLoadTypedArrayElementStatic(const LAllocation &ptr) {
+    explicit LLoadTypedArrayElementStatic(const LAllocation &ptr) {
         setOperand(0, ptr);
     }
     MLoadTypedArrayElementStatic *mir() const {
         return mir_->toLoadTypedArrayElementStatic();
     }
     const LAllocation *ptr() {
         return getOperand(0);
     }
@@ -4347,17 +4347,17 @@ class LEffectiveAddress : public LInstru
     }
 };
 
 class LClampIToUint8 : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(ClampIToUint8)
 
-    LClampIToUint8(const LAllocation &in) {
+    explicit LClampIToUint8(const LAllocation &in) {
         setOperand(0, in);
     }
 };
 
 class LClampDToUint8 : public LInstructionHelper<1, 1, 1>
 {
   public:
     LIR_HEADER(ClampDToUint8)
@@ -4368,17 +4368,17 @@ class LClampDToUint8 : public LInstructi
     }
 };
 
 class LClampVToUint8 : public LInstructionHelper<1, BOX_PIECES, 1>
 {
   public:
     LIR_HEADER(ClampVToUint8)
 
-    LClampVToUint8(const LDefinition &tempFloat) {
+    explicit LClampVToUint8(const LDefinition &tempFloat) {
         setTemp(0, tempFloat);
     }
 
     static const size_t Input = 0;
 
     const LDefinition *tempFloat() {
         return getTemp(0);
     }
@@ -4388,45 +4388,45 @@ class LClampVToUint8 : public LInstructi
 };
 
 // Load a boxed value from an object's fixed slot.
 class LLoadFixedSlotV : public LInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
     LIR_HEADER(LoadFixedSlotV)
 
-    LLoadFixedSlotV(const LAllocation &object) {
+    explicit LLoadFixedSlotV(const LAllocation &object) {
         setOperand(0, object);
     }
     const MLoadFixedSlot *mir() const {
         return mir_->toLoadFixedSlot();
     }
 };
 
 // Load a typed value from an object's fixed slot.
 class LLoadFixedSlotT : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(LoadFixedSlotT)
 
-    LLoadFixedSlotT(const LAllocation &object) {
+    explicit LLoadFixedSlotT(const LAllocation &object) {
         setOperand(0, object);
     }
     const MLoadFixedSlot *mir() const {
         return mir_->toLoadFixedSlot();
     }
 };
 
 // Store a boxed value to an object's fixed slot.
 class LStoreFixedSlotV : public LInstructionHelper<0, 1 + BOX_PIECES, 0>
 {
   public:
     LIR_HEADER(StoreFixedSlotV)
 
-    LStoreFixedSlotV(const LAllocation &obj) {
+    explicit LStoreFixedSlotV(const LAllocation &obj) {
         setOperand(0, obj);
     }
 
     static const size_t Value = 1;
 
     const MStoreFixedSlot *mir() const {
         return mir_->toStoreFixedSlot();
     }
@@ -4458,17 +4458,17 @@ class LStoreFixedSlotT : public LInstruc
 };
 
 // Note, Name ICs always return a Value. There are no V/T variants.
 class LGetNameCache : public LInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
     LIR_HEADER(GetNameCache)
 
-    LGetNameCache(const LAllocation &scopeObj) {
+    explicit LGetNameCache(const LAllocation &scopeObj) {
         setOperand(0, scopeObj);
     }
     const LAllocation *scopeObj() {
         return getOperand(0);
     }
     const MGetNameCache *mir() const {
         return mir_->toGetNameCache();
     }
@@ -4484,17 +4484,17 @@ class LCallGetIntrinsicValue : public LC
     }
 };
 
 class LCallsiteCloneCache : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(CallsiteCloneCache);
 
-    LCallsiteCloneCache(const LAllocation &callee) {
+    explicit LCallsiteCloneCache(const LAllocation &callee) {
         setOperand(0, callee);
     }
     const LAllocation *callee() {
         return getOperand(0);
     }
     const MCallsiteCloneCache *mir() const {
         return mir_->toCallsiteCloneCache();
     }
@@ -4502,17 +4502,17 @@ class LCallsiteCloneCache : public LInst
 
 // Patchable jump to stubs generated for a GetProperty cache, which loads a
 // boxed value.
 class LGetPropertyCacheV : public LInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
     LIR_HEADER(GetPropertyCacheV)
 
-    LGetPropertyCacheV(const LAllocation &object) {
+    explicit LGetPropertyCacheV(const LAllocation &object) {
         setOperand(0, object);
     }
     const MGetPropertyCache *mir() const {
         return mir_->toGetPropertyCache();
     }
 };
 
 // Patchable jump to stubs generated for a GetProperty cache, which loads a
@@ -4536,17 +4536,17 @@ class LGetPropertyCacheT : public LInstr
 
 // Emit code to load a boxed value from an object's slots if its shape matches
 // one of the shapes observed by the baseline IC, else bails out.
 class LGetPropertyPolymorphicV : public LInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
     LIR_HEADER(GetPropertyPolymorphicV)
 
-    LGetPropertyPolymorphicV(const LAllocation &obj) {
+    explicit LGetPropertyPolymorphicV(const LAllocation &obj) {
         setOperand(0, obj);
     }
     const LAllocation *obj() {
         return getOperand(0);
     }
     const MGetPropertyPolymorphic *mir() const {
         return mir_->toGetPropertyPolymorphic();
     }
@@ -4639,17 +4639,17 @@ class LSetPropertyPolymorphicT : public 
 
 class LGetElementCacheV : public LInstructionHelper<BOX_PIECES, 1 + BOX_PIECES, 0>
 {
   public:
     LIR_HEADER(GetElementCacheV)
 
     static const size_t Index = 1;
 
-    LGetElementCacheV(const LAllocation &object) {
+    explicit LGetElementCacheV(const LAllocation &object) {
         setOperand(0, object);
     }
     const LAllocation *object() {
         return getOperand(0);
     }
     const MGetElementCache *mir() const {
         return mir_->toGetElementCache();
     }
@@ -4683,64 +4683,64 @@ class LGetElementCacheT : public LInstru
     }
 };
 
 class LBindNameCache : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(BindNameCache)
 
-    LBindNameCache(const LAllocation &scopeChain) {
+    explicit LBindNameCache(const LAllocation &scopeChain) {
         setOperand(0, scopeChain);
     }
     const LAllocation *scopeChain() {
         return getOperand(0);
     }
     const MBindNameCache *mir() const {
         return mir_->toBindNameCache();
     }
 };
 
 // Load a value from an object's dslots or a slots vector.
 class LLoadSlotV : public LInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
     LIR_HEADER(LoadSlotV)
 
-    LLoadSlotV(const LAllocation &in) {
+    explicit LLoadSlotV(const LAllocation &in) {
         setOperand(0, in);
     }
     const MLoadSlot *mir() const {
         return mir_->toLoadSlot();
     }
 };
 
 // Load a typed value from an object's dslots or a slots vector. Unlike
 // LLoadSlotV, this can bypass extracting a type tag, directly retrieving a
 // pointer, integer, or double.
 class LLoadSlotT : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(LoadSlotT)
 
-    LLoadSlotT(const LAllocation &in) {
+    explicit LLoadSlotT(const LAllocation &in) {
         setOperand(0, in);
     }
     const MLoadSlot *mir() const {
         return mir_->toLoadSlot();
     }
 };
 
 // Store a value to an object's dslots or a slots vector.
 class LStoreSlotV : public LInstructionHelper<0, 1 + BOX_PIECES, 0>
 {
   public:
     LIR_HEADER(StoreSlotV)
 
-    LStoreSlotV(const LAllocation &slots) {
+    explicit LStoreSlotV(const LAllocation &slots) {
         setOperand(0, slots);
     }
 
     static const size_t Value = 1;
 
     const MStoreSlot *mir() const {
         return mir_->toStoreSlot();
     }
@@ -4776,43 +4776,43 @@ class LStoreSlotT : public LInstructionH
 };
 
 // Read length field of a JSString*.
 class LStringLength : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(StringLength)
 
-    LStringLength(const LAllocation &string) {
+    explicit LStringLength(const LAllocation &string) {
         setOperand(0, string);
     }
 
     const LAllocation *string() {
         return getOperand(0);
     }
 };
 
 // Take the floor of a double precision number. Implements Math.floor().
 class LFloor : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(Floor)
 
-    LFloor(const LAllocation &num) {
+    explicit LFloor(const LAllocation &num) {
         setOperand(0, num);
     }
 };
 
 // Take the floor of a single precision number. Implements Math.floor().
 class LFloorF : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(FloorF)
 
-    LFloorF(const LAllocation &num) {
+    explicit LFloorF(const LAllocation &num) {
         setOperand(0, num);
     }
 };
 
 // Take the ceiling of a double precision number. Implements Math.ceil().
 class LCeil : public LInstructionHelper<1, 1, 0>
 {
   public:
@@ -4873,30 +4873,30 @@ class LRoundF : public LInstructionHelpe
 };
 
 // Load a function's call environment.
 class LFunctionEnvironment : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(FunctionEnvironment)
 
-    LFunctionEnvironment(const LAllocation &function) {
+    explicit LFunctionEnvironment(const LAllocation &function) {
         setOperand(0, function);
     }
     const LAllocation *function() {
         return getOperand(0);
     }
 };
 
 class LForkJoinContext : public LCallInstructionHelper<1, 0, 1>
 {
   public:
     LIR_HEADER(ForkJoinContext);
 
-    LForkJoinContext(const LDefinition &temp1) {
+    explicit LForkJoinContext(const LDefinition &temp1) {
         setTemp(0, temp1);
     }
 
     const LDefinition *getTempReg() {
         return getTemp(0);
     }
 };
 
@@ -4982,17 +4982,17 @@ public:
 };
 
 // Call a VM function to perform a property or name assignment of a generic value.
 class LCallSetProperty : public LCallInstructionHelper<0, 1 + BOX_PIECES, 0>
 {
   public:
     LIR_HEADER(CallSetProperty)
 
-    LCallSetProperty(const LAllocation &obj) {
+    explicit LCallSetProperty(const LAllocation &obj) {
         setOperand(0, obj);
     }
 
     static const size_t Value = 1;
 
     const MCallSetProperty *mir() const {
         return mir_->toCallSetProperty();
     }
@@ -5154,17 +5154,17 @@ class LSetElementCacheT : public LInstru
     }
 };
 
 class LCallIteratorStart : public LCallInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(CallIteratorStart)
 
-    LCallIteratorStart(const LAllocation &object) {
+    explicit LCallIteratorStart(const LAllocation &object) {
         setOperand(0, object);
     }
     const LAllocation *object() {
         return getOperand(0);
     }
     MIteratorStart *mir() const {
         return mir_->toIteratorStart();
     }
@@ -5276,31 +5276,31 @@ class LArgumentsLength : public LInstruc
 };
 
 // Load a value from the actual arguments.
 class LGetFrameArgument : public LInstructionHelper<BOX_PIECES, 1, 0>
 {
   public:
     LIR_HEADER(GetFrameArgument)
 
-    LGetFrameArgument(const LAllocation &index) {
+    explicit LGetFrameArgument(const LAllocation &index) {
         setOperand(0, index);
     }
     const LAllocation *index() {
         return getOperand(0);
     }
 };
 
 // Load a value from the actual arguments.
 class LSetFrameArgumentT : public LInstructionHelper<0, 1, 0>
 {
   public:
     LIR_HEADER(SetFrameArgumentT)
 
-    LSetFrameArgumentT(const LAllocation &input) {
+    explicit LSetFrameArgumentT(const LAllocation &input) {
         setOperand(0, input);
     }
     MSetFrameArgument *mir() const {
         return mir_->toSetFrameArgument();
     }
     const LAllocation *input() {
         return getOperand(0);
     }
@@ -5309,17 +5309,17 @@ class LSetFrameArgumentT : public LInstr
 // Load a value from the actual arguments.
 class LSetFrameArgumentC : public LInstructionHelper<0, 0, 0>
 {
     Value val_;
 
   public:
     LIR_HEADER(SetFrameArgumentC)
 
-    LSetFrameArgumentC(const Value &val) {
+    explicit LSetFrameArgumentC(const Value &val) {
         val_ = val;
     }
     MSetFrameArgument *mir() const {
         return mir_->toSetFrameArgument();
     }
     const Value &val() const {
         return val_;
     }
@@ -5442,17 +5442,17 @@ class LGuardShapePolymorphic : public LI
 };
 
 // Guard that a value is in a TypeSet.
 class LTypeBarrierV : public LInstructionHelper<0, BOX_PIECES, 1>
 {
   public:
     LIR_HEADER(TypeBarrierV)
 
-    LTypeBarrierV(const LDefinition &temp) {
+    explicit LTypeBarrierV(const LDefinition &temp) {
         setTemp(0, temp);
     }
 
     static const size_t Input = 0;
 
     const MTypeBarrier *mir() const {
         return mir_->toTypeBarrier();
     }
@@ -5483,17 +5483,17 @@ class LTypeBarrierO : public LInstructio
 };
 
 // Guard that a value is in a TypeSet.
 class LMonitorTypes : public LInstructionHelper<0, BOX_PIECES, 1>
 {
   public:
     LIR_HEADER(MonitorTypes)
 
-    LMonitorTypes(const LDefinition &temp) {
+    explicit LMonitorTypes(const LDefinition &temp) {
         setTemp(0, temp);
     }
 
     static const size_t Input = 0;
 
     const MMonitorTypes *mir() const {
         return mir_->toMonitorTypes();
     }
@@ -5554,17 +5554,17 @@ class LPostWriteBarrierV : public LInstr
 };
 
 // Guard against an object's identity.
 class LGuardObjectIdentity : public LInstructionHelper<0, 1, 0>
 {
   public:
     LIR_HEADER(GuardObjectIdentity)
 
-    LGuardObjectIdentity(const LAllocation &in) {
+    explicit LGuardObjectIdentity(const LAllocation &in) {
         setOperand(0, in);
     }
     const MGuardObjectIdentity *mir() const {
         return mir_->toGuardObjectIdentity();
     }
 };
 
 // Guard against an object's class.
@@ -5649,17 +5649,17 @@ class LPhi MOZ_FINAL : public LInstructi
         printOperands(fp);
     }
 };
 
 class LIn : public LCallInstructionHelper<1, BOX_PIECES+1, 0>
 {
   public:
     LIR_HEADER(In)
-    LIn(const LAllocation &rhs) {
+    explicit LIn(const LAllocation &rhs) {
         setOperand(RHS, rhs);
     }
 
     const LAllocation *lhs() {
         return getOperand(LHS);
     }
     const LAllocation *rhs() {
         return getOperand(RHS);
@@ -5668,17 +5668,17 @@ class LIn : public LCallInstructionHelpe
     static const size_t LHS = 0;
     static const size_t RHS = BOX_PIECES;
 };
 
 class LInstanceOfO : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(InstanceOfO)
-    LInstanceOfO(const LAllocation &lhs) {
+    explicit LInstanceOfO(const LAllocation &lhs) {
         setOperand(0, lhs);
     }
 
     MInstanceOf *mir() const {
         return mir_->toInstanceOf();
     }
 
     const LAllocation *lhs() {
@@ -5703,17 +5703,17 @@ class LInstanceOfV : public LInstruction
 
     static const size_t LHS = 0;
 };
 
 class LCallInstanceOf : public LCallInstructionHelper<1, BOX_PIECES+1, 0>
 {
   public:
     LIR_HEADER(CallInstanceOf)
-    LCallInstanceOf(const LAllocation &rhs) {
+    explicit LCallInstanceOf(const LAllocation &rhs) {
         setOperand(RHS, rhs);
     }
 
     const LDefinition *output() {
         return this->getDef(0);
     }
     const LAllocation *lhs() {
         return getOperand(LHS);
@@ -5726,17 +5726,17 @@ class LCallInstanceOf : public LCallInst
     static const size_t RHS = BOX_PIECES;
 };
 
 class LProfilerStackOp : public LInstructionHelper<0, 0, 1>
 {
   public:
     LIR_HEADER(ProfilerStackOp)
 
-    LProfilerStackOp(const LDefinition &temp) {
+    explicit LProfilerStackOp(const LDefinition &temp) {
         setTemp(0, temp);
     }
 
     const LDefinition *temp() {
         return getTemp(0);
     }
 
     JSScript *script() {
@@ -5751,17 +5751,17 @@ class LProfilerStackOp : public LInstruc
         return mir_->toProfilerStackOp()->inlineLevel();
     }
 };
 
 class LIsCallable : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(IsCallable);
-    LIsCallable(const LAllocation &object) {
+    explicit LIsCallable(const LAllocation &object) {
         setOperand(0, object);
     }
 
     const LAllocation *object() {
         return getOperand(0);
     }
     MIsCallable *mir() const {
         return mir_->toIsCallable();
@@ -5789,33 +5789,33 @@ class LHaveSameClass : public LInstructi
         return mir_->toHaveSameClass();
     }
 };
 
 class LHasClass : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(HasClass);
-    LHasClass(const LAllocation &lhs) {
+    explicit LHasClass(const LAllocation &lhs) {
         setOperand(0, lhs);
     }
 
     const LAllocation *lhs() {
         return getOperand(0);
     }
     MHasClass *mir() const {
         return mir_->toHasClass();
     }
 };
 
 class LAsmJSLoadHeap : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(AsmJSLoadHeap);
-    LAsmJSLoadHeap(const LAllocation &ptr) {
+    explicit LAsmJSLoadHeap(const LAllocation &ptr) {
         setOperand(0, ptr);
     }
     MAsmJSLoadHeap *mir() const {
         return mir_->toAsmJSLoadHeap();
     }
     const LAllocation *ptr() {
         return getOperand(0);
     }
@@ -5848,17 +5848,17 @@ class LAsmJSLoadGlobalVar : public LInst
         return mir_->toAsmJSLoadGlobalVar();
     }
 };
 
 class LAsmJSStoreGlobalVar : public LInstructionHelper<0, 1, 0>
 {
   public:
     LIR_HEADER(AsmJSStoreGlobalVar);
-    LAsmJSStoreGlobalVar(const LAllocation &value) {
+    explicit LAsmJSStoreGlobalVar(const LAllocation &value) {
         setOperand(0, value);
     }
     MAsmJSStoreGlobalVar *mir() const {
         return mir_->toAsmJSStoreGlobalVar();
     }
     const LAllocation *value() {
         return getOperand(0);
     }
@@ -5890,17 +5890,17 @@ class LAsmJSVoidReturn : public LInstruc
   public:
     LIR_HEADER(AsmJSVoidReturn);
 };
 
 class LAsmJSPassStackArg : public LInstructionHelper<0, 1, 0>
 {
   public:
     LIR_HEADER(AsmJSPassStackArg);
-    LAsmJSPassStackArg(const LAllocation &arg) {
+    explicit LAsmJSPassStackArg(const LAllocation &arg) {
         setOperand(0, arg);
     }
     MAsmJSPassStackArg *mir() const {
         return mirRaw()->toAsmJSPassStackArg();
     }
     const LAllocation *arg() {
         return getOperand(0);
     }
@@ -5973,17 +5973,17 @@ class LAsmJSCall MOZ_FINAL : public LIns
     }
 };
 
 class LAssertRangeI : public LInstructionHelper<0, 1, 0>
 {
   public:
     LIR_HEADER(AssertRangeI)
 
-    LAssertRangeI(const LAllocation &input) {
+    explicit LAssertRangeI(const LAllocation &input) {
         setOperand(0, input);
     }
 
     const LAllocation *input() {
         return getOperand(0);
     }
 
     MAssertRange *mir() {
@@ -6079,17 +6079,17 @@ class LAssertRangeV : public LInstructio
     }
 };
 
 class LRecompileCheck : public LInstructionHelper<0, 0, 1>
 {
   public:
     LIR_HEADER(RecompileCheck)
 
-    LRecompileCheck(const LDefinition &scratch) {
+    explicit LRecompileCheck(const LDefinition &scratch) {
         setTemp(0, scratch);
     }
 
     const LDefinition *scratch() {
         return getTemp(0);
     }
     MRecompileCheck *mir() {
         return mir_->toRecompileCheck();
--- a/js/src/jit/LIR.h
+++ b/js/src/jit/LIR.h
@@ -251,23 +251,23 @@ class LUse : public LAllocation
                             ((usedAtStart ? 1 : 0) << USED_AT_START_SHIFT));
     }
 
   public:
     LUse(uint32_t vreg, Policy policy, bool usedAtStart = false) {
         set(policy, 0, usedAtStart);
         setVirtualRegister(vreg);
     }
-    LUse(Policy policy, bool usedAtStart = false) {
+    explicit LUse(Policy policy, bool usedAtStart = false) {
         set(policy, 0, usedAtStart);
     }
-    LUse(Register reg, bool usedAtStart = false) {
+    explicit LUse(Register reg, bool usedAtStart = false) {
         set(FIXED, reg.code(), usedAtStart);
     }
-    LUse(FloatRegister reg, bool usedAtStart = false) {
+    explicit LUse(FloatRegister reg, bool usedAtStart = false) {
         set(FIXED, reg.code(), usedAtStart);
     }
     LUse(Register reg, uint32_t virtualRegister) {
         set(FIXED, reg.code(), false);
         setVirtualRegister(virtualRegister);
     }
     LUse(FloatRegister reg, uint32_t virtualRegister) {
         set(FIXED, reg.code(), false);
@@ -450,17 +450,17 @@ class LDefinition
         bits_ = (index << VREG_SHIFT) | (policy << POLICY_SHIFT) | (type << TYPE_SHIFT);
     }
 
   public:
     LDefinition(uint32_t index, Type type, Policy policy = DEFAULT) {
         set(index, type, policy);
     }
 
-    LDefinition(Type type, Policy policy = DEFAULT) {
+    explicit LDefinition(Type type, Policy policy = DEFAULT) {
         set(0, type, policy);
     }
 
     LDefinition(Type type, const LAllocation &a)
       : output_(a)
     {
         set(0, type, PRESET);
     }
@@ -900,17 +900,17 @@ class LRecoverInfo : public TempObject
   private:
     // List of instructions needed to recover the stack frames.
     // Outer frames are stored before inner frames.
     Instructions instructions_;
 
     // Cached offset where this resume point is encoded.
     RecoverOffset recoverOffset_;
 
-    LRecoverInfo(TempAllocator &alloc);
+    explicit LRecoverInfo(TempAllocator &alloc);
     bool init(MResumePoint *mir);
 
     // Fill the instruction vector such as all instructions needed for the
     // recovery are pushed before the current instruction.
     bool appendOperands(MNode *ins);
     bool appendDefinition(MDefinition *def);
     bool appendResumePoint(MResumePoint *rp);
   public:
@@ -940,17 +940,17 @@ class LRecoverInfo : public TempObject
 
     class OperandIter
     {
       private:
         MNode **it_;
         size_t op_;
 
       public:
-        OperandIter(MNode **it)
+        explicit OperandIter(MNode **it)
           : it_(it), op_(0)
         { }
 
         MDefinition *operator *() {
             return (*it_)->getOperand(op_);
         }
         MDefinition *operator ->() {
             return (*it_)->getOperand(op_);
@@ -1128,17 +1128,17 @@ class LSafepoint : public TempObject
     void assertInvariants() {
         // Every register in valueRegs and gcRegs should also be in liveRegs.
 #ifndef JS_NUNBOX32
         JS_ASSERT((valueRegs().bits() & ~liveRegs().gprs().bits()) == 0);
 #endif
         JS_ASSERT((gcRegs().bits() & ~liveRegs().gprs().bits()) == 0);
     }
 
-    LSafepoint(TempAllocator &alloc)
+    explicit LSafepoint(TempAllocator &alloc)
       : safepointOffset_(INVALID_SAFEPOINT_OFFSET)
       , osiCallPointOffset_(0)
       , gcSlots_(alloc)
       , valueSlots_(alloc)
 #ifdef JS_NUNBOX32
       , nunboxParts_(alloc)
       , partialNunboxes_(0)
 #endif
@@ -1418,17 +1418,17 @@ class LInstruction::InputIterator
         // Iterate on the snapshot when iteration over all operands is done.
         if (!snapshot_ && idx_ == ins_.numOperands() && ins_.snapshot()) {
             idx_ = 0;
             snapshot_ = true;
         }
     }
 
 public:
-    InputIterator(LInstruction &ins) :
+    explicit InputIterator(LInstruction &ins) :
       ins_(ins),
       idx_(0),
       snapshot_(false)
     {
         handleOperandsEnd();
     }
 
     bool more() const {
@@ -1501,17 +1501,17 @@ class LIRGraph
     LSnapshot *entrySnapshot_;
 
     // LBlock containing LOsrEntry, or nullptr.
     LBlock *osrBlock_;
 
     MIRGraph &mir_;
 
   public:
-    LIRGraph(MIRGraph *mir);
+    explicit LIRGraph(MIRGraph *mir);
 
     bool init() {
         return constantPoolMap_.init();
     }
     MIRGraph &mir() const {
         return mir_;
     }
     size_t numBlocks() const {
--- a/js/src/jit/LinearScan.h
+++ b/js/src/jit/LinearScan.h
@@ -21,17 +21,17 @@ class LinearScanVirtualRegister : public
 
     bool spillAtDefinition_ : 1;
 
     // This bit is used to determine whether both halves of a nunbox have been
     // processed by freeAllocation().
     bool finished_ : 1;
 
   public:
-    LinearScanVirtualRegister(TempAllocator &alloc)
+    explicit LinearScanVirtualRegister(TempAllocator &alloc)
       : VirtualRegister(alloc)
     {}
     void setCanonicalSpill(LAllocation *alloc) {
         canonicalSpill_ = alloc;
     }
     LAllocation *canonicalSpill() const {
         return canonicalSpill_;
     }
--- a/js/src/jit/LiveRangeAllocator.h
+++ b/js/src/jit/LiveRangeAllocator.h
@@ -28,32 +28,32 @@ class Requirement
         FIXED,
         SAME_AS_OTHER
     };
 
     Requirement()
       : kind_(NONE)
     { }
 
-    Requirement(Kind kind)
+    explicit Requirement(Kind kind)
       : kind_(kind)
     {
         // These have dedicated constructors.
         JS_ASSERT(kind != FIXED && kind != SAME_AS_OTHER);
     }
 
     Requirement(Kind kind, CodePosition at)
       : kind_(kind),
         position_(at)
     {
         // These have dedicated constructors.
         JS_ASSERT(kind != FIXED && kind != SAME_AS_OTHER);
     }
 
-    Requirement(LAllocation fixed)
+    explicit Requirement(LAllocation fixed)
       : kind_(FIXED),
         allocation_(fixed)
     {
         JS_ASSERT(fixed == LAllocation() || !fixed.isUse());
     }
 
     // Only useful as a hint, encodes where the fixed requirement is used to
     // avoid allocating a fixed register too early.
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -176,17 +176,17 @@ class MNode : public TempObject
         Definition,
         ResumePoint
     };
 
     MNode()
       : block_(nullptr)
     { }
 
-    MNode(MBasicBlock *block)
+    explicit MNode(MBasicBlock *block)
       : block_(block)
     { }
 
     virtual Kind kind() const = 0;
 
     // Returns the definition at a given operand.
     virtual MDefinition *getOperand(size_t index) const = 0;
     virtual size_t numOperands() const = 0;
@@ -251,17 +251,17 @@ class AliasSet {
         Last              = AsmJSHeap,
         Any               = Last | (Last - 1),
 
         NumCategories     = 9,
 
         // Indicates load or store.
         Store_            = 1 << 31
     };
-    AliasSet(uint32_t flags)
+    explicit AliasSet(uint32_t flags)
       : flags_(flags)
     {
         JS_STATIC_ASSERT((1 << NumCategories) - 1 == Any);
     }
 
   public:
     inline bool isNone() const {
         return flags_ == None_;
@@ -717,17 +717,17 @@ class MUseDefIterator
         for (; i != def_->usesEnd(); i++) {
             if (i->consumer()->isDefinition())
                 return i;
         }
         return def_->usesEnd();
     }
 
   public:
-    MUseDefIterator(MDefinition *def)
+    explicit MUseDefIterator(MDefinition *def)
       : def_(def),
         current_(search(def->usesBegin()))
     { }
 
     operator bool() const {
         return current_ != def_->usesEnd();
     }
     MUseDefIterator operator ++(int) {
@@ -814,17 +814,17 @@ class MAryInstruction : public MInstruct
 };
 
 class MNullaryInstruction : public MAryInstruction<0>
 { };
 
 class MUnaryInstruction : public MAryInstruction<1>
 {
   protected:
-    MUnaryInstruction(MDefinition *ins)
+    explicit MUnaryInstruction(MDefinition *ins)
     {
         initOperand(0, ins);
     }
 
   public:
     MDefinition *input() const {
         return getOperand(0);
     }
@@ -955,17 +955,17 @@ class MStart : public MNullaryInstructio
         StartType_Default,
         StartType_Osr
     };
 
   private:
     StartType startType_;
 
   private:
-    MStart(StartType startType)
+    explicit MStart(StartType startType)
       : startType_(startType)
     { }
 
   public:
     INSTRUCTION_HEADER(Start)
     static MStart *New(TempAllocator &alloc, StartType startType) {
         return new(alloc) MStart(startType);
     }
@@ -1052,17 +1052,17 @@ class MLimitedTruncate : public MUnaryIn
 
 // A constant js::Value.
 class MConstant : public MNullaryInstruction
 {
     Value value_;
 
   protected:
     MConstant(const Value &v, types::CompilerConstraintList *constraints);
-    MConstant(JSObject *obj);
+    explicit MConstant(JSObject *obj);
 
   public:
     INSTRUCTION_HEADER(Constant)
     static MConstant *New(TempAllocator &alloc, const Value &v,
                           types::CompilerConstraintList *constraints = nullptr);
     static MConstant *NewAsmJS(TempAllocator &alloc, const Value &v, MIRType type);
     static MConstant *NewConstraintlessObject(TempAllocator &alloc, JSObject *v);
 
@@ -1104,17 +1104,17 @@ class MConstant : public MNullaryInstruc
 };
 
 // Deep clone a constant JSObject.
 class MCloneLiteral
   : public MUnaryInstruction,
     public ObjectPolicy<0>
 {
   protected:
-    MCloneLiteral(MDefinition *obj)
+    explicit MCloneLiteral(MDefinition *obj)
       : MUnaryInstruction(obj)
     {
         setResultType(MIRType_Object);
     }
 
   public:
     INSTRUCTION_HEADER(CloneLiteral)
     static MCloneLiteral *New(TempAllocator &alloc, MDefinition *obj);
@@ -1377,17 +1377,17 @@ class MAryControlInstruction : public MC
     void replaceSuccessor(size_t i, MBasicBlock *succ) MOZ_FINAL MOZ_OVERRIDE {
         successors_[i] = succ;
     }
 };
 
 // Jump to the start of another basic block.
 class MGoto : public MAryControlInstruction<0, 1>
 {
-    MGoto(MBasicBlock *target) {
+    explicit MGoto(MBasicBlock *target) {
         setSuccessor(0, target);
     }
 
   public:
     INSTRUCTION_HEADER(Goto)
     static MGoto *New(TempAllocator &alloc, MBasicBlock *target);
 
     MBasicBlock *target() {
@@ -1473,17 +1473,17 @@ class MTest
 #endif
 };
 
 // Returns from this function to the previous caller.
 class MReturn
   : public MAryControlInstruction<1, 0>,
     public BoxInputsPolicy
 {
-    MReturn(MDefinition *ins) {
+    explicit MReturn(MDefinition *ins) {
         initOperand(0, ins);
     }
 
   public:
     INSTRUCTION_HEADER(Return)
     static MReturn *New(TempAllocator &alloc, MDefinition *ins) {
         return new(alloc) MReturn(ins);
     }
@@ -1498,17 +1498,17 @@ class MReturn
         return AliasSet::None();
     }
 };
 
 class MThrow
   : public MAryControlInstruction<1, 0>,
     public BoxInputsPolicy
 {
-    MThrow(MDefinition *ins) {
+    explicit MThrow(MDefinition *ins) {
         initOperand(0, ins);
     }
 
   public:
     INSTRUCTION_HEADER(Throw)
     static MThrow *New(TempAllocator &alloc, MDefinition *ins) {
         return new(alloc) MThrow(ins);
     }
@@ -2311,17 +2311,17 @@ class MGetDynamicName
 };
 
 // Bailout if the input string contains 'arguments' or 'eval'.
 class MFilterArgumentsOrEval
   : public MAryInstruction<1>,
     public BoxExceptPolicy<0, MIRType_String>
 {
   protected:
-    MFilterArgumentsOrEval(MDefinition *string)
+    explicit MFilterArgumentsOrEval(MDefinition *string)
     {
         initOperand(0, string);
         setGuard();
         setResultType(MIRType_None);
     }
 
   public:
     INSTRUCTION_HEADER(FilterArgumentsOrEval)
@@ -2686,17 +2686,17 @@ class MUnbox : public MUnaryInstruction,
         // Should only be called if we're already Infallible or TypeBarrier
         JS_ASSERT(mode() != Fallible);
         mode_ = Infallible;
     }
 };
 
 class MGuardObject : public MUnaryInstruction, public SingleObjectPolicy
 {
-    MGuardObject(MDefinition *ins)
+    explicit MGuardObject(MDefinition *ins)
       : MUnaryInstruction(ins)
     {
         setGuard();
         setMovable();
         setResultType(MIRType_Object);
     }
 
   public:
@@ -2713,17 +2713,17 @@ class MGuardObject : public MUnaryInstru
         return AliasSet::None();
     }
 };
 
 class MGuardString
   : public MUnaryInstruction,
     public StringPolicy<0>
 {
-    MGuardString(MDefinition *ins)
+    explicit MGuardString(MDefinition *ins)
       : MUnaryInstruction(ins)
     {
         setGuard();
         setMovable();
         setResultType(MIRType_String);
     }
 
   public:
@@ -2855,17 +2855,17 @@ class MCreateThisWithProto
 };
 
 // Caller-side allocation of |this| for |new|:
 // Constructs |this| when possible, else MagicValue(JS_IS_CONSTRUCTING).
 class MCreateThis
   : public MUnaryInstruction,
     public ObjectPolicy<0>
 {
-    MCreateThis(MDefinition *callee)
+    explicit MCreateThis(MDefinition *callee)
       : MUnaryInstruction(callee)
     {
         setResultType(MIRType_Value);
     }
 
   public:
     INSTRUCTION_HEADER(CreateThis)
     static MCreateThis *New(TempAllocator &alloc, MDefinition *callee)
@@ -2889,17 +2889,17 @@ class MCreateThis
     }
 };
 
 // Eager initialization of arguments object.
 class MCreateArgumentsObject
   : public MUnaryInstruction,
     public ObjectPolicy<0>
 {
-    MCreateArgumentsObject(MDefinition *callObj)
+    explicit MCreateArgumentsObject(MDefinition *callObj)
       : MUnaryInstruction(callObj)
     {
         setResultType(MIRType_Object);
         setGuard();
     }
 
   public:
     INSTRUCTION_HEADER(CreateArgumentsObject)
@@ -3071,17 +3071,17 @@ class MToDouble
         NumbersOnly
     };
 
   private:
     ConversionKind conversion_;
 
     TruncateKind implicitTruncate_;
 
-    MToDouble(MDefinition *def, ConversionKind conversion = NonStringPrimitives)
+    explicit MToDouble(MDefinition *def, ConversionKind conversion = NonStringPrimitives)
       : MUnaryInstruction(def), conversion_(conversion), implicitTruncate_(NoTruncate)
     {
         setResultType(MIRType_Double);
         setMovable();
 
         // An object might have "valueOf", which means it is effectful.
         if (def->mightBeType(MIRType_Object))
             setGuard();
@@ -3194,17 +3194,17 @@ class MToFloat32
     bool canConsumeFloat32(MUse *use) const { return true; }
     bool canProduceFloat32() const { return true; }
 };
 
 // Converts a uint32 to a double (coming from asm.js).
 class MAsmJSUnsignedToDouble
   : public MUnaryInstruction
 {
-    MAsmJSUnsignedToDouble(MDefinition *def)
+    explicit MAsmJSUnsignedToDouble(MDefinition *def)
       : MUnaryInstruction(def)
     {
         setResultType(MIRType_Double);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(AsmJSUnsignedToDouble);
@@ -3220,17 +3220,17 @@ class MAsmJSUnsignedToDouble
         return AliasSet::None();
     }
 };
 
 // Converts a uint32 to a float32 (coming from asm.js).
 class MAsmJSUnsignedToFloat32
   : public MUnaryInstruction
 {
-    MAsmJSUnsignedToFloat32(MDefinition *def)
+    explicit MAsmJSUnsignedToFloat32(MDefinition *def)
       : MUnaryInstruction(def)
     {
         setResultType(MIRType_Float32);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(AsmJSUnsignedToFloat32);
@@ -3314,17 +3314,17 @@ class MToInt32
     bool isConsistentFloat32Use(MUse *use) const { return true; }
 #endif
 };
 
 // Converts a value or typed input to a truncated int32, for use with bitwise
 // operations. This is an infallible ValueToECMAInt32.
 class MTruncateToInt32 : public MUnaryInstruction
 {
-    MTruncateToInt32(MDefinition *def)
+    explicit MTruncateToInt32(MDefinition *def)
       : MUnaryInstruction(def)
     {
         setResultType(MIRType_Int32);
         setMovable();
 
         // An object might have "valueOf", which means it is effectful.
         if (def->mightBeType(MIRType_Object))
             setGuard();
@@ -3355,17 +3355,17 @@ class MTruncateToInt32 : public MUnaryIn
         return true;
     }
 #endif
 };
 
 // Converts any type to a string
 class MToString : public MUnaryInstruction
 {
-    MToString(MDefinition *def)
+    explicit MToString(MDefinition *def)
       : MUnaryInstruction(def)
     {
         // Converting an object to a string might be effectful.
         JS_ASSERT(!def->mightBeType(MIRType_Object));
 
         // NOP
         JS_ASSERT(def->type() != MIRType_String);
 
@@ -3391,17 +3391,17 @@ class MToString : public MUnaryInstructi
     }
 };
 
 class MBitNot
   : public MUnaryInstruction,
     public BitwisePolicy
 {
   protected:
-    MBitNot(MDefinition *input)
+    explicit MBitNot(MDefinition *input)
       : MUnaryInstruction(input)
     {
         setResultType(MIRType_Int32);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(BitNot)
@@ -4057,17 +4057,17 @@ class MPow
 class MPowHalf
   : public MUnaryInstruction,
     public DoublePolicy<0>
 {
     bool operandIsNeverNegativeInfinity_;
     bool operandIsNeverNegativeZero_;
     bool operandIsNeverNaN_;
 
-    MPowHalf(MDefinition *input)
+    explicit MPowHalf(MDefinition *input)
       : MUnaryInstruction(input),
         operandIsNeverNegativeInfinity_(false),
         operandIsNeverNegativeZero_(false),
         operandIsNeverNaN_(false)
     {
         setResultType(MIRType_Double);
         setMovable();
     }
@@ -4642,17 +4642,17 @@ class MCharCodeAt
 
     void computeRange(TempAllocator &alloc);
 };
 
 class MFromCharCode
   : public MUnaryInstruction,
     public IntPolicy<0>
 {
-    MFromCharCode(MDefinition *code)
+    explicit MFromCharCode(MDefinition *code)
       : MUnaryInstruction(code)
     {
         setMovable();
         setResultType(MIRType_String);
     }
 
   public:
     INSTRUCTION_HEADER(FromCharCode)
@@ -4719,17 +4719,17 @@ class MStringSplit
 };
 
 // Returns an object to use as |this| value. See also ComputeThis and
 // BoxNonStrictThis in Interpreter.h.
 class MComputeThis
   : public MUnaryInstruction,
     public BoxPolicy<0>
 {
-    MComputeThis(MDefinition *def)
+    explicit MComputeThis(MDefinition *def)
       : MUnaryInstruction(def)
     {
         setResultType(MIRType_Object);
     }
 
   public:
     INSTRUCTION_HEADER(ComputeThis)
 
@@ -4751,17 +4751,17 @@ class MComputeThis
     // effectful.
 };
 
 // Load an arrow function's |this| value.
 class MLoadArrowThis
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
-    MLoadArrowThis(MDefinition *callee)
+    explicit MLoadArrowThis(MDefinition *callee)
       : MUnaryInstruction(callee)
     {
         setResultType(MIRType_Value);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(LoadArrowThis)
@@ -4993,17 +4993,17 @@ class MOsrValue : public MUnaryInstructi
     }
 };
 
 // MIR representation of a JSObject scope chain pointer on the OSR BaselineFrame.
 // The pointer is indexed off of OsrFrameReg.
 class MOsrScopeChain : public MUnaryInstruction
 {
   private:
-    MOsrScopeChain(MOsrEntry *entry)
+    explicit MOsrScopeChain(MOsrEntry *entry)
       : MUnaryInstruction(entry)
     {
         setResultType(MIRType_Object);
     }
 
   public:
     INSTRUCTION_HEADER(OsrScopeChain)
     static MOsrScopeChain *New(TempAllocator &alloc, MOsrEntry *entry) {
@@ -5015,17 +5015,17 @@ class MOsrScopeChain : public MUnaryInst
     }
 };
 
 // MIR representation of a JSObject ArgumentsObject pointer on the OSR BaselineFrame.
 // The pointer is indexed off of OsrFrameReg.
 class MOsrArgumentsObject : public MUnaryInstruction
 {
   private:
-    MOsrArgumentsObject(MOsrEntry *entry)
+    explicit MOsrArgumentsObject(MOsrEntry *entry)
       : MUnaryInstruction(entry)
     {
         setResultType(MIRType_Object);
     }
 
   public:
     INSTRUCTION_HEADER(OsrArgumentsObject)
     static MOsrArgumentsObject *New(TempAllocator &alloc, MOsrEntry *entry) {
@@ -5037,17 +5037,17 @@ class MOsrArgumentsObject : public MUnar
     }
 };
 
 // MIR representation of the return value on the OSR BaselineFrame.
 // The Value is indexed off of OsrFrameReg.
 class MOsrReturnValue : public MUnaryInstruction
 {
   private:
-    MOsrReturnValue(MOsrEntry *entry)
+    explicit MOsrReturnValue(MOsrEntry *entry)
       : MUnaryInstruction(entry)
     {
         setResultType(MIRType_Value);
     }
 
   public:
     INSTRUCTION_HEADER(OsrReturnValue)
     static MOsrReturnValue *New(TempAllocator &alloc, MOsrEntry *entry) {
@@ -5069,17 +5069,17 @@ class MCheckOverRecursed : public MNulla
         return new(alloc) MCheckOverRecursed();
     }
 };
 
 // Check the current frame for over-recursion past the global stack limit.
 // Uses the per-thread recursion limit.
 class MCheckOverRecursedPar : public MUnaryInstruction
 {
-    MCheckOverRecursedPar(MDefinition *cx)
+    explicit MCheckOverRecursedPar(MDefinition *cx)
       : MUnaryInstruction(cx)
     {
         setResultType(MIRType_None);
         setGuard();
         setMovable();
     }
 
   public:
@@ -5092,17 +5092,17 @@ class MCheckOverRecursedPar : public MUn
     MDefinition *forkJoinContext() const {
         return getOperand(0);
     }
 };
 
 // Check for an interrupt (or rendezvous) in parallel mode.
 class MInterruptCheckPar : public MUnaryInstruction
 {
-    MInterruptCheckPar(MDefinition *cx)
+    explicit MInterruptCheckPar(MDefinition *cx)
       : MUnaryInstruction(cx)
     {
         setResultType(MIRType_None);
         setGuard();
         setMovable();
     }
 
   public:
@@ -5392,17 +5392,17 @@ struct LambdaFunctionInfo
     // the script, and are immutable except for delazification. Record this
     // information while still on the main thread to avoid races.
     CompilerRootFunction fun;
     uint16_t flags;
     gc::Cell *scriptOrLazyScript;
     bool singletonType;
     bool useNewTypeForClone;
 
-    LambdaFunctionInfo(JSFunction *fun)
+    explicit LambdaFunctionInfo(JSFunction *fun)
       : fun(fun), flags(fun->flags()),
         scriptOrLazyScript(fun->hasScript()
                            ? (gc::Cell *) fun->nonLazyScript()
                            : (gc::Cell *) fun->lazyScript()),
         singletonType(fun->hasSingletonType()),
         useNewTypeForClone(types::UseNewTypeForClone(fun))
     {}
 
@@ -5526,17 +5526,17 @@ class MLambdaPar
     }
 };
 
 // Determines the implicit |this| value for function calls.
 class MImplicitThis
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
-    MImplicitThis(MDefinition *callee)
+    explicit MImplicitThis(MDefinition *callee)
       : MUnaryInstruction(callee)
     {
         setResultType(MIRType_Value);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(ImplicitThis)
@@ -5556,17 +5556,17 @@ class MImplicitThis
     }
 };
 
 // Returns obj->slots.
 class MSlots
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
-    MSlots(MDefinition *object)
+    explicit MSlots(MDefinition *object)
       : MUnaryInstruction(object)
     {
         setResultType(MIRType_Slots);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(Slots)
@@ -5589,17 +5589,17 @@ class MSlots
     }
 };
 
 // Returns obj->elements.
 class MElements
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
-    MElements(MDefinition *object)
+    explicit MElements(MDefinition *object)
       : MUnaryInstruction(object)
     {
         setResultType(MIRType_Elements);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(Elements)
@@ -5623,17 +5623,17 @@ class MElements
 };
 
 // A constant value for some object's array elements or typed array elements.
 class MConstantElements : public MNullaryInstruction
 {
     void *value_;
 
   protected:
-    MConstantElements(void *v)
+    explicit MConstantElements(void *v)
       : value_(v)
     {
         setResultType(MIRType_Elements);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(ConstantElements)
@@ -5659,17 +5659,17 @@ class MConstantElements : public MNullar
         return AliasSet::None();
     }
 };
 
 // Passes through an object's elements, after ensuring it is entirely doubles.
 class MConvertElementsToDoubles
   : public MUnaryInstruction
 {
-    MConvertElementsToDoubles(MDefinition *elements)
+    explicit MConvertElementsToDoubles(MDefinition *elements)
       : MUnaryInstruction(elements)
     {
         setGuard();
         setMovable();
         setResultType(MIRType_Elements);
     }
 
   public:
@@ -5737,17 +5737,17 @@ class MMaybeToDoubleElement
         return AliasSet::Load(AliasSet::ObjectFields);
     }
 };
 
 // Load the initialized length from an elements header.
 class MInitializedLength
   : public MUnaryInstruction
 {
-    MInitializedLength(MDefinition *elements)
+    explicit MInitializedLength(MDefinition *elements)
       : MUnaryInstruction(elements)
     {
         setResultType(MIRType_Int32);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(InitializedLength)
@@ -5796,17 +5796,17 @@ class MSetInitializedLength
         return AliasSet::Store(AliasSet::ObjectFields);
     }
 };
 
 // Load the array length from an elements header.
 class MArrayLength
   : public MUnaryInstruction
 {
-    MArrayLength(MDefinition *elements)
+    explicit MArrayLength(MDefinition *elements)
       : MUnaryInstruction(elements)
     {
         setResultType(MIRType_Int32);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(ArrayLength)
@@ -5856,17 +5856,17 @@ class MSetArrayLength
     }
 };
 
 // Read the length of a typed array.
 class MTypedArrayLength
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
-    MTypedArrayLength(MDefinition *obj)
+    explicit MTypedArrayLength(MDefinition *obj)
       : MUnaryInstruction(obj)
     {
         setResultType(MIRType_Int32);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(TypedArrayLength)
@@ -5893,17 +5893,17 @@ class MTypedArrayLength
     void computeRange(TempAllocator &alloc);
 };
 
 // Load a typed array's elements vector.
 class MTypedArrayElements
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
-    MTypedArrayElements(MDefinition *object)
+    explicit MTypedArrayElements(MDefinition *object)
       : MUnaryInstruction(object)
     {
         setResultType(MIRType_Elements);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(TypedArrayElements)
@@ -5926,17 +5926,17 @@ class MTypedArrayElements
     }
 };
 
 // Checks whether a typed object is neutered.
 class MNeuterCheck
   : public MUnaryInstruction
 {
   private:
-    MNeuterCheck(MDefinition *object)
+    explicit MNeuterCheck(MDefinition *object)
       : MUnaryInstruction(object)
     {
         JS_ASSERT(object->type() == MIRType_Object);
         setResultType(MIRType_Object);
         setResultTypeSet(object->resultTypeSet());
         setGuard();
         setMovable();
     }
@@ -5964,17 +5964,17 @@ class MNeuterCheck
 // Load a binary data object's "elements", which is just its opaque
 // binary data space. Eventually this should probably be
 // unified with `MTypedArrayElements`.
 class MTypedObjectElements
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
   private:
-    MTypedObjectElements(MDefinition *object)
+    explicit MTypedObjectElements(MDefinition *object)
       : MUnaryInstruction(object)
     {
         setResultType(MIRType_Elements);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(TypedObjectElements)
@@ -6039,17 +6039,17 @@ class MSetTypedObjectOffset
 class MNot
   : public MUnaryInstruction,
     public TestPolicy
 {
     bool operandMightEmulateUndefined_;
     bool operandIsNeverNaN_;
 
   public:
-    MNot(MDefinition *input)
+    explicit MNot(MDefinition *input)
       : MUnaryInstruction(input),
         operandMightEmulateUndefined_(true),
         operandIsNeverNaN_(false)
     {
         setResultType(MIRType_Boolean);
         setMovable();
     }
 
@@ -6163,17 +6163,17 @@ class MBoundsCheck
 
 // Bailout if index < minimum.
 class MBoundsCheckLower
   : public MUnaryInstruction
 {
     int32_t minimum_;
     bool fallible_;
 
-    MBoundsCheckLower(MDefinition *index)
+    explicit MBoundsCheckLower(MDefinition *index)
       : MUnaryInstruction(index), minimum_(0), fallible_(true)
     {
         setGuard();
         setMovable();
         JS_ASSERT(index->type() == MIRType_Int32);
     }
 
   public:
@@ -6990,17 +6990,17 @@ class MEffectiveAddress : public MBinary
     }
 };
 
 // Clamp input to range [0, 255] for Uint8ClampedArray.
 class MClampToUint8
   : public MUnaryInstruction,
     public ClampPolicy
 {
-    MClampToUint8(MDefinition *input)
+    explicit MClampToUint8(MDefinition *input)
       : MUnaryInstruction(input)
     {
         setResultType(MIRType_Int32);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(ClampToUint8)
@@ -7959,17 +7959,17 @@ class MLoadSlot
 };
 
 // Inline call to access a function's environment (scope chain).
 class MFunctionEnvironment
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
   public:
-    MFunctionEnvironment(MDefinition *function)
+    explicit MFunctionEnvironment(MDefinition *function)
         : MUnaryInstruction(function)
     {
         setResultType(MIRType_Object);
         setMovable();
     }
 
     INSTRUCTION_HEADER(FunctionEnvironment)
 
@@ -8020,17 +8020,17 @@ class MForkJoinContext
     }
 };
 
 // Calls the ForkJoinGetSlice stub, used for inlining the eponymous intrinsic.
 // Only applicable in ParallelExecution.
 class MForkJoinGetSlice
   : public MUnaryInstruction
 {
-    MForkJoinGetSlice(MDefinition *cx)
+    explicit MForkJoinGetSlice(MDefinition *cx)
       : MUnaryInstruction(cx)
     {
         setResultType(MIRType_Int32);
     }
 
   public:
     INSTRUCTION_HEADER(ForkJoinGetSlice);
 
@@ -8152,17 +8152,17 @@ class MGetNameCache
         return kind_;
     }
 };
 
 class MCallGetIntrinsicValue : public MNullaryInstruction
 {
     CompilerRootPropertyName name_;
 
-    MCallGetIntrinsicValue(PropertyName *name)
+    explicit MCallGetIntrinsicValue(PropertyName *name)
       : name_(name)
     {
         setResultType(MIRType_Value);
     }
 
   public:
     INSTRUCTION_HEADER(CallGetIntrinsicValue)
 
@@ -8735,17 +8735,17 @@ class MGetDOMMember : public MGetDOMProp
         return false;
     }
 };
 
 class MStringLength
   : public MUnaryInstruction,
     public StringPolicy<0>
 {
-    MStringLength(MDefinition *string)
+    explicit MStringLength(MDefinition *string)
       : MUnaryInstruction(string)
     {
         setResultType(MIRType_Int32);
         setMovable();
     }
   public:
     INSTRUCTION_HEADER(StringLength)
 
@@ -8774,17 +8774,17 @@ class MStringLength
     void computeRange(TempAllocator &alloc);
 };
 
 // Inlined version of Math.floor().
 class MFloor
   : public MUnaryInstruction,
     public FloatingPointPolicy<0>
 {
-    MFloor(MDefinition *num)
+    explicit MFloor(MDefinition *num)
       : MUnaryInstruction(num)
     {
         setResultType(MIRType_Int32);
         setPolicyType(MIRType_Double);
         setMovable();
     }
 
   public:
@@ -8861,17 +8861,17 @@ class MCeil
     }
 };
 
 // Inlined version of Math.round().
 class MRound
   : public MUnaryInstruction,
     public FloatingPointPolicy<0>
 {
-    MRound(MDefinition *num)
+    explicit MRound(MDefinition *num)
       : MUnaryInstruction(num)
     {
         setResultType(MIRType_Int32);
         setPolicyType(MIRType_Double);
         setMovable();
     }
 
   public:
@@ -8934,17 +8934,17 @@ class MIteratorStart
         return flags_;
     }
 };
 
 class MIteratorNext
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
-    MIteratorNext(MDefinition *iter)
+    explicit MIteratorNext(MDefinition *iter)
       : MUnaryInstruction(iter)
     {
         setResultType(MIRType_Value);
     }
 
   public:
     INSTRUCTION_HEADER(IteratorNext)
 
@@ -8959,17 +8959,17 @@ class MIteratorNext
         return getOperand(0);
     }
 };
 
 class MIteratorMore
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
-    MIteratorMore(MDefinition *iter)
+    explicit MIteratorMore(MDefinition *iter)
       : MUnaryInstruction(iter)
     {
         setResultType(MIRType_Boolean);
     }
 
   public:
     INSTRUCTION_HEADER(IteratorMore)
 
@@ -8984,17 +8984,17 @@ class MIteratorMore
         return getOperand(0);
     }
 };
 
 class MIteratorEnd
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
-    MIteratorEnd(MDefinition *iter)
+    explicit MIteratorEnd(MDefinition *iter)
       : MUnaryInstruction(iter)
     { }
 
   public:
     INSTRUCTION_HEADER(IteratorEnd)
 
     static MIteratorEnd *New(TempAllocator &alloc, MDefinition *iter) {
         return new(alloc) MIteratorEnd(iter);
@@ -9585,17 +9585,17 @@ class MPostWriteBarrier : public MBinary
     }
 #endif
 };
 
 class MNewDeclEnvObject : public MNullaryInstruction
 {
     CompilerRootObject templateObj_;
 
-    MNewDeclEnvObject(JSObject *templateObj)
+    explicit MNewDeclEnvObject(JSObject *templateObj)
       : MNullaryInstruction(),
         templateObj_(templateObj)
     {
         setResultType(MIRType_Object);
     }
 
   public:
     INSTRUCTION_HEADER(NewDeclEnvObject);
@@ -9612,17 +9612,17 @@ class MNewDeclEnvObject : public MNullar
     }
 };
 
 class MNewCallObjectBase : public MNullaryInstruction
 {
     CompilerRootObject templateObj_;
 
   protected:
-    MNewCallObjectBase(JSObject *templateObj)
+    explicit MNewCallObjectBase(JSObject *templateObj)
       : MNullaryInstruction(),
         templateObj_(templateObj)
     {
         setResultType(MIRType_Object);
     }
 
   public:
     JSObject *templateObject() {
@@ -9633,33 +9633,33 @@ class MNewCallObjectBase : public MNulla
     }
 };
 
 class MNewCallObject : public MNewCallObjectBase
 {
   public:
     INSTRUCTION_HEADER(NewCallObject)
 
-    MNewCallObject(JSObject *templateObj)
+    explicit MNewCallObject(JSObject *templateObj)
       : MNewCallObjectBase(templateObj)
     {}
 
     static MNewCallObject *
     New(TempAllocator &alloc, JSObject *templateObj)
     {
         return new(alloc) MNewCallObject(templateObj);
     }
 };
 
 class MNewRunOnceCallObject : public MNewCallObjectBase
 {
   public:
     INSTRUCTION_HEADER(NewRunOnceCallObject)
 
-    MNewRunOnceCallObject(JSObject *templateObj)
+    explicit MNewRunOnceCallObject(JSObject *templateObj)
       : MNewCallObjectBase(templateObj)
     {}
 
     static MNewRunOnceCallObject *
     New(TempAllocator &alloc, JSObject *templateObj)
     {
         return new(alloc) MNewRunOnceCallObject(templateObj);
     }
@@ -9775,17 +9775,17 @@ class MProfilerStackOp : public MNullary
     AliasSet getAliasSet() const {
         return AliasSet::None();
     }
 };
 
 // This is an alias for MLoadFixedSlot.
 class MEnclosingScope : public MLoadFixedSlot
 {
-    MEnclosingScope(MDefinition *obj)
+    explicit MEnclosingScope(MDefinition *obj)
       : MLoadFixedSlot(obj, ScopeObject::enclosingScopeSlot())
     {
         setResultType(MIRType_Object);
     }
 
   public:
     static MEnclosingScope *New(TempAllocator &alloc, MDefinition *obj) {
         return new(alloc) MEnclosingScope(obj);
@@ -9948,17 +9948,17 @@ class MResumePoint MOZ_FINAL : public MN
     virtual void dump(FILE *fp) const;
     virtual void dump() const;
 };
 
 class MIsCallable
   : public MUnaryInstruction,
     public SingleObjectPolicy
 {
-    MIsCallable(MDefinition *object)
+    explicit MIsCallable(MDefinition *object)
       : MUnaryInstruction(object)
     {
         setResultType(MIRType_Boolean);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(IsCallable);
@@ -10245,17 +10245,17 @@ class MAsmJSLoadFuncPtr : public MUnaryI
     }
 
     unsigned globalDataOffset() const { return globalDataOffset_; }
     MDefinition *index() const { return getOperand(0); }
 };
 
 class MAsmJSLoadFFIFunc : public MNullaryInstruction
 {
-    MAsmJSLoadFFIFunc(unsigned globalDataOffset)
+    explicit MAsmJSLoadFFIFunc(unsigned globalDataOffset)
       : globalDataOffset_(globalDataOffset)
     {
         setResultType(MIRType_Pointer);
     }
 
     unsigned globalDataOffset_;
 
   public:
@@ -10286,17 +10286,17 @@ class MAsmJSParameter : public MNullaryI
         return new(alloc) MAsmJSParameter(abi, mirType);
     }
 
     ABIArg abi() const { return abi_; }
 };
 
 class MAsmJSReturn : public MAryControlInstruction<1, 0>
 {
-    MAsmJSReturn(MDefinition *ins) {
+    explicit MAsmJSReturn(MDefinition *ins) {
         initOperand(0, ins);
     }
 
   public:
     INSTRUCTION_HEADER(AsmJSReturn);
     static MAsmJSReturn *New(TempAllocator &alloc, MDefinition *ins) {
         return new(alloc) MAsmJSReturn(ins);
     }
@@ -10346,19 +10346,19 @@ class MAsmJSCall MOZ_FINAL : public MIns
         Which which_;
         union {
             Label *internal_;
             MDefinition *dynamic_;
             AsmJSImmKind builtin_;
         } u;
       public:
         Callee() {}
-        Callee(Label *callee) : which_(Internal) { u.internal_ = callee; }
-        Callee(MDefinition *callee) : which_(Dynamic) { u.dynamic_ = callee; }
-        Callee(AsmJSImmKind callee) : which_(Builtin) { u.builtin_ = callee; }
+        explicit Callee(Label *callee) : which_(Internal) { u.internal_ = callee; }
+        explicit Callee(MDefinition *callee) : which_(Dynamic) { u.dynamic_ = callee; }
+        explicit Callee(AsmJSImmKind callee) : which_(Builtin) { u.builtin_ = callee; }
         Which which() const { return which_; }
         Label *internal() const { JS_ASSERT(which_ == Internal); return u.internal_; }
         MDefinition *dynamic() const { JS_ASSERT(which_ == Dynamic); return u.dynamic_; }
         AsmJSImmKind builtin() const { JS_ASSERT(which_ == Builtin); return u.builtin_; }
     };
 
   private:
     struct Operand {
--- a/js/src/jit/MIRGraph.h
+++ b/js/src/jit/MIRGraph.h
@@ -540,17 +540,17 @@ class MIRGraph
     uint32_t idGen_;
     MBasicBlock *osrBlock_;
     MStart *osrStart_;
 
     size_t numBlocks_;
     bool hasTryBlock_;
 
   public:
-    MIRGraph(TempAllocator *alloc)
+    explicit MIRGraph(TempAllocator *alloc)
       : alloc_(alloc),
         returnAccumulator_(nullptr),
         blockIdGen_(0),
         idGen_(1),
         osrBlock_(nullptr),
         osrStart_(nullptr),
         numBlocks_(0),
         hasTryBlock_(false)
@@ -693,17 +693,17 @@ class MDefinitionIterator
             iter_++;
     }
 
     bool more() const {
         return atPhi() || (*iter_) != block_->lastIns();
     }
 
   public:
-    MDefinitionIterator(MBasicBlock *block)
+    explicit MDefinitionIterator(MBasicBlock *block)
       : block_(block),
         phiIter_(block->phisBegin()),
         iter_(block->begin())
     { }
 
     MDefinitionIterator operator ++(int) {
         MDefinitionIterator old(*this);
         if (more())
--- a/js/src/jit/ParallelSafetyAnalysis.cpp
+++ b/js/src/jit/ParallelSafetyAnalysis.cpp
@@ -87,17 +87,17 @@ class ParallelSafetyVisitor : public MIn
         return true;
     }
 
     TempAllocator &alloc() const {
         return graph_.alloc();
     }
 
   public:
-    ParallelSafetyVisitor(MIRGraph &graph)
+    explicit ParallelSafetyVisitor(MIRGraph &graph)
       : graph_(graph),
         unsafe_(false),
         cx_(nullptr)
     { }
 
     void clearUnsafe() { unsafe_ = false; }
     bool unsafe() { return unsafe_; }
     MDefinition *ForkJoinContext() {
--- a/js/src/jit/RangeAnalysis.h
+++ b/js/src/jit/RangeAnalysis.h
@@ -361,17 +361,17 @@ class Range : public TempObject {
         symbolicUpper_(nullptr)
     {
         assertInvariants();
     }
 
     // Construct a range from the given MDefinition. This differs from the
     // MDefinition's range() method in that it describes the range of values
     // *after* any bailout checks.
-    Range(const MDefinition *def);
+    explicit Range(const MDefinition *def);
 
     static Range *NewInt32Range(TempAllocator &alloc, int32_t l, int32_t h) {
         return new(alloc) Range(l, h, false, MaxInt32Exponent);
     }
 
     static Range *NewUInt32Range(TempAllocator &alloc, uint32_t l, uint32_t h) {
         // For now, just pass them to the constructor as int64_t values.
         // They'll become unbounded if they're not in the int32_t range.
--- a/js/src/jit/Recover.h
+++ b/js/src/jit/Recover.h
@@ -63,17 +63,17 @@ class RInstruction
     // tag written by the writeRecoverData function of the corresponding MIR
     // instruction.
     static void readRecoverData(CompactBufferReader &reader, RInstructionStorage *raw);
 };
 
 #define RINSTRUCTION_HEADER_(op)                                        \
   private:                                                              \
     friend class RInstruction;                                          \
-    R##op(CompactBufferReader &reader);                                 \
+    explicit R##op(CompactBufferReader &reader);                        \
                                                                         \
   public:                                                               \
     Opcode opcode() const {                                             \
         return RInstruction::Recover_##op;                              \
     }
 
 class RResumePoint MOZ_FINAL : public RInstruction
 {
--- a/js/src/jit/RegisterAllocator.h
+++ b/js/src/jit/RegisterAllocator.h
@@ -133,17 +133,17 @@ struct AllocationIntegrityState
 // this instruction, it can be clobbered in the output". Just having ranges
 // of instruction IDs is insufficiently expressive to denote all possibilities.
 // This class solves this issue by associating an extra bit with the instruction
 // ID which indicates whether the position is the input half or output half of
 // an instruction.
 class CodePosition
 {
   private:
-    MOZ_CONSTEXPR CodePosition(const uint32_t &bits)
+    MOZ_CONSTEXPR explicit CodePosition(const uint32_t &bits)
       : bits_(bits)
     { }
 
     static const unsigned int INSTRUCTION_SHIFT = 1;
     static const unsigned int SUBPOSITION_MASK = 1;
     uint32_t bits_;
 
   public:
--- a/js/src/jit/RegisterSets.h
+++ b/js/src/jit/RegisterSets.h
@@ -161,17 +161,17 @@ class TypedOrValueRegister
     {}
 
     TypedOrValueRegister(MIRType type, AnyRegister reg)
       : type_(type)
     {
         dataTyped() = reg;
     }
 
-    TypedOrValueRegister(ValueOperand value)
+    MOZ_IMPLICIT TypedOrValueRegister(ValueOperand value)
       : type_(MIRType_Value)
     {
         dataValue() = value;
     }
 
     MIRType type() const {
         return type_;
     }
@@ -220,23 +220,23 @@ class ConstantOrRegister
         return *data.reg.addr();
     }
 
   public:
 
     ConstantOrRegister()
     {}
 
-    ConstantOrRegister(Value value)
+    MOZ_IMPLICIT ConstantOrRegister(Value value)
       : constant_(true)
     {
         dataValue() = value;
     }
 
-    ConstantOrRegister(TypedOrValueRegister reg)
+    MOZ_IMPLICIT ConstantOrRegister(TypedOrValueRegister reg)
       : constant_(false)
     {
         dataReg() = reg;
     }
 
     bool constant() {
         return constant_;
     }
@@ -626,17 +626,17 @@ class RegisterSet {
 // Use TypedRegisterBackwardIterator or TypedRegisterForwardIterator if a
 // specific order is required.
 template <typename T>
 class TypedRegisterIterator
 {
     TypedRegisterSet<T> regset_;
 
   public:
-    TypedRegisterIterator(TypedRegisterSet<T> regset) : regset_(regset)
+    explicit TypedRegisterIterator(TypedRegisterSet<T> regset) : regset_(regset)
     { }
     TypedRegisterIterator(const TypedRegisterIterator &other) : regset_(other.regset_)
     { }
 
     bool more() const {
         return !regset_.empty();
     }
     TypedRegisterIterator<T> operator ++(int) {
@@ -655,17 +655,17 @@ class TypedRegisterIterator
 
 // iterates backwards, that is, rn to r0
 template <typename T>
 class TypedRegisterBackwardIterator
 {
     TypedRegisterSet<T> regset_;
 
   public:
-    TypedRegisterBackwardIterator(TypedRegisterSet<T> regset) : regset_(regset)
+    explicit TypedRegisterBackwardIterator(TypedRegisterSet<T> regset) : regset_(regset)
     { }
     TypedRegisterBackwardIterator(const TypedRegisterBackwardIterator &other)
       : regset_(other.regset_)
     { }
 
     bool more() const {
         return !regset_.empty();
     }
@@ -685,17 +685,17 @@ class TypedRegisterBackwardIterator
 
 // iterates forwards, that is r0 to rn
 template <typename T>
 class TypedRegisterForwardIterator
 {
     TypedRegisterSet<T> regset_;
 
   public:
-    TypedRegisterForwardIterator(TypedRegisterSet<T> regset) : regset_(regset)
+    explicit TypedRegisterForwardIterator(TypedRegisterSet<T> regset) : regset_(regset)
     { }
     TypedRegisterForwardIterator(const TypedRegisterForwardIterator &other) : regset_(other.regset_)
     { }
 
     bool more() const {
         return !regset_.empty();
     }
     TypedRegisterForwardIterator<T> operator ++(int) {
@@ -726,17 +726,17 @@ class AnyRegisterIterator
 
   public:
     AnyRegisterIterator()
       : geniter_(GeneralRegisterSet::All()), floatiter_(FloatRegisterSet::All())
     { }
     AnyRegisterIterator(GeneralRegisterSet genset, FloatRegisterSet floatset)
       : geniter_(genset), floatiter_(floatset)
     { }
-    AnyRegisterIterator(const RegisterSet &set)
+    explicit AnyRegisterIterator(const RegisterSet &set)
       : geniter_(set.gpr_), floatiter_(set.fpu_)
     { }
     AnyRegisterIterator(const AnyRegisterIterator &other)
       : geniter_(other.geniter_), floatiter_(other.floatiter_)
     { }
     bool more() const {
         return geniter_.more() || floatiter_.more();
     }
@@ -765,19 +765,19 @@ class ABIArg
     union {
         Registers::Code gpr_;
         FloatRegisters::Code fpu_;
         uint32_t offset_;
     } u;
 
   public:
     ABIArg() : kind_(Kind(-1)) { u.offset_ = -1; }
-    ABIArg(Register gpr) : kind_(GPR) { u.gpr_ = gpr.code(); }
-    ABIArg(FloatRegister fpu) : kind_(FPU) { u.fpu_ = fpu.code(); }
-    ABIArg(uint32_t offset) : kind_(Stack) { u.offset_ = offset; }
+    explicit ABIArg(Register gpr) : kind_(GPR) { u.gpr_ = gpr.code(); }
+    explicit ABIArg(FloatRegister fpu) : kind_(FPU) { u.fpu_ = fpu.code(); }
+    explicit ABIArg(uint32_t offset) : kind_(Stack) { u.offset_ = offset; }
 
     Kind kind() const { return kind_; }
     Register gpr() const { JS_ASSERT(kind() == GPR); return Register::FromCode(u.gpr_); }
     FloatRegister fpu() const { JS_ASSERT(kind() == FPU); return FloatRegister::FromCode(u.fpu_); }
     uint32_t offsetFromArgBase() const { JS_ASSERT(kind() == Stack); return u.offset_; }
 
     bool argInRegister() const { return kind() != Stack; }
     AnyRegister reg() const { return kind_ == GPR ? AnyRegister(gpr()) : AnyRegister(fpu()); }
--- a/js/src/jit/RematerializedFrame.cpp
+++ b/js/src/jit/RematerializedFrame.cpp
@@ -14,17 +14,17 @@
 
 using namespace js;
 using namespace jit;
 
 struct CopyValueToRematerializedFrame
 {
     Value *slots;
 
-    CopyValueToRematerializedFrame(Value *slots)
+    explicit CopyValueToRematerializedFrame(Value *slots)
       : slots(slots)
     { }
 
     void operator()(const Value &v) {
         *slots++ = v;
     }
 };
 
--- a/js/src/jit/Safepoints.cpp
+++ b/js/src/jit/Safepoints.cpp
@@ -374,17 +374,17 @@ SafepointReader::osiReturnPointOffset() 
     return osiCallPointOffset_ + Assembler::patchWrite_NearCallSize();
 }
 
 CodeLocationLabel
 SafepointReader::InvalidationPatchPoint(IonScript *script, const SafepointIndex *si)
 {
     SafepointReader reader(script, si);
 
-    return CodeLocationLabel(script->method(), reader.osiCallPointOffset());
+    return CodeLocationLabel(script->method(), CodeOffsetLabel(reader.osiCallPointOffset()));
 }
 
 void
 SafepointReader::advanceFromGcRegs()
 {
     currentSlotChunk_ = 0;
     nextSlotChunkNumber_ = 0;
 }
--- a/js/src/jit/Snapshots.h
+++ b/js/src/jit/Snapshots.h
@@ -144,17 +144,17 @@ class RValueAllocation
     }
 
     RValueAllocation(Mode mode, Payload a1)
       : mode_(mode),
         arg1_(a1)
     {
     }
 
-    RValueAllocation(Mode mode)
+    explicit RValueAllocation(Mode mode)
       : mode_(mode)
     {
     }
 
   public:
     RValueAllocation()
       : mode_(INVALID)
     { }
--- a/js/src/jit/TypePolicy.h
+++ b/js/src/jit/TypePolicy.h
@@ -95,17 +95,17 @@ class CallPolicy : public BoxInputsPolic
 };
 
 // Policy for MPow. First operand Double; second Double or Int32.
 class PowPolicy : public BoxInputsPolicy
 {
     MIRType specialization_;
 
   public:
-    PowPolicy(MIRType specialization)
+    explicit PowPolicy(MIRType specialization)
       : specialization_(specialization)
     { }
 
     bool adjustInputs(TempAllocator &alloc, MInstruction *ins);
 };
 
 // Expect a string for operand Op. If the input is a Value, it is unboxed.
 template <unsigned Op>
--- a/js/src/jit/VMFunctions.h
+++ b/js/src/jit/VMFunctions.h
@@ -237,17 +237,17 @@ struct VMFunction
   private:
     // Add this to the global list of VMFunctions.
     void addToFunctions();
 };
 
 // A collection of VM functions for each execution mode.
 struct VMFunctionsModal
 {
-    VMFunctionsModal(const VMFunction &info) {
+    explicit VMFunctionsModal(const VMFunction &info) {
         add(info);
     }
     VMFunctionsModal(const VMFunction &info1, const VMFunction &info2) {
         add(info1);
         add(info2);
     }
 
     inline const VMFunction &operator[](ExecutionMode mode) const {
@@ -440,17 +440,17 @@ template <> struct MatchContext<ThreadSa
         return ForEachNb(COMPUTE_ARG_PROP, SEP_OR, NOTHING);                            \
     }                                                                                   \
     static inline uint32_t argumentPassedInFloatRegs() {                                \
         return ForEachNb(COMPUTE_ARG_FLOAT, SEP_OR, NOTHING);                           \
     }                                                                                   \
     static inline uint64_t argumentRootTypes() {                                        \
         return ForEachNb(COMPUTE_ARG_ROOT, SEP_OR, NOTHING);                            \
     }                                                                                   \
-    FunctionInfo(pf fun, PopValues extraValuesToPop = PopValues(0))                     \
+    explicit FunctionInfo(pf fun, PopValues extraValuesToPop = PopValues(0))            \
         : VMFunction(JS_FUNC_TO_DATA_PTR(void *, fun), explicitArgs(),                  \
                      argumentProperties(), argumentPassedInFloatRegs(),                 \
                      argumentRootTypes(), outParam(), outParamRootType(),               \
                      returnType(), executionMode(),                                     \
                      extraValuesToPop.numValues)                                        \
     { }
 
 template <typename Fun>
@@ -481,17 +481,17 @@ struct FunctionInfo<R (*)(Context)> : pu
         return 0;
     }
     static inline uint32_t argumentPassedInFloatRegs() {
         return 0;
     }
     static inline uint64_t argumentRootTypes() {
         return 0;
     }
-    FunctionInfo(pf fun)
+    explicit FunctionInfo(pf fun)
       : VMFunction(JS_FUNC_TO_DATA_PTR(void *, fun), explicitArgs(),
                    argumentProperties(), argumentPassedInFloatRegs(),
                    argumentRootTypes(), outParam(), outParamRootType(),
                    returnType(), executionMode())
     { }
 };
 
 // Specialize the class for each number of argument used by VMFunction.
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -2042,17 +2042,17 @@ void
 MacroAssemblerARMCompat::movePtr(AsmJSImmPtr imm, Register dest)
 {
     RelocStyle rs;
     if (hasMOVWT())
         rs = L_MOVWT;
     else
         rs = L_LDR;
 
-    enoughMemory_ &= append(AsmJSAbsoluteLink(nextOffset().getOffset(), imm.kind()));
+    enoughMemory_ &= append(AsmJSAbsoluteLink(CodeOffsetLabel(nextOffset().getOffset()), imm.kind()));
     ma_movPatchable(Imm32(-1), dest, Always, rs);
 }
 void
 MacroAssemblerARMCompat::load8ZeroExtend(const Address &address, Register dest)
 {
     ma_dataTransferN(IsLoad, 8, false, address.base, Imm32(address.offset), dest);
 }
 
--- a/js/src/jit/arm/MacroAssembler-arm.h
+++ b/js/src/jit/arm/MacroAssembler-arm.h
@@ -694,17 +694,17 @@ class MacroAssemblerARMCompat : public M
 
     CodeOffsetLabel pushWithPatch(ImmWord imm) {
         CodeOffsetLabel label = movWithPatch(imm, ScratchRegister);
         ma_push(ScratchRegister);
         return label;
     }
 
     CodeOffsetLabel movWithPatch(ImmWord imm, Register dest) {
-        CodeOffsetLabel label = currentOffset();
+        CodeOffsetLabel label = CodeOffsetLabel(currentOffset());
         ma_movPatchable(Imm32(imm.value), dest, Always, hasMOVWT() ? L_MOVWT : L_LDR);
         return label;
     }
     CodeOffsetLabel movWithPatch(ImmPtr imm, Register dest) {
         return movWithPatch(ImmWord(uintptr_t(imm.value)), dest);
     }
 
     void jump(Label *label) {
--- a/js/src/jit/shared/Assembler-shared.h
+++ b/js/src/jit/shared/Assembler-shared.h
@@ -358,17 +358,17 @@ class CodeLabel
 
     // The source label (relative) in the code to where the
     // the destination should get patched to.
     Label src_;
 
   public:
     CodeLabel()
     { }
-    CodeLabel(const AbsoluteLabel &dest)
+    explicit CodeLabel(const AbsoluteLabel &dest)
        : dest_(dest)
     { }
     AbsoluteLabel *dest() {
         return &dest_;
     }
     Label *src() {
         return &src_;
     }
@@ -408,17 +408,17 @@ class CodeOffsetJump
     void fixup(MacroAssembler *masm);
 };
 
 class CodeOffsetLabel
 {
     size_t offset_;
 
   public:
-    CodeOffsetLabel(size_t offset) : offset_(offset) {}
+    explicit CodeOffsetLabel(size_t offset) : offset_(offset) {}
     CodeOffsetLabel() : offset_(0) {}
 
     size_t offset() const {
         return offset_;
     }
     void fixup(MacroAssembler *masm);
 
 };
@@ -524,21 +524,21 @@ class CodeLocationLabel
     CodeLocationLabel() {
         raw_ = nullptr;
         setUninitialized();
     }
     CodeLocationLabel(JitCode *code, CodeOffsetLabel base) {
         *this = base;
         repoint(code);
     }
-    CodeLocationLabel(JitCode *code) {
+    explicit CodeLocationLabel(JitCode *code) {
         raw_ = code->raw();
         setAbsolute();
     }
-    CodeLocationLabel(uint8_t *raw) {
+    explicit CodeLocationLabel(uint8_t *raw) {
         raw_ = raw;
         setAbsolute();
     }
 
     void operator = (CodeOffsetLabel base) {
         raw_ = (uint8_t *)base.offset();
         setRelative();
     }
@@ -752,28 +752,29 @@ enum AsmJSImmKind
 };
 
 // Pointer to be embedded as an immediate in asm.js code.
 class AsmJSImmPtr
 {
     AsmJSImmKind kind_;
   public:
     AsmJSImmKind kind() const { return kind_; }
-    AsmJSImmPtr(AsmJSImmKind kind) : kind_(kind) { JS_ASSERT(IsCompilingAsmJS()); }
+    // This needs to be MOZ_IMPLICIT in order to make MacroAssember::CallWithABINoProfiling compile.
+    MOZ_IMPLICIT AsmJSImmPtr(AsmJSImmKind kind) : kind_(kind) { JS_ASSERT(IsCompilingAsmJS()); }
     AsmJSImmPtr() {}
 };
 
 // Pointer to be embedded as an immediate that is loaded/stored from by an
 // instruction in asm.js code.
 class AsmJSAbsoluteAddress
 {
     AsmJSImmKind kind_;
   public:
     AsmJSImmKind kind() const { return kind_; }
-    AsmJSAbsoluteAddress(AsmJSImmKind kind) : kind_(kind) { JS_ASSERT(IsCompilingAsmJS()); }
+    explicit AsmJSAbsoluteAddress(AsmJSImmKind kind) : kind_(kind) { JS_ASSERT(IsCompilingAsmJS()); }
     AsmJSAbsoluteAddress() {}
 };
 
 // Represents an instruction to be patched and the intended pointee. These
 // links are accumulated in the MacroAssembler, but patching is done outside
 // the MacroAssembler (in AsmJSModule::staticallyLink).
 struct AsmJSAbsoluteLink
 {
--- a/js/src/jit/shared/BaselineCompiler-shared.cpp
+++ b/js/src/jit/shared/BaselineCompiler-shared.cpp
@@ -92,12 +92,12 @@ BaselineCompilerShared::callVM(const VMF
     // Perform the call.
     masm.call(code);
     uint32_t callOffset = masm.currentOffset();
     masm.pop(BaselineFrameReg);
 
     // Add a fake ICEntry (without stubs), so that the return offset to
     // pc mapping works.
     ICEntry entry(script->pcToOffset(pc), ICEntry::Kind_CallVM);
-    entry.setReturnOffset(callOffset);
+    entry.setReturnOffset(CodeOffsetLabel(callOffset));
 
     return icEntries_.append(entry);
 }
--- a/js/src/jit/shared/CodeGenerator-shared.h
+++ b/js/src/jit/shared/CodeGenerator-shared.h
@@ -644,17 +644,17 @@ struct StoreNothing
 };
 
 class StoreRegisterTo
 {
   private:
     Register out_;
 
   public:
-    StoreRegisterTo(Register out)
+    explicit StoreRegisterTo(Register out)
       : out_(out)
     { }
 
     inline void generate(CodeGeneratorShared *codegen) const {
         codegen->storeResultTo(out_);
     }
     inline RegisterSet clobbered() const {
         RegisterSet set = RegisterSet();
@@ -664,17 +664,17 @@ class StoreRegisterTo
 };
 
 class StoreFloatRegisterTo
 {
   private:
     FloatRegister out_;
 
   public:
-    StoreFloatRegisterTo(FloatRegister out)
+    explicit StoreFloatRegisterTo(FloatRegister out)
       : out_(out)
     { }
 
     inline void generate(CodeGeneratorShared *codegen) const {
         codegen->storeFloatResultTo(out_);
     }
     inline RegisterSet clobbered() const {
         RegisterSet set = RegisterSet();
@@ -685,17 +685,17 @@ class StoreFloatRegisterTo
 
 template <typename Output>
 class StoreValueTo_
 {
   private:
     Output out_;
 
   public:
-    StoreValueTo_(const Output &out)
+    explicit StoreValueTo_(const Output &out)
       : out_(out)
     { }
 
     inline void generate(CodeGeneratorShared *codegen) const {
         codegen->storeResultValueTo(out_);
     }
     inline RegisterSet clobbered() const {
         RegisterSet set = RegisterSet();
@@ -798,17 +798,17 @@ class OutOfLineAbortPar : public OutOfLi
 
 // Used when some callee has aborted.
 class OutOfLinePropagateAbortPar : public OutOfLineCode
 {
   private:
     LInstruction *lir_;
 
   public:
-    OutOfLinePropagateAbortPar(LInstruction *lir)
+    explicit OutOfLinePropagateAbortPar(LInstruction *lir)
       : lir_(lir)
     { }
 
     LInstruction *lir() { return lir_; }
 
     bool generate(CodeGeneratorShared *codegen);
 };
 
--- a/js/src/jit/shared/CodeGenerator-x86-shared.cpp
+++ b/js/src/jit/shared/CodeGenerator-x86-shared.cpp
@@ -362,33 +362,33 @@ CodeGeneratorX86Shared::generateOutOfLin
 
     return true;
 }
 
 class BailoutJump {
     Assembler::Condition cond_;
 
   public:
-    BailoutJump(Assembler::Condition cond) : cond_(cond)
+    explicit BailoutJump(Assembler::Condition cond) : cond_(cond)
     { }
 #ifdef JS_CODEGEN_X86
     void operator()(MacroAssembler &masm, uint8_t *code) const {
         masm.j(cond_, ImmPtr(code), Relocation::HARDCODED);
     }
 #endif
     void operator()(MacroAssembler &masm, Label *label) const {
         masm.j(cond_, label);
     }
 };
 
 class BailoutLabel {
     Label *label_;
 
   public:
-    BailoutLabel(Label *label) : label_(label)
+    explicit BailoutLabel(Label *label) : label_(label)
     { }
 #ifdef JS_CODEGEN_X86
     void operator()(MacroAssembler &masm, uint8_t *code) const {
         masm.retarget(label_, ImmPtr(code), Relocation::HARDCODED);
     }
 #endif
     void operator()(MacroAssembler &masm, Label *label) const {
         masm.retarget(label_, label);
@@ -611,17 +611,17 @@ CodeGeneratorX86Shared::visitPowHalfD(LP
     return true;
 }
 
 class OutOfLineUndoALUOperation : public OutOfLineCodeBase<CodeGeneratorX86Shared>
 {
     LInstruction *ins_;
 
   public:
-    OutOfLineUndoALUOperation(LInstruction *ins)
+    explicit OutOfLineUndoALUOperation(LInstruction *ins)
         : ins_(ins)
     { }
 
     virtual bool accept(CodeGeneratorX86Shared *codegen) {
         return codegen->visitOutOfLineUndoALUOperation(this);
     }
     LInstruction *ins() const {
         return ins_;
@@ -706,17 +706,17 @@ CodeGeneratorX86Shared::visitOutOfLineUn
     return bailout(ool->ins()->snapshot());
 }
 
 class MulNegativeZeroCheck : public OutOfLineCodeBase<CodeGeneratorX86Shared>
 {
     LMulI *ins_;
 
   public:
-    MulNegativeZeroCheck(LMulI *ins)
+    explicit MulNegativeZeroCheck(LMulI *ins)
       : ins_(ins)
     { }
 
     virtual bool accept(CodeGeneratorX86Shared *codegen) {
         return codegen->visitMulNegativeZeroCheck(this);
     }
     LMulI *ins() const {
         return ins_;
@@ -1441,17 +1441,17 @@ class OutOfLineTableSwitch : public OutO
     MTableSwitch *mir_;
     CodeLabel jumpLabel_;
 
     bool accept(CodeGeneratorX86Shared *codegen) {
         return codegen->visitOutOfLineTableSwitch(this);
     }
 
   public:
-    OutOfLineTableSwitch(MTableSwitch *mir)
+    explicit OutOfLineTableSwitch(MTableSwitch *mir)
       : mir_(mir)
     {}
 
     MTableSwitch *mir() const {
         return mir_;
     }
 
     CodeLabel *jumpLabel() {
--- a/js/src/jit/shared/CodeGenerator-x86-shared.h
+++ b/js/src/jit/shared/CodeGenerator-x86-shared.h
@@ -192,17 +192,17 @@ class CodeGeneratorX86Shared : public Co
 };
 
 // An out-of-line bailout thunk.
 class OutOfLineBailout : public OutOfLineCodeBase<CodeGeneratorX86Shared>
 {
     LSnapshot *snapshot_;
 
   public:
-    OutOfLineBailout(LSnapshot *snapshot)
+    explicit OutOfLineBailout(LSnapshot *snapshot)
       : snapshot_(snapshot)
     { }
 
     bool accept(CodeGeneratorX86Shared *codegen);
 
     LSnapshot *snapshot() const {
         return snapshot_;
     }
--- a/js/src/jit/shared/LIR-x86-shared.h
+++ b/js/src/jit/shared/LIR-x86-shared.h
@@ -187,17 +187,17 @@ class LModPowTwoI : public LInstructionH
     }
 };
 
 // Double raised to a half power.
 class LPowHalfD : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(PowHalfD)
-    LPowHalfD(const LAllocation &input) {
+    explicit LPowHalfD(const LAllocation &input) {
         setOperand(0, input);
     }
 
     const LAllocation *input() {
         return getOperand(0);
     }
     const LDefinition *output() {
         return getDef(0);
@@ -269,30 +269,30 @@ class LTableSwitchV : public LInstructio
     }
 };
 
 class LGuardShape : public LInstructionHelper<0, 1, 0>
 {
   public:
     LIR_HEADER(GuardShape)
 
-    LGuardShape(const LAllocation &in) {
+    explicit LGuardShape(const LAllocation &in) {
         setOperand(0, in);
     }
     const MGuardShape *mir() const {
         return mir_->toGuardShape();
     }
 };
 
 class LGuardObjectType : public LInstructionHelper<0, 1, 0>
 {
   public:
     LIR_HEADER(GuardObjectType)
 
-    LGuardObjectType(const LAllocation &in) {
+    explicit LGuardObjectType(const LAllocation &in) {
         setOperand(0, in);
     }
     const MGuardObjectType *mir() const {
         return mir_->toGuardObjectType();
     }
 };
 
 class LInterruptCheck : public LInstructionHelper<0, 0, 0>
--- a/js/src/jit/shared/Lowering-shared-inl.h
+++ b/js/src/jit/shared/Lowering-shared-inl.h
@@ -395,17 +395,17 @@ LUse
 LIRGeneratorShared::useFixed(MDefinition *mir, FloatRegister reg)
 {
     return use(mir, LUse(reg));
 }
 
 LUse
 LIRGeneratorShared::useFixed(MDefinition *mir, AnyRegister reg)
 {
-    return reg.isFloat() ? use(mir, reg.fpu()) : use(mir, reg.gpr());
+    return reg.isFloat() ? use(mir, LUse(reg.fpu())) : use(mir, LUse(reg.gpr()));
 }
 
 LDefinition
 LIRGeneratorShared::temp(LDefinition::Type type, LDefinition::Policy policy)
 {
     uint32_t vreg = getVirtualRegister();
     if (vreg >= MAX_VIRTUAL_REGISTERS) {
         gen->abort("max virtual registers");
--- a/js/src/jit/shared/Lowering-shared.cpp
+++ b/js/src/jit/shared/Lowering-shared.cpp
@@ -133,17 +133,17 @@ LIRGeneratorShared::buildSnapshot(LInstr
         // interpreter state with the given information. Note that for
         // constants, including known types, we record a dummy placeholder,
         // since we can recover the same information, much cleaner, from MIR.
         if (ins->isConstant() || ins->isUnused()) {
             *type = LConstantIndex::Bogus();
             *payload = LConstantIndex::Bogus();
         } else if (ins->type() != MIRType_Value) {
             *type = LConstantIndex::Bogus();
-            *payload = use(ins, LUse::KEEPALIVE);
+            *payload = use(ins, LUse(LUse::KEEPALIVE));
         } else {
             *type = useType(ins, LUse::KEEPALIVE);
             *payload = usePayload(ins, LUse::KEEPALIVE);
         }
     }
 
     return snapshot;
 }
--- a/js/src/jit/shared/MoveEmitter-x86-shared.h
+++ b/js/src/jit/shared/MoveEmitter-x86-shared.h
@@ -46,17 +46,17 @@ class MoveEmitterX86
     void emitInt32Move(const MoveOperand &from, const MoveOperand &to);
     void emitGeneralMove(const MoveOperand &from, const MoveOperand &to);
     void emitFloat32Move(const MoveOperand &from, const MoveOperand &to);
     void emitDoubleMove(const MoveOperand &from, const MoveOperand &to);
     void breakCycle(const MoveOperand &to, MoveOp::Type type);
     void completeCycle(const MoveOperand &to, MoveOp::Type type);
 
   public:
-    MoveEmitterX86(MacroAssemblerSpecific &masm);
+    explicit MoveEmitterX86(MacroAssemblerSpecific &masm);
     ~MoveEmitterX86();
     void emit(const MoveResolver &moves);
     void finish();
 };
 
 typedef MoveEmitterX86 MoveEmitter;
 
 } // ion
--- a/js/src/jit/x64/Assembler-x64.cpp
+++ b/js/src/jit/x64/Assembler-x64.cpp
@@ -210,17 +210,17 @@ Assembler::executableCopy(uint8_t *buffe
 class RelocationIterator
 {
     CompactBufferReader reader_;
     uint32_t tableStart_;
     uint32_t offset_;
     uint32_t extOffset_;
 
   public:
-    RelocationIterator(CompactBufferReader &reader)
+    explicit RelocationIterator(CompactBufferReader &reader)
       : reader_(reader)
     {
         tableStart_ = reader_.readFixedUint32_t();
     }
 
     bool read() {
         if (!reader_.more())
             return false;
--- a/js/src/jit/x64/Assembler-x64.h
+++ b/js/src/jit/x64/Assembler-x64.h
@@ -294,17 +294,17 @@ class Assembler : public AssemblerX86Sha
 
     void pop(FloatRegister src) {
         movsd(Address(StackPointer, 0), src);
         addq(Imm32(sizeof(double)), StackPointer);
     }
 
     CodeOffsetLabel movWithPatch(ImmWord word, Register dest) {
         masm.movq_i64r(word.value, dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movWithPatch(ImmPtr imm, Register dest) {
         return movWithPatch(ImmWord(uintptr_t(imm.value)), dest);
     }
 
     // Load an ImmWord value into a register. Note that this instruction will
     // attempt to optimize its immediate field size. When a full 64-bit
     // immediate is needed for a relocation, use movWithPatch.
@@ -523,17 +523,17 @@ class Assembler : public AssemblerX86Sha
         else
             movq(word, dest);
     }
     void mov(ImmPtr imm, Register dest) {
         movq(imm, dest);
     }
     void mov(AsmJSImmPtr imm, Register dest) {
         masm.movq_i64r(-1, dest.code());
-        enoughMemory_ &= append(AsmJSAbsoluteLink(masm.currentOffset(), imm.kind()));
+        enoughMemory_ &= append(AsmJSAbsoluteLink(CodeOffsetLabel(masm.currentOffset()), imm.kind()));
     }
     void mov(const Operand &src, Register dest) {
         movq(src, dest);
     }
     void mov(Register src, const Operand &dest) {
         movq(src, dest);
     }
     void mov(Imm32 imm32, const Operand &dest) {
--- a/js/src/jit/x64/CodeGenerator-x64.cpp
+++ b/js/src/jit/x64/CodeGenerator-x64.cpp
@@ -479,59 +479,59 @@ CodeGeneratorX64::visitAsmJSLoadGlobalVa
     MAsmJSLoadGlobalVar *mir = ins->mir();
 
     CodeOffsetLabel label;
     if (mir->type() == MIRType_Int32)
         label = masm.loadRipRelativeInt32(ToRegister(ins->output()));
     else
         label = masm.loadRipRelativeDouble(ToFloatRegister(ins->output()));
 
-    return masm.append(AsmJSGlobalAccess(label.offset(), mir->globalDataOffset()));
+    return masm.append(AsmJSGlobalAccess(CodeOffsetLabel(label.offset()), mir->globalDataOffset()));
 }
 
 bool
 CodeGeneratorX64::visitAsmJSStoreGlobalVar(LAsmJSStoreGlobalVar *ins)
 {
     MAsmJSStoreGlobalVar *mir = ins->mir();
 
     MIRType type = mir->value()->type();
     JS_ASSERT(IsNumberType(type));
 
     CodeOffsetLabel label;
     if (type == MIRType_Int32)
         label = masm.storeRipRelativeInt32(ToRegister(ins->value()));
     else
         label = masm.storeRipRelativeDouble(ToFloatRegister(ins->value()));
 
-    return masm.append(AsmJSGlobalAccess(label.offset(), mir->globalDataOffset()));
+    return masm.append(AsmJSGlobalAccess(CodeOffsetLabel(label.offset()), mir->globalDataOffset()));
 }
 
 bool
 CodeGeneratorX64::visitAsmJSLoadFuncPtr(LAsmJSLoadFuncPtr *ins)
 {
     MAsmJSLoadFuncPtr *mir = ins->mir();
 
     Register index = ToRegister(ins->index());
     Register tmp = ToRegister(ins->temp());
     Register out = ToRegister(ins->output());
 
     CodeOffsetLabel label = masm.leaRipRelative(tmp);
     masm.loadPtr(Operand(tmp, index, TimesEight, 0), out);
 
-    return masm.append(AsmJSGlobalAccess(label.offset(), mir->globalDataOffset()));
+    return masm.append(AsmJSGlobalAccess(CodeOffsetLabel(label.offset()), mir->globalDataOffset()));
 }
 
 bool
 CodeGeneratorX64::visitAsmJSLoadFFIFunc(LAsmJSLoadFFIFunc *ins)
 {
     MAsmJSLoadFFIFunc *mir = ins->mir();
 
     CodeOffsetLabel label = masm.loadRipRelativeInt64(ToRegister(ins->output()));
 
-    return masm.append(AsmJSGlobalAccess(label.offset(), mir->globalDataOffset()));
+    return masm.append(AsmJSGlobalAccess(CodeOffsetLabel(label.offset()), mir->globalDataOffset()));
 }
 
 void
 DispatchIonCache::initializeAddCacheState(LInstruction *ins, AddCacheState *addState)
 {
     // Can always use the scratch register on x64.
     addState->dispatchScratch = ScratchReg;
 }
--- a/js/src/jit/x64/LIR-x64.h
+++ b/js/src/jit/x64/LIR-x64.h
@@ -32,32 +32,32 @@ class LBox : public LInstructionHelper<1
     }
 };
 
 // Given an untyped input, guards on whether it's a specific type and returns
 // the unboxed payload.
 class LUnboxBase : public LInstructionHelper<1, 1, 0>
 {
   public:
-    LUnboxBase(const LAllocation &input) {
+    explicit LUnboxBase(const LAllocation &input) {
         setOperand(0, input);
     }
 
     static const size_t Input = 0;
 
     MUnbox *mir() const {
         return mir_->toUnbox();
     }
 };
 
 class LUnbox : public LUnboxBase {
   public:
     LIR_HEADER(Unbox)
 
-    LUnbox(const LAllocation &input)
+    explicit LUnbox(const LAllocation &input)
       : LUnboxBase(input)
     { }
 
     const char *extraName() const {
         return StringFromMIRType(mir()->type());
     }
 };
 
@@ -81,28 +81,28 @@ class LUnboxFloatingPoint : public LUnbo
 };
 
 // Convert a 32-bit unsigned integer to a double.
 class LAsmJSUInt32ToDouble : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(AsmJSUInt32ToDouble)
 
-    LAsmJSUInt32ToDouble(const LAllocation &input) {
+    explicit LAsmJSUInt32ToDouble(const LAllocation &input) {
         setOperand(0, input);
     }
 };
 
 // Convert a 32-bit unsigned integer to a float32.
 class LAsmJSUInt32ToFloat32 : public LInstructionHelper<1, 1, 0>
 {
   public:
     LIR_HEADER(AsmJSUInt32ToFloat32)
 
-    LAsmJSUInt32ToFloat32(const LAllocation &input) {
+    explicit LAsmJSUInt32ToFloat32(const LAllocation &input) {
         setOperand(0, input);
     }
 };
 
 class LAsmJSLoadFuncPtr : public LInstructionHelper<1, 1, 1>
 {
   public:
     LIR_HEADER(AsmJSLoadFuncPtr);
--- a/js/src/jit/x64/MacroAssembler-x64.h
+++ b/js/src/jit/x64/MacroAssembler-x64.h
@@ -11,28 +11,28 @@
 #include "jit/MoveResolver.h"
 #include "jit/shared/MacroAssembler-x86-shared.h"
 
 namespace js {
 namespace jit {
 
 struct ImmShiftedTag : public ImmWord
 {
-    ImmShiftedTag(JSValueShiftedTag shtag)
+    explicit ImmShiftedTag(JSValueShiftedTag shtag)
       : ImmWord((uintptr_t)shtag)
     { }
 
-    ImmShiftedTag(JSValueType type)
+    explicit ImmShiftedTag(JSValueType type)
       : ImmWord(uintptr_t(JSValueShiftedTag(JSVAL_TYPE_TO_SHIFTED_TAG(type))))
     { }
 };
 
 struct ImmTag : public Imm32
 {
-    ImmTag(JSValueTag tag)
+    explicit ImmTag(JSValueTag tag)
       : Imm32(tag)
     { }
 };
 
 class MacroAssemblerX64 : public MacroAssemblerX86Shared
 {
     // Number of bytes the stack is adjusted inside a call to C. Calls to C may
     // not be nested.
@@ -45,27 +45,27 @@ class MacroAssemblerX64 : public MacroAs
     bool enoughMemory_;
 
     // These use SystemAllocPolicy since asm.js releases memory after each
     // function is compiled, and these need to live until after all functions
     // are compiled.
     struct Double {
         double value;
         NonAssertingLabel uses;
-        Double(double value) : value(value) {}
+        explicit Double(double value) : value(value) {}
     };
     Vector<Double, 0, SystemAllocPolicy> doubles_;
 
     typedef HashMap<double, size_t, DefaultHasher<double>, SystemAllocPolicy> DoubleMap;
     DoubleMap doubleMap_;
 
     struct Float {
         float value;
         NonAssertingLabel uses;
-        Float(float value) : value(value) {}
+        explicit Float(float value) : value(value) {}
     };
     Vector<Float, 0, SystemAllocPolicy> floats_;
 
     typedef HashMap<float, size_t, DefaultHasher<float>, SystemAllocPolicy> FloatMap;
     FloatMap floatMap_;
 
     void setupABICall(uint32_t arg);
 
--- a/js/src/jit/x86/Assembler-x86.h
+++ b/js/src/jit/x86/Assembler-x86.h
@@ -197,27 +197,27 @@ class Assembler : public AssemblerX86Sha
     }
     void push(FloatRegister src) {
         subl(Imm32(sizeof(double)), StackPointer);
         movsd(src, Address(StackPointer, 0));
     }
 
     CodeOffsetLabel pushWithPatch(ImmWord word) {
         push(Imm32(word.value));
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
 
     void pop(FloatRegister src) {
         movsd(Address(StackPointer, 0), src);
         addl(Imm32(sizeof(double)), StackPointer);
     }
 
     CodeOffsetLabel movWithPatch(ImmWord word, Register dest) {
         movl(Imm32(word.value), dest);
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movWithPatch(ImmPtr imm, Register dest) {
         return movWithPatch(ImmWord(uintptr_t(imm.value)), dest);
     }
 
     void movl(ImmGCPtr ptr, Register dest) {
         masm.movl_i32r(uintptr_t(ptr.value), dest.code());
         writeDataRelocation(ptr);
@@ -255,17 +255,17 @@ class Assembler : public AssemblerX86Sha
         else
             movl(imm, dest);
     }
     void mov(ImmPtr imm, Register dest) {
         mov(ImmWord(uintptr_t(imm.value)), dest);
     }
     void mov(AsmJSImmPtr imm, Register dest) {
         masm.movl_i32r(-1, dest.code());
-        enoughMemory_ &= append(AsmJSAbsoluteLink(masm.currentOffset(), imm.kind()));
+        enoughMemory_ &= append(AsmJSAbsoluteLink(CodeOffsetLabel(masm.currentOffset()), imm.kind()));
     }
     void mov(const Operand &src, Register dest) {
         movl(src, dest);
     }
     void mov(Register src, const Operand &dest) {
         movl(src, dest);
     }
     void mov(Imm32 imm, const Operand &dest) {
@@ -336,21 +336,21 @@ class Assembler : public AssemblerX86Sha
             writeDataRelocation(imm);
             break;
           default:
             MOZ_ASSUME_UNREACHABLE("unexpected operand kind");
         }
     }
     void cmpl(AsmJSAbsoluteAddress lhs, Register rhs) {
         masm.cmpl_rm_force32(rhs.code(), (void*)-1);
-        enoughMemory_ &= append(AsmJSAbsoluteLink(masm.currentOffset(), lhs.kind()));
+        enoughMemory_ &= append(AsmJSAbsoluteLink(CodeOffsetLabel(masm.currentOffset()), lhs.kind()));
     }
     CodeOffsetLabel cmplWithPatch(Register lhs, Imm32 rhs) {
         masm.cmpl_ir_force32(rhs.value, lhs.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
 
     void jmp(ImmPtr target, Relocation::Kind reloc = Relocation::HARDCODED) {
         JmpSrc src = masm.jmp();
         addPendingJump(src, target, reloc);
     }
     void j(Condition cond, ImmPtr target,
            Relocation::Kind reloc = Relocation::HARDCODED) {
@@ -414,137 +414,137 @@ class Assembler : public AssemblerX86Sha
         }
         label->reset();
     }
 
     // Move a 32-bit immediate into a register where the immediate can be
     // patched.
     CodeOffsetLabel movlWithPatch(Imm32 imm, Register dest) {
         masm.movl_i32r(imm.value, dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
 
     // Load from *(base + disp32) where disp32 can be patched.
     CodeOffsetLabel movsblWithPatch(Address src, Register dest) {
         masm.movsbl_mr_disp32(src.offset, src.base.code(), dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movzblWithPatch(Address src, Register dest) {
         masm.movzbl_mr_disp32(src.offset, src.base.code(), dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movswlWithPatch(Address src, Register dest) {
         masm.movswl_mr_disp32(src.offset, src.base.code(), dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movzwlWithPatch(Address src, Register dest) {
         masm.movzwl_mr_disp32(src.offset, src.base.code(), dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movlWithPatch(Address src, Register dest) {
         masm.movl_mr_disp32(src.offset, src.base.code(), dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movssWithPatch(Address src, FloatRegister dest) {
         JS_ASSERT(HasSSE2());
         masm.movss_mr_disp32(src.offset, src.base.code(), dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movsdWithPatch(Address src, FloatRegister dest) {
         JS_ASSERT(HasSSE2());
         masm.movsd_mr_disp32(src.offset, src.base.code(), dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
 
     // Store to *(base + disp32) where disp32 can be patched.
     CodeOffsetLabel movbWithPatch(Register src, Address dest) {
         masm.movb_rm_disp32(src.code(), dest.offset, dest.base.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movwWithPatch(Register src, Address dest) {
         masm.movw_rm_disp32(src.code(), dest.offset, dest.base.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movlWithPatch(Register src, Address dest) {
         masm.movl_rm_disp32(src.code(), dest.offset, dest.base.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movssWithPatch(FloatRegister src, Address dest) {
         JS_ASSERT(HasSSE2());
         masm.movss_rm_disp32(src.code(), dest.offset, dest.base.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movsdWithPatch(FloatRegister src, Address dest) {
         JS_ASSERT(HasSSE2());
         masm.movsd_rm_disp32(src.code(), dest.offset, dest.base.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
 
     // Load from *(addr + index*scale) where addr can be patched.
     CodeOffsetLabel movlWithPatch(PatchedAbsoluteAddress addr, Register index, Scale scale,
                                   Register dest)
     {
         masm.movl_mr(addr.addr, index.code(), scale, dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
 
     // Load from *src where src can be patched.
     CodeOffsetLabel movsblWithPatch(PatchedAbsoluteAddress src, Register dest) {
         masm.movsbl_mr(src.addr, dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movzblWithPatch(PatchedAbsoluteAddress src, Register dest) {
         masm.movzbl_mr(src.addr, dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movswlWithPatch(PatchedAbsoluteAddress src, Register dest) {
         masm.movswl_mr(src.addr, dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movzwlWithPatch(PatchedAbsoluteAddress src, Register dest) {
         masm.movzwl_mr(src.addr, dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movlWithPatch(PatchedAbsoluteAddress src, Register dest) {
         masm.movl_mr(src.addr, dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movssWithPatch(PatchedAbsoluteAddress src, FloatRegister dest) {
         JS_ASSERT(HasSSE2());
         masm.movss_mr(src.addr, dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movsdWithPatch(PatchedAbsoluteAddress src, FloatRegister dest) {
         JS_ASSERT(HasSSE2());
         masm.movsd_mr(src.addr, dest.code());
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
 
     // Store to *dest where dest can be patched.
     CodeOffsetLabel movbWithPatch(Register src, PatchedAbsoluteAddress dest) {
         masm.movb_rm(src.code(), dest.addr);
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movwWithPatch(Register src, PatchedAbsoluteAddress dest) {
         masm.movw_rm(src.code(), dest.addr);
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movlWithPatch(Register src, PatchedAbsoluteAddress dest) {
         masm.movl_rm(src.code(), dest.addr);
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movssWithPatch(FloatRegister src, PatchedAbsoluteAddress dest) {
         JS_ASSERT(HasSSE2());
         masm.movss_rm(src.code(), dest.addr);
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
     CodeOffsetLabel movsdWithPatch(FloatRegister src, PatchedAbsoluteAddress dest) {
         JS_ASSERT(HasSSE2());
         masm.movsd_rm(src.code(), dest.addr);
-        return masm.currentOffset();
+        return CodeOffsetLabel(masm.currentOffset());
     }
 
 };
 
 // Get a register in which we plan to put a quantity that will be used as an
 // integer argument.  This differs from GetIntArgReg in that if we have no more
 // actual argument registers to use we will fall back on using whatever
 // CallTempReg* don't overlap the argument registers, and only fail once those
--- a/js/src/jit/x86/CodeGenerator-x86.cpp
+++ b/js/src/jit/x86/CodeGenerator-x86.cpp
@@ -629,17 +629,17 @@ CodeGeneratorX86::visitAsmJSLoadGlobalVa
     CodeOffsetLabel label;
     if (type == MIRType_Int32)
         label = masm.movlWithPatch(PatchedAbsoluteAddress(), ToRegister(ins->output()));
     else if (type == MIRType_Float32)
         label = masm.movssWithPatch(PatchedAbsoluteAddress(), ToFloatRegister(ins->output()));
     else
         label = masm.movsdWithPatch(PatchedAbsoluteAddress(), ToFloatRegister(ins->output()));
 
-    return masm.append(AsmJSGlobalAccess(label.offset(), mir->globalDataOffset()));
+    return masm.append(AsmJSGlobalAccess(CodeOffsetLabel(label.offset()), mir->globalDataOffset()));
 }
 
 bool
 CodeGeneratorX86::visitAsmJSStoreGlobalVar(LAsmJSStoreGlobalVar *ins)
 {
     MAsmJSStoreGlobalVar *mir = ins->mir();
 
     MIRType type = mir->value()->type();
@@ -648,40 +648,40 @@ CodeGeneratorX86::visitAsmJSStoreGlobalV
     CodeOffsetLabel label;
     if (type == MIRType_Int32)
         label = masm.movlWithPatch(ToRegister(ins->value()), PatchedAbsoluteAddress());
     else if (type == MIRType_Float32)
         label = masm.movssWithPatch(ToFloatRegister(ins->value()), PatchedAbsoluteAddress());
     else
         label = masm.movsdWithPatch(ToFloatRegister(ins->value()), PatchedAbsoluteAddress());
 
-    return masm.append(AsmJSGlobalAccess(label.offset(), mir->globalDataOffset()));
+    return masm.append(AsmJSGlobalAccess(CodeOffsetLabel(label.offset()), mir->globalDataOffset()));
 }
 
 bool
 CodeGeneratorX86::visitAsmJSLoadFuncPtr(LAsmJSLoadFuncPtr *ins)
 {
     MAsmJSLoadFuncPtr *mir = ins->mir();
 
     Register index = ToRegister(ins->index());
     Register out = ToRegister(ins->output());
     CodeOffsetLabel label = masm.movlWithPatch(PatchedAbsoluteAddress(), index, TimesFour, out);
 
-    return masm.append(AsmJSGlobalAccess(label.offset(), mir->globalDataOffset()));
+    return masm.append(AsmJSGlobalAccess(CodeOffsetLabel(label.offset()), mir->globalDataOffset()));
 }
 
 bool
 CodeGeneratorX86::visitAsmJSLoadFFIFunc(LAsmJSLoadFFIFunc *ins)
 {
     MAsmJSLoadFFIFunc *mir = ins->mir();
 
     Register out = ToRegister(ins->output());
     CodeOffsetLabel label = masm.movlWithPatch(PatchedAbsoluteAddress(), out);
 
-    return masm.append(AsmJSGlobalAccess(label.offset(), mir->globalDataOffset()));
+    return masm.append(AsmJSGlobalAccess(CodeOffsetLabel(label.offset()), mir->globalDataOffset()));
 }
 
 void
 CodeGeneratorX86::postAsmJSCall(LAsmJSCall *lir)
 {
     MAsmJSCall *mir = lir->mir();
     if (!IsFloatingPointType(mir->type()) || mir->callee().which() != MAsmJSCall::Callee::Builtin)
         return;
--- a/js/src/jsalloc.h
+++ b/js/src/jsalloc.h
@@ -47,18 +47,18 @@ class TempAllocPolicy
 
     /*
      * Non-inline helper to call JSRuntime::onOutOfMemory with minimal
      * code bloat.
      */
     JS_FRIEND_API(void *) onOutOfMemory(void *p, size_t nbytes);
 
   public:
-    TempAllocPolicy(JSContext *cx) : cx_((ContextFriendFields *) cx) {} // :(
-    TempAllocPolicy(ContextFriendFields *cx) : cx_(cx) {}
+    MOZ_IMPLICIT TempAllocPolicy(JSContext *cx) : cx_((ContextFriendFields *) cx) {} // :(
+    MOZ_IMPLICIT TempAllocPolicy(ContextFriendFields *cx) : cx_(cx) {}
 
     void *malloc_(size_t bytes) {
         void *p = js_malloc(bytes);
         if (MOZ_UNLIKELY(!p))
             p = onOutOfMemory(nullptr, bytes);
         return p;
     }
 
--- a/js/src/jsapi-tests/testChromeBuffer.cpp
+++ b/js/src/jsapi-tests/testChromeBuffer.cpp
@@ -92,17 +92,17 @@ BEGIN_TEST(testChromeBuffer)
                             "    }                                      "
                             "}                                          ";
         JS::CompileOptions options(cx);
         options.setFileAndLine("", 0);
         CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
                                        bytes, strlen(bytes), options));
 
         JS::RootedValue rval(cx);
-        CHECK(JS_CallFunction(cx, JS::NullPtr(), fun, v, &rval));
+        CHECK(JS_CallFunction(cx, JS::NullPtr(), fun, JS::HandleValueArray(v), &rval));
         CHECK(rval.toInt32() == 100);
     }
 
     /*
      * Check that content called from chrome in the reserved-buffer space
      * immediately ooms.
      */
     {
@@ -132,17 +132,17 @@ BEGIN_TEST(testChromeBuffer)
                             "  return trusted(untrusted);               "
                             "}                                          ";
         JS::CompileOptions options(cx);
         options.setFileAndLine("", 0);
         CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
                                        bytes, strlen(bytes), options));
 
         JS::RootedValue rval(cx);
-        CHECK(JS_CallFunction(cx, JS::NullPtr(), fun, v, &rval));
+        CHECK(JS_CallFunction(cx, JS::NullPtr(), fun, JS::HandleValueArray(v), &rval));
         bool match;
         CHECK(JS_StringEqualsAscii(cx, rval.toString(), "From trusted: InternalError: too much recursion", &match));
         CHECK(match);
     }
 
     /*
      * Check that JS_SaveFrameChain called on the way from content to chrome
      * (say, as done by XPCJSContextSTack::Push) works.
@@ -170,17 +170,17 @@ BEGIN_TEST(testChromeBuffer)
                             "}                                          ";
         JS::CompileOptions options(cx);
         options.setFileAndLine("", 0);
         CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
                                        bytes, strlen(bytes), options));
 
         JS::RootedValue arg(cx, JS::ObjectValue(*callTrusted));
         JS::RootedValue rval(cx);
-        CHECK(JS_CallFunction(cx, JS::NullPtr(), fun, arg, &rval));
+        CHECK(JS_CallFunction(cx, JS::NullPtr(), fun, JS::HandleValueArray(arg), &rval));
         CHECK(rval.toInt32() == 42);
     }
 
     return true;
 }
 virtual void uninit() {
     trusted_glob = nullptr;
     trusted_fun = nullptr;
--- a/js/src/jsapi-tests/testCloneScript.cpp
+++ b/js/src/jsapi-tests/testCloneScript.cpp
@@ -132,17 +132,17 @@ BEGIN_TEST(test_cloneScriptWithPrincipal
 
         JSScript *script;
         CHECK(script = JS_GetFunctionScript(cx, fun));
 
         CHECK(JS_GetScriptPrincipals(script) == principalsB);
 
         JS::RootedValue v(cx);
         JS::RootedValue arg(cx, JS::Int32Value(1));
-        CHECK(JS_CallFunctionValue(cx, B, clonedValue, arg, &v));
+        CHECK(JS_CallFunctionValue(cx, B, clonedValue, JS::HandleValueArray(arg), &v));
         CHECK(v.isObject());
 
         JSObject *funobj = &v.toObject();
         CHECK(JS_ObjectIsFunction(cx, funobj));
         CHECK(fun = JS_ValueToFunction(cx, v));
         CHECK(script = JS_GetFunctionScript(cx, fun));
         CHECK(JS_GetScriptPrincipals(script) == principalsB);
     }
--- a/js/src/jsapi-tests/testDebugger.cpp
+++ b/js/src/jsapi-tests/testDebugger.cpp
@@ -223,17 +223,17 @@ bool testIndirectEval(JS::HandleObject s
     EXEC("hits = 0;");
 
     {
         JSAutoCompartment ae(cx, scope);
         JSString *codestr = JS_NewStringCopyZ(cx, code);
         CHECK(codestr);
         JS::RootedValue arg(cx, JS::StringValue(codestr));
         JS::RootedValue v(cx);
-        CHECK(JS_CallFunctionName(cx, scope, "eval", arg, &v));
+        CHECK(JS_CallFunctionName(cx, scope, "eval", HandleValueArray(arg), &v));
     }
 
     JS::RootedValue hitsv(cx);
     EVAL("hits", &hitsv);
     CHECK_SAME(hitsv, INT_TO_JSVAL(1));
     return true;
 }
 END_TEST(testDebugger_newScriptHook)
--- a/js/src/jsapi-tests/testLooselyEqual.cpp
+++ b/js/src/jsapi-tests/testLooselyEqual.cpp
@@ -35,17 +35,17 @@ struct LooseEqualityData
     JS::RootedValue d42;
     JS::RootedValue i42;
     JS::RootedValue undef;
     JS::RootedValue null;
     JS::RootedValue obj;
     JS::RootedValue poszero;
     JS::RootedValue negzero;
 
-    LooseEqualityData(JSContext *cx)
+    explicit LooseEqualityData(JSContext *cx)
       : qNaN(cx),
         sNaN(cx),
         d42(cx),
         i42(cx),
         undef(cx),
         null(cx),
         obj(cx),
         poszero(cx),
--- a/js/src/jsapi-tests/testParseJSON.cpp
+++ b/js/src/jsapi-tests/testParseJSON.cpp
@@ -14,17 +14,17 @@
 using namespace js;
 
 class AutoInflatedString {
     JSContext * const cx;
     jschar *chars_;
     size_t length_;
 
   public:
-    AutoInflatedString(JSContext *cx) : cx(cx), chars_(nullptr), length_(0) { }
+    explicit AutoInflatedString(JSContext *cx) : cx(cx), chars_(nullptr), length_(0) { }
     ~AutoInflatedString() {
         JS_free(cx, chars_);
     }
 
     template<size_t N> void operator=(const char (&str)[N]) {
         length_ = N - 1;
         chars_ = InflateString(cx, str, &length_);
         if (!chars_)
--- a/js/src/jsapi-tests/testPersistentRooted.cpp
+++ b/js/src/jsapi-tests/testPersistentRooted.cpp
@@ -35,17 +35,17 @@ const JSClass BarkWhenTracedClass::class
   nullptr,
   nullptr,
   nullptr,
   trace
 };
 
 struct Kennel {
     PersistentRootedObject obj;
-    Kennel(JSContext *cx) : obj(cx) { }
+    explicit Kennel(JSContext *cx) : obj(cx) { }
     Kennel(JSContext *cx, const HandleObject &woof) : obj(cx, woof) { };
 };
 
 // A function for allocating a Kennel and a barker. Only allocating
 // PersistentRooteds on the heap, and in this function, helps ensure that the
 // conservative GC doesn't find stray references to the barker. Ugh.
 MOZ_NEVER_INLINE static Kennel *
 Allocate(JSContext *cx)
--- a/js/src/jsapi-tests/testResolveRecursion.cpp
+++ b/js/src/jsapi-tests/testResolveRecursion.cpp
@@ -62,17 +62,17 @@ BEGIN_TEST(testResolveRecursion)
 
 JS::Heap<JSObject *> obj1;
 JS::Heap<JSObject *> obj2;
 unsigned resolveEntryCount;
 unsigned resolveExitCount;
 
 struct AutoIncrCounters {
 
-    AutoIncrCounters(cls_testResolveRecursion *t) : t(t) {
+    explicit AutoIncrCounters(cls_testResolveRecursion *t) : t(t) {
         t->resolveEntryCount++;
     }
 
     ~AutoIncrCounters() {
         t->resolveExitCount++;
     }
 
     cls_testResolveRecursion *t;
--- a/js/src/jsapi-tests/tests.cpp
+++ b/js/src/jsapi-tests/tests.cpp
@@ -28,25 +28,25 @@ bool JSAPITest::init()
     return true;
 }
 
 bool JSAPITest::exec(const char *bytes, const char *filename, int lineno)
 {
     JS::RootedValue v(cx);
     JS::HandleObject global = JS::HandleObject::fromMarkedLocation(this->global.unsafeGet());
     return JS_EvaluateScript(cx, global, bytes, strlen(bytes), filename, lineno, &v) ||
-        fail(bytes, filename, lineno);
+        fail(JSAPITestString(bytes), filename, lineno);
 }
 
 bool JSAPITest::evaluate(const char *bytes, const char *filename, int lineno,
                          JS::MutableHandleValue vp)
 {
     JS::HandleObject global = JS::HandleObject::fromMarkedLocation(this->global.unsafeGet());
     return JS_EvaluateScript(cx, global, bytes, strlen(bytes), filename, lineno, vp) ||
-        fail(bytes, filename, lineno);
+        fail(JSAPITestString(bytes), filename, lineno);
 }
 
 bool JSAPITest::definePrint()
 {
     JS::HandleObject global = JS::HandleObject::fromMarkedLocation(this->global.unsafeGet());
     return JS_DefineFunction(cx, global, "print", (JSNative) print, 0, 0);
 }
 
--- a/js/src/jsapi-tests/tests.h
+++ b/js/src/jsapi-tests/tests.h
@@ -18,17 +18,17 @@
 
 #include "js/Vector.h"
 
 /* Note: Aborts on OOM. */
 class JSAPITestString {
     js::Vector<char, 0, js::SystemAllocPolicy> chars;
   public:
     JSAPITestString() {}
-    JSAPITestString(const char *s) { *this += s; }
+    explicit JSAPITestString(const char *s) { *this += s; }
     JSAPITestString(const JSAPITestString &s) { *this += s; }
 
     const char *begin() const { return chars.begin(); }
     const char *end() const { return chars.end(); }
     size_t length() const { return chars.length(); }
 
     JSAPITestString & operator +=(const char *s) {
         if (!chars.append(s, strlen(s)))
@@ -198,17 +198,17 @@ class JSAPITest
     do { \
         if (!checkSame(actual, expected, #actual, #expected, __FILE__, __LINE__)) \
             return false; \
     } while (false)
 
 #define CHECK(expr) \
     do { \
         if (!(expr)) \
-            return fail("CHECK failed: " #expr, __FILE__, __LINE__); \
+            return fail(JSAPITestString("CHECK failed: " #expr), __FILE__, __LINE__); \
     } while (false)
 
     bool fail(JSAPITestString msg = JSAPITestString(), const char *filename = "-", int lineno = 0) {
         if (JS_IsExceptionPending(cx)) {
             js::gc::AutoSuppressGC gcoff(cx);
             JS::RootedValue v(cx);
             JS_GetPendingException(cx, &v);
             JS_ClearPendingException(cx);
@@ -403,16 +403,16 @@ class TempFile {
         name = nullptr;
     }
 };
 
 // Just a wrapper around JSPrincipals that allows static construction.
 class TestJSPrincipals : public JSPrincipals
 {
   public:
-    TestJSPrincipals(int rc = 0)
+    explicit TestJSPrincipals(int rc = 0)
       : JSPrincipals()
     {
         refcount = rc;
     }
 };
 
 #endif /* jsapi_tests_tests_h */
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -1132,17 +1132,17 @@ JS_TransplantObject(JSContext *cx, Handl
     if (origobj->compartment() != destination) {
         RootedObject newIdentityWrapper(cx, newIdentity);
         AutoCompartment ac(cx, origobj);
         if (!JS_WrapObject(cx, &newIdentityWrapper))
             MOZ_CRASH();
         JS_ASSERT(Wrapper::wrappedObject(newIdentityWrapper) == newIdentity);
         if (!JSObject::swap(cx, origobj, newIdentityWrapper))
             MOZ_CRASH();
-        origobj->compartment()->putWrapper(cx, ObjectValue(*newIdentity), origv);
+        origobj->compartment()->putWrapper(cx, CrossCompartmentKey(newIdentity), origv);
     }
 
     // The new identity object might be one of several things. Return it to avoid
     // ambiguity.
     return newIdentity;
 }
 
 /*
@@ -4326,18 +4326,18 @@ JS_DefineFunctionById(JSContext *cx, Han
     AssertHeapIsIdle(cx);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj);
     return DefineFunction(cx, obj, id, call, nargs, attrs);
 }
 
 struct AutoLastFrameCheck
 {
-    AutoLastFrameCheck(JSContext *cx
-                       MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+    explicit AutoLastFrameCheck(JSContext *cx
+                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : cx(cx)
     {
         JS_ASSERT(cx);
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     }
 
     ~AutoLastFrameCheck() {
         if (cx->isExceptionPending() &&
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -137,18 +137,18 @@ class JS_PUBLIC_API(AutoGCRooter) {
 /* AutoValueArray roots an internal fixed-size array of Values. */
 template <size_t N>
 class AutoValueArray : public AutoGCRooter
 {
     const size_t length_;
     Value elements_[N];
 
   public:
-    AutoValueArray(JSContext *cx
-                   MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+    explicit AutoValueArray(JSContext *cx
+                            MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : AutoGCRooter(cx, VALARRAY), length_(N)
     {
         /* Always initialize in case we GC before assignment. */
         mozilla::PodArrayZero(elements_);
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     }
 
     unsigned length() const { return length_; }
@@ -595,26 +595,26 @@ class JS_PUBLIC_API(CustomAutoRooter) : 
 class HandleValueArray
 {
     const size_t length_;
     const Value * const elements_;
 
     HandleValueArray(size_t len, const Value *elements) : length_(len), elements_(elements) {}
 
   public:
-    HandleValueArray(const RootedValue& value) : length_(1), elements_(value.address()) {}
-
-    HandleValueArray(const AutoValueVector& values)
+    explicit HandleValueArray(const RootedValue& value) : length_(1), elements_(value.address()) {}
+
+    MOZ_IMPLICIT HandleValueArray(const AutoValueVector& values)
       : length_(values.length()), elements_(values.begin()) {}
 
     template <size_t N>
     HandleValueArray(const AutoValueArray<N>& values) : length_(N), elements_(values.begin()) {}
 
     /* CallArgs must already be rooted somewhere up the stack. */
-    HandleValueArray(const JS::CallArgs& args) : length_(args.length()), elements_(args.array()) {}
+    MOZ_IMPLICIT HandleValueArray(const JS::CallArgs& args) : length_(args.length()), elements_(args.array()) {}
 
     /* Use with care! Only call this if the data is guaranteed to be marked. */
     static HandleValueArray fromMarkedLocation(size_t len, const Value *elements) {
         return HandleValueArray(len, elements);
     }
 
     static HandleValueArray subarray(const HandleValueArray& values, size_t startIndex, size_t len) {
         JS_ASSERT(startIndex + len <= values.length());
@@ -638,17 +638,17 @@ class HandleValueArray
 
 /************************************************************************/
 
 struct JSFreeOp {
   private:
     JSRuntime   *runtime_;
 
   protected:
-    JSFreeOp(JSRuntime *rt)
+    explicit JSFreeOp(JSRuntime *rt)
       : runtime_(rt) { }
 
   public:
     JSRuntime *runtime() const {
         return runtime_;
     }
 };
 
@@ -1337,18 +1337,18 @@ AssertHeapIsIdle(JSRuntime *rt);
 void
 AssertHeapIsIdle(JSContext *cx);
 
 } /* namespace js */
 
 class JSAutoRequest
 {
   public:
-    JSAutoRequest(JSContext *cx
-                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+    explicit JSAutoRequest(JSContext *cx
+                           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : mContext(cx)
     {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
         JS_BeginRequest(mContext);
     }
     ~JSAutoRequest() {
         JS_EndRequest(mContext);
     }
@@ -1362,18 +1362,18 @@ class JSAutoRequest
     static void *operator new(size_t) CPP_THROW_NEW { return 0; };
     static void operator delete(void *, size_t) { };
 #endif
 };
 
 class JSAutoCheckRequest
 {
   public:
-    JSAutoCheckRequest(JSContext *cx
-                       MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+    explicit JSAutoCheckRequest(JSContext *cx
+                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     {
 #if defined JS_THREADSAFE && defined JS_DEBUG
         mContext = cx;
         JS_ASSERT(JS_IsInRequest(JS_GetRuntime(cx)));
 #endif
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     }
 
@@ -1617,17 +1617,17 @@ class JS_PUBLIC_API(ContextOptions) {
     bool cloneSingletons_ : 1;
 };
 
 JS_PUBLIC_API(ContextOptions &)
 ContextOptionsRef(JSContext *cx);
 
 class JS_PUBLIC_API(AutoSaveContextOptions) {
   public:
-    AutoSaveContextOptions(JSContext *cx)
+    explicit AutoSaveContextOptions(JSContext *cx)
       : cx_(cx),
         oldOptions_(ContextOptionsRef(cx_))
     {
     }
 
     ~AutoSaveContextOptions()
     {
         ContextOptionsRef(cx_) = oldOptions_;
@@ -1730,17 +1730,17 @@ class JS_PUBLIC_API(JSAutoCompartment)
     ~JSAutoCompartment();
 };
 
 class JS_PUBLIC_API(JSAutoNullCompartment)
 {
     JSContext *cx_;
     JSCompartment *oldCompartment_;
   public:
-    JSAutoNullCompartment(JSContext *cx);
+    explicit JSAutoNullCompartment(JSContext *cx);
     ~JSAutoNullCompartment();
 };
 
 /* NB: This API is infallible; a nullptr return value does not indicate error. */
 extern JS_PUBLIC_API(JSCompartment *)
 JS_EnterCompartment(JSContext *cx, JSObject *target);
 
 extern JS_PUBLIC_API(void)
@@ -4869,18 +4869,18 @@ extern JS_PUBLIC_API(void)
 HideScriptedCaller(JSContext *cx);
 
 extern JS_PUBLIC_API(void)
 UnhideScriptedCaller(JSContext *cx);
 
 class AutoHideScriptedCaller
 {
   public:
-    AutoHideScriptedCaller(JSContext *cx
-                           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+    explicit AutoHideScriptedCaller(JSContext *cx
+                                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : mContext(cx)
     {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
         HideScriptedCaller(mContext);
     }
     ~AutoHideScriptedCaller() {
         UnhideScriptedCaller(mContext);
     }
@@ -5009,17 +5009,17 @@ class MOZ_STACK_CLASS JS_PUBLIC_API(ForO
     uint32_t index;
 
     static const uint32_t NOT_ARRAY = UINT32_MAX;
 
     ForOfIterator(const ForOfIterator &) MOZ_DELETE;
     ForOfIterator &operator=(const ForOfIterator &) MOZ_DELETE;
 
   public:
-    ForOfIterator(JSContext *cx) : cx_(cx), iterator(cx_), index(NOT_ARRAY) { }
+    explicit ForOfIterator(JSContext *cx) : cx_(cx), iterator(cx_), index(NOT_ARRAY) { }
 
     enum NonIterableBehavior {
         ThrowOnNonIterable,
         AllowNonIterable
     };
 
     /*
      * Initialize the iterator.  If AllowNonIterable is passed then if iterable
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -954,17 +954,17 @@ array_toSource(JSContext *cx, unsigned a
 struct EmptySeparatorOp
 {
     bool operator()(JSContext *, StringBuffer &sb) { return true; }
 };
 
 struct CharSeparatorOp
 {
     jschar sep;
-    CharSeparatorOp(jschar sep) : sep(sep) {};
+    explicit CharSeparatorOp(jschar sep) : sep(sep) {};
     bool operator()(JSContext *, StringBuffer &sb) { return sb.append(sep); }
 };
 
 struct StringSeparatorOp
 {
     const jschar *sepchars;
     size_t seplen;
 
@@ -1505,17 +1505,17 @@ CompareSubStringValues(JSContext *cx, co
     *lessOrEqualp = (result <= 0);
     return true;
 }
 
 struct SortComparatorStrings
 {
     JSContext   *const cx;
 
-    SortComparatorStrings(JSContext *cx)
+    explicit SortComparatorStrings(JSContext *cx)
       : cx(cx) {}
 
     bool operator()(const Value &a, const Value &b, bool *lessOrEqualp) {
         return CompareStringValues(cx, a, b, lessOrEqualp);
     }
 };
 
 struct SortComparatorLexicographicInt32
@@ -3076,17 +3076,17 @@ js_InitArrayClass(JSContext *cx, HandleO
     JS_ASSERT(obj->isNative());
 
     Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
 
     RootedObject proto(cx, global->getOrCreateObjectPrototype(cx));
     if (!proto)
         return nullptr;
 
-    RootedTypeObject type(cx, cx->getNewType(&ArrayObject::class_, proto.get()));
+    RootedTypeObject type(cx, cx->getNewType(&ArrayObject::class_, TaggedProto(proto)));
     if (!type)
         return nullptr;
 
     JSObject *metadata = nullptr;
     if (!NewObjectMetadata(cx, &metadata))
         return nullptr;
 
     RootedShape shape(cx, EmptyShape::getInitialShape(cx, &ArrayObject::class_, TaggedProto(proto),
@@ -3186,17 +3186,17 @@ NewArray(ExclusiveContext *cxArg, uint32
 
     RootedObject proto(cxArg, protoArg);
     if (protoArg)
         JS::PoisonPtr(&protoArg);
 
     if (!proto && !GetBuiltinPrototype(cxArg, JSProto_Array, &proto))
         return nullptr;
 
-    RootedTypeObject type(cxArg, cxArg->getNewType(&ArrayObject::class_, proto.get()));
+    RootedTypeObject type(cxArg, cxArg->getNewType(&ArrayObject::class_, TaggedProto(proto)));
     if (!type)
         return nullptr;
 
     JSObject *metadata = nullptr;
     if (!NewObjectMetadata(cxArg, &metadata))
         return nullptr;
 
     /*
--- a/js/src/jsatom.h
+++ b/js/src/jsatom.h
@@ -91,17 +91,17 @@ struct AtomHasher
 
         HashNumber hash;
 
         Lookup(const jschar *chars, size_t length)
           : chars(chars), length(length), atom(nullptr)
         {
             hash = mozilla::HashString(chars, length);
         }
-        inline Lookup(const JSAtom *atom);
+        inline explicit Lookup(const JSAtom *atom);
     };
 
     static HashNumber hash(const Lookup &l) { return l.hash; }
     static inline bool match(const AtomStateEntry &entry, const Lookup &lookup);
     static void rekey(AtomStateEntry &k, const AtomStateEntry& newKey) { k = newKey; }
 };
 
 typedef HashSet<AtomStateEntry, AtomHasher, SystemAllocPolicy> AtomSet;
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -964,17 +964,17 @@ class AutoArrayRooter : private AutoGCRo
 class AutoAssertNoException
 {
 #ifdef DEBUG
     JSContext *cx;
     bool hadException;
 #endif
 
   public:
-    AutoAssertNoException(JSContext *cx)
+    explicit AutoAssertNoException(JSContext *cx)
 #ifdef DEBUG
       : cx(cx),
         hadException(cx->isExceptionPending())
 #endif
     {
     }
 
     ~AutoAssertNoException()
@@ -986,17 +986,17 @@ class AutoAssertNoException
 /*
  * FIXME bug 647103 - replace these *AllocPolicy names.
  */
 class ContextAllocPolicy
 {
     ThreadSafeContext *const cx_;
 
   public:
-    ContextAllocPolicy(ThreadSafeContext *cx) : cx_(cx) {}
+    MOZ_IMPLICIT ContextAllocPolicy(ThreadSafeContext *cx) : cx_(cx) {}
     ThreadSafeContext *context() const { return cx_; }
     void *malloc_(size_t bytes) { return cx_->malloc_(bytes); }
     void *calloc_(size_t bytes) { return cx_->calloc_(bytes); }
     void *realloc_(void *p, size_t oldBytes, size_t bytes) { return cx_->realloc_(p, oldBytes, bytes); }
     void free_(void *p) { js_free(p); }
     void reportAllocOverflow() const { js_ReportAllocationOverflow(cx_); }
 };
 
@@ -1042,21 +1042,21 @@ class AutoLockForExclusiveAccess
 #endif
         } else {
             JS_ASSERT(!runtime->mainThreadHasExclusiveAccess);
             runtime->mainThreadHasExclusiveAccess = true;
         }
     }
 
   public:
-    AutoLockForExclusiveAccess(ExclusiveContext *cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM) {
+    explicit AutoLockForExclusiveAccess(ExclusiveContext *cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM) {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
         init(cx->runtime_);
     }
-    AutoLockForExclusiveAccess(JSRuntime *rt MOZ_GUARD_OBJECT_NOTIFIER_PARAM) {
+    explicit AutoLockForExclusiveAccess(JSRuntime *rt MOZ_GUARD_OBJECT_NOTIFIER_PARAM) {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
         init(rt);
     }
     ~AutoLockForExclusiveAccess() {
         if (runtime->numExclusiveThreads) {
             JS_ASSERT(runtime->exclusiveAccessOwner == PR_GetCurrentThread());
             runtime->exclusiveAccessOwner = nullptr;
             PR_Unlock(runtime->exclusiveAccessLock);
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -243,17 +243,17 @@ bool
 JSCompartment::putWrapper(JSContext *cx, const CrossCompartmentKey &wrapped, const js::Value &wrapper)
 {
     JS_ASSERT(wrapped.wrapped);
     JS_ASSERT(!IsPoisonedPtr(wrapped.wrapped));
     JS_ASSERT(!IsPoisonedPtr(wrapped.debugger));
     JS_ASSERT(!IsPoisonedPtr(wrapper.toGCThing()));
     JS_ASSERT_IF(wrapped.kind == CrossCompartmentKey::StringWrapper, wrapper.isString());
     JS_ASSERT_IF(wrapped.kind != CrossCompartmentKey::StringWrapper, wrapper.isObject());
-    bool success = crossCompartmentWrappers.put(wrapped, wrapper);
+    bool success = crossCompartmentWrappers.put(wrapped, ReadBarriered<Value>(wrapper));
 
 #ifdef JSGC_GENERATIONAL
     /* There's no point allocating wrappers in the nursery since we will tenure them anyway. */
     JS_ASSERT(!IsInsideNursery(static_cast<gc::Cell *>(wrapper.toGCThing())));
 
     if (success && (IsInsideNursery(wrapped.wrapped) || IsInsideNursery(wrapped.debugger))) {
         WrapperMapRef ref(&crossCompartmentWrappers, wrapped);
         cx->runtime()->gc.storeBuffer.putGeneric(ref);
@@ -277,17 +277,17 @@ JSCompartment::wrap(JSContext *cx, JSStr
     /* If the string is an atom, we don't have to copy. */
     if (str->isAtom()) {
         JS_ASSERT(cx->runtime()->isAtomsZone(str->zone()));
         return true;
     }
 
     /* Check the cache. */
     RootedValue key(cx, StringValue(str));
-    if (WrapperMap::Ptr p = crossCompartmentWrappers.lookup(key)) {
+    if (WrapperMap::Ptr p = crossCompartmentWrappers.lookup(CrossCompartmentKey(key))) {
         *strp = p->value().get().toString();
         return true;
     }
 
     /*
      * No dice. Make a copy, and cache it. Directly allocate the copy in the
      * destination compartment, rather than first flattening it (and possibly
      * allocating in source compartment), because we don't know whether the
@@ -300,17 +300,17 @@ JSCompartment::wrap(JSContext *cx, JSStr
         ScopedJSFreePtr<jschar> copiedChars;
         if (!str->copyNonPureCharsZ(cx, copiedChars))
             return false;
         copy = js_NewString<CanGC>(cx, copiedChars.forget(), str->length());
     }
 
     if (!copy)
         return false;
-    if (!putWrapper(cx, key, StringValue(copy)))
+    if (!putWrapper(cx, CrossCompartmentKey(key), StringValue(copy)))
         return false;
 
     *strp = copy;
     return true;
 }
 
 bool
 JSCompartment::wrap(JSContext *cx, HeapPtrString *strp)
@@ -389,17 +389,17 @@ JSCompartment::wrap(JSContext *cx, Mutab
     MOZ_ASSERT(obj == GetOuterObject(cx, obj));
 
     if (obj->compartment() == this)
         return true;
 
 
     // If we already have a wrapper for this value, use it.
     RootedValue key(cx, ObjectValue(*obj));
-    if (WrapperMap::Ptr p = crossCompartmentWrappers.lookup(key)) {
+    if (WrapperMap::Ptr p = crossCompartmentWrappers.lookup(CrossCompartmentKey(key))) {
         obj.set(&p->value().get().toObject());
         JS_ASSERT(obj->is<CrossCompartmentWrapperObject>());
         JS_ASSERT(obj->getParent() == global);
         return true;
     }
 
     RootedObject proto(cx, TaggedProto::LazyProto);
     RootedObject existing(cx, existingArg);
@@ -418,17 +418,17 @@ JSCompartment::wrap(JSContext *cx, Mutab
     obj.set(cb->wrap(cx, existing, obj, proto, global, flags));
     if (!obj)
         return false;
 
     // We maintain the invariant that the key in the cross-compartment wrapper
     // map is always directly wrapped by the value.
     JS_ASSERT(Wrapper::wrappedObject(obj) == &key.get().toObject());
 
-    return putWrapper(cx, key, ObjectValue(*obj));
+    return putWrapper(cx, CrossCompartmentKey(key), ObjectValue(*obj));
 }
 
 bool
 JSCompartment::wrapId(JSContext *cx, jsid *idp)
 {
     MOZ_ASSERT(*idp != JSID_VOID, "JSID_VOID is an out-of-band sentinel value");
     if (JSID_IS_INT(*idp))
         return tr