Bug 1074911 - Replace JS_ASSERT by MOZ_ASSERT. r=jorendorff
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Wed, 01 Oct 2014 19:17:51 +0200
changeset 208230 ed4b995667b58b364d2a7ce9b2111fc22dc1f622
parent 208229 a8b3263797908ab04861b6910937f852405ee2d5
child 208231 020a62efb303bb8a1d78a7b124de112c7c704fe9
push idunknown
push userunknown
push dateunknown
reviewersjorendorff
bugs1074911
milestone35.0a1
Bug 1074911 - Replace JS_ASSERT by MOZ_ASSERT. r=jorendorff Apply the following script sed -i ' /JS_ASSERT(/ { s/JS_ASSERT(/MOZ_ASSERT(/; :b; s/ \\$/\\/; /;/ { p; d; }; n; s/^/ /; b b; }; s/JS_ASSERT (/MOZ_ASSERT(/; ' Except where the JS_ASSERT macro does not end with a semi-colon, where empty lines are in the middle of the macro, and where the backslahes are always the same-length after the expression.
js/ipc/JavaScriptShared.cpp
js/ipc/WrapperOwner.cpp
js/public/HashTable.h
js/public/HeapAPI.h
js/public/Id.h
js/public/ProfilingFrameIterator.h
js/public/RootingAPI.h
js/src/asmjs/AsmJSFrameIterator.cpp
js/src/asmjs/AsmJSFrameIterator.h
js/src/asmjs/AsmJSLink.cpp
js/src/asmjs/AsmJSModule.cpp
js/src/asmjs/AsmJSModule.h
js/src/asmjs/AsmJSSignalHandlers.cpp
js/src/asmjs/AsmJSValidate.cpp
js/src/asmjs/AsmJSValidate.h
js/src/builtin/Eval.cpp
js/src/builtin/Intl.cpp
js/src/builtin/MapObject.cpp
js/src/builtin/Object.cpp
js/src/builtin/RegExp.cpp
js/src/builtin/SIMD.cpp
js/src/builtin/SymbolObject.cpp
js/src/builtin/TestingFunctions.cpp
js/src/builtin/TypedObject.cpp
js/src/builtin/TypedObject.h
js/src/ctypes/CTypes.cpp
js/src/ctypes/CTypes.h
js/src/ctypes/Library.cpp
js/src/devtools/sharkctl.cpp
js/src/ds/FixedSizeHash.h
js/src/ds/InlineMap.h
js/src/ds/LifoAlloc.cpp
js/src/ds/LifoAlloc.h
js/src/ds/Sort.h
js/src/ds/SplayTree.h
js/src/frontend/BytecodeCompiler.cpp
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/FoldConstants.cpp
js/src/frontend/FullParseHandler.h
js/src/frontend/NameFunctions.cpp
js/src/frontend/ParseMaps.cpp
js/src/frontend/ParseMaps.h
js/src/frontend/ParseNode-inl.h
js/src/frontend/ParseNode.cpp
js/src/frontend/ParseNode.h
js/src/frontend/Parser-inl.h
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
js/src/frontend/SharedContext.h
js/src/frontend/TokenStream.cpp
js/src/frontend/TokenStream.h
js/src/gc/Barrier.cpp
js/src/gc/Barrier.h
js/src/gc/FindSCCs.h
js/src/gc/ForkJoinNursery-inl.h
js/src/gc/ForkJoinNursery.cpp
js/src/gc/GCInternals.h
js/src/gc/GCRuntime.h
js/src/gc/GCTrace.cpp
js/src/gc/Heap.h
js/src/gc/Iteration.cpp
js/src/gc/Marking.cpp
js/src/gc/Marking.h
js/src/gc/Nursery-inl.h
js/src/gc/Nursery.cpp
js/src/gc/Nursery.h
js/src/gc/RootMarking.cpp
js/src/gc/Statistics.cpp
js/src/gc/Statistics.h
js/src/gc/StoreBuffer.cpp
js/src/gc/StoreBuffer.h
js/src/gc/Tracer.cpp
js/src/gc/Tracer.h
js/src/gc/Verifier.cpp
js/src/gc/Zone.cpp
js/src/gc/Zone.h
js/src/gdb/README
js/src/irregexp/NativeRegExpMacroAssembler.cpp
js/src/irregexp/RegExpAST.cpp
js/src/irregexp/RegExpEngine.cpp
js/src/irregexp/RegExpEngine.h
js/src/irregexp/RegExpInterpreter.cpp
js/src/irregexp/RegExpMacroAssembler.cpp
js/src/irregexp/RegExpMacroAssembler.h
js/src/irregexp/RegExpParser.cpp
js/src/irregexp/RegExpParser.h
js/src/irregexp/RegExpStack.cpp
js/src/irregexp/RegExpStack.h
js/src/jit/AliasAnalysis.cpp
js/src/jit/BacktrackingAllocator.cpp
js/src/jit/BacktrackingAllocator.h
js/src/jit/Bailouts.cpp
js/src/jit/Bailouts.h
js/src/jit/BaselineBailouts.cpp
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineFrame-inl.h
js/src/jit/BaselineFrame.cpp
js/src/jit/BaselineFrame.h
js/src/jit/BaselineFrameInfo.cpp
js/src/jit/BaselineFrameInfo.h
js/src/jit/BaselineIC.cpp
js/src/jit/BaselineIC.h
js/src/jit/BaselineInspector.cpp
js/src/jit/BaselineInspector.h
js/src/jit/BaselineJIT.cpp
js/src/jit/BaselineJIT.h
js/src/jit/BitSet.cpp
js/src/jit/BitSet.h
js/src/jit/BytecodeAnalysis.cpp
js/src/jit/BytecodeAnalysis.h
js/src/jit/CodeGenerator.cpp
js/src/jit/CompactBuffer.h
js/src/jit/CompileInfo-inl.h
js/src/jit/CompileInfo.h
js/src/jit/CompileWrappers.cpp
js/src/jit/EffectiveAddressAnalysis.cpp
js/src/jit/ExecutableAllocator.h
js/src/jit/FixedList.h
js/src/jit/InlineList.h
js/src/jit/Ion.cpp
js/src/jit/IonAllocPolicy.h
js/src/jit/IonAnalysis.cpp
js/src/jit/IonBuilder.cpp
js/src/jit/IonBuilder.h
js/src/jit/IonCaches.cpp
js/src/jit/IonCaches.h
js/src/jit/IonCode.h
js/src/jit/IonFrames-inl.h
js/src/jit/IonFrames.cpp
js/src/jit/IonFrames.h
js/src/jit/IonInstrumentation.h
js/src/jit/IonLinker.h
js/src/jit/IonMacroAssembler.cpp
js/src/jit/IonMacroAssembler.h
js/src/jit/IonOptimizationLevels.cpp
js/src/jit/IonOptimizationLevels.h
js/src/jit/IonTypes.h
js/src/jit/JSONSpewer.cpp
js/src/jit/JitCompartment.h
js/src/jit/JitFrameIterator-inl.h
js/src/jit/JitFrameIterator.h
js/src/jit/JitSpewer.cpp
js/src/jit/JitcodeMap.cpp
js/src/jit/JitcodeMap.h
js/src/jit/LIR-Common.h
js/src/jit/LIR.cpp
js/src/jit/LIR.h
js/src/jit/Label.h
js/src/jit/LinearScan.cpp
js/src/jit/LiveRangeAllocator.cpp
js/src/jit/LiveRangeAllocator.h
js/src/jit/LoopUnroller.cpp
js/src/jit/Lowering.cpp
js/src/jit/MCallOptimize.cpp
js/src/jit/MIR.cpp
js/src/jit/MIR.h
js/src/jit/MIRGenerator.h
js/src/jit/MIRGraph.cpp
js/src/jit/MIRGraph.h
js/src/jit/MoveResolver.cpp
js/src/jit/MoveResolver.h
js/src/jit/ParallelFunctions.cpp
js/src/jit/ParallelSafetyAnalysis.cpp
js/src/jit/PerfSpewer.cpp
js/src/jit/RangeAnalysis.cpp
js/src/jit/RangeAnalysis.h
js/src/jit/RegisterAllocator.cpp
js/src/jit/RegisterAllocator.h
js/src/jit/RegisterSets.h
js/src/jit/Registers.h
js/src/jit/RematerializedFrame.cpp
js/src/jit/RematerializedFrame.h
js/src/jit/Safepoints.cpp
js/src/jit/Snapshots.cpp
js/src/jit/Snapshots.h
js/src/jit/StackSlotAllocator.h
js/src/jit/StupidAllocator.cpp
js/src/jit/TypePolicy.cpp
js/src/jit/TypedObjectPrediction.cpp
js/src/jit/TypedObjectPrediction.h
js/src/jit/VMFunctions.cpp
js/src/jit/VMFunctions.h
js/src/jit/arm/Architecture-arm.h
js/src/jit/arm/Assembler-arm.cpp
js/src/jit/arm/Assembler-arm.h
js/src/jit/arm/Bailouts-arm.cpp
js/src/jit/arm/BaselineHelpers-arm.h
js/src/jit/arm/BaselineIC-arm.cpp
js/src/jit/arm/CodeGenerator-arm.cpp
js/src/jit/arm/Lowering-arm.cpp
js/src/jit/arm/MacroAssembler-arm.cpp
js/src/jit/arm/MacroAssembler-arm.h
js/src/jit/arm/MoveEmitter-arm.cpp
js/src/jit/arm/Trampoline-arm.cpp
js/src/jit/mips/Architecture-mips.h
js/src/jit/mips/CodeGenerator-mips.cpp
js/src/jit/mips/Lowering-mips.cpp
js/src/jit/mips/MacroAssembler-mips.cpp
js/src/jit/mips/MacroAssembler-mips.h
js/src/jit/shared/Assembler-shared.h
js/src/jit/shared/Assembler-x86-shared.cpp
js/src/jit/shared/Assembler-x86-shared.h
js/src/jit/shared/AssemblerBuffer-x86-shared.h
js/src/jit/shared/BaseAssembler-x86-shared.h
js/src/jit/shared/BaselineCompiler-shared.cpp
js/src/jit/shared/BaselineCompiler-shared.h
js/src/jit/shared/CodeGenerator-shared-inl.h
js/src/jit/shared/CodeGenerator-shared.cpp
js/src/jit/shared/CodeGenerator-shared.h
js/src/jit/shared/CodeGenerator-x86-shared.cpp
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/Lowering-x86-shared.cpp
js/src/jit/shared/MacroAssembler-x86-shared.cpp
js/src/jit/shared/MacroAssembler-x86-shared.h
js/src/jit/shared/MoveEmitter-x86-shared.cpp
js/src/jit/x64/Architecture-x64.h
js/src/jit/x64/Assembler-x64.cpp
js/src/jit/x64/Assembler-x64.h
js/src/jit/x64/BaselineHelpers-x64.h
js/src/jit/x64/BaselineIC-x64.cpp
js/src/jit/x64/CodeGenerator-x64.cpp
js/src/jit/x64/Lowering-x64.cpp
js/src/jit/x64/MacroAssembler-x64.cpp
js/src/jit/x64/MacroAssembler-x64.h
js/src/jit/x64/Trampoline-x64.cpp
js/src/jit/x86/Architecture-x86.h
js/src/jit/x86/Assembler-x86.cpp
js/src/jit/x86/Assembler-x86.h
js/src/jit/x86/Bailouts-x86.cpp
js/src/jit/x86/BaselineHelpers-x86.h
js/src/jit/x86/BaselineIC-x86.cpp
js/src/jit/x86/CodeGenerator-x86.cpp
js/src/jit/x86/LIR-x86.h
js/src/jit/x86/Lowering-x86.cpp
js/src/jit/x86/MacroAssembler-x86.cpp
js/src/jit/x86/MacroAssembler-x86.h
js/src/jit/x86/Trampoline-x86.cpp
js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp
js/src/jsapi-tests/testLooselyEqual.cpp
js/src/jsapi-tests/testOOM.cpp
js/src/jsapi-tests/testParseJSON.cpp
js/src/jsapi-tests/testSetProperty.cpp
js/src/jsapi-tests/tests.h
js/src/jsapi.cpp
js/src/jsapi.h
js/src/jsarray.cpp
js/src/jsarray.h
js/src/jsatom.cpp
js/src/jsatom.h
js/src/jsatominlines.h
js/src/jsbool.cpp
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/jscntxtinlines.h
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jscompartmentinlines.h
js/src/jsdate.cpp
js/src/jsdtoa.cpp
js/src/jsexn.cpp
js/src/jsexn.h
js/src/jsfriendapi.cpp
js/src/jsfriendapi.h
js/src/jsfun.cpp
js/src/jsfun.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/jsiter.h
js/src/jsmath.cpp
js/src/jsnativestack.cpp
js/src/jsnativestack.h
js/src/jsnum.cpp
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/json.cpp
js/src/jsonparser.cpp
js/src/jsonparser.h
js/src/jsopcode.cpp
js/src/jsopcode.h
js/src/jsprf.cpp
js/src/jspropertytree.cpp
js/src/jspropertytree.h
js/src/jsproxy.h
js/src/jsreflect.cpp
js/src/jsscript.cpp
js/src/jsscript.h
js/src/jsscriptinlines.h
js/src/jsstr.cpp
js/src/jsstr.h
js/src/jsutil.cpp
js/src/jsutil.h
js/src/jswatchpoint.cpp
js/src/jsweakcache.h
js/src/jsweakmap.cpp
js/src/jsweakmap.h
js/src/jswrapper.h
js/src/perf/pm_linux.cpp
js/src/proxy/BaseProxyHandler.cpp
js/src/proxy/CrossCompartmentWrapper.cpp
js/src/proxy/DirectProxyHandler.cpp
js/src/proxy/Proxy.cpp
js/src/proxy/ScriptedDirectProxyHandler.cpp
js/src/proxy/ScriptedIndirectProxyHandler.cpp
js/src/proxy/Wrapper.cpp
js/src/shell/js.cpp
js/src/shell/jsheaptools.cpp
js/src/shell/jsoptparse.cpp
js/src/shell/jsoptparse.h
js/src/vm/ArgumentsObject-inl.h
js/src/vm/ArgumentsObject.cpp
js/src/vm/ArgumentsObject.h
js/src/vm/ArrayBufferObject.cpp
js/src/vm/ArrayBufferObject.h
js/src/vm/ArrayObject-inl.h
js/src/vm/ArrayObject.h
js/src/vm/CallNonGenericMethod.cpp
js/src/vm/CharacterEncoding.cpp
js/src/vm/Compression.cpp
js/src/vm/Debugger-inl.h
js/src/vm/Debugger.cpp
js/src/vm/Debugger.h
js/src/vm/ForkJoin.cpp
js/src/vm/GlobalObject.cpp
js/src/vm/GlobalObject.h
js/src/vm/HelperThreads.cpp
js/src/vm/HelperThreads.h
js/src/vm/Interpreter-inl.h
js/src/vm/Interpreter.cpp
js/src/vm/Interpreter.h
js/src/vm/MatchPairs.h
js/src/vm/MemoryMetrics.cpp
js/src/vm/ObjectImpl-inl.h
js/src/vm/ObjectImpl.cpp
js/src/vm/ObjectImpl.h
js/src/vm/OldDebugAPI.cpp
js/src/vm/PIC.cpp
js/src/vm/PIC.h
js/src/vm/PosixNSPR.cpp
js/src/vm/ProxyObject.cpp
js/src/vm/ProxyObject.h
js/src/vm/RegExpObject.cpp
js/src/vm/RegExpObject.h
js/src/vm/RegExpStatics.cpp
js/src/vm/RegExpStatics.h
js/src/vm/Runtime-inl.h
js/src/vm/Runtime.cpp
js/src/vm/Runtime.h
js/src/vm/SPSProfiler.cpp
js/src/vm/SPSProfiler.h
js/src/vm/SavedStacks.cpp
js/src/vm/ScopeObject-inl.h
js/src/vm/ScopeObject.cpp
js/src/vm/ScopeObject.h
js/src/vm/SelfHosting.cpp
js/src/vm/Shape-inl.h
js/src/vm/Shape.cpp
js/src/vm/Shape.h
js/src/vm/SharedArrayObject.cpp
js/src/vm/SharedArrayObject.h
js/src/vm/SharedTypedArrayObject.cpp
js/src/vm/SharedTypedArrayObject.h
js/src/vm/Stack-inl.h
js/src/vm/Stack.cpp
js/src/vm/Stack.h
js/src/vm/String-inl.h
js/src/vm/String.cpp
js/src/vm/String.h
js/src/vm/StringBuffer.cpp
js/src/vm/StringObject-inl.h
js/src/vm/StringObject.h
js/src/vm/StructuredClone.cpp
js/src/vm/ThreadPool.cpp
js/src/vm/TraceLogging.cpp
js/src/vm/TypedArrayObject.cpp
js/src/vm/TypedArrayObject.h
js/src/vm/Xdr.cpp
js/src/vm/Xdr.h
--- a/js/ipc/JavaScriptShared.cpp
+++ b/js/ipc/JavaScriptShared.cpp
@@ -413,17 +413,17 @@ static const uint64_t UnknownPropertyOp 
 bool
 JavaScriptShared::fromDescriptor(JSContext *cx, Handle<JSPropertyDescriptor> desc,
                                  PPropertyDescriptor *out)
 {
     out->attrs() = desc.attributes();
     if (!toVariant(cx, desc.value(), &out->value()))
         return false;
 
-    JS_ASSERT(desc.object());
+    MOZ_ASSERT(desc.object());
     if (!toObjectVariant(cx, desc.object(), &out->obj()))
         return false;
 
     if (!desc.getter()) {
         out->getter() = 0;
     } else if (desc.hasGetterObject()) {
         JSObject *getter = desc.getterObject();
         ObjectVariant objVar;
--- a/js/ipc/WrapperOwner.cpp
+++ b/js/ipc/WrapperOwner.cpp
@@ -892,17 +892,17 @@ WrapperOwner::ok(JSContext *cx, const Re
     JS_SetPendingException(cx, exn);
     return false;
 }
 
 bool
 WrapperOwner::toObjectVariant(JSContext *cx, JSObject *objArg, ObjectVariant *objVarp)
 {
     RootedObject obj(cx, objArg);
-    JS_ASSERT(obj);
+    MOZ_ASSERT(obj);
 
     // We always save objects unwrapped in the CPOW table. If we stored
     // wrappers, then the wrapper might be GCed while the target remained alive.
     // Whenever operating on an object that comes from the table, we wrap it
     // in findObjectById.
     unsigned wrapperFlags = 0;
     obj = js::UncheckedUnwrap(obj, false, &wrapperFlags);
     if (obj && IsCPOW(obj) && OwnerOf(obj) == this) {
--- a/js/public/HashTable.h
+++ b/js/public/HashTable.h
@@ -954,17 +954,17 @@ class HashTable : private AllocPolicy
             this->mutationCount = table_.mutationCount;
 #endif
         }
 
         // Removes the |front()| element and re-inserts it into the table with
         // a new key at the new Lookup position.  |front()| is invalid after
         // this operation until the next call to |popFront()|.
         void rekeyFront(const Lookup &l, const Key &k) {
-            JS_ASSERT(&k != &HashPolicy::getKey(this->cur->get()));
+            MOZ_ASSERT(&k != &HashPolicy::getKey(this->cur->get()));
             Ptr p(*this->cur, table_);
             table_.rekeyWithoutRehash(p, l, k);
             rekeyed = true;
 #ifdef JS_DEBUG
             this->validEntry = false;
             this->mutationCount = table_.mutationCount;
 #endif
         }
--- a/js/public/HeapAPI.h
+++ b/js/public/HeapAPI.h
@@ -255,17 +255,17 @@ IsInsideNursery(const js::gc::Cell *cell
 {
 #ifdef JSGC_GENERATIONAL
     if (!cell)
         return false;
     uintptr_t addr = uintptr_t(cell);
     addr &= ~js::gc::ChunkMask;
     addr |= js::gc::ChunkLocationOffset;
     uint32_t location = *reinterpret_cast<uint32_t *>(addr);
-    JS_ASSERT(location != 0);
+    MOZ_ASSERT(location != 0);
     return location & ChunkLocationAnyNursery;
 #else
     return false;
 #endif
 }
 
 } /* namespace gc */
 
@@ -273,17 +273,17 @@ IsInsideNursery(const js::gc::Cell *cell
 
 namespace JS {
 
 static MOZ_ALWAYS_INLINE Zone *
 GetTenuredGCThingZone(void *thing)
 {
     MOZ_ASSERT(thing);
 #ifdef JSGC_GENERATIONAL
-    JS_ASSERT(!js::gc::IsInsideNursery((js::gc::Cell *)thing));
+    MOZ_ASSERT(!js::gc::IsInsideNursery((js::gc::Cell *)thing));
 #endif
     return js::gc::GetGCThingArena(thing)->zone;
 }
 
 extern JS_PUBLIC_API(Zone *)
 GetObjectZone(JSObject *obj);
 
 static MOZ_ALWAYS_INLINE bool
--- a/js/public/Id.h
+++ b/js/public/Id.h
@@ -122,18 +122,18 @@ JSID_TO_SYMBOL(jsid id)
 }
 
 static MOZ_ALWAYS_INLINE jsid
 SYMBOL_TO_JSID(JS::Symbol *sym)
 {
     jsid id;
     MOZ_ASSERT(sym != nullptr);
     MOZ_ASSERT((size_t(sym) & JSID_TYPE_MASK) == 0);
-    JS_ASSERT(!js::gc::IsInsideNursery(JS::AsCell(sym)));
-    JS_ASSERT(!JS::IsPoisonedPtr(sym));
+    MOZ_ASSERT(!js::gc::IsInsideNursery(JS::AsCell(sym)));
+    MOZ_ASSERT(!JS::IsPoisonedPtr(sym));
     JSID_BITS(id) = (size_t(sym) | JSID_TYPE_SYMBOL);
     return id;
 }
 
 static MOZ_ALWAYS_INLINE bool
 JSID_IS_GCTHING(jsid id)
 {
     return JSID_IS_STRING(id) || JSID_IS_SYMBOL(id);
--- a/js/public/ProfilingFrameIterator.h
+++ b/js/public/ProfilingFrameIterator.h
@@ -29,21 +29,21 @@ namespace JS {
 // unwound.
 class JS_PUBLIC_API(ProfilingFrameIterator)
 {
     js::Activation *activation_;
 
     static const unsigned StorageSpace = 6 * sizeof(void*);
     mozilla::AlignedStorage<StorageSpace> storage_;
     js::AsmJSProfilingFrameIterator &asmJSIter() {
-        JS_ASSERT(!done());
+        MOZ_ASSERT(!done());
         return *reinterpret_cast<js::AsmJSProfilingFrameIterator*>(storage_.addr());
     }
     const js::AsmJSProfilingFrameIterator &asmJSIter() const {
-        JS_ASSERT(!done());
+        MOZ_ASSERT(!done());
         return *reinterpret_cast<const js::AsmJSProfilingFrameIterator*>(storage_.addr());
     }
 
     void settle();
 
   public:
     struct RegisterState
     {
--- a/js/public/RootingAPI.h
+++ b/js/public/RootingAPI.h
@@ -665,17 +665,17 @@ struct GCMethods<T *>
 template <>
 struct GCMethods<JSObject *>
 {
     static JSObject *initial() { return nullptr; }
     static bool poisoned(JSObject *v) { return JS::IsPoisonedPtr(v); }
     static gc::Cell *asGCThingOrNull(JSObject *v) {
         if (!v)
             return nullptr;
-        JS_ASSERT(uintptr_t(v) > 32);
+        MOZ_ASSERT(uintptr_t(v) > 32);
         return reinterpret_cast<gc::Cell *>(v);
     }
     static bool needsPostBarrier(JSObject *v) {
         return v != nullptr && gc::IsInsideNursery(reinterpret_cast<gc::Cell *>(v));
     }
 #ifdef JSGC_GENERATIONAL
     static void postBarrier(JSObject **vp) {
         JS::HeapCellPostBarrier(reinterpret_cast<js::gc::Cell **>(vp));
--- a/js/src/asmjs/AsmJSFrameIterator.cpp
+++ b/js/src/asmjs/AsmJSFrameIterator.cpp
@@ -49,61 +49,61 @@ AsmJSFrameIterator::AsmJSFrameIterator(c
     if (!fp_)
         return;
     settle();
 }
 
 void
 AsmJSFrameIterator::operator++()
 {
-    JS_ASSERT(!done());
+    MOZ_ASSERT(!done());
     DebugOnly<uint8_t*> oldfp = fp_;
     fp_ += callsite_->stackDepth();
     JS_ASSERT_IF(module_->profilingEnabled(), fp_ == CallerFPFromFP(oldfp));
     settle();
 }
 
 void
 AsmJSFrameIterator::settle()
 {
     void *returnAddress = ReturnAddressFromFP(fp_);
 
     const AsmJSModule::CodeRange *codeRange = module_->lookupCodeRange(returnAddress);
-    JS_ASSERT(codeRange);
+    MOZ_ASSERT(codeRange);
     codeRange_ = codeRange;
 
     switch (codeRange->kind()) {
       case AsmJSModule::CodeRange::Function:
         callsite_ = module_->lookupCallSite(returnAddress);
-        JS_ASSERT(callsite_);
+        MOZ_ASSERT(callsite_);
         break;
       case AsmJSModule::CodeRange::Entry:
         fp_ = nullptr;
-        JS_ASSERT(done());
+        MOZ_ASSERT(done());
         break;
       case AsmJSModule::CodeRange::IonFFI:
       case AsmJSModule::CodeRange::SlowFFI:
       case AsmJSModule::CodeRange::Interrupt:
       case AsmJSModule::CodeRange::Inline:
       case AsmJSModule::CodeRange::Thunk:
         MOZ_CRASH("Should not encounter an exit during iteration");
     }
 }
 
 JSAtom *
 AsmJSFrameIterator::functionDisplayAtom() const
 {
-    JS_ASSERT(!done());
+    MOZ_ASSERT(!done());
     return reinterpret_cast<const AsmJSModule::CodeRange*>(codeRange_)->functionName(*module_);
 }
 
 unsigned
 AsmJSFrameIterator::computeLine(uint32_t *column) const
 {
-    JS_ASSERT(!done());
+    MOZ_ASSERT(!done());
     if (column)
         *column = callsite_->column();
     return callsite_->line();
 }
 
 /*****************************************************************************/
 // Prologue/epilogue code generation
 
@@ -171,24 +171,24 @@ GenerateProfilingPrologue(MacroAssembler
     {
 #if defined(JS_CODEGEN_ARM)
         AutoForbidPools afp(&masm, /* number of instructions in scope = */ 5);
 #endif
         DebugOnly<uint32_t> offsetAtBegin = masm.currentOffset();
         masm.bind(begin);
 
         PushRetAddr(masm);
-        JS_ASSERT(PushedRetAddr == masm.currentOffset() - offsetAtBegin);
+        MOZ_ASSERT(PushedRetAddr == masm.currentOffset() - offsetAtBegin);
 
         masm.loadAsmJSActivation(scratch);
         masm.push(Address(scratch, AsmJSActivation::offsetOfFP()));
-        JS_ASSERT(PushedFP == masm.currentOffset() - offsetAtBegin);
+        MOZ_ASSERT(PushedFP == masm.currentOffset() - offsetAtBegin);
 
         masm.storePtr(StackPointer, Address(scratch, AsmJSActivation::offsetOfFP()));
-        JS_ASSERT(StoredFP == masm.currentOffset() - offsetAtBegin);
+        MOZ_ASSERT(StoredFP == masm.currentOffset() - offsetAtBegin);
     }
 
     if (reason != AsmJSExit::None)
         masm.store32_NoSecondScratch(Imm32(reason), Address(scratch, AsmJSActivation::offsetOfExitReason()));
 
 #if defined(JS_CODEGEN_ARM)
     masm.setSecondScratchReg(lr);
 #endif
@@ -285,17 +285,17 @@ js::GenerateAsmJSFunctionPrologue(MacroA
 // profiling and non-profiling epilogue a priori. When the profiling mode is
 // toggled, AsmJSModule::setProfilingEnabled patches the 'profiling jump' to
 // either be a nop (falling through to the normal prologue) or a jump (jumping
 // to the profiling epilogue).
 void
 js::GenerateAsmJSFunctionEpilogue(MacroAssembler &masm, unsigned framePushed,
                                   AsmJSFunctionLabels *labels)
 {
-    JS_ASSERT(masm.framePushed() == framePushed);
+    MOZ_ASSERT(masm.framePushed() == framePushed);
 
 #if defined(JS_CODEGEN_ARM)
     // Flush pending pools so they do not get dumped between the profilingReturn
     // and profilingJump/profilingEpilogue labels since the difference must be
     // less than UINT8_MAX.
     masm.flushBuffer();
 #endif
 
@@ -374,17 +374,17 @@ js::GenerateAsmJSExitPrologue(MacroAssem
     masm.setFramePushed(framePushed);
 }
 
 void
 js::GenerateAsmJSExitEpilogue(MacroAssembler &masm, unsigned framePushed, AsmJSExit::Reason reason,
                               Label *profilingReturn)
 {
     // Inverse of GenerateAsmJSExitPrologue:
-    JS_ASSERT(masm.framePushed() == framePushed);
+    MOZ_ASSERT(masm.framePushed() == framePushed);
     GenerateProfilingEpilogue(masm, framePushed, reason, profilingReturn);
     masm.setFramePushed(0);
 }
 
 /*****************************************************************************/
 // AsmJSProfilingFrameIterator
 
 AsmJSProfilingFrameIterator::AsmJSProfilingFrameIterator(const AsmJSActivation &activation)
@@ -399,56 +399,56 @@ AsmJSProfilingFrameIterator::AsmJSProfil
 }
 
 static inline void
 AssertMatchesCallSite(const AsmJSModule &module, const AsmJSModule::CodeRange *calleeCodeRange,
                       void *callerPC, void *callerFP, void *fp)
 {
 #ifdef DEBUG
     const AsmJSModule::CodeRange *callerCodeRange = module.lookupCodeRange(callerPC);
-    JS_ASSERT(callerCodeRange);
+    MOZ_ASSERT(callerCodeRange);
     if (callerCodeRange->isEntry()) {
-        JS_ASSERT(callerFP == nullptr);
+        MOZ_ASSERT(callerFP == nullptr);
         return;
     }
 
     const CallSite *callsite = module.lookupCallSite(callerPC);
     if (calleeCodeRange->isThunk()) {
-        JS_ASSERT(!callsite);
-        JS_ASSERT(callerCodeRange->isFunction());
+        MOZ_ASSERT(!callsite);
+        MOZ_ASSERT(callerCodeRange->isFunction());
     } else {
-        JS_ASSERT(callsite);
-        JS_ASSERT(callerFP == (uint8_t*)fp + callsite->stackDepth());
+        MOZ_ASSERT(callsite);
+        MOZ_ASSERT(callerFP == (uint8_t*)fp + callsite->stackDepth());
     }
 #endif
 }
 
 void
 AsmJSProfilingFrameIterator::initFromFP(const AsmJSActivation &activation)
 {
     uint8_t *fp = activation.fp();
 
     // If a signal was handled while entering an activation, the frame will
     // still be null.
     if (!fp) {
-        JS_ASSERT(done());
+        MOZ_ASSERT(done());
         return;
     }
 
     // Since we don't have the pc for fp, start unwinding at the caller of fp,
     // whose pc we do have via fp->returnAddress. This means that the innermost
     // frame is skipped but this is fine because:
     //  - for FFI calls, the innermost frame is a thunk, so the first frame that
     //    shows up is the function calling the FFI;
     //  - for Math and other builtin calls, when profiling is activated, we
     //    patch all call sites to instead call through a thunk; and
     //  - for interrupts, we just accept that we'll lose the innermost frame.
     void *pc = ReturnAddressFromFP(fp);
     const AsmJSModule::CodeRange *codeRange = module_->lookupCodeRange(pc);
-    JS_ASSERT(codeRange);
+    MOZ_ASSERT(codeRange);
     codeRange_ = codeRange;
     stackAddress_ = fp;
 
     switch (codeRange->kind()) {
       case AsmJSModule::CodeRange::Entry:
         callerPC_ = nullptr;
         callerFP_ = nullptr;
         break;
@@ -472,17 +472,17 @@ AsmJSProfilingFrameIterator::initFromFP(
     // stored on all the paths leaving asm.js and the iterator logic treats this
     // reason as its own frame. If we have exited asm.js code without setting an
     // exit reason, the reason will be None and this means the code was
     // asynchronously interrupted.
     exitReason_ = activation.exitReason();
     if (exitReason_ == AsmJSExit::None)
         exitReason_ = AsmJSExit::Interrupt;
 
-    JS_ASSERT(!done());
+    MOZ_ASSERT(!done());
 }
 
 typedef JS::ProfilingFrameIterator::RegisterState RegisterState;
 
 AsmJSProfilingFrameIterator::AsmJSProfilingFrameIterator(const AsmJSActivation &activation,
                                                          const RegisterState &state)
   : module_(&activation.module()),
     callerFP_(nullptr),
@@ -491,17 +491,17 @@ AsmJSProfilingFrameIterator::AsmJSProfil
     codeRange_(nullptr)
 {
     // If profiling hasn't been enabled for this module, then CallerFPFromFP
     // will be trash, so ignore the entire activation. In practice, this only
     // happens if profiling is enabled while module->active() (in this case,
     // profiling will be enabled when the module becomes inactive and gets
     // called again).
     if (!module_->profilingEnabled()) {
-        JS_ASSERT(done());
+        MOZ_ASSERT(done());
         return;
     }
 
     // If pc isn't in the module, we must have exited the asm.js module via an
     // exit trampoline or signal handler.
     if (!module_->containsCodePC(state.pc)) {
         initFromFP(activation);
         return;
@@ -522,117 +522,117 @@ AsmJSProfilingFrameIterator::AsmJSProfil
         // activation.fp isn't always the AsmJSFrame for state.pc; during the
         // prologue/epilogue, activation.fp will point to the caller's frame.
         // Naively unwinding starting at activation.fp could thus lead to the
         // second-to-innermost function being skipped in the callstack which will
         // bork profiling stacks. Instead, we depend on the exact layout of the
         // prologue/epilogue, as generated by GenerateProfiling(Prologue|Epilogue)
         // below.
         uint32_t offsetInModule = ((uint8_t*)state.pc) - module_->codeBase();
-        JS_ASSERT(offsetInModule < module_->codeBytes());
-        JS_ASSERT(offsetInModule >= codeRange->begin());
-        JS_ASSERT(offsetInModule < codeRange->end());
+        MOZ_ASSERT(offsetInModule < module_->codeBytes());
+        MOZ_ASSERT(offsetInModule >= codeRange->begin());
+        MOZ_ASSERT(offsetInModule < codeRange->end());
         uint32_t offsetInCodeRange = offsetInModule - codeRange->begin();
         void **sp = (void**)state.sp;
 #if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS)
         if (offsetInCodeRange < PushedRetAddr) {
             callerPC_ = state.lr;
             callerFP_ = fp;
             AssertMatchesCallSite(*module_, codeRange, callerPC_, callerFP_, sp - 2);
         } else
 #endif
         if (offsetInCodeRange < PushedFP || offsetInModule == codeRange->profilingReturn()) {
             callerPC_ = *sp;
             callerFP_ = fp;
             AssertMatchesCallSite(*module_, codeRange, callerPC_, callerFP_, sp - 1);
         } else if (offsetInCodeRange < StoredFP) {
-            JS_ASSERT(fp == CallerFPFromFP(sp));
+            MOZ_ASSERT(fp == CallerFPFromFP(sp));
             callerPC_ = ReturnAddressFromFP(sp);
             callerFP_ = CallerFPFromFP(sp);
             AssertMatchesCallSite(*module_, codeRange, callerPC_, callerFP_, sp);
         } else {
             callerPC_ = ReturnAddressFromFP(fp);
             callerFP_ = CallerFPFromFP(fp);
             AssertMatchesCallSite(*module_, codeRange, callerPC_, callerFP_, fp);
         }
         break;
       }
       case AsmJSModule::CodeRange::Entry: {
         // The entry trampoline is the final frame in an AsmJSActivation. The entry
         // trampoline also doesn't GenerateAsmJSPrologue/Epilogue so we can't use
         // the general unwinding logic below.
-        JS_ASSERT(!fp);
+        MOZ_ASSERT(!fp);
         callerPC_ = nullptr;
         callerFP_ = nullptr;
         break;
       }
       case AsmJSModule::CodeRange::Inline: {
         // The throw stub clears AsmJSActivation::fp on it's way out.
         if (!fp) {
-            JS_ASSERT(done());
+            MOZ_ASSERT(done());
             return;
         }
 
         // Inline code ranges execute in the frame of the caller have no
         // prologue/epilogue and thus don't require the general unwinding logic
         // as below.
         callerPC_ = ReturnAddressFromFP(fp);
         callerFP_ = CallerFPFromFP(fp);
         AssertMatchesCallSite(*module_, codeRange, callerPC_, callerFP_, fp);
         break;
       }
     }
 
     codeRange_ = codeRange;
     stackAddress_ = state.sp;
-    JS_ASSERT(!done());
+    MOZ_ASSERT(!done());
 }
 
 void
 AsmJSProfilingFrameIterator::operator++()
 {
     if (exitReason_ != AsmJSExit::None) {
-        JS_ASSERT(codeRange_);
+        MOZ_ASSERT(codeRange_);
         exitReason_ = AsmJSExit::None;
-        JS_ASSERT(!done());
+        MOZ_ASSERT(!done());
         return;
     }
 
     if (!callerPC_) {
-        JS_ASSERT(!callerFP_);
+        MOZ_ASSERT(!callerFP_);
         codeRange_ = nullptr;
-        JS_ASSERT(done());
+        MOZ_ASSERT(done());
         return;
     }
 
-    JS_ASSERT(callerPC_);
+    MOZ_ASSERT(callerPC_);
     const AsmJSModule::CodeRange *codeRange = module_->lookupCodeRange(callerPC_);
-    JS_ASSERT(codeRange);
+    MOZ_ASSERT(codeRange);
     codeRange_ = codeRange;
 
     switch (codeRange->kind()) {
       case AsmJSModule::CodeRange::Entry:
-        JS_ASSERT(callerFP_ == nullptr);
-        JS_ASSERT(callerPC_ != nullptr);
+        MOZ_ASSERT(callerFP_ == nullptr);
+        MOZ_ASSERT(callerPC_ != nullptr);
         callerPC_ = nullptr;
         break;
       case AsmJSModule::CodeRange::Function:
       case AsmJSModule::CodeRange::IonFFI:
       case AsmJSModule::CodeRange::SlowFFI:
       case AsmJSModule::CodeRange::Interrupt:
       case AsmJSModule::CodeRange::Inline:
       case AsmJSModule::CodeRange::Thunk:
         stackAddress_ = callerFP_;
         callerPC_ = ReturnAddressFromFP(callerFP_);
         AssertMatchesCallSite(*module_, codeRange, callerPC_, CallerFPFromFP(callerFP_), callerFP_);
         callerFP_ = CallerFPFromFP(callerFP_);
         break;
     }
 
-    JS_ASSERT(!done());
+    MOZ_ASSERT(!done());
 }
 
 static const char *
 BuiltinToName(AsmJSExit::BuiltinKind builtin)
 {
     // Note: this label is regexp-matched by
     // browser/devtools/profiler/cleopatra/js/parserWorker.js.
 
@@ -660,17 +660,17 @@ BuiltinToName(AsmJSExit::BuiltinKind bui
       case AsmJSExit::Builtin_Limit:     break;
     }
     MOZ_CRASH("Bad builtin kind");
 }
 
 const char *
 AsmJSProfilingFrameIterator::label() const
 {
-    JS_ASSERT(!done());
+    MOZ_ASSERT(!done());
 
     // Use the same string for both time inside and under so that the two
     // entries will be coalesced by the profiler.
     //
     // NB: these labels are regexp-matched by
     //     browser/devtools/profiler/cleopatra/js/parserWorker.js.
     const char *ionFFIDescription = "fast FFI trampoline (in asm.js)";
     const char *slowFFIDescription = "slow FFI trampoline (in asm.js)";
--- a/js/src/asmjs/AsmJSFrameIterator.h
+++ b/js/src/asmjs/AsmJSFrameIterator.h
@@ -111,17 +111,17 @@ namespace AsmJSExit
     static const uint32_t Interrupt = Reason_Interrupt;
     static inline Reason Builtin(BuiltinKind builtin) {
         return uint16_t(Reason_Builtin) | (uint16_t(builtin) << 16);
     }
     static inline ReasonKind ExtractReasonKind(Reason reason) {
         return ReasonKind(uint16_t(reason));
     }
     static inline BuiltinKind ExtractBuiltinKind(Reason reason) {
-        JS_ASSERT(ExtractReasonKind(reason) == Reason_Builtin);
+        MOZ_ASSERT(ExtractReasonKind(reason) == Reason_Builtin);
         return BuiltinKind(uint16_t(reason >> 16));
     }
 }
 
 // Iterates over the frames of a single AsmJSActivation, given an
 // asynchrously-interrupted thread's state. If the activation's
 // module is not in profiling mode, the activation is skipped.
 class AsmJSProfilingFrameIterator
@@ -141,17 +141,17 @@ class AsmJSProfilingFrameIterator
   public:
     AsmJSProfilingFrameIterator() : codeRange_(nullptr) {}
     explicit AsmJSProfilingFrameIterator(const AsmJSActivation &activation);
     AsmJSProfilingFrameIterator(const AsmJSActivation &activation,
                                 const JS::ProfilingFrameIterator::RegisterState &state);
     void operator++();
     bool done() const { return !codeRange_; }
 
-    void *stackAddress() const { JS_ASSERT(!done()); return stackAddress_; }
+    void *stackAddress() const { MOZ_ASSERT(!done()); return stackAddress_; }
     const char *label() const;
 };
 
 /******************************************************************************/
 // Prologue/epilogue code generation.
 
 void
 GenerateAsmJSFunctionPrologue(jit::MacroAssembler &masm, unsigned framePushed,
--- a/js/src/asmjs/AsmJSLink.cpp
+++ b/js/src/asmjs/AsmJSLink.cpp
@@ -124,17 +124,17 @@ HasPureCoercion(JSContext *cx, HandleVal
 
     return false;
 }
 
 static bool
 ValidateGlobalVariable(JSContext *cx, const AsmJSModule &module, AsmJSModule::Global &global,
                        HandleValue importVal)
 {
-    JS_ASSERT(global.which() == AsmJSModule::Global::Variable);
+    MOZ_ASSERT(global.which() == AsmJSModule::Global::Variable);
 
     void *datum = module.globalVarToGlobalDatum(global);
 
     switch (global.varInitKind()) {
       case AsmJSModule::Global::InitConstant: {
         const AsmJSNumLit &lit = global.varInitNumLit();
         switch (lit.which()) {
           case AsmJSNumLit::Fixnum:
@@ -430,17 +430,17 @@ LinkModuleToHeap(JSContext *cx, AsmJSMod
                         "valid length is 0x%x",
                         heapLength,
                         RoundUpToNextValidAsmJSHeapLength(heapLength)));
         return LinkFail(cx, msg.get());
     }
 
     // This check is sufficient without considering the size of the loaded datum because heap
     // loads and stores start on an aligned boundary and the heap byteLength has larger alignment.
-    JS_ASSERT((module.minHeapLength() - 1) <= INT32_MAX);
+    MOZ_ASSERT((module.minHeapLength() - 1) <= INT32_MAX);
     if (heapLength < module.minHeapLength()) {
         ScopedJSFreePtr<char> msg(
             JS_smprintf("ArrayBuffer byteLength of 0x%x is less than 0x%x (which is the "
                         "largest constant heap access offset rounded up to the next valid "
                         "heap size).",
                         heapLength,
                         module.minHeapLength()));
         return LinkFail(cx, msg.get());
@@ -772,17 +772,17 @@ SendFunctionsToVTune(JSContext *cx, AsmJ
 {
     uint8_t *base = module.codeBase();
 
     for (unsigned i = 0; i < module.numProfiledFunctions(); i++) {
         const AsmJSModule::ProfiledFunction &func = module.profiledFunction(i);
 
         uint8_t *start = base + func.pod.startCodeOffset;
         uint8_t *end   = base + func.pod.endCodeOffset;
-        JS_ASSERT(end >= start);
+        MOZ_ASSERT(end >= start);
 
         unsigned method_id = iJIT_GetNewMethodID();
         if (method_id == 0)
             return false;
 
         JSAutoByteString bytes;
         const char *method_name = AtomToPrintableString(cx, func.name, &bytes);
         if (!method_name)
@@ -815,17 +815,17 @@ SendFunctionsToPerf(JSContext *cx, AsmJS
 
     uintptr_t base = (uintptr_t) module.codeBase();
     const char *filename = module.scriptSource()->filename();
 
     for (unsigned i = 0; i < module.numProfiledFunctions(); i++) {
         const AsmJSModule::ProfiledFunction &func = module.profiledFunction(i);
         uintptr_t start = base + (unsigned long) func.pod.startCodeOffset;
         uintptr_t end   = base + (unsigned long) func.pod.endCodeOffset;
-        JS_ASSERT(end >= start);
+        MOZ_ASSERT(end >= start);
         size_t size = end - start;
 
         JSAutoByteString bytes;
         const char *name = AtomToPrintableString(cx, func.name, &bytes);
         if (!name)
             return false;
 
         writePerfSpewerAsmJSFunctionMap(start, size, filename, func.pod.lineno,
@@ -903,17 +903,17 @@ CreateExportObject(JSContext *cx, Handle
 
     for (unsigned i = 0; i < module.numExportedFunctions(); i++) {
         const AsmJSModule::ExportedFunction &func = module.exportedFunction(i);
 
         RootedFunction fun(cx, NewExportedFunction(cx, func, moduleObj, i));
         if (!fun)
             return nullptr;
 
-        JS_ASSERT(func.maybeFieldName() != nullptr);
+        MOZ_ASSERT(func.maybeFieldName() != nullptr);
         RootedId id(cx, NameToId(func.maybeFieldName()));
         RootedValue val(cx, ObjectValue(*fun));
         if (!DefineNativeProperty(cx, obj, id, val, nullptr, nullptr, JSPROP_ENUMERATE))
             return nullptr;
     }
 
     return obj;
 }
@@ -1169,28 +1169,28 @@ js::AsmJSFunctionToString(JSContext *cx,
     uint32_t begin = module.srcStart() + f.startOffsetInModule();
     uint32_t end = module.srcStart() + f.endOffsetInModule();
 
     ScriptSource *source = module.scriptSource();
     StringBuffer out(cx);
 
     // asm.js functions cannot have been created with a Function constructor
     // as they belong within a module.
-    JS_ASSERT(!(begin == 0 && end == source->length() && source->argumentsNotIncluded()));
+    MOZ_ASSERT(!(begin == 0 && end == source->length() && source->argumentsNotIncluded()));
 
     if (!out.append("function "))
         return nullptr;
 
     if (module.strict()) {
         // AppendUseStrictSource expects its input to start right after the
         // function name, so split the source chars from the src into two parts:
         // the function name and the rest (arguments + body).
 
         // asm.js functions can't be anonymous
-        JS_ASSERT(fun->atom());
+        MOZ_ASSERT(fun->atom());
         if (!out.append(fun->atom()))
             return nullptr;
 
         size_t nameEnd = begin + fun->atom()->length();
         Rooted<JSFlatString*> src(cx, source->substring(cx, nameEnd, end));
         if (!AppendUseStrictSource(cx, fun, src, out))
             return nullptr;
     } else {
--- a/js/src/asmjs/AsmJSModule.cpp
+++ b/js/src/asmjs/AsmJSModule.cpp
@@ -54,17 +54,17 @@ using mozilla::BinarySearch;
 using mozilla::PodCopy;
 using mozilla::PodEqual;
 using mozilla::Compression::LZ4;
 using mozilla::Swap;
 
 static uint8_t *
 AllocateExecutableMemory(ExclusiveContext *cx, size_t totalBytes)
 {
-    JS_ASSERT(totalBytes % AsmJSPageSize == 0);
+    MOZ_ASSERT(totalBytes % AsmJSPageSize == 0);
 
 #ifdef XP_WIN
     void *p = VirtualAlloc(nullptr, totalBytes, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
     if (!p) {
         js_ReportOutOfMemory(cx);
         return nullptr;
     }
 #else  // assume Unix
@@ -199,17 +199,17 @@ struct CallSiteRetAddrOffset
     uint32_t operator[](size_t index) const {
         return callSites[index].returnAddressOffset();
     }
 };
 
 const CallSite *
 AsmJSModule::lookupCallSite(void *returnAddress) const
 {
-    JS_ASSERT(isFinished());
+    MOZ_ASSERT(isFinished());
 
     uint32_t target = ((uint8_t*)returnAddress) - code_;
     size_t lowerBound = 0;
     size_t upperBound = callSites_.length();
 
     size_t match;
     if (!BinarySearch(CallSiteRetAddrOffset(callSites_), lowerBound, upperBound, target, &match))
         return nullptr;
@@ -238,17 +238,17 @@ operator<(size_t pcOffset, const AsmJSMo
     return pcOffset < rhs.begin();
 }
 
 } // namespace js
 
 const AsmJSModule::CodeRange *
 AsmJSModule::lookupCodeRange(void *pc) const
 {
-    JS_ASSERT(isFinished());
+    MOZ_ASSERT(isFinished());
 
     uint32_t target = ((uint8_t*)pc) - code_;
     size_t lowerBound = 0;
     size_t upperBound = codeRanges_.length();
 
     size_t match;
     if (!BinarySearch(codeRanges_, lowerBound, upperBound, target, &match))
         return nullptr;
@@ -263,67 +263,67 @@ struct HeapAccessOffset
     uintptr_t operator[](size_t index) const {
         return accesses[index].offset();
     }
 };
 
 const AsmJSHeapAccess *
 AsmJSModule::lookupHeapAccess(void *pc) const
 {
-    JS_ASSERT(isFinished());
-    JS_ASSERT(containsFunctionPC(pc));
+    MOZ_ASSERT(isFinished());
+    MOZ_ASSERT(containsFunctionPC(pc));
 
     uint32_t target = ((uint8_t*)pc) - code_;
     size_t lowerBound = 0;
     size_t upperBound = heapAccesses_.length();
 
     size_t match;
     if (!BinarySearch(HeapAccessOffset(heapAccesses_), lowerBound, upperBound, target, &match))
         return nullptr;
 
     return &heapAccesses_[match];
 }
 
 bool
 AsmJSModule::finish(ExclusiveContext *cx, TokenStream &tokenStream, MacroAssembler &masm,
                     const Label &interruptLabel)
 {
-    JS_ASSERT(isFinishedWithFunctionBodies() && !isFinished());
+    MOZ_ASSERT(isFinishedWithFunctionBodies() && !isFinished());
 
     uint32_t endBeforeCurly = tokenStream.currentToken().pos.end;
     uint32_t endAfterCurly = tokenStream.peekTokenPos().end;
-    JS_ASSERT(endBeforeCurly >= srcBodyStart_);
-    JS_ASSERT(endAfterCurly >= srcBodyStart_);
+    MOZ_ASSERT(endBeforeCurly >= srcBodyStart_);
+    MOZ_ASSERT(endAfterCurly >= srcBodyStart_);
     pod.srcLength_ = endBeforeCurly - srcStart_;
     pod.srcLengthWithRightBrace_ = endAfterCurly - srcStart_;
 
     // The global data section sits immediately after the executable (and
     // other) data allocated by the MacroAssembler, so ensure it is
     // SIMD-aligned.
     pod.codeBytes_ = AlignBytes(masm.bytesNeeded(), SimdStackAlignment);
 
     // The entire region is allocated via mmap/VirtualAlloc which requires
     // units of pages.
     pod.totalBytes_ = AlignBytes(pod.codeBytes_ + globalDataBytes(), AsmJSPageSize);
 
-    JS_ASSERT(!code_);
+    MOZ_ASSERT(!code_);
     code_ = AllocateExecutableMemory(cx, pod.totalBytes_);
     if (!code_)
         return false;
 
     // Copy the code from the MacroAssembler into its final resting place in the
     // AsmJSModule.
-    JS_ASSERT(uintptr_t(code_) % AsmJSPageSize == 0);
+    MOZ_ASSERT(uintptr_t(code_) % AsmJSPageSize == 0);
     masm.executableCopy(code_);
 
     // c.f. JitCode::copyFrom
-    JS_ASSERT(masm.jumpRelocationTableBytes() == 0);
-    JS_ASSERT(masm.dataRelocationTableBytes() == 0);
-    JS_ASSERT(masm.preBarrierTableBytes() == 0);
-    JS_ASSERT(!masm.hasEnteredExitFrame());
+    MOZ_ASSERT(masm.jumpRelocationTableBytes() == 0);
+    MOZ_ASSERT(masm.dataRelocationTableBytes() == 0);
+    MOZ_ASSERT(masm.preBarrierTableBytes() == 0);
+    MOZ_ASSERT(!masm.hasEnteredExitFrame());
 
     // Copy over metadata, making sure to update all offsets on ARM.
 
     staticLinkData_.interruptExitOffset = masm.actualOffset(interruptLabel.offset());
 
     // Heap-access metadata used for link-time patching and fault-handling.
     heapAccesses_ = masm.extractAsmJSHeapAccesses();
 
@@ -347,17 +347,17 @@ AsmJSModule::finish(ExclusiveContext *cx
     }
     for (size_t i = 0; i < codeRanges_.length(); i++) {
         codeRanges_[i].updateOffsets(masm);
         JS_ASSERT_IF(i > 0, codeRanges_[i - 1].end() <= codeRanges_[i].begin());
     }
     for (size_t i = 0; i < builtinThunkOffsets_.length(); i++)
         builtinThunkOffsets_[i] = masm.actualOffset(builtinThunkOffsets_[i]);
 #endif
-    JS_ASSERT(pod.functionBytes_ % AsmJSPageSize == 0);
+    MOZ_ASSERT(pod.functionBytes_ % AsmJSPageSize == 0);
 
     // Absolute link metadata: absolute addresses that refer to some fixed
     // address in the address space.
     AbsoluteLinkArray &absoluteLinks = staticLinkData_.absoluteLinks;
     for (size_t i = 0; i < masm.numAsmJSAbsoluteLinks(); i++) {
         AsmJSAbsoluteLink src = masm.asmJSAbsoluteLink(i);
         if (!absoluteLinks[src.target].append(masm.actualOffset(src.patchAt.offset())))
             return false;
@@ -447,17 +447,17 @@ AsmJSModule::finish(ExclusiveContext *cx
 #endif
 
     return true;
 }
 
 void
 AsmJSModule::setAutoFlushICacheRange()
 {
-    JS_ASSERT(isFinished());
+    MOZ_ASSERT(isFinished());
     AutoFlushICache::setRange(uintptr_t(code_), pod.codeBytes_);
 }
 
 static void
 AsmJSReportOverRecursed()
 {
     JSContext *cx = PerThreadData::innermostAsmJSActivation()->cx();
     js_ReportOverRecursed(cx);
@@ -698,18 +698,18 @@ AddressOf(AsmJSImmKind kind, ExclusiveCo
     }
 
     MOZ_CRASH("Bad AsmJSImmKind");
 }
 
 void
 AsmJSModule::staticallyLink(ExclusiveContext *cx)
 {
-    JS_ASSERT(isFinished());
-    JS_ASSERT(!isStaticallyLinked());
+    MOZ_ASSERT(isFinished());
+    MOZ_ASSERT(!isStaticallyLinked());
 
     // Process staticLinkData_
 
     interruptExit_ = code_ + staticLinkData_.interruptExitOffset;
 
     for (size_t i = 0; i < staticLinkData_.relativeLinks.length(); i++) {
         RelativeLink link = staticLinkData_.relativeLinks[i];
         uint8_t *patchAt = code_ + link.patchAtOffset;
@@ -734,39 +734,39 @@ AsmJSModule::staticallyLink(ExclusiveCon
 
     for (size_t i = 0; i < exits_.length(); i++) {
         AsmJSModule::ExitDatum &exitDatum = exitIndexToGlobalDatum(i);
         exitDatum.exit = interpExitTrampoline(exits_[i]);
         exitDatum.fun = nullptr;
         exitDatum.ionScript = nullptr;
     }
 
-    JS_ASSERT(isStaticallyLinked());
+    MOZ_ASSERT(isStaticallyLinked());
 }
 
 void
 AsmJSModule::initHeap(Handle<ArrayBufferObjectMaybeShared *> heap, JSContext *cx)
 {
-    JS_ASSERT(IsValidAsmJSHeapLength(heap->byteLength()));
-    JS_ASSERT(dynamicallyLinked_);
-    JS_ASSERT(!maybeHeap_);
+    MOZ_ASSERT(IsValidAsmJSHeapLength(heap->byteLength()));
+    MOZ_ASSERT(dynamicallyLinked_);
+    MOZ_ASSERT(!maybeHeap_);
 
     maybeHeap_ = heap;
     heapDatum() = heap->dataPointer();
 
 #if defined(JS_CODEGEN_X86)
     uint8_t *heapOffset = heap->dataPointer();
     void *heapLength = (void*)heap->byteLength();
     for (unsigned i = 0; i < heapAccesses_.length(); i++) {
         const jit::AsmJSHeapAccess &access = heapAccesses_[i];
         if (access.hasLengthCheck())
             X86Assembler::setPointer(access.patchLengthAt(code_), heapLength);
         void *addr = access.patchOffsetAt(code_);
         uint32_t disp = reinterpret_cast<uint32_t>(X86Assembler::getPointer(addr));
-        JS_ASSERT(disp <= INT32_MAX);
+        MOZ_ASSERT(disp <= INT32_MAX);
         X86Assembler::setPointer(addr, (void *)(heapOffset + disp));
     }
 #elif defined(JS_CODEGEN_X64)
     int32_t heapLength = int32_t(intptr_t(heap->byteLength()));
     if (usesSignalHandlersForOOB())
         return;
     // If we cannot use the signal handlers, we need to patch the heap length
     // checks at the right places. All accesses that have been recorded are the
@@ -820,17 +820,17 @@ AsmJSModule::restoreToInitialState(uint8
     if (maybePrevBuffer) {
 #if defined(JS_CODEGEN_X86)
         // Subtract out the base-pointer added by AsmJSModule::initHeap.
         uint8_t *ptrBase = maybePrevBuffer->dataPointer();
         for (unsigned i = 0; i < heapAccesses_.length(); i++) {
             const jit::AsmJSHeapAccess &access = heapAccesses_[i];
             void *addr = access.patchOffsetAt(code_);
             uint8_t *ptr = reinterpret_cast<uint8_t*>(X86Assembler::getPointer(addr));
-            JS_ASSERT(ptr >= ptrBase);
+            MOZ_ASSERT(ptr >= ptrBase);
             X86Assembler::setPointer(addr, (void *)(ptr - ptrBase));
         }
 #endif
     }
 }
 
 static void
 AsmJSModuleObject_finalize(FreeOp *fop, JSObject *obj)
@@ -871,17 +871,17 @@ AsmJSModuleObject::create(ExclusiveConte
 
     obj->setReservedSlot(MODULE_SLOT, PrivateValue(module->forget()));
     return &obj->as<AsmJSModuleObject>();
 }
 
 AsmJSModule &
 AsmJSModuleObject::module() const
 {
-    JS_ASSERT(is<AsmJSModuleObject>());
+    MOZ_ASSERT(is<AsmJSModuleObject>());
     return *(AsmJSModule *)getReservedSlot(MODULE_SLOT).toPrivate();
 }
 
 static inline uint8_t *
 WriteBytes(uint8_t *dst, const void *src, size_t nbytes)
 {
     memcpy(dst, src, nbytes);
     return dst + nbytes;
@@ -1202,69 +1202,69 @@ AsmJSModule::CodeRange::CodeRange(uint32
     lineNumber_(lineNumber),
     begin_(l.begin.offset()),
     profilingReturn_(l.profilingReturn.offset()),
     end_(l.end.offset())
 {
     u.kind_ = Function;
     setDeltas(l.entry.offset(), l.profilingJump.offset(), l.profilingEpilogue.offset());
 
-    JS_ASSERT(l.begin.offset() < l.entry.offset());
-    JS_ASSERT(l.entry.offset() < l.profilingJump.offset());
-    JS_ASSERT(l.profilingJump.offset() < l.profilingEpilogue.offset());
-    JS_ASSERT(l.profilingEpilogue.offset() < l.profilingReturn.offset());
-    JS_ASSERT(l.profilingReturn.offset() < l.end.offset());
+    MOZ_ASSERT(l.begin.offset() < l.entry.offset());
+    MOZ_ASSERT(l.entry.offset() < l.profilingJump.offset());
+    MOZ_ASSERT(l.profilingJump.offset() < l.profilingEpilogue.offset());
+    MOZ_ASSERT(l.profilingEpilogue.offset() < l.profilingReturn.offset());
+    MOZ_ASSERT(l.profilingReturn.offset() < l.end.offset());
 }
 
 void
 AsmJSModule::CodeRange::setDeltas(uint32_t entry, uint32_t profilingJump, uint32_t profilingEpilogue)
 {
-    JS_ASSERT(entry - begin_ <= UINT8_MAX);
+    MOZ_ASSERT(entry - begin_ <= UINT8_MAX);
     u.func.beginToEntry_ = entry - begin_;
 
-    JS_ASSERT(profilingReturn_ - profilingJump <= UINT8_MAX);
+    MOZ_ASSERT(profilingReturn_ - profilingJump <= UINT8_MAX);
     u.func.profilingJumpToProfilingReturn_ = profilingReturn_ - profilingJump;
 
-    JS_ASSERT(profilingReturn_ - profilingEpilogue <= UINT8_MAX);
+    MOZ_ASSERT(profilingReturn_ - profilingEpilogue <= UINT8_MAX);
     u.func.profilingEpilogueToProfilingReturn_ = profilingReturn_ - profilingEpilogue;
 }
 
 AsmJSModule::CodeRange::CodeRange(Kind kind, uint32_t begin, uint32_t end)
   : begin_(begin),
     end_(end)
 {
     u.kind_ = kind;
 
-    JS_ASSERT(begin_ <= end_);
-    JS_ASSERT(u.kind_ == Entry || u.kind_ == Inline);
+    MOZ_ASSERT(begin_ <= end_);
+    MOZ_ASSERT(u.kind_ == Entry || u.kind_ == Inline);
 }
 
 AsmJSModule::CodeRange::CodeRange(Kind kind, uint32_t begin, uint32_t profilingReturn, uint32_t end)
   : begin_(begin),
     profilingReturn_(profilingReturn),
     end_(end)
 {
     u.kind_ = kind;
 
-    JS_ASSERT(begin_ < profilingReturn_);
-    JS_ASSERT(profilingReturn_ < end_);
-    JS_ASSERT(u.kind_ == IonFFI || u.kind_ == SlowFFI || u.kind_ == Interrupt);
+    MOZ_ASSERT(begin_ < profilingReturn_);
+    MOZ_ASSERT(profilingReturn_ < end_);
+    MOZ_ASSERT(u.kind_ == IonFFI || u.kind_ == SlowFFI || u.kind_ == Interrupt);
 }
 
 AsmJSModule::CodeRange::CodeRange(AsmJSExit::BuiltinKind builtin, uint32_t begin,
                                   uint32_t profilingReturn, uint32_t end)
   : begin_(begin),
     profilingReturn_(profilingReturn),
     end_(end)
 {
     u.kind_ = Thunk;
     u.thunk.target_ = builtin;
 
-    JS_ASSERT(begin_ < profilingReturn_);
-    JS_ASSERT(profilingReturn_ < end_);
+    MOZ_ASSERT(begin_ < profilingReturn_);
+    MOZ_ASSERT(profilingReturn_ < end_);
 }
 
 void
 AsmJSModule::CodeRange::updateOffsets(jit::MacroAssembler &masm)
 {
     uint32_t entryBefore, profilingJumpBefore, profilingEpilogueBefore;
     if (isFunction()) {
         entryBefore = entry();
@@ -1551,17 +1551,17 @@ AsmJSModule::clone(JSContext *cx, Scoped
 
     out.restoreToInitialState(code_, maybeHeap_, cx);
     return true;
 }
 
 void
 AsmJSModule::setProfilingEnabled(bool enabled, JSContext *cx)
 {
-    JS_ASSERT(isDynamicallyLinked());
+    MOZ_ASSERT(isDynamicallyLinked());
 
     if (profilingEnabled_ == enabled)
         return;
 
     // When enabled, generate profiling labels for every name in names_ that is
     // the name of some Function CodeRange. This involves malloc() so do it now
     // since, once we start sampling, we'll be in a signal-handing context where
     // we cannot malloc.
@@ -1669,34 +1669,34 @@ AsmJSModule::setProfilingEnabled(bool en
             continue;
         uint8_t *jump = code_ + cr.profilingJump();
         uint8_t *profilingEpilogue = code_ + cr.profilingEpilogue();
 #if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
         // An unconditional jump with a 1 byte offset immediate has the opcode
         // 0x90. The offset is relative to the address of the instruction after
         // the jump. 0x66 0x90 is the canonical two-byte nop.
         ptrdiff_t jumpImmediate = profilingEpilogue - jump - 2;
-        JS_ASSERT(jumpImmediate > 0 && jumpImmediate <= 127);
+        MOZ_ASSERT(jumpImmediate > 0 && jumpImmediate <= 127);
         if (enabled) {
-            JS_ASSERT(jump[0] == 0x66);
-            JS_ASSERT(jump[1] == 0x90);
+            MOZ_ASSERT(jump[0] == 0x66);
+            MOZ_ASSERT(jump[1] == 0x90);
             jump[0] = 0xeb;
             jump[1] = jumpImmediate;
         } else {
-            JS_ASSERT(jump[0] == 0xeb);
-            JS_ASSERT(jump[1] == jumpImmediate);
+            MOZ_ASSERT(jump[0] == 0xeb);
+            MOZ_ASSERT(jump[1] == jumpImmediate);
             jump[0] = 0x66;
             jump[1] = 0x90;
         }
 #elif defined(JS_CODEGEN_ARM)
         if (enabled) {
-            JS_ASSERT(reinterpret_cast<Instruction*>(jump)->is<InstNOP>());
+            MOZ_ASSERT(reinterpret_cast<Instruction*>(jump)->is<InstNOP>());
             new (jump) InstBImm(BOffImm(profilingEpilogue - jump), Assembler::Always);
         } else {
-            JS_ASSERT(reinterpret_cast<Instruction*>(jump)->is<InstBImm>());
+            MOZ_ASSERT(reinterpret_cast<Instruction*>(jump)->is<InstBImm>());
             new (jump) InstNOP();
         }
 #elif defined(JS_CODEGEN_MIPS)
         Instruction *instr = (Instruction *)jump;
         if (enabled) {
             Assembler::WriteLuiOriInstructions(instr, instr->next(),
                                                ScratchRegister, (uint32_t)profilingEpilogue);
             instr[2] = InstReg(op_special, ScratchRegister, zero, zero, ff_jr);
@@ -1722,31 +1722,31 @@ AsmJSModule::setProfilingEnabled(bool en
         void *to = code_ + builtinThunkOffsets_[builtin];
         if (!enabled)
             Swap(from, to);
         for (size_t j = 0; j < offsets.length(); j++) {
             uint8_t *caller = code_ + offsets[j];
             const AsmJSModule::CodeRange *codeRange = lookupCodeRange(caller);
             if (codeRange->isThunk())
                 continue;
-            JS_ASSERT(codeRange->isFunction());
+            MOZ_ASSERT(codeRange->isFunction());
             Assembler::PatchDataWithValueCheck(CodeLocationLabel(caller),
                                                PatchedImmPtr(to),
                                                PatchedImmPtr(from));
         }
     }
 
     profilingEnabled_ = enabled;
 }
 
 void
 AsmJSModule::protectCode(JSRuntime *rt) const
 {
-    JS_ASSERT(isDynamicallyLinked());
-    JS_ASSERT(rt->currentThreadOwnsInterruptLock());
+    MOZ_ASSERT(isDynamicallyLinked());
+    MOZ_ASSERT(rt->currentThreadOwnsInterruptLock());
 
     codeIsProtected_ = true;
 
     if (!pod.functionBytes_)
         return;
 
     // Technically, we should be able to only take away the execute permissions,
     // however this seems to break our emulators which don't always check
@@ -1759,18 +1759,18 @@ AsmJSModule::protectCode(JSRuntime *rt) 
     if (mprotect(codeBase(), functionBytes(), PROT_NONE))
         MOZ_CRASH();
 #endif
 }
 
 void
 AsmJSModule::unprotectCode(JSRuntime *rt) const
 {
-    JS_ASSERT(isDynamicallyLinked());
-    JS_ASSERT(rt->currentThreadOwnsInterruptLock());
+    MOZ_ASSERT(isDynamicallyLinked());
+    MOZ_ASSERT(rt->currentThreadOwnsInterruptLock());
 
     codeIsProtected_ = false;
 
     if (!pod.functionBytes_)
         return;
 
 #if defined(XP_WIN)
     DWORD oldProtect;
@@ -1780,18 +1780,18 @@ AsmJSModule::unprotectCode(JSRuntime *rt
     if (mprotect(codeBase(), functionBytes(), PROT_READ | PROT_WRITE | PROT_EXEC))
         MOZ_CRASH();
 #endif
 }
 
 bool
 AsmJSModule::codeIsProtected(JSRuntime *rt) const
 {
-    JS_ASSERT(isDynamicallyLinked());
-    JS_ASSERT(rt->currentThreadOwnsInterruptLock());
+    MOZ_ASSERT(isDynamicallyLinked());
+    MOZ_ASSERT(rt->currentThreadOwnsInterruptLock());
     return codeIsProtected_;
 }
 
 static bool
 GetCPUID(uint32_t *cpuId)
 {
     enum Arch {
         X86 = 0x1,
@@ -1905,17 +1905,17 @@ class ModuleChars
 class ModuleCharsForStore : ModuleChars
 {
     uint32_t uncompressedSize_;
     uint32_t compressedSize_;
     Vector<char, 0, SystemAllocPolicy> compressedBuffer_;
 
   public:
     bool init(AsmJSParser &parser) {
-        JS_ASSERT(beginOffset(parser) < endOffset(parser));
+        MOZ_ASSERT(beginOffset(parser) < endOffset(parser));
 
         uncompressedSize_ = (endOffset(parser) - beginOffset(parser)) * sizeof(char16_t);
         size_t maxCompressedSize = LZ4::maxCompressedSize(uncompressedSize_);
         if (maxCompressedSize < uncompressedSize_)
             return false;
 
         if (!compressedBuffer_.resize(maxCompressedSize))
             return false;
@@ -1999,17 +1999,17 @@ class ModuleCharsForLookup : ModuleChars
             cursor = DeserializeVector(cx, cursor, &funCtorArgs_);
 
         return cursor;
     }
 
     bool match(AsmJSParser &parser) const {
         const char16_t *parseBegin = parser.tokenStream.rawBase() + beginOffset(parser);
         const char16_t *parseLimit = parser.tokenStream.rawLimit();
-        JS_ASSERT(parseLimit >= parseBegin);
+        MOZ_ASSERT(parseLimit >= parseBegin);
         if (uint32_t(parseLimit - parseBegin) < chars_.length())
             return false;
         if (!PodEqual(chars_.begin(), parseBegin, chars_.length()))
             return false;
         if (isFunCtor_ != parser.pc->isFunctionConstructorBody())
             return false;
         if (isFunCtor_) {
             // For function statements, the closing } is included as the last
@@ -2089,17 +2089,17 @@ js::StoreAsmJSModuleInCache(AsmJSParser 
         return false;
     }
 
     uint8_t *cursor = entry.memory;
     cursor = machineId.serialize(cursor);
     cursor = moduleChars.serialize(cursor);
     cursor = module.serialize(cursor);
 
-    JS_ASSERT(cursor == entry.memory + serializedSize);
+    MOZ_ASSERT(cursor == entry.memory + serializedSize);
     return true;
 }
 
 struct ScopedCacheEntryOpenedForRead
 {
     ExclusiveContext *cx;
     size_t serializedSize;
     const uint8_t *memory;
--- a/js/src/asmjs/AsmJSModule.h
+++ b/js/src/asmjs/AsmJSModule.h
@@ -129,58 +129,58 @@ class AsmJSNumLit
         jit::SimdConstant simd_;
     } value;
 
   public:
     static AsmJSNumLit Create(Which w, Value v) {
         AsmJSNumLit lit;
         lit.which_ = w;
         lit.value.scalar_ = v;
-        JS_ASSERT(!lit.isSimd());
+        MOZ_ASSERT(!lit.isSimd());
         return lit;
     }
 
     static AsmJSNumLit Create(Which w, jit::SimdConstant c) {
         AsmJSNumLit lit;
         lit.which_ = w;
         lit.value.simd_ = c;
-        JS_ASSERT(lit.isSimd());
+        MOZ_ASSERT(lit.isSimd());
         return lit;
     }
 
     Which which() const {
         return which_;
     }
 
     int32_t toInt32() const {
-        JS_ASSERT(which_ == Fixnum || which_ == NegativeInt || which_ == BigUnsigned);
+        MOZ_ASSERT(which_ == Fixnum || which_ == NegativeInt || which_ == BigUnsigned);
         return value.scalar_.toInt32();
     }
 
     double toDouble() const {
-        JS_ASSERT(which_ == Double);
+        MOZ_ASSERT(which_ == Double);
         return value.scalar_.toDouble();
     }
 
     float toFloat() const {
-        JS_ASSERT(which_ == Float);
+        MOZ_ASSERT(which_ == Float);
         return float(value.scalar_.toDouble());
     }
 
     Value scalarValue() const {
-        JS_ASSERT(which_ != OutOfRangeInt);
+        MOZ_ASSERT(which_ != OutOfRangeInt);
         return value.scalar_;
     }
 
     bool isSimd() const {
         return which_ == Int32x4 || which_ == Float32x4;
     }
 
     const jit::SimdConstant &simdValue() const {
-        JS_ASSERT(isSimd());
+        MOZ_ASSERT(isSimd());
         return value.simd_;
     }
 
     bool hasType() const {
         return which_ != OutOfRangeInt;
     }
 };
 
@@ -249,92 +249,92 @@ class AsmJSModule
         }
 
       public:
         Global() {}
         Which which() const {
             return pod.which_;
         }
         uint32_t varIndex() const {
-            JS_ASSERT(pod.which_ == Variable);
+            MOZ_ASSERT(pod.which_ == Variable);
             return pod.u.var.index_;
         }
         VarInitKind varInitKind() const {
-            JS_ASSERT(pod.which_ == Variable);
+            MOZ_ASSERT(pod.which_ == Variable);
             return pod.u.var.initKind_;
         }
         const AsmJSNumLit &varInitNumLit() const {
-            JS_ASSERT(pod.which_ == Variable);
-            JS_ASSERT(pod.u.var.initKind_ == InitConstant);
+            MOZ_ASSERT(pod.which_ == Variable);
+            MOZ_ASSERT(pod.u.var.initKind_ == InitConstant);
             return pod.u.var.u.numLit_;
         }
         AsmJSCoercion varInitCoercion() const {
-            JS_ASSERT(pod.which_ == Variable);
-            JS_ASSERT(pod.u.var.initKind_ == InitImport);
+            MOZ_ASSERT(pod.which_ == Variable);
+            MOZ_ASSERT(pod.u.var.initKind_ == InitImport);
             return pod.u.var.u.coercion_;
         }
         PropertyName *varImportField() const {
-            JS_ASSERT(pod.which_ == Variable);
-            JS_ASSERT(pod.u.var.initKind_ == InitImport);
+            MOZ_ASSERT(pod.which_ == Variable);
+            MOZ_ASSERT(pod.u.var.initKind_ == InitImport);
             return name_;
         }
         PropertyName *ffiField() const {
-            JS_ASSERT(pod.which_ == FFI);
+            MOZ_ASSERT(pod.which_ == FFI);
             return name_;
         }
         uint32_t ffiIndex() const {
-            JS_ASSERT(pod.which_ == FFI);
+            MOZ_ASSERT(pod.which_ == FFI);
             return pod.u.ffiIndex_;
         }
         PropertyName *viewName() const {
-            JS_ASSERT(pod.which_ == ArrayView);
+            MOZ_ASSERT(pod.which_ == ArrayView);
             return name_;
         }
         Scalar::Type viewType() const {
-            JS_ASSERT(pod.which_ == ArrayView);
+            MOZ_ASSERT(pod.which_ == ArrayView);
             return pod.u.viewType_;
         }
         PropertyName *mathName() const {
-            JS_ASSERT(pod.which_ == MathBuiltinFunction);
+            MOZ_ASSERT(pod.which_ == MathBuiltinFunction);
             return name_;
         }
         AsmJSMathBuiltinFunction mathBuiltinFunction() const {
-            JS_ASSERT(pod.which_ == MathBuiltinFunction);
+            MOZ_ASSERT(pod.which_ == MathBuiltinFunction);
             return pod.u.mathBuiltinFunc_;
         }
         AsmJSSimdType simdCtorType() const {
-            JS_ASSERT(pod.which_ == SimdCtor);
+            MOZ_ASSERT(pod.which_ == SimdCtor);
             return pod.u.simdCtorType_;
         }
         PropertyName *simdCtorName() const {
-            JS_ASSERT(pod.which_ == SimdCtor);
+            MOZ_ASSERT(pod.which_ == SimdCtor);
             return name_;
         }
         PropertyName *simdOperationName() const {
-            JS_ASSERT(pod.which_ == SimdOperation);
+            MOZ_ASSERT(pod.which_ == SimdOperation);
             return name_;
         }
         AsmJSSimdOperation simdOperation() const {
-            JS_ASSERT(pod.which_ == SimdOperation);
+            MOZ_ASSERT(pod.which_ == SimdOperation);
             return pod.u.simdOp.which_;
         }
         AsmJSSimdType simdOperationType() const {
-            JS_ASSERT(pod.which_ == SimdOperation);
+            MOZ_ASSERT(pod.which_ == SimdOperation);
             return pod.u.simdOp.type_;
         }
         PropertyName *constantName() const {
-            JS_ASSERT(pod.which_ == Constant);
+            MOZ_ASSERT(pod.which_ == Constant);
             return name_;
         }
         ConstantKind constantKind() const {
-            JS_ASSERT(pod.which_ == Constant);
+            MOZ_ASSERT(pod.which_ == Constant);
             return pod.u.constant.kind_;
         }
         double constantValue() const {
-            JS_ASSERT(pod.which_ == Constant);
+            MOZ_ASSERT(pod.which_ == Constant);
             return pod.u.constant.value_;
         }
 
         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, Global *out) const;
     };
@@ -356,21 +356,21 @@ class AsmJSModule
         {}
         unsigned ffiIndex() const {
             return ffiIndex_;
         }
         unsigned globalDataOffset() const {
             return globalDataOffset_;
         }
         void initInterpOffset(unsigned off) {
-            JS_ASSERT(!interpCodeOffset_);
+            MOZ_ASSERT(!interpCodeOffset_);
             interpCodeOffset_ = off;
         }
         void initIonOffset(unsigned off) {
-            JS_ASSERT(!ionCodeOffset_);
+            MOZ_ASSERT(!ionCodeOffset_);
             ionCodeOffset_ = off;
         }
         void updateOffsets(jit::MacroAssembler &masm) {
             interpCodeOffset_ = masm.actualOffset(interpCodeOffset_);
             ionCodeOffset_ = masm.actualOffset(ionCodeOffset_);
         }
 
         size_t serializedSize() const;
@@ -444,17 +444,17 @@ class AsmJSModule
         ExportedFunction(ExportedFunction &&rhs) {
             name_ = rhs.name_;
             maybeFieldName_ = rhs.maybeFieldName_;
             argCoercions_ = mozilla::Move(rhs.argCoercions_);
             pod = rhs.pod;
         }
 
         void initCodeOffset(unsigned off) {
-            JS_ASSERT(pod.codeOffset_ == UINT32_MAX);
+            MOZ_ASSERT(pod.codeOffset_ == UINT32_MAX);
             pod.codeOffset_ = off;
         }
         void updateCodeOffset(jit::MacroAssembler &masm) {
             pod.codeOffset_ = masm.actualOffset(pod.codeOffset_);
         }
 
 
         PropertyName *name() const {
@@ -524,52 +524,52 @@ class AsmJSModule
         bool isFFI() const { return kind() == IonFFI || kind() == SlowFFI; }
         bool isInterrupt() const { return kind() == Interrupt; }
         bool isThunk() const { return kind() == Thunk; }
 
         uint32_t begin() const {
             return begin_;
         }
         uint32_t entry() const {
-            JS_ASSERT(isFunction());
+            MOZ_ASSERT(isFunction());
             return begin_ + u.func.beginToEntry_;
         }
         uint32_t end() const {
             return end_;
         }
         uint32_t profilingJump() const {
-            JS_ASSERT(isFunction());
+            MOZ_ASSERT(isFunction());
             return profilingReturn_ - u.func.profilingJumpToProfilingReturn_;
         }
         uint32_t profilingEpilogue() const {
-            JS_ASSERT(isFunction());
+            MOZ_ASSERT(isFunction());
             return profilingReturn_ - u.func.profilingEpilogueToProfilingReturn_;
         }
         uint32_t profilingReturn() const {
-            JS_ASSERT(isFunction() || isFFI() || isInterrupt() || isThunk());
+            MOZ_ASSERT(isFunction() || isFFI() || isInterrupt() || isThunk());
             return profilingReturn_;
         }
         uint32_t functionNameIndex() const {
-            JS_ASSERT(isFunction());
+            MOZ_ASSERT(isFunction());
             return nameIndex_;
         }
         PropertyName *functionName(const AsmJSModule &module) const {
-            JS_ASSERT(isFunction());
+            MOZ_ASSERT(isFunction());
             return module.names_[nameIndex_].name();
         }
         const char *functionProfilingLabel(const AsmJSModule &module) const {
-            JS_ASSERT(isFunction());
+            MOZ_ASSERT(isFunction());
             return module.profilingLabels_[nameIndex_].get();
         }
         uint32_t functionLineNumber() const {
-            JS_ASSERT(isFunction());
+            MOZ_ASSERT(isFunction());
             return lineNumber_;
         }
         AsmJSExit::BuiltinKind thunkTarget() const {
-            JS_ASSERT(isThunk());
+            MOZ_ASSERT(isThunk());
             return AsmJSExit::BuiltinKind(u.thunk.target_);
         }
     };
 
     class FuncPtrTable
     {
         uint32_t globalDataOffset_;
         uint32_t numElems_;
@@ -613,17 +613,17 @@ class AsmJSModule
         explicit ProfiledFunction()
           : name(nullptr)
         { }
 
         ProfiledFunction(PropertyName *name, unsigned start, unsigned end,
                          unsigned line = 0, unsigned column = 0)
           : name(name)
         {
-            JS_ASSERT(name->isTenured());
+            MOZ_ASSERT(name->isTenured());
 
             pod.startCodeOffset = start;
             pod.endCodeOffset = end;
             pod.lineno = line;
             pod.columnIndex = column;
         }
 
         void trace(JSTracer *trc) {
@@ -643,17 +643,17 @@ class AsmJSModule
         unsigned endInlineCodeOffset;
         jit::BasicBlocksVector blocks;
 
         ProfiledBlocksFunction(PropertyName *name, unsigned start, unsigned endInline, unsigned end,
                                jit::BasicBlocksVector &blocksVector)
           : ProfiledFunction(name, start, end), endInlineCodeOffset(endInline),
             blocks(mozilla::Move(blocksVector))
         {
-            JS_ASSERT(name->isTenured());
+            MOZ_ASSERT(name->isTenured());
         }
 
         ProfiledBlocksFunction(ProfiledBlocksFunction &&copy)
           : ProfiledFunction(copy.name, copy.pod.startCodeOffset, copy.pod.endCodeOffset),
             endInlineCodeOffset(copy.endInlineCodeOffset), blocks(mozilla::Move(copy.blocks))
         { }
     };
 #endif
@@ -672,17 +672,17 @@ class AsmJSModule
 
         explicit RelativeLink(Kind kind)
         {
 #if defined(JS_CODEGEN_MIPS)
             kind_ = kind;
 #elif defined(JS_CODEGEN_ARM)
             // On ARM, CodeLabels are only used to label raw pointers, so in
             // all cases on ARM, a RelativePatch means patching a raw pointer.
-            JS_ASSERT(kind == CodeLabel || kind == RawPointer);
+            MOZ_ASSERT(kind == CodeLabel || kind == RawPointer);
 #endif
             // On X64 and X86, all RelativePatch-es are patched as raw pointers.
         }
 
         bool isRawPointerPatch() {
 #if defined(JS_CODEGEN_MIPS)
             return kind_ == RawPointer;
 #else
@@ -702,21 +702,21 @@ class AsmJSModule
     typedef Vector<uint32_t, 0, SystemAllocPolicy> OffsetVector;
 
     class AbsoluteLinkArray
     {
         OffsetVector array_[jit::AsmJSImm_Limit];
 
       public:
         OffsetVector &operator[](size_t i) {
-            JS_ASSERT(i < jit::AsmJSImm_Limit);
+            MOZ_ASSERT(i < jit::AsmJSImm_Limit);
             return array_[i];
         }
         const OffsetVector &operator[](size_t i) const {
-            JS_ASSERT(i < jit::AsmJSImm_Limit);
+            MOZ_ASSERT(i < jit::AsmJSImm_Limit);
             return array_[i];
         }
 
         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, AbsoluteLinkArray *out) const;
 
@@ -810,17 +810,17 @@ class AsmJSModule
     bool isFinished() const { return !!code_; }
     bool isStaticallyLinked() const { return !!interruptExit_; }
     bool isDynamicallyLinked() const { return dynamicallyLinked_; }
 
     /*************************************************************************/
     // These functions may be used as soon as the module is constructed:
 
     ScriptSource *scriptSource() const {
-        JS_ASSERT(scriptSource_);
+        MOZ_ASSERT(scriptSource_);
         return scriptSource_;
     }
     bool strict() const {
         return pod.strict_;
     }
     bool usesSignalHandlersForInterrupt() const {
         return pod.usesSignalHandlers_;
     }
@@ -866,41 +866,41 @@ class AsmJSModule
     void addSizeOfMisc(mozilla::MallocSizeOf mallocSizeOf, size_t *asmJSModuleCode,
                        size_t *asmJSModuleData);
 
     /*************************************************************************/
     // These functions build the global scope of the module while parsing the
     // module prologue (before the function bodies):
 
     void initGlobalArgumentName(PropertyName *n) {
-        JS_ASSERT(!isFinishedWithModulePrologue());
+        MOZ_ASSERT(!isFinishedWithModulePrologue());
         JS_ASSERT_IF(n, n->isTenured());
         globalArgumentName_ = n;
     }
     void initImportArgumentName(PropertyName *n) {
-        JS_ASSERT(!isFinishedWithModulePrologue());
+        MOZ_ASSERT(!isFinishedWithModulePrologue());
         JS_ASSERT_IF(n, n->isTenured());
         importArgumentName_ = n;
     }
     void initBufferArgumentName(PropertyName *n) {
-        JS_ASSERT(!isFinishedWithModulePrologue());
+        MOZ_ASSERT(!isFinishedWithModulePrologue());
         JS_ASSERT_IF(n, n->isTenured());
         bufferArgumentName_ = n;
     }
     PropertyName *globalArgumentName() const {
         return globalArgumentName_;
     }
     PropertyName *importArgumentName() const {
         return importArgumentName_;
     }
     PropertyName *bufferArgumentName() const {
         return bufferArgumentName_;
     }
     bool addGlobalVarInit(const AsmJSNumLit &lit, uint32_t *globalIndex) {
-        JS_ASSERT(!isFinishedWithModulePrologue());
+        MOZ_ASSERT(!isFinishedWithModulePrologue());
         Global g(Global::Variable, nullptr);
         g.pod.u.var.initKind_ = Global::InitConstant;
         g.pod.u.var.u.numLit_ = lit;
 
         if (lit.isSimd()) {
             if (pod.numGlobalSimdVars_ == UINT32_MAX)
                 return false;
             *globalIndex = pod.numGlobalSimdVars_++;
@@ -921,48 +921,48 @@ class AsmJSModule
             return false;
           case AsmJS_ToInt32x4:
           case AsmJS_ToFloat32x4:
             return true;
         }
         MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("unexpected AsmJSCoercion");
     }
     bool addGlobalVarImport(PropertyName *name, AsmJSCoercion coercion, uint32_t *globalIndex) {
-        JS_ASSERT(!isFinishedWithModulePrologue());
+        MOZ_ASSERT(!isFinishedWithModulePrologue());
         Global g(Global::Variable, name);
         g.pod.u.var.initKind_ = Global::InitImport;
         g.pod.u.var.u.coercion_ = coercion;
         *globalIndex = IsSimdCoercion(coercion) ? pod.numGlobalSimdVars_++
                                                 : pod.numGlobalScalarVars_++;
         g.pod.u.var.index_ = *globalIndex;
         return globals_.append(g);
     }
     bool addFFI(PropertyName *field, uint32_t *ffiIndex) {
-        JS_ASSERT(!isFinishedWithModulePrologue());
+        MOZ_ASSERT(!isFinishedWithModulePrologue());
         if (pod.numFFIs_ == UINT32_MAX)
             return false;
         Global g(Global::FFI, field);
         g.pod.u.ffiIndex_ = *ffiIndex = pod.numFFIs_++;
         return globals_.append(g);
     }
     bool addArrayView(Scalar::Type vt, PropertyName *field) {
-        JS_ASSERT(!isFinishedWithModulePrologue());
+        MOZ_ASSERT(!isFinishedWithModulePrologue());
         pod.hasArrayView_ = true;
         Global g(Global::ArrayView, field);
         g.pod.u.viewType_ = vt;
         return globals_.append(g);
     }
     bool addMathBuiltinFunction(AsmJSMathBuiltinFunction func, PropertyName *field) {
-        JS_ASSERT(!isFinishedWithModulePrologue());
+        MOZ_ASSERT(!isFinishedWithModulePrologue());
         Global g(Global::MathBuiltinFunction, field);
         g.pod.u.mathBuiltinFunc_ = func;
         return globals_.append(g);
     }
     bool addMathBuiltinConstant(double value, PropertyName *field) {
-        JS_ASSERT(!isFinishedWithModulePrologue());
+        MOZ_ASSERT(!isFinishedWithModulePrologue());
         Global g(Global::Constant, field);
         g.pod.u.constant.value_ = value;
         g.pod.u.constant.kind_ = Global::MathConstant;
         return globals_.append(g);
     }
     bool addSimdCtor(AsmJSSimdType type, PropertyName *field) {
         Global g(Global::SimdCtor, field);
         g.pod.u.simdCtorType_ = type;
@@ -970,148 +970,148 @@ class AsmJSModule
     }
     bool addSimdOperation(AsmJSSimdType type, AsmJSSimdOperation op, PropertyName *field) {
         Global g(Global::SimdOperation, field);
         g.pod.u.simdOp.type_ = type;
         g.pod.u.simdOp.which_ = op;
         return globals_.append(g);
     }
     bool addGlobalConstant(double value, PropertyName *name) {
-        JS_ASSERT(!isFinishedWithModulePrologue());
+        MOZ_ASSERT(!isFinishedWithModulePrologue());
         Global g(Global::Constant, name);
         g.pod.u.constant.value_ = value;
         g.pod.u.constant.kind_ = Global::GlobalConstant;
         return globals_.append(g);
     }
     unsigned numGlobals() const {
         return globals_.length();
     }
     Global &global(unsigned i) {
         return globals_[i];
     }
 
     /*************************************************************************/
 
     void startFunctionBodies() {
-        JS_ASSERT(!isFinishedWithModulePrologue());
+        MOZ_ASSERT(!isFinishedWithModulePrologue());
         pod.funcPtrTableAndExitBytes_ = 0;
-        JS_ASSERT(isFinishedWithModulePrologue());
+        MOZ_ASSERT(isFinishedWithModulePrologue());
     }
 
     /*************************************************************************/
     // These functions are called while parsing/compiling function bodies:
 
     void requireHeapLengthToBeAtLeast(uint32_t len) {
-        JS_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
+        MOZ_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
         len = RoundUpToNextValidAsmJSHeapLength(len);
         if (len > pod.minHeapLength_)
             pod.minHeapLength_ = len;
     }
     bool addCodeRange(CodeRange::Kind kind, uint32_t begin, uint32_t end) {
         return codeRanges_.append(CodeRange(kind, begin, end));
     }
     bool addCodeRange(CodeRange::Kind kind, uint32_t begin, uint32_t pret, uint32_t end) {
         return codeRanges_.append(CodeRange(kind, begin, pret, end));
     }
     bool addFunctionCodeRange(PropertyName *name, uint32_t lineNumber,
                               const AsmJSFunctionLabels &labels)
     {
-        JS_ASSERT(!isFinished());
-        JS_ASSERT(name->isTenured());
+        MOZ_ASSERT(!isFinished());
+        MOZ_ASSERT(name->isTenured());
         if (names_.length() >= UINT32_MAX)
             return false;
         uint32_t nameIndex = names_.length();
         return names_.append(name) && codeRanges_.append(CodeRange(nameIndex, lineNumber, labels));
     }
     bool addBuiltinThunkCodeRange(AsmJSExit::BuiltinKind builtin, uint32_t begin,
                                   uint32_t profilingReturn, uint32_t end)
     {
         return builtinThunkOffsets_.append(begin) &&
                codeRanges_.append(CodeRange(builtin, begin, profilingReturn, end));
     }
     bool addExit(unsigned ffiIndex, unsigned *exitIndex) {
-        JS_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
+        MOZ_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
         if (SIZE_MAX - pod.funcPtrTableAndExitBytes_ < sizeof(ExitDatum))
             return false;
         uint32_t globalDataOffset = globalDataBytes();
         JS_STATIC_ASSERT(sizeof(ExitDatum) % sizeof(void*) == 0);
         pod.funcPtrTableAndExitBytes_ += sizeof(ExitDatum);
         *exitIndex = unsigned(exits_.length());
         return exits_.append(Exit(ffiIndex, globalDataOffset));
     }
     unsigned numExits() const {
-        JS_ASSERT(isFinishedWithModulePrologue());
+        MOZ_ASSERT(isFinishedWithModulePrologue());
         return exits_.length();
     }
     Exit &exit(unsigned i) {
-        JS_ASSERT(isFinishedWithModulePrologue());
+        MOZ_ASSERT(isFinishedWithModulePrologue());
         return exits_[i];
     }
     const Exit &exit(unsigned i) const {
-        JS_ASSERT(isFinishedWithModulePrologue());
+        MOZ_ASSERT(isFinishedWithModulePrologue());
         return exits_[i];
     }
     bool addFuncPtrTable(unsigned numElems, uint32_t *globalDataOffset) {
-        JS_ASSERT(isFinishedWithModulePrologue() && !isFinished());
-        JS_ASSERT(IsPowerOfTwo(numElems));
+        MOZ_ASSERT(isFinishedWithModulePrologue() && !isFinished());
+        MOZ_ASSERT(IsPowerOfTwo(numElems));
         if (SIZE_MAX - pod.funcPtrTableAndExitBytes_ < numElems * sizeof(void*))
             return false;
         *globalDataOffset = globalDataBytes();
         if (!funcPtrTables_.append(FuncPtrTable(*globalDataOffset, numElems)))
             return false;
         pod.funcPtrTableAndExitBytes_ += numElems * sizeof(void*);
         return true;
     }
     bool addFunctionCounts(jit::IonScriptCounts *counts) {
-        JS_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
+        MOZ_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
         return functionCounts_.append(counts);
     }
 #if defined(MOZ_VTUNE) || defined(JS_ION_PERF)
     bool addProfiledFunction(PropertyName *name, unsigned codeStart, unsigned codeEnd,
                              unsigned line, unsigned column)
     {
-        JS_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
+        MOZ_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
         ProfiledFunction func(name, codeStart, codeEnd, line, column);
         return profiledFunctions_.append(func);
     }
     unsigned numProfiledFunctions() const {
-        JS_ASSERT(isFinishedWithModulePrologue());
+        MOZ_ASSERT(isFinishedWithModulePrologue());
         return profiledFunctions_.length();
     }
     ProfiledFunction &profiledFunction(unsigned i) {
-        JS_ASSERT(isFinishedWithModulePrologue());
+        MOZ_ASSERT(isFinishedWithModulePrologue());
         return profiledFunctions_[i];
     }
 #endif
 #ifdef JS_ION_PERF
     bool addProfiledBlocks(PropertyName *name, unsigned codeBegin, unsigned inlineEnd,
                            unsigned codeEnd, jit::BasicBlocksVector &basicBlocks)
     {
-        JS_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
+        MOZ_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
         ProfiledBlocksFunction func(name, codeBegin, inlineEnd, codeEnd, basicBlocks);
         return perfProfiledBlocksFunctions_.append(mozilla::Move(func));
     }
     unsigned numPerfBlocksFunctions() const {
-        JS_ASSERT(isFinishedWithModulePrologue());
+        MOZ_ASSERT(isFinishedWithModulePrologue());
         return perfProfiledBlocksFunctions_.length();
     }
     ProfiledBlocksFunction &perfProfiledBlocksFunction(unsigned i) {
-        JS_ASSERT(isFinishedWithModulePrologue());
+        MOZ_ASSERT(isFinishedWithModulePrologue());
         return perfProfiledBlocksFunctions_[i];
     }
 #endif
 
     /*************************************************************************/
 
     // This function is called after compiling the function bodies (before
     // compiling entries/exits) to record the extent of compiled function code.
     void finishFunctionBodies(size_t functionBytes) {
-        JS_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
+        MOZ_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
         pod.functionBytes_ = functionBytes;
-        JS_ASSERT(isFinishedWithFunctionBodies());
+        MOZ_ASSERT(isFinishedWithFunctionBodies());
     }
 
     /*************************************************************************/
     // Exported functions are added after finishFunctionBodies() and before
     // finish(). The list of exported functions can be accessed any time after
     // the exported functions have been added.
 
     bool addExportedFunction(PropertyName *name,
@@ -1119,33 +1119,33 @@ class AsmJSModule
                              uint32_t funcSrcEnd,
                              PropertyName *maybeFieldName,
                              ArgCoercionVector &&argCoercions,
                              ReturnType returnType)
     {
         // NB: funcSrcBegin/funcSrcEnd are given relative to the ScriptSource
         // (the entire file) and ExportedFunctions store offsets relative to
         // the beginning of the module (so that they are caching-invariant).
-        JS_ASSERT(isFinishedWithFunctionBodies() && !isFinished());
-        JS_ASSERT(srcStart_ < funcSrcBegin);
-        JS_ASSERT(funcSrcBegin < funcSrcEnd);
+        MOZ_ASSERT(isFinishedWithFunctionBodies() && !isFinished());
+        MOZ_ASSERT(srcStart_ < funcSrcBegin);
+        MOZ_ASSERT(funcSrcBegin < funcSrcEnd);
         ExportedFunction func(name, funcSrcBegin - srcStart_, funcSrcEnd - srcStart_,
                               maybeFieldName, mozilla::Move(argCoercions), returnType);
         return exports_.length() < UINT32_MAX && exports_.append(mozilla::Move(func));
     }
     unsigned numExportedFunctions() const {
-        JS_ASSERT(isFinishedWithFunctionBodies());
+        MOZ_ASSERT(isFinishedWithFunctionBodies());
         return exports_.length();
     }
     const ExportedFunction &exportedFunction(unsigned i) const {
-        JS_ASSERT(isFinishedWithFunctionBodies());
+        MOZ_ASSERT(isFinishedWithFunctionBodies());
         return exports_[i];
     }
     ExportedFunction &exportedFunction(unsigned i) {
-        JS_ASSERT(isFinishedWithFunctionBodies());
+        MOZ_ASSERT(isFinishedWithFunctionBodies());
         return exports_[i];
     }
 
     /*************************************************************************/
 
     // finish() is called once the entire module has been parsed (via
     // tokenStream) and all function and entry/exit trampolines have been
     // generated (via masm). After this function, the module must still be
@@ -1154,60 +1154,60 @@ class AsmJSModule
                 frontend::TokenStream &tokenStream,
                 jit::MacroAssembler &masm,
                 const jit::Label &interruptLabel);
 
     /*************************************************************************/
     // These accessor functions can be used after finish():
 
     bool hasArrayView() const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return pod.hasArrayView_;
     }
     unsigned numFFIs() const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return pod.numFFIs_;
     }
     uint32_t srcEndBeforeCurly() const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return srcStart_ + pod.srcLength_;
     }
     uint32_t srcEndAfterCurly() const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return srcStart_ + pod.srcLengthWithRightBrace_;
     }
     uint8_t *codeBase() const {
-        JS_ASSERT(isFinished());
-        JS_ASSERT(uintptr_t(code_) % AsmJSPageSize == 0);
+        MOZ_ASSERT(isFinished());
+        MOZ_ASSERT(uintptr_t(code_) % AsmJSPageSize == 0);
         return code_;
     }
     size_t functionBytes() const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return pod.functionBytes_;
     }
     size_t codeBytes() const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return pod.codeBytes_;
     }
     bool containsFunctionPC(void *pc) const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return pc >= code_ && pc < (code_ + functionBytes());
     }
     bool containsCodePC(void *pc) const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return pc >= code_ && pc < (code_ + codeBytes());
     }
     uint8_t *interpExitTrampoline(const Exit &exit) const {
-        JS_ASSERT(isFinished());
-        JS_ASSERT(exit.interpCodeOffset_);
+        MOZ_ASSERT(isFinished());
+        MOZ_ASSERT(exit.interpCodeOffset_);
         return code_ + exit.interpCodeOffset_;
     }
     uint8_t *ionExitTrampoline(const Exit &exit) const {
-        JS_ASSERT(isFinished());
-        JS_ASSERT(exit.ionCodeOffset_);
+        MOZ_ASSERT(isFinished());
+        MOZ_ASSERT(exit.ionCodeOffset_);
         return code_ + exit.ionCodeOffset_;
     }
 
     // Lookup a callsite by the return pc (from the callee to the caller).
     // Return null if no callsite was found.
     const jit::CallSite *lookupCallSite(void *returnAddress) const;
 
     // Lookup the name the code range containing the given pc. Return null if no
@@ -1226,21 +1226,21 @@ class AsmJSModule
     //   2. the double float constant NaN
     //   3. the float32 constant NaN, padded to Simd128DataSize
     //   4. global SIMD variable state (elements are Simd128DataSize)
     //   5. global variable state (elements are sizeof(uint64_t))
     //   6. interleaved function-pointer tables and exits. These are allocated
     //      while type checking function bodies (as exits and uses of
     //      function-pointer tables are encountered).
     size_t offsetOfGlobalData() const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return pod.codeBytes_;
     }
     uint8_t *globalData() const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return code_ + offsetOfGlobalData();
     }
     size_t globalSimdVarsOffset() const {
         return AlignBytes(/* 0 */ sizeof(void*) +
                           /* 1 */ sizeof(void*) +
                           /* 2 */ sizeof(double) +
                           /* 3 */ sizeof(float),
                           jit::Simd128DataSize);
@@ -1260,17 +1260,17 @@ class AsmJSModule
     }
     bool active() const {
         return activation() != nullptr;
     }
     static unsigned heapGlobalDataOffset() {
         return sizeof(void*);
     }
     uint8_t *&heapDatum() const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return *(uint8_t**)(globalData() + heapGlobalDataOffset());
     }
     static unsigned nan64GlobalDataOffset() {
         static_assert(jit::AsmJSNaN64GlobalDataOffset % sizeof(double) == 0,
                       "Global data NaN should be aligned");
         return heapGlobalDataOffset() + sizeof(void*);
     }
     static unsigned nan32GlobalDataOffset() {
@@ -1280,74 +1280,74 @@ class AsmJSModule
     }
     void initGlobalNaN() {
         MOZ_ASSERT(jit::AsmJSNaN64GlobalDataOffset == nan64GlobalDataOffset());
         MOZ_ASSERT(jit::AsmJSNaN32GlobalDataOffset == nan32GlobalDataOffset());
         *(double *)(globalData() + nan64GlobalDataOffset()) = GenericNaN();
         *(float *)(globalData() + nan32GlobalDataOffset()) = GenericNaN();
     }
     unsigned globalSimdVarIndexToGlobalDataOffset(unsigned i) const {
-        JS_ASSERT(isFinishedWithModulePrologue());
-        JS_ASSERT(i < pod.numGlobalSimdVars_);
+        MOZ_ASSERT(isFinishedWithModulePrologue());
+        MOZ_ASSERT(i < pod.numGlobalSimdVars_);
         return globalSimdVarsOffset() +
                i * jit::Simd128DataSize;
     }
     unsigned globalScalarVarIndexToGlobalDataOffset(unsigned i) const {
-        JS_ASSERT(isFinishedWithModulePrologue());
-        JS_ASSERT(i < pod.numGlobalScalarVars_);
+        MOZ_ASSERT(isFinishedWithModulePrologue());
+        MOZ_ASSERT(i < pod.numGlobalScalarVars_);
         return globalSimdVarsOffset() +
                pod.numGlobalSimdVars_ * jit::Simd128DataSize +
                i * sizeof(uint64_t);
     }
     void *globalScalarVarIndexToGlobalDatum(unsigned i) const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return (void *)(globalData() + globalScalarVarIndexToGlobalDataOffset(i));
     }
     void *globalSimdVarIndexToGlobalDatum(unsigned i) const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return (void *)(globalData() + globalSimdVarIndexToGlobalDataOffset(i));
     }
     void *globalVarToGlobalDatum(const Global &g) const {
         unsigned index = g.varIndex();
         if (g.varInitKind() == Global::VarInitKind::InitConstant) {
             return g.varInitNumLit().isSimd()
                    ? globalSimdVarIndexToGlobalDatum(index)
                    : globalScalarVarIndexToGlobalDatum(index);
         }
 
-        JS_ASSERT(g.varInitKind() == Global::VarInitKind::InitImport);
+        MOZ_ASSERT(g.varInitKind() == Global::VarInitKind::InitImport);
         return IsSimdCoercion(g.varInitCoercion())
                ? globalSimdVarIndexToGlobalDatum(index)
                : globalScalarVarIndexToGlobalDatum(index);
     }
     uint8_t **globalDataOffsetToFuncPtrTable(unsigned globalDataOffset) const {
-        JS_ASSERT(isFinished());
-        JS_ASSERT(globalDataOffset < globalDataBytes());
+        MOZ_ASSERT(isFinished());
+        MOZ_ASSERT(globalDataOffset < globalDataBytes());
         return (uint8_t **)(globalData() + globalDataOffset);
     }
     unsigned exitIndexToGlobalDataOffset(unsigned exitIndex) const {
-        JS_ASSERT(isFinishedWithModulePrologue());
+        MOZ_ASSERT(isFinishedWithModulePrologue());
         return exits_[exitIndex].globalDataOffset();
     }
     ExitDatum &exitIndexToGlobalDatum(unsigned exitIndex) const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         return *(ExitDatum *)(globalData() + exitIndexToGlobalDataOffset(exitIndex));
     }
     void detachIonCompilation(size_t exitIndex) const {
-        JS_ASSERT(isFinished());
+        MOZ_ASSERT(isFinished());
         ExitDatum &exitDatum = exitIndexToGlobalDatum(exitIndex);
         exitDatum.exit = interpExitTrampoline(exit(exitIndex));
         exitDatum.ionScript = nullptr;
     }
 
     /*************************************************************************/
     // These functions are called after finish() but before staticallyLink():
 
     bool addRelativeLink(RelativeLink link) {
-        JS_ASSERT(isFinished() && !isStaticallyLinked());
+        MOZ_ASSERT(isFinished() && !isStaticallyLinked());
         return staticLinkData_.relativeLinks.append(link);
     }
 
     // A module is serialized after it is finished but before it is statically
     // linked. (Technically, it could be serialized after static linking, but it
     // would still need to be statically linked on deserialization.)
     size_t serializedSize() const;
     uint8_t *serialize(uint8_t *cursor) const;
@@ -1366,51 +1366,51 @@ class AsmJSModule
     void staticallyLink(ExclusiveContext *cx);
 
     // After a module is statically linked, it is "dynamically linked" which
     // specializes it to a particular set of arguments. In particular, this
     // binds the code to a particular heap (via initHeap) and set of global
     // variables. A given asm.js module cannot be dynamically linked more than
     // once so, if JS tries, the module is cloned.
     void setIsDynamicallyLinked() {
-        JS_ASSERT(!isDynamicallyLinked());
+        MOZ_ASSERT(!isDynamicallyLinked());
         dynamicallyLinked_ = true;
-        JS_ASSERT(isDynamicallyLinked());
+        MOZ_ASSERT(isDynamicallyLinked());
     }
     void initHeap(Handle<ArrayBufferObjectMaybeShared*> heap, JSContext *cx);
     bool clone(JSContext *cx, ScopedJSDeletePtr<AsmJSModule> *moduleOut) const;
     void restoreToInitialState(uint8_t *prevCode,
                                ArrayBufferObjectMaybeShared *maybePrevBuffer,
                                ExclusiveContext *cx);
 
     /*************************************************************************/
     // Functions that can be called after dynamic linking succeeds:
 
     CodePtr entryTrampoline(const ExportedFunction &func) const {
-        JS_ASSERT(isDynamicallyLinked());
+        MOZ_ASSERT(isDynamicallyLinked());
         return JS_DATA_TO_FUNC_PTR(CodePtr, code_ + func.pod.codeOffset_);
     }
     uint8_t *interruptExit() const {
-        JS_ASSERT(isDynamicallyLinked());
+        MOZ_ASSERT(isDynamicallyLinked());
         return interruptExit_;
     }
     uint8_t *maybeHeap() const {
-        JS_ASSERT(isDynamicallyLinked());
+        MOZ_ASSERT(isDynamicallyLinked());
         return heapDatum();
     }
     ArrayBufferObjectMaybeShared *maybeHeapBufferObject() const {
-        JS_ASSERT(isDynamicallyLinked());
+        MOZ_ASSERT(isDynamicallyLinked());
         return maybeHeap_;
     }
     size_t heapLength() const {
-        JS_ASSERT(isDynamicallyLinked());
+        MOZ_ASSERT(isDynamicallyLinked());
         return maybeHeap_ ? maybeHeap_->byteLength() : 0;
     }
     bool profilingEnabled() const {
-        JS_ASSERT(isDynamicallyLinked());
+        MOZ_ASSERT(isDynamicallyLinked());
         return profilingEnabled_;
     }
     void setProfilingEnabled(bool enabled, JSContext *cx);
 
     // Additionally, these functions may only be called while holding the
     // runtime's interrupt lock.
     void protectCode(JSRuntime *rt) const;
     void unprotectCode(JSRuntime *rt) const;
--- a/js/src/asmjs/AsmJSSignalHandlers.cpp
+++ b/js/src/asmjs/AsmJSSignalHandlers.cpp
@@ -180,23 +180,23 @@ RuntimeForCurrentThread()
 class AutoSetHandlingSignal
 {
     JSRuntime *rt;
 
   public:
     explicit AutoSetHandlingSignal(JSRuntime *rt)
       : rt(rt)
     {
-        JS_ASSERT(!rt->handlingSignal);
+        MOZ_ASSERT(!rt->handlingSignal);
         rt->handlingSignal = true;
     }
 
     ~AutoSetHandlingSignal()
     {
-        JS_ASSERT(rt->handlingSignal);
+        MOZ_ASSERT(rt->handlingSignal);
         rt->handlingSignal = false;
     }
 };
 
 #if defined(JS_CODEGEN_X64)
 template <class T>
 static void
 SetXMMRegToNaN(bool isFloat32, T *xmm_reg)
@@ -434,17 +434,17 @@ HandleException(PEXCEPTION_POINTERS exce
     EXCEPTION_RECORD *record = exception->ExceptionRecord;
     CONTEXT *context = exception->ContextRecord;
 
     if (record->ExceptionCode != EXCEPTION_ACCESS_VIOLATION)
         return false;
 
     uint8_t **ppc = ContextToPC(context);
     uint8_t *pc = *ppc;
-    JS_ASSERT(pc == record->ExceptionAddress);
+    MOZ_ASSERT(pc == record->ExceptionAddress);
 
     if (record->NumberParameters < 2)
         return false;
 
     void *faultingAddress = (void*)record->ExceptionInformation[1];
 
     JSRuntime *rt = RuntimeForCurrentThread();
 
@@ -820,25 +820,25 @@ AsmJSMachExceptionHandler::uninstall()
         }
 
         // Wait for the handler thread to complete before deallocating the port.
         PR_JoinThread(thread_);
         thread_ = nullptr;
     }
     if (port_ != MACH_PORT_NULL) {
         DebugOnly<kern_return_t> kret = mach_port_destroy(mach_task_self(), port_);
-        JS_ASSERT(kret == KERN_SUCCESS);
+        MOZ_ASSERT(kret == KERN_SUCCESS);
         port_ = MACH_PORT_NULL;
     }
 }
 
 bool
 AsmJSMachExceptionHandler::install(JSRuntime *rt)
 {
-    JS_ASSERT(!installed());
+    MOZ_ASSERT(!installed());
     kern_return_t kret;
     mach_port_t thread;
 
     // Get a port which can send and receive data.
     kret = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &port_);
     if (kret != KERN_SUCCESS)
         goto error;
     kret = mach_port_insert_right(mach_task_self(), port_, port_, MACH_MSG_TYPE_MAKE_SEND);
@@ -1051,17 +1051,17 @@ js::RequestInterruptForAsmJSCode(JSRunti
         // the code and taking a fault.
         return;
     }
 
     AsmJSActivation *activation = rt->mainThread.asmJSActivationStack();
     if (!activation)
         return;
 
-    JS_ASSERT(rt->currentThreadOwnsInterruptLock());
+    MOZ_ASSERT(rt->currentThreadOwnsInterruptLock());
     activation->module().protectCode(rt);
 }
 
 // This is not supported by clang-cl yet.
 #if defined(MOZ_ASAN) && defined(JS_STANDALONE) && !defined(_MSC_VER)
 // Usually, this definition is found in mozglue (see mozglue/build/AsanOptions.cpp).
 // However, when doing standalone JS builds, mozglue is not used and we must ensure
 // that we still allow custom SIGSEGV handlers for asm.js and ion to work correctly.
--- a/js/src/asmjs/AsmJSValidate.cpp
+++ b/js/src/asmjs/AsmJSValidate.cpp
@@ -76,137 +76,137 @@ static inline ParseNode *
 NextNode(ParseNode *pn)
 {
     return pn->pn_next;
 }
 
 static inline ParseNode *
 UnaryKid(ParseNode *pn)
 {
-    JS_ASSERT(pn->isArity(PN_UNARY));
+    MOZ_ASSERT(pn->isArity(PN_UNARY));
     return pn->pn_kid;
 }
 
 static inline ParseNode *
 ReturnExpr(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_RETURN));
+    MOZ_ASSERT(pn->isKind(PNK_RETURN));
     return UnaryKid(pn);
 }
 
 static inline ParseNode *
 BinaryRight(ParseNode *pn)
 {
-    JS_ASSERT(pn->isArity(PN_BINARY));
+    MOZ_ASSERT(pn->isArity(PN_BINARY));
     return pn->pn_right;
 }
 
 static inline ParseNode *
 BinaryLeft(ParseNode *pn)
 {
-    JS_ASSERT(pn->isArity(PN_BINARY));
+    MOZ_ASSERT(pn->isArity(PN_BINARY));
     return pn->pn_left;
 }
 
 static inline ParseNode *
 TernaryKid1(ParseNode *pn)
 {
-    JS_ASSERT(pn->isArity(PN_TERNARY));
+    MOZ_ASSERT(pn->isArity(PN_TERNARY));
     return pn->pn_kid1;
 }
 
 static inline ParseNode *
 TernaryKid2(ParseNode *pn)
 {
-    JS_ASSERT(pn->isArity(PN_TERNARY));
+    MOZ_ASSERT(pn->isArity(PN_TERNARY));
     return pn->pn_kid2;
 }
 
 static inline ParseNode *
 TernaryKid3(ParseNode *pn)
 {
-    JS_ASSERT(pn->isArity(PN_TERNARY));
+    MOZ_ASSERT(pn->isArity(PN_TERNARY));
     return pn->pn_kid3;
 }
 
 static inline ParseNode *
 ListHead(ParseNode *pn)
 {
-    JS_ASSERT(pn->isArity(PN_LIST));
+    MOZ_ASSERT(pn->isArity(PN_LIST));
     return pn->pn_head;
 }
 
 static inline unsigned
 ListLength(ParseNode *pn)
 {
-    JS_ASSERT(pn->isArity(PN_LIST));
+    MOZ_ASSERT(pn->isArity(PN_LIST));
     return pn->pn_count;
 }
 
 static inline ParseNode *
 CallCallee(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_CALL));
+    MOZ_ASSERT(pn->isKind(PNK_CALL));
     return ListHead(pn);
 }
 
 static inline unsigned
 CallArgListLength(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_CALL));
-    JS_ASSERT(ListLength(pn) >= 1);
+    MOZ_ASSERT(pn->isKind(PNK_CALL));
+    MOZ_ASSERT(ListLength(pn) >= 1);
     return ListLength(pn) - 1;
 }
 
 static inline ParseNode *
 CallArgList(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_CALL));
+    MOZ_ASSERT(pn->isKind(PNK_CALL));
     return NextNode(ListHead(pn));
 }
 
 static inline ParseNode *
 VarListHead(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_VAR) || pn->isKind(PNK_CONST));
+    MOZ_ASSERT(pn->isKind(PNK_VAR) || pn->isKind(PNK_CONST));
     return ListHead(pn);
 }
 
 static inline ParseNode *
 CaseExpr(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_CASE) || pn->isKind(PNK_DEFAULT));
+    MOZ_ASSERT(pn->isKind(PNK_CASE) || pn->isKind(PNK_DEFAULT));
     return BinaryLeft(pn);
 }
 
 static inline ParseNode *
 CaseBody(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_CASE) || pn->isKind(PNK_DEFAULT));
+    MOZ_ASSERT(pn->isKind(PNK_CASE) || pn->isKind(PNK_DEFAULT));
     return BinaryRight(pn);
 }
 
 static inline bool
 IsExpressionStatement(ParseNode *pn)
 {
     return pn->isKind(PNK_SEMI);
 }
 
 static inline ParseNode *
 ExpressionStatementExpr(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_SEMI));
+    MOZ_ASSERT(pn->isKind(PNK_SEMI));
     return UnaryKid(pn);
 }
 
 static inline PropertyName *
 LoopControlMaybeLabel(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_BREAK) || pn->isKind(PNK_CONTINUE));
-    JS_ASSERT(pn->isArity(PN_NULLARY));
+    MOZ_ASSERT(pn->isKind(PNK_BREAK) || pn->isKind(PNK_CONTINUE));
+    MOZ_ASSERT(pn->isArity(PN_NULLARY));
     return pn->as<LoopControlStatement>().label();
 }
 
 static inline PropertyName *
 LabeledStatementLabel(ParseNode *pn)
 {
     return pn->as<LabeledStatement>().label();
 }
@@ -215,115 +215,115 @@ static inline ParseNode *
 LabeledStatementStatement(ParseNode *pn)
 {
     return pn->as<LabeledStatement>().statement();
 }
 
 static double
 NumberNodeValue(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_NUMBER));
+    MOZ_ASSERT(pn->isKind(PNK_NUMBER));
     return pn->pn_dval;
 }
 
 static bool
 NumberNodeHasFrac(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_NUMBER));
+    MOZ_ASSERT(pn->isKind(PNK_NUMBER));
     return pn->pn_u.number.decimalPoint == HasDecimal;
 }
 
 static ParseNode *
 DotBase(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_DOT));
-    JS_ASSERT(pn->isArity(PN_NAME));
+    MOZ_ASSERT(pn->isKind(PNK_DOT));
+    MOZ_ASSERT(pn->isArity(PN_NAME));
     return pn->expr();
 }
 
 static PropertyName *
 DotMember(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_DOT));
-    JS_ASSERT(pn->isArity(PN_NAME));
+    MOZ_ASSERT(pn->isKind(PNK_DOT));
+    MOZ_ASSERT(pn->isArity(PN_NAME));
     return pn->pn_atom->asPropertyName();
 }
 
 static ParseNode *
 ElemBase(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_ELEM));
+    MOZ_ASSERT(pn->isKind(PNK_ELEM));
     return BinaryLeft(pn);
 }
 
 static ParseNode *
 ElemIndex(ParseNode *pn)
 {
-    JS_ASSERT(pn->isKind(PNK_ELEM));
+    MOZ_ASSERT(pn->isKind(PNK_ELEM));
     return BinaryRight(pn);
 }
 
 static inline JSFunction *
 FunctionObject(ParseNode *fn)
 {
-    JS_ASSERT(fn->isKind(PNK_FUNCTION));
-    JS_ASSERT(fn->isArity(PN_CODE));
+    MOZ_ASSERT(fn->isKind(PNK_FUNCTION));
+    MOZ_ASSERT(fn->isArity(PN_CODE));
     return fn->pn_funbox->function();
 }
 
 static inline PropertyName *
 FunctionName(ParseNode *fn)
 {
     if (JSAtom *atom = FunctionObject(fn)->atom())
         return atom->asPropertyName();
     return nullptr;
 }
 
 static inline ParseNode *
 FunctionStatementList(ParseNode *fn)
 {
-    JS_ASSERT(fn->pn_body->isKind(PNK_ARGSBODY));
+    MOZ_ASSERT(fn->pn_body->isKind(PNK_ARGSBODY));
     ParseNode *last = fn->pn_body->last();
-    JS_ASSERT(last->isKind(PNK_STATEMENTLIST));
+    MOZ_ASSERT(last->isKind(PNK_STATEMENTLIST));
     return last;
 }
 
 static inline bool
 IsNormalObjectField(ExclusiveContext *cx, ParseNode *pn)
 {
     return pn->isKind(PNK_COLON) &&
            pn->getOp() == JSOP_INITPROP &&
            BinaryLeft(pn)->isKind(PNK_NAME) &&
            BinaryLeft(pn)->name() != cx->names().proto;
 }
 
 static inline PropertyName *
 ObjectNormalFieldName(ExclusiveContext *cx, ParseNode *pn)
 {
-    JS_ASSERT(IsNormalObjectField(cx, pn));
+    MOZ_ASSERT(IsNormalObjectField(cx, pn));
     return BinaryLeft(pn)->name();
 }
 
 static inline ParseNode *
 ObjectNormalFieldInitializer(ExclusiveContext *cx, ParseNode *pn)
 {
-    JS_ASSERT(IsNormalObjectField(cx, pn));
+    MOZ_ASSERT(IsNormalObjectField(cx, pn));
     return BinaryRight(pn);
 }
 
 static inline bool
 IsDefinition(ParseNode *pn)
 {
     return pn->isKind(PNK_NAME) && pn->isDefn();
 }
 
 static inline ParseNode *
 MaybeDefinitionInitializer(ParseNode *pn)
 {
-    JS_ASSERT(IsDefinition(pn));
+    MOZ_ASSERT(IsDefinition(pn));
     return pn->expr();
 }
 
 static inline bool
 IsUseOfName(ParseNode *pn, PropertyName *name)
 {
     return pn->isKind(PNK_NAME) && pn->name() == name;
 }
@@ -365,17 +365,17 @@ ParseVarOrConstStatement(AsmJSParser &pa
         *var = nullptr;
         return true;
     }
 
     *var = parser.statement();
     if (!*var)
         return false;
 
-    JS_ASSERT((*var)->isKind(PNK_VAR) || (*var)->isKind(PNK_CONST));
+    MOZ_ASSERT((*var)->isKind(PNK_VAR) || (*var)->isKind(PNK_CONST));
     return true;
 }
 
 /*****************************************************************************/
 
 namespace {
 
 // Respresents the type of a general asm.js expression.
@@ -399,18 +399,18 @@ class Type
     };
 
   private:
     Which which_;
 
   public:
     Type() : which_(Which(-1)) {}
     static Type Of(const AsmJSNumLit &lit) {
-        JS_ASSERT(lit.hasType());
-        JS_ASSERT(Type::Which(lit.which()) >= Fixnum && Type::Which(lit.which()) <= Float32x4);
+        MOZ_ASSERT(lit.hasType());
+        MOZ_ASSERT(Type::Which(lit.which()) >= Fixnum && Type::Which(lit.which()) <= Float32x4);
         Type t;
         t.which_ = Type::Which(lit.which());
         return t;
     }
     MOZ_IMPLICIT Type(Which w) : which_(w) {}
     MOZ_IMPLICIT Type(AsmJSSimdType type) {
         switch (type) {
           case AsmJSSimdType_int32x4:
@@ -530,17 +530,17 @@ class Type
             return MIRType_Float32x4;
           case Void:
             return MIRType_None;
         }
         MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Invalid Type");
     }
 
     Type simdToScalarType() const {
-        JS_ASSERT(isSimd());
+        MOZ_ASSERT(isSimd());
         switch (which_) {
           case Int32x4:
             return Int;
           case Float32x4:
             return Float;
           // Scalar types
           case Double:
           case MaybeDouble:
@@ -554,17 +554,17 @@ class Type
           case Intish:
           case Void:
             break;
         }
         MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Invalid SIMD Type");
     }
 
     Type simdToCoercedScalarType() const {
-        JS_ASSERT(isSimd());
+        MOZ_ASSERT(isSimd());
         switch (which_) {
           case Int32x4:
             return Intish;
           case Float32x4:
             return Floatish;
           // Scalar types
           case Double:
           case MaybeDouble:
@@ -578,17 +578,17 @@ class Type
           case Intish:
           case Void:
             break;
         }
         MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Invalid SIMD Type");
     }
 
     AsmJSSimdType simdToSimdType() const {
-        JS_ASSERT(isSimd());
+        MOZ_ASSERT(isSimd());
         switch (which_) {
           case Int32x4:
             return AsmJSSimdType_int32x4;
           case Float32x4:
             return AsmJSSimdType_float32x4;
           // Scalar types
           case Double:
           case MaybeDouble:
@@ -765,17 +765,17 @@ class VarType
           case AsmJS_ToInt32: which_ = Int; break;
           case AsmJS_ToNumber: which_ = Double; break;
           case AsmJS_FRound: which_ = Float; break;
           case AsmJS_ToInt32x4: which_ = Int32x4; break;
           case AsmJS_ToFloat32x4: which_ = Float32x4; break;
         }
     }
     static VarType Of(const AsmJSNumLit &lit) {
-        JS_ASSERT(lit.hasType());
+        MOZ_ASSERT(lit.hasType());
         VarType v;
         switch (lit.which()) {
           case AsmJSNumLit::Fixnum:
           case AsmJSNumLit::NegativeInt:
           case AsmJSNumLit::BigUnsigned:
             v.which_ = Int;
             return v;
           case AsmJSNumLit::Double:
@@ -818,17 +818,17 @@ class VarType
           case Double:    return AsmJS_ToNumber;
           case Float:     return AsmJS_FRound;
           case Int32x4:   return AsmJS_ToInt32x4;
           case Float32x4: return AsmJS_ToFloat32x4;
         }
         MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("VarType can only be Int, SIMD, Double or Float");
     }
     static VarType FromCheckedType(Type type) {
-        JS_ASSERT(type.isInt() || type.isMaybeDouble() || type.isFloatish() || type.isSimd());
+        MOZ_ASSERT(type.isInt() || type.isMaybeDouble() || type.isFloatish() || type.isSimd());
         if (type.isMaybeDouble())
             return Double;
         else if (type.isFloatish())
             return Float;
         else if (type.isInt())
             return Int;
         else if (type.isInt32x4())
             return Int32x4;
@@ -869,24 +869,24 @@ class ABIArgIter
     ABIArgGenerator gen_;
     const VecT &types_;
     unsigned i_;
 
     void settle() { if (!done()) gen_.next(ToMIRType(types_[i_])); }
 
   public:
     explicit ABIArgIter(const VecT &types) : types_(types), i_(0) { settle(); }
-    void operator++(int) { JS_ASSERT(!done()); i_++; settle(); }
+    void operator++(int) { MOZ_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_]); }
+    ABIArg *operator->() { MOZ_ASSERT(!done()); return &gen_.current(); }
+    ABIArg &operator*() { MOZ_ASSERT(!done()); return gen_.current(); }
+
+    unsigned index() const { MOZ_ASSERT(!done()); return i_; }
+    MIRType mirType() const { MOZ_ASSERT(!done()); return ToMIRType(types_[i_]); }
     uint32_t stackBytesConsumedSoFar() const { return gen_.stackBytesConsumedSoFar(); }
 };
 
 typedef Vector<MIRType, 8> MIRTypeVector;
 typedef ABIArgIter<MIRTypeVector> ABIArgMIRTypeIter;
 
 typedef Vector<VarType, 8, LifoAllocPolicy<Fallible> > VarTypeVector;
 typedef ABIArgIter<VarTypeVector> ABIArgTypeIter;
@@ -1055,24 +1055,24 @@ class MOZ_STACK_CLASS ModuleCompiler
           : sig_(Move(sig)), name_(name), entry_(entry), srcBegin_(0), srcEnd_(0),
             compileTime_(0), defined_(false)
         {}
 
         PropertyName *name() const { return name_; }
         bool defined() const { return defined_; }
 
         void define(ModuleCompiler &m, ParseNode *fn) {
-            JS_ASSERT(!defined_);
+            MOZ_ASSERT(!defined_);
             defined_ = true;
             srcBegin_ = fn->pn_pos.begin;
             srcEnd_ = fn->pn_pos.end;
         }
 
-        uint32_t srcBegin() const { JS_ASSERT(defined_); return srcBegin_; }
-        uint32_t srcEnd() const { JS_ASSERT(defined_); return srcEnd_; }
+        uint32_t srcBegin() const { MOZ_ASSERT(defined_); return srcBegin_; }
+        uint32_t srcEnd() const { MOZ_ASSERT(defined_); return srcEnd_; }
         Signature &sig() { return sig_; }
         const Signature &sig() const { return sig_; }
         Label &entry() const { return *entry_; }
         uint32_t compileTime() const { return compileTime_; }
         void accumulateCompileTime(uint32_t ms) { compileTime_ += ms; }
     };
 
     class Global
@@ -1116,69 +1116,69 @@ class MOZ_STACK_CLASS ModuleCompiler
 
         explicit Global(Which which) : which_(which) {}
 
       public:
         Which which() const {
             return which_;
         }
         VarType varOrConstType() const {
-            JS_ASSERT(which_ == Variable || which_ == ConstantLiteral || which_ == ConstantImport);
+            MOZ_ASSERT(which_ == Variable || which_ == ConstantLiteral || which_ == ConstantImport);
             return VarType(u.varOrConst.type_);
         }
         uint32_t varOrConstIndex() const {
-            JS_ASSERT(which_ == Variable || which_ == ConstantImport);
+            MOZ_ASSERT(which_ == Variable || which_ == ConstantImport);
             return u.varOrConst.index_;
         }
         bool isConst() const {
             return which_ == ConstantLiteral || which_ == ConstantImport;
         }
         AsmJSNumLit constLiteralValue() const {
-            JS_ASSERT(which_ == ConstantLiteral);
+            MOZ_ASSERT(which_ == ConstantLiteral);
             return u.varOrConst.literalValue_;
         }
         uint32_t funcIndex() const {
-            JS_ASSERT(which_ == Function);
+            MOZ_ASSERT(which_ == Function);
             return u.funcIndex_;
         }
         uint32_t funcPtrTableIndex() const {
-            JS_ASSERT(which_ == FuncPtrTable);
+            MOZ_ASSERT(which_ == FuncPtrTable);
             return u.funcPtrTableIndex_;
         }
         unsigned ffiIndex() const {
-            JS_ASSERT(which_ == FFI);
+            MOZ_ASSERT(which_ == FFI);
             return u.ffiIndex_;
         }
         Scalar::Type viewType() const {
-            JS_ASSERT(which_ == ArrayView);
+            MOZ_ASSERT(which_ == ArrayView);
             return u.viewType_;
         }
         bool isMathFunction() const {
             return which_ == MathBuiltinFunction;
         }
         AsmJSMathBuiltinFunction mathBuiltinFunction() const {
-            JS_ASSERT(which_ == MathBuiltinFunction);
+            MOZ_ASSERT(which_ == MathBuiltinFunction);
             return u.mathBuiltinFunc_;
         }
         bool isSimdCtor() const {
             return which_ == SimdCtor;
         }
         AsmJSSimdType simdCtorType() const {
-            JS_ASSERT(which_ == SimdCtor);
+            MOZ_ASSERT(which_ == SimdCtor);
             return u.simdCtorType_;
         }
         bool isSimdOperation() const {
             return which_ == SimdOperation;
         }
         AsmJSSimdOperation simdOperation() const {
-            JS_ASSERT(which_ == SimdOperation);
+            MOZ_ASSERT(which_ == SimdOperation);
             return u.simdOp.which_;
         }
         AsmJSSimdType simdOperationType() const {
-            JS_ASSERT(which_ == SimdOperation);
+            MOZ_ASSERT(which_ == SimdOperation);
             return u.simdOp.type_;
         }
     };
 
     typedef Vector<const Func*> FuncPtrVector;
 
     class FuncPtrTable
     {
@@ -1198,18 +1198,18 @@ class MOZ_STACK_CLASS ModuleCompiler
         {}
 
         Signature &sig() { return sig_; }
         const Signature &sig() const { return sig_; }
         unsigned mask() const { return mask_; }
         unsigned globalDataOffset() const { return globalDataOffset_; }
 
         bool initialized() const { return !elems_.empty(); }
-        void initElems(FuncPtrVector &&elems) { elems_ = Move(elems); JS_ASSERT(initialized()); }
-        unsigned numElems() const { JS_ASSERT(initialized()); return elems_.length(); }
+        void initElems(FuncPtrVector &&elems) { elems_ = Move(elems); MOZ_ASSERT(initialized()); }
+        unsigned numElems() const { MOZ_ASSERT(initialized()); return elems_.length(); }
         const Func &elem(unsigned i) const { return *elems_[i]; }
     };
 
     typedef Vector<FuncPtrTable> FuncPtrTableVector;
 
     class ExitDescriptor
     {
         PropertyName *name_;
@@ -1351,22 +1351,22 @@ class MOZ_STACK_CLASS ModuleCompiler
         errorString_(nullptr),
         errorOffset_(UINT32_MAX),
         errorOverRecursed_(false),
         usecBefore_(PRMJ_Now()),
         slowFunctions_(cx),
         finishedFunctionBodies_(false),
         supportsSimd_(cx->jitSupportsSimd())
     {
-        JS_ASSERT(moduleFunctionNode_->pn_funbox == parser.pc->sc->asFunctionBox());
+        MOZ_ASSERT(moduleFunctionNode_->pn_funbox == parser.pc->sc->asFunctionBox());
     }
 
     ~ModuleCompiler() {
         if (errorString_) {
-            JS_ASSERT(errorOffset_ != UINT32_MAX);
+            MOZ_ASSERT(errorOffset_ != UINT32_MAX);
             tokenStream().reportAsmJSError(errorOffset_,
                                            JSMSG_USE_ASM_TYPE_FAIL,
                                            errorString_.get());
         }
         if (errorOverRecursed_)
             js_ReportOverRecursed(cx_);
     }
 
@@ -1425,19 +1425,19 @@ class MOZ_STACK_CLASS ModuleCompiler
                                          cx_->canUseSignalHandlers());
         if (!module_)
             return false;
 
         return true;
     }
 
     bool failOffset(uint32_t offset, const char *str) {
-        JS_ASSERT(!errorString_);
-        JS_ASSERT(errorOffset_ == UINT32_MAX);
-        JS_ASSERT(str);
+        MOZ_ASSERT(!errorString_);
+        MOZ_ASSERT(errorOffset_ == UINT32_MAX);
+        MOZ_ASSERT(str);
         errorOffset_ = offset;
         errorString_ = DuplicateString(cx_, str);
         return false;
     }
 
     bool fail(ParseNode *pn, const char *str) {
         if (pn)
             return failOffset(pn->pn_pos.begin, str);
@@ -1446,19 +1446,19 @@ class MOZ_STACK_CLASS ModuleCompiler
         // that unrooted things on the stack during compilation may still be accessed after this.
         // Since pn is typically only null under OOM, this suppression simply forces any GC to be
         // delayed until the compilation is off the stack and more memory can be freed.
         gc::AutoSuppressGC nogc(cx_);
         return failOffset(tokenStream().peekTokenPos().begin, str);
     }
 
     bool failfVA(ParseNode *pn, const char *fmt, va_list ap) {
-        JS_ASSERT(!errorString_);
-        JS_ASSERT(errorOffset_ == UINT32_MAX);
-        JS_ASSERT(fmt);
+        MOZ_ASSERT(!errorString_);
+        MOZ_ASSERT(errorOffset_ == UINT32_MAX);
+        MOZ_ASSERT(fmt);
         errorOffset_ = pn ? pn->pn_pos.begin : tokenStream().currentToken().pos.end;
         errorString_.reset(JS_vsmprintf(fmt, ap));
         return false;
     }
 
     bool failf(ParseNode *pn, const char *fmt, ...) {
         va_list ap;
         va_start(ap, fmt);
@@ -1577,17 +1577,17 @@ class MOZ_STACK_CLASS ModuleCompiler
         Global *global = moduleLifo_.new_<Global>(which);
         if (!global)
             return false;
         global->u.varOrConst.index_ = index;
         global->u.varOrConst.type_ = VarType(coercion).which();
         return globals_.putNew(varName, global);
     }
     bool addFunction(PropertyName *name, Signature &&sig, Func **func) {
-        JS_ASSERT(!finishedFunctionBodies_);
+        MOZ_ASSERT(!finishedFunctionBodies_);
         Global *global = moduleLifo_.new_<Global>(Global::Function);
         if (!global)
             return false;
         global->u.funcIndex_ = functions_.length();
         if (!globals_.putNew(name, global))
             return false;
         Label *entry = moduleLifo_.new_<Label>();
         if (!entry)
@@ -1759,58 +1759,58 @@ class MOZ_STACK_CLASS ModuleCompiler
 #endif
         return true;
     }
     void finishFunctionBodies() {
         // When an interrupt is triggered, all function code is mprotected and,
         // for sanity, stub code (particularly the interrupt stub) is not.
         // Protection works at page granularity, so we need to ensure that no
         // stub code gets into the function code pages.
-        JS_ASSERT(!finishedFunctionBodies_);
+        MOZ_ASSERT(!finishedFunctionBodies_);
         masm_.align(AsmJSPageSize);
         module_->finishFunctionBodies(masm_.currentOffset());
         finishedFunctionBodies_ = true;
     }
 
     bool finishGeneratingEntry(unsigned exportIndex, Label *begin) {
-        JS_ASSERT(finishedFunctionBodies_);
+        MOZ_ASSERT(finishedFunctionBodies_);
         module_->exportedFunction(exportIndex).initCodeOffset(begin->offset());
         uint32_t end = masm_.currentOffset();
         return module_->addCodeRange(AsmJSModule::CodeRange::Entry, begin->offset(), end);
     }
     bool finishGeneratingInterpExit(unsigned exitIndex, Label *begin, Label *profilingReturn) {
-        JS_ASSERT(finishedFunctionBodies_);
+        MOZ_ASSERT(finishedFunctionBodies_);
         uint32_t beg = begin->offset();
         module_->exit(exitIndex).initInterpOffset(beg);
         uint32_t pret = profilingReturn->offset();
         uint32_t end = masm_.currentOffset();
         return module_->addCodeRange(AsmJSModule::CodeRange::SlowFFI, beg, pret, end);
     }
     bool finishGeneratingIonExit(unsigned exitIndex, Label *begin, Label *profilingReturn) {
-        JS_ASSERT(finishedFunctionBodies_);
+        MOZ_ASSERT(finishedFunctionBodies_);
         uint32_t beg = begin->offset();
         module_->exit(exitIndex).initIonOffset(beg);
         uint32_t pret = profilingReturn->offset();
         uint32_t end = masm_.currentOffset();
         return module_->addCodeRange(AsmJSModule::CodeRange::IonFFI, beg, pret, end);
     }
     bool finishGeneratingInterrupt(Label *begin, Label *profilingReturn) {
-        JS_ASSERT(finishedFunctionBodies_);
+        MOZ_ASSERT(finishedFunctionBodies_);
         uint32_t beg = begin->offset();
         uint32_t pret = profilingReturn->offset();
         uint32_t end = masm_.currentOffset();
         return module_->addCodeRange(AsmJSModule::CodeRange::Interrupt, beg, pret, end);
     }
     bool finishGeneratingInlineStub(Label *begin) {
-        JS_ASSERT(finishedFunctionBodies_);
+        MOZ_ASSERT(finishedFunctionBodies_);
         uint32_t end = masm_.currentOffset();
         return module_->addCodeRange(AsmJSModule::CodeRange::Inline, begin->offset(), end);
     }
     bool finishGeneratingBuiltinThunk(AsmJSExit::BuiltinKind builtin, Label *begin, Label *pret) {
-        JS_ASSERT(finishedFunctionBodies_);
+        MOZ_ASSERT(finishedFunctionBodies_);
         uint32_t end = masm_.currentOffset();
         return module_->addBuiltinThunkCodeRange(builtin, begin->offset(), pret->offset(), end);
     }
 
     void buildCompilationTimeReport(bool storedInCache, ScopedJSFreePtr<char> *out) {
         ScopedJSFreePtr<char> slowFuns;
 #ifndef JS_MORE_DETERMINISTIC
         int64_t usecAfter = PRMJ_Now();
@@ -1992,17 +1992,17 @@ IsSimdLiteral(ModuleCompiler &m, ParseNo
           case AsmJSSimdType_float32x4:
             if (!IsNumericNonFloatLiteral(arg))
                 return false;
         }
 
         arg = NextNode(arg);
     }
 
-    JS_ASSERT(arg == nullptr);
+    MOZ_ASSERT(arg == nullptr);
     return true;
 }
 
 static bool
 IsNumericLiteral(ModuleCompiler &m, ParseNode *pn)
 {
     return IsNumericNonFloatLiteral(pn) ||
            IsFloatLiteral(m, pn) ||
@@ -2011,108 +2011,108 @@ IsNumericLiteral(ModuleCompiler &m, Pars
 
 // The JS grammar treats -42 as -(42) (i.e., with separate grammar
 // productions) for the unary - and literal 42). However, the asm.js spec
 // recognizes -42 (modulo parens, so -(42) and -((42))) as a single literal
 // so fold the two potential parse nodes into a single double value.
 static double
 ExtractNumericNonFloatValue(ParseNode *pn, ParseNode **out = nullptr)
 {
-    JS_ASSERT(IsNumericNonFloatLiteral(pn));
+    MOZ_ASSERT(IsNumericNonFloatLiteral(pn));
 
     if (pn->isKind(PNK_NEG)) {
         pn = UnaryKid(pn);
         if (out)
             *out = pn;
         return -NumberNodeValue(pn);
     }
 
     return NumberNodeValue(pn);
 }
 
 static AsmJSNumLit
 ExtractSimdValue(ModuleCompiler &m, ParseNode *pn)
 {
-    JS_ASSERT(IsSimdLiteral(m, pn));
+    MOZ_ASSERT(IsSimdLiteral(m, pn));
 
     AsmJSSimdType type;
     JS_ALWAYS_TRUE(IsSimdTuple(m, pn, &type));
 
     ParseNode *arg = CallArgList(pn);
     switch (type) {
       case AsmJSSimdType_int32x4: {
-        JS_ASSERT(SimdTypeToLength(type) == 4);
+        MOZ_ASSERT(SimdTypeToLength(type) == 4);
         int32_t val[4];
         for (size_t i = 0; i < 4; i++, arg = NextNode(arg)) {
             uint32_t u32;
             JS_ALWAYS_TRUE(IsLiteralInt(m, arg, &u32));
             val[i] = int32_t(u32);
         }
-        JS_ASSERT(arg== nullptr);
+        MOZ_ASSERT(arg== nullptr);
         return AsmJSNumLit::Create(AsmJSNumLit::Int32x4, SimdConstant::CreateX4(val));
       }
       case AsmJSSimdType_float32x4: {
-        JS_ASSERT(SimdTypeToLength(type) == 4);
+        MOZ_ASSERT(SimdTypeToLength(type) == 4);
         float val[4];
         for (size_t i = 0; i < 4; i++, arg = NextNode(arg))
             val[i] = float(ExtractNumericNonFloatValue(arg));
-        JS_ASSERT(arg == nullptr);
+        MOZ_ASSERT(arg == nullptr);
         return AsmJSNumLit::Create(AsmJSNumLit::Float32x4, SimdConstant::CreateX4(val));
       }
     }
 
     MOZ_CRASH("Unexpected SIMD type.");
 }
 
 static AsmJSNumLit
 ExtractNumericLiteral(ModuleCompiler &m, ParseNode *pn)
 {
-    JS_ASSERT(IsNumericLiteral(m, pn));
+    MOZ_ASSERT(IsNumericLiteral(m, pn));
 
     if (pn->isKind(PNK_CALL)) {
         // Float literals are explicitly coerced and thus the coerced literal may be
         // any valid (non-float) numeric literal.
         if (CallArgListLength(pn) == 1) {
             pn = CallArgList(pn);
             double d = ExtractNumericNonFloatValue(pn);
             return AsmJSNumLit::Create(AsmJSNumLit::Float, DoubleValue(d));
         }
 
-        JS_ASSERT(CallArgListLength(pn) == 4);
+        MOZ_ASSERT(CallArgListLength(pn) == 4);
         return ExtractSimdValue(m, pn);
     }
 
     double d = ExtractNumericNonFloatValue(pn, &pn);
 
     // The asm.js spec syntactically distinguishes any literal containing a
     // decimal point or the literal -0 as having double type.
     if (NumberNodeHasFrac(pn) || IsNegativeZero(d))
         return AsmJSNumLit::Create(AsmJSNumLit::Double, DoubleValue(d));
 
     // The syntactic checks above rule out these double values.
-    JS_ASSERT(!IsNegativeZero(d));
-    JS_ASSERT(!IsNaN(d));
+    MOZ_ASSERT(!IsNegativeZero(d));
+    MOZ_ASSERT(!IsNaN(d));
 
     // Although doubles can only *precisely* represent 53-bit integers, they
     // can *imprecisely* represent integers much bigger than an int64_t.
     // Furthermore, d may be inf or -inf. In both cases, casting to an int64_t
     // is undefined, so test against the integer bounds using doubles.
     if (d < double(INT32_MIN) || d > double(UINT32_MAX))
         return AsmJSNumLit::Create(AsmJSNumLit::OutOfRangeInt, UndefinedValue());
 
     // With the above syntactic and range limitations, d is definitely an
     // integer in the range [INT32_MIN, UINT32_MAX] range.
     int64_t i64 = int64_t(d);
     if (i64 >= 0) {
         if (i64 <= INT32_MAX)
             return AsmJSNumLit::Create(AsmJSNumLit::Fixnum, Int32Value(i64));
-        JS_ASSERT(i64 <= UINT32_MAX);
+        MOZ_ASSERT(i64 <= UINT32_MAX);
         return AsmJSNumLit::Create(AsmJSNumLit::BigUnsigned, Int32Value(uint32_t(i64)));
     }
-    JS_ASSERT(i64 >= INT32_MIN);
+    MOZ_ASSERT(i64 >= INT32_MIN);
     return AsmJSNumLit::Create(AsmJSNumLit::NegativeInt, Int32Value(i64));
 }
 
 static inline bool
 IsLiteralInt(ModuleCompiler &m, ParseNode *pn, uint32_t *u32)
 {
     if (!IsNumericLiteral(m, pn))
         return false;
@@ -2236,22 +2236,22 @@ class FunctionCompiler
     {
         return m_.failName(pn, fmt, name);
     }
 
     ~FunctionCompiler()
     {
 #ifdef DEBUG
         if (!m().hasError() && cx()->isJSContext() && !cx()->asJSContext()->isExceptionPending()) {
-            JS_ASSERT(loopStack_.empty());
-            JS_ASSERT(unlabeledBreaks_.empty());
-            JS_ASSERT(unlabeledContinues_.empty());
-            JS_ASSERT(labeledBreaks_.empty());
-            JS_ASSERT(labeledContinues_.empty());
-            JS_ASSERT(inDeadCode());
+            MOZ_ASSERT(loopStack_.empty());
+            MOZ_ASSERT(unlabeledBreaks_.empty());
+            MOZ_ASSERT(unlabeledContinues_.empty());
+            MOZ_ASSERT(labeledBreaks_.empty());
+            MOZ_ASSERT(labeledContinues_.empty());
+            MOZ_ASSERT(inDeadCode());
         }
 #endif
     }
 
     /***************************************************** Local scope setup */
 
     bool addFormal(ParseNode *pn, PropertyName *name, VarType type)
     {
@@ -2268,17 +2268,17 @@ class FunctionCompiler
             return failName(pn, "duplicate local name '%s' not allowed", name);
         if (!locals_.add(p, name, Local(VarType::Of(init), locals_.count())))
             return false;
         return varInitializers_.append(init);
     }
 
     bool prepareToEmitMIR(const VarTypeVector &argTypes)
     {
-        JS_ASSERT(locals_.count() == argTypes.length() + varInitializers_.length());
+        MOZ_ASSERT(locals_.count() == argTypes.length() + varInitializers_.length());
 
         alloc_  = lifo_.new_<TempAllocator>(&lifo_);
         ionContext_.emplace(m_.cx(), alloc_);
 
         graph_  = lifo_.new_<MIRGraph>(alloc_);
         info_   = lifo_.new_<CompileInfo>(locals_.count(), SequentialExecution);
         const OptimizationInfo *optimizationInfo = js_IonOptimizations.get(Optimization_AsmJS);
         const JitCompileOptions options;
@@ -2327,19 +2327,19 @@ class FunctionCompiler
     }
 
     void setReturnedType(RetType retType) {
         alreadyReturned_.emplace(retType);
     }
 
     /************************* Read-only interface (after local scope setup) */
 
-    MIRGenerator & mirGen() const     { JS_ASSERT(mirGen_); return *mirGen_; }
-    MIRGraph &     mirGraph() const   { JS_ASSERT(graph_); return *graph_; }
-    CompileInfo &  info() const       { JS_ASSERT(info_); return *info_; }
+    MIRGenerator & mirGen() const     { MOZ_ASSERT(mirGen_); return *mirGen_; }
+    MIRGraph &     mirGraph() const   { MOZ_ASSERT(graph_); return *graph_; }
+    CompileInfo &  info() const       { MOZ_ASSERT(info_); return *info_; }
 
     const Local *lookupLocal(PropertyName *name) const
     {
         if (LocalMap::Ptr p = locals_.lookup(name))
             return &p->value();
         return nullptr;
     }
 
@@ -2428,31 +2428,31 @@ class FunctionCompiler
     }
 
     MDefinition *binarySimd(MDefinition *lhs, MDefinition *rhs, MSimdBinaryArith::Operation op,
                             MIRType type)
     {
         if (inDeadCode())
             return nullptr;
 
-        JS_ASSERT(IsSimdType(lhs->type()) && rhs->type() == lhs->type());
-        JS_ASSERT(lhs->type() == type);
+        MOZ_ASSERT(IsSimdType(lhs->type()) && rhs->type() == lhs->type());
+        MOZ_ASSERT(lhs->type() == type);
         MSimdBinaryArith *ins = MSimdBinaryArith::NewAsmJS(alloc(), lhs, rhs, op, type);
         curBlock_->add(ins);
         return ins;
     }
 
     MDefinition *binarySimd(MDefinition *lhs, MDefinition *rhs, MSimdBinaryBitwise::Operation op,
                             MIRType type)
     {
         if (inDeadCode())
             return nullptr;
 
-        JS_ASSERT(IsSimdType(lhs->type()) && rhs->type() == lhs->type());
-        JS_ASSERT(lhs->type() == type);
+        MOZ_ASSERT(IsSimdType(lhs->type()) && rhs->type() == lhs->type());
+        MOZ_ASSERT(lhs->type() == type);
         MSimdBinaryBitwise *ins = MSimdBinaryBitwise::NewAsmJS(alloc(), lhs, rhs, op, type);
         curBlock_->add(ins);
         return ins;
     }
 
     template<class T>
     MDefinition *binarySimd(MDefinition *lhs, MDefinition *rhs, typename T::Operation op)
     {
@@ -2503,17 +2503,17 @@ class FunctionCompiler
         return ins;
     }
 
     MDefinition *splatSimd(MDefinition *v, MIRType type)
     {
         if (inDeadCode())
             return nullptr;
 
-        JS_ASSERT(IsSimdType(type));
+        MOZ_ASSERT(IsSimdType(type));
         MSimdSplatX4 *ins = MSimdSplatX4::New(alloc(), type, v);
         curBlock_->add(ins);
         return ins;
     }
 
     MDefinition *minMax(MDefinition *lhs, MDefinition *rhs, MIRType type, bool isMax) {
         if (inDeadCode())
             return nullptr;
@@ -2624,17 +2624,17 @@ class FunctionCompiler
         curBlock_->add(load);
         return load;
     }
 
     void storeGlobalVar(const ModuleCompiler::Global &global, MDefinition *v)
     {
         if (inDeadCode())
             return;
-        JS_ASSERT(!global.isConst());
+        MOZ_ASSERT(!global.isConst());
 
         unsigned globalDataOffset;
         if (IsSimdType(v->type()))
             globalDataOffset = module().globalSimdVarIndexToGlobalDataOffset(global.varOrConstIndex());
         else
             globalDataOffset = module().globalScalarVarIndexToGlobalDataOffset(global.varOrConstIndex());
 
         curBlock_->add(MAsmJSStoreGlobalVar::New(alloc(), globalDataOffset, v));
@@ -2654,42 +2654,42 @@ class FunctionCompiler
         curBlock_->add(MAsmJSInterruptCheck::New(alloc(), &m().syncInterruptLabel(), callDesc));
     }
 
     MDefinition *extractSimdElement(SimdLane lane, MDefinition *base, MIRType type)
     {
         if (inDeadCode())
             return nullptr;
 
-        JS_ASSERT(IsSimdType(base->type()));
-        JS_ASSERT(!IsSimdType(type));
+        MOZ_ASSERT(IsSimdType(base->type()));
+        MOZ_ASSERT(!IsSimdType(type));
         MSimdExtractElement *ins = MSimdExtractElement::NewAsmJS(alloc(), base, type, lane);
         curBlock_->add(ins);
         return ins;
     }
 
     MDefinition *extractSignMask(MDefinition *base)
     {
         if (inDeadCode())
             return nullptr;
 
-        JS_ASSERT(IsSimdType(base->type()));
+        MOZ_ASSERT(IsSimdType(base->type()));
         MSimdSignMask *ins = MSimdSignMask::NewAsmJS(alloc(), base);
         curBlock_->add(ins);
         return ins;
     }
 
     template<typename T>
     MDefinition *constructSimd(MDefinition *x, MDefinition *y, MDefinition *z, MDefinition *w,
                                MIRType type)
     {
         if (inDeadCode())
             return nullptr;
 
-        JS_ASSERT(IsSimdType(type));
+        MOZ_ASSERT(IsSimdType(type));
         T *ins = T::New(alloc(), type, x, y, z, w);
         curBlock_->add(ins);
         return ins;
     }
 
     /***************************************************************** Calls */
 
     // The IonMonkey backend maintains a single stack offset (from the stack
@@ -2916,17 +2916,17 @@ class FunctionCompiler
         curBlock_ = *thenBlock;
         mirGraph().moveBlockToEnd(curBlock_);
         return true;
     }
 
     void assertCurrentBlockIs(MBasicBlock *block) {
         if (inDeadCode())
             return;
-        JS_ASSERT(curBlock_ == block);
+        MOZ_ASSERT(curBlock_ == block);
     }
 
     bool appendThenBlock(BlockVector *thenBlocks)
     {
         if (inDeadCode())
             return true;
         return thenBlocks->append(curBlock_);
     }
@@ -2974,25 +2974,25 @@ class FunctionCompiler
         curBlock_ = join;
         return true;
     }
 
     void pushPhiInput(MDefinition *def)
     {
         if (inDeadCode())
             return;
-        JS_ASSERT(curBlock_->stackDepth() == info().firstStackSlot());
+        MOZ_ASSERT(curBlock_->stackDepth() == info().firstStackSlot());
         curBlock_->push(def);
     }
 
     MDefinition *popPhiOutput()
     {
         if (inDeadCode())
             return nullptr;
-        JS_ASSERT(curBlock_->stackDepth() == info().firstStackSlot() + 1);
+        MOZ_ASSERT(curBlock_->stackDepth() == info().firstStackSlot() + 1);
         return curBlock_->pop();
     }
 
     bool startPendingLoop(ParseNode *pn, MBasicBlock **loopEntry, ParseNode *bodyStmt)
     {
         if (!loopStack_.append(pn) || !breakableStack_.append(pn))
             return false;
         JS_ASSERT_IF(curBlock_, curBlock_->loopDepth() == loopStack_.length() - 1);
@@ -3014,17 +3014,17 @@ class FunctionCompiler
     }
 
     bool branchAndStartLoopBody(MDefinition *cond, MBasicBlock **afterLoop, ParseNode *bodyPn, ParseNode *afterPn)
     {
         if (inDeadCode()) {
             *afterLoop = nullptr;
             return true;
         }
-        JS_ASSERT(curBlock_->loopDepth() > 0);
+        MOZ_ASSERT(curBlock_->loopDepth() > 0);
         MBasicBlock *body;
         if (!newBlock(curBlock_, &body, bodyPn))
             return false;
         if (cond->isConstant() && cond->toConstant()->valueToBoolean()) {
             *afterLoop = nullptr;
             curBlock_->end(MGoto::New(alloc(), body));
         } else {
             if (!newBlockWithDepth(curBlock_, curBlock_->loopDepth() - 1, afterLoop, afterPn))
@@ -3034,56 +3034,56 @@ class FunctionCompiler
         curBlock_ = body;
         return true;
     }
 
   private:
     ParseNode *popLoop()
     {
         ParseNode *pn = loopStack_.popCopy();
-        JS_ASSERT(!unlabeledContinues_.has(pn));
+        MOZ_ASSERT(!unlabeledContinues_.has(pn));
         breakableStack_.popBack();
         return pn;
     }
 
   public:
     bool closeLoop(MBasicBlock *loopEntry, MBasicBlock *afterLoop)
     {
         ParseNode *pn = popLoop();
         if (!loopEntry) {
-            JS_ASSERT(!afterLoop);
-            JS_ASSERT(inDeadCode());
-            JS_ASSERT(!unlabeledBreaks_.has(pn));
+            MOZ_ASSERT(!afterLoop);
+            MOZ_ASSERT(inDeadCode());
+            MOZ_ASSERT(!unlabeledBreaks_.has(pn));
             return true;
         }
-        JS_ASSERT(loopEntry->loopDepth() == loopStack_.length() + 1);
+        MOZ_ASSERT(loopEntry->loopDepth() == loopStack_.length() + 1);
         JS_ASSERT_IF(afterLoop, afterLoop->loopDepth() == loopStack_.length());
         if (curBlock_) {
-            JS_ASSERT(curBlock_->loopDepth() == loopStack_.length() + 1);
+            MOZ_ASSERT(curBlock_->loopDepth() == loopStack_.length() + 1);
             curBlock_->end(MGoto::New(alloc(), loopEntry));
             if (!loopEntry->setBackedgeAsmJS(curBlock_))
                 return false;
         }
         curBlock_ = afterLoop;
         if (curBlock_)
             mirGraph().moveBlockToEnd(curBlock_);
         return bindUnlabeledBreaks(pn);
     }
 
     bool branchAndCloseDoWhileLoop(MDefinition *cond, MBasicBlock *loopEntry, ParseNode *afterLoopStmt)
     {
         ParseNode *pn = popLoop();
         if (!loopEntry) {
-            JS_ASSERT(inDeadCode());
-            JS_ASSERT(!unlabeledBreaks_.has(pn));
+            MOZ_ASSERT(inDeadCode());
+            MOZ_ASSERT(!unlabeledBreaks_.has(pn));
             return true;
         }
-        JS_ASSERT(loopEntry->loopDepth() == loopStack_.length() + 1);
+        MOZ_ASSERT(loopEntry->loopDepth() == loopStack_.length() + 1);
         if (curBlock_) {
-            JS_ASSERT(curBlock_->loopDepth() == loopStack_.length() + 1);
+            MOZ_ASSERT(curBlock_->loopDepth() == loopStack_.length() + 1);
             if (cond->isConstant()) {
                 if (cond->toConstant()->valueToBoolean()) {
                     curBlock_->end(MGoto::New(alloc(), loopEntry));
                     if (!loopEntry->setBackedgeAsmJS(curBlock_))
                         return false;
                     curBlock_ = nullptr;
                 } else {
                     MBasicBlock *afterLoop;
@@ -3198,17 +3198,17 @@ class FunctionCompiler
         }
         return bindUnlabeledBreaks(pn);
     }
 
     /*************************************************************************/
 
     MIRGenerator *extractMIR()
     {
-        JS_ASSERT(mirGen_ != nullptr);
+        MOZ_ASSERT(mirGen_ != nullptr);
         MIRGenerator *mirGen = mirGen_;
         mirGen_ = nullptr;
         return mirGen;
     }
 
     /*************************************************************************/
   private:
     void noteBasicBlockPosition(MBasicBlock *blk, ParseNode *pn)
@@ -3255,17 +3255,17 @@ class FunctionCompiler
                 if (curBlock_) {
                     curBlock_->end(MGoto::New(alloc(), next));
                     if (!next->addPredecessor(alloc(), curBlock_))
                         return false;
                 }
                 curBlock_ = next;
                 *createdJoinBlock = true;
             }
-            JS_ASSERT(curBlock_->begin() == curBlock_->end());
+            MOZ_ASSERT(curBlock_->begin() == curBlock_->end());
             if (!mirGen_->ensureBallast())
                 return false;
         }
         preds->clear();
         return true;
     }
 
     bool bindLabeledBreaksOrContinues(const LabelVector *maybeLabels, LabeledBlockMap *map,
@@ -3414,17 +3414,17 @@ CheckModuleArguments(ModuleCompiler &m, 
     m.initBufferArgumentName(arg3Name);
 
     return true;
 }
 
 static bool
 CheckPrecedingStatements(ModuleCompiler &m, ParseNode *stmtList)
 {
-    JS_ASSERT(stmtList->isKind(PNK_STATEMENTLIST));
+    MOZ_ASSERT(stmtList->isKind(PNK_STATEMENTLIST));
 
     if (ListLength(stmtList) != 0)
         return m.fail(ListHead(stmtList), "invalid asm.js statement");
 
     return true;
 }
 
 static bool
@@ -4042,17 +4042,17 @@ CheckArrayAccess(FunctionCompiler &f, Pa
             return false;
 
         if (!pointerType.isIntish())
             return f.failf(indexExpr, "%s is not a subtype of int", pointerType.toChars());
     } else {
         if (TypedArrayShift(*viewType) != 0)
             return f.fail(indexExpr, "index expression isn't shifted; must be an Int8/Uint8 access");
 
-        JS_ASSERT(mask == -1);
+        MOZ_ASSERT(mask == -1);
         bool folded = false;
 
         if (indexExpr->isKind(PNK_BITAND))
             folded = FoldMaskedArrayIndex(f, &indexExpr, &mask, needsBoundsCheck);
 
         Type pointerType;
         if (!CheckExpr(f, indexExpr, &pointerDef, &pointerType))
             return false;
@@ -4088,17 +4088,17 @@ CheckLoadArray(FunctionCompiler &f, Pars
     *def = f.loadHeap(viewType, pointerDef, needsBoundsCheck);
     *type = TypedArrayLoadType(viewType);
     return true;
 }
 
 static bool
 CheckDotAccess(FunctionCompiler &f, ParseNode *elem, MDefinition **def, Type *type)
 {
-    JS_ASSERT(elem->isKind(PNK_DOT));
+    MOZ_ASSERT(elem->isKind(PNK_DOT));
 
     ParseNode *base = DotBase(elem);
     MDefinition *baseDef;
     Type baseType;
     if (!CheckExpr(f, base, &baseDef, &baseType))
         return false;
     if (!baseType.isSimd())
         return f.failf(base, "expected SIMD type, got %s", baseType.toChars());
@@ -4209,17 +4209,17 @@ CheckAssignName(FunctionCompiler &f, Par
     *def = rhsDef;
     *type = rhsType;
     return true;
 }
 
 static bool
 CheckAssign(FunctionCompiler &f, ParseNode *assign, MDefinition **def, Type *type)
 {
-    JS_ASSERT(assign->isKind(PNK_ASSIGN));
+    MOZ_ASSERT(assign->isKind(PNK_ASSIGN));
     ParseNode *lhs = BinaryLeft(assign);
     ParseNode *rhs = BinaryRight(assign);
 
     if (lhs->getKind() == PNK_ELEM)
         return CheckStoreArray(f, lhs, rhs, def, type);
 
     if (lhs->getKind() == PNK_NAME)
         return CheckAssignName(f, lhs, rhs, def, type);
@@ -4427,17 +4427,17 @@ CheckSignatureAgainstExisting(ModuleComp
         }
     }
 
     if (sig.retType() != existing.retType()) {
         return m.failf(usepn, "%s incompatible with previous return of type %s",
                        sig.retType().toType().toChars(), existing.retType().toType().toChars());
     }
 
-    JS_ASSERT(sig == existing);
+    MOZ_ASSERT(sig == existing);
     return true;
 }
 
 static bool
 CheckFunctionSignature(ModuleCompiler &m, ParseNode *usepn, Signature &&sig, PropertyName *name,
                        ModuleCompiler::Func **func)
 {
     ModuleCompiler::Func *existing = m.lookupFunction(name);
@@ -4660,17 +4660,17 @@ CheckMathFRound(FunctionCompiler &f, Par
         return f.fail(callNode, "Math.fround must be passed 1 argument");
 
     ParseNode *argNode = CallArgList(callNode);
     MDefinition *argDef;
     Type argType;
     if (!CheckCoercionArg(f, argNode, AsmJS_FRound, &argDef, &argType))
         return false;
 
-    JS_ASSERT(argType == Type::Float);
+    MOZ_ASSERT(argType == Type::Float);
     *def = argDef;
     *type = MathRetType::Float;
     return true;
 }
 
 static bool
 CheckMathBuiltinCall(FunctionCompiler &f, ParseNode *callNode, AsmJSMathBuiltinFunction func,
                      MDefinition **def, MathRetType *type)
@@ -5007,17 +5007,17 @@ CheckSimdOperationCall(FunctionCompiler 
     }
     MOZ_CRASH("unexpected simd operation in CheckSimdOperationCall");
 }
 
 static bool
 CheckSimdCtorCall(FunctionCompiler &f, ParseNode *call, const ModuleCompiler::Global *global,
                   MDefinition **def, Type *type)
 {
-    JS_ASSERT(call->isKind(PNK_CALL));
+    MOZ_ASSERT(call->isKind(PNK_CALL));
 
     AsmJSCoercion coercion;
     ParseNode *argNode;
     if (IsCoercionCall(f.m(), call, &coercion, &argNode))
         return CheckCoercionArg(f, argNode, coercion, def, type);
 
     AsmJSSimdType simdType = global->simdCtorType();
     Type retType = simdType;
@@ -5034,17 +5034,17 @@ CheckSimdCtorCall(FunctionCompiler &f, P
     *def = f.constructSimd<MSimdValueX4>(defs[0], defs[1], defs[2], defs[3], opType);
     *type = retType;
     return true;
 }
 
 static bool
 CheckUncoercedCall(FunctionCompiler &f, ParseNode *expr, MDefinition **def, Type *type)
 {
-    JS_ASSERT(expr->isKind(PNK_CALL));
+    MOZ_ASSERT(expr->isKind(PNK_CALL));
 
     const ModuleCompiler::Global *global;
     if (IsCallToGlobal(f.m(), expr, &global)) {
         if (global->isMathFunction()) {
             MathRetType mathRetType;
             if (!CheckMathBuiltinCall(f, expr, global->mathBuiltinFunction(), def, &mathRetType))
                 return false;
             *type = mathRetType.toType();
@@ -5140,22 +5140,22 @@ CheckCoercedMathBuiltinCall(FunctionComp
 static bool
 CheckCoercedSimdCall(FunctionCompiler &f, ParseNode *call, const ModuleCompiler::Global *global,
                      RetType retType, MDefinition **def, Type *type)
 {
     if (global->isSimdCtor()) {
         if (!CheckSimdCtorCall(f, call, global, def, type))
             return false;
     } else {
-        JS_ASSERT(global->isSimdOperation());
+        MOZ_ASSERT(global->isSimdOperation());
         if (!CheckSimdOperationCall(f, call, global, def, type))
             return false;
     }
 
-    JS_ASSERT(type->isSimd());
+    MOZ_ASSERT(type->isSimd());
     return CoerceResult(f, call, retType, *def, *type, def, type);
 }
 
 static bool
 CheckCoercedCall(FunctionCompiler &f, ParseNode *call, RetType retType, MDefinition **def, Type *type)
 {
     JS_CHECK_RECURSION_DONT_REPORT(f.cx(), return f.m().failOverRecursed());
 
@@ -5196,34 +5196,34 @@ CheckCoercedCall(FunctionCompiler &f, Pa
     }
 
     return CheckInternalCall(f, call, calleeName, retType, def, type);
 }
 
 static bool
 CheckPos(FunctionCompiler &f, ParseNode *pos, MDefinition **def, Type *type)
 {
-    JS_ASSERT(pos->isKind(PNK_POS));
+    MOZ_ASSERT(pos->isKind(PNK_POS));
     ParseNode *operand = UnaryKid(pos);
 
     if (operand->isKind(PNK_CALL))
         return CheckCoercedCall(f, operand, RetType::Double, def, type);
 
     MDefinition *operandDef;
     Type operandType;
     if (!CheckExpr(f, operand, &operandDef, &operandType))
         return false;
 
     return CoerceResult(f, operand, RetType::Double, operandDef, operandType, def, type);
 }
 
 static bool
 CheckNot(FunctionCompiler &f, ParseNode *expr, MDefinition **def, Type *type)
 {
-    JS_ASSERT(expr->isKind(PNK_NOT));
+    MOZ_ASSERT(expr->isKind(PNK_NOT));
     ParseNode *operand = UnaryKid(expr);
 
     MDefinition *operandDef;
     Type operandType;
     if (!CheckExpr(f, operand, &operandDef, &operandType))
         return false;
 
     if (!operandType.isInt())
@@ -5232,17 +5232,17 @@ CheckNot(FunctionCompiler &f, ParseNode 
     *def = f.unary<MNot>(operandDef);
     *type = Type::Int;
     return true;
 }
 
 static bool
 CheckNeg(FunctionCompiler &f, ParseNode *expr, MDefinition **def, Type *type)
 {
-    JS_ASSERT(expr->isKind(PNK_NEG));
+    MOZ_ASSERT(expr->isKind(PNK_NEG));
     ParseNode *operand = UnaryKid(expr);
 
     MDefinition *operandDef;
     Type operandType;
     if (!CheckExpr(f, operand, &operandDef, &operandType))
         return false;
 
     if (operandType.isInt()) {
@@ -5264,17 +5264,17 @@ CheckNeg(FunctionCompiler &f, ParseNode 
     }
 
     return f.failf(operand, "%s is not a subtype of int, float? or double?", operandType.toChars());
 }
 
 static bool
 CheckCoerceToInt(FunctionCompiler &f, ParseNode *expr, MDefinition **def, Type *type)
 {
-    JS_ASSERT(expr->isKind(PNK_BITNOT));
+    MOZ_ASSERT(expr->isKind(PNK_BITNOT));
     ParseNode *operand = UnaryKid(expr);
 
     MDefinition *operandDef;
     Type operandType;
     if (!CheckExpr(f, operand, &operandDef, &operandType))
         return false;
 
     if (operandType.isMaybeDouble() || operandType.isMaybeFloat()) {
@@ -5289,17 +5289,17 @@ CheckCoerceToInt(FunctionCompiler &f, Pa
     *def = operandDef;
     *type = Type::Signed;
     return true;
 }
 
 static bool
 CheckBitNot(FunctionCompiler &f, ParseNode *neg, MDefinition **def, Type *type)
 {
-    JS_ASSERT(neg->isKind(PNK_BITNOT));
+    MOZ_ASSERT(neg->isKind(PNK_BITNOT));
     ParseNode *operand = UnaryKid(neg);
 
     if (operand->isKind(PNK_BITNOT))
         return CheckCoerceToInt(f, operand, def, type);
 
     MDefinition *operandDef;
     Type operandType;
     if (!CheckExpr(f, operand, &operandDef, &operandType))
@@ -5311,17 +5311,17 @@ CheckBitNot(FunctionCompiler &f, ParseNo
     *def = f.bitwise<MBitNot>(operandDef);
     *type = Type::Signed;
     return true;
 }
 
 static bool
 CheckComma(FunctionCompiler &f, ParseNode *comma, MDefinition **def, Type *type)
 {
-    JS_ASSERT(comma->isKind(PNK_COMMA));
+    MOZ_ASSERT(comma->isKind(PNK_COMMA));
     ParseNode *operands = ListHead(comma);
 
     ParseNode *pn = operands;
     for (; NextNode(pn); pn = NextNode(pn)) {
         MDefinition *_1;
         Type _2;
         if (pn->isKind(PNK_CALL)) {
             if (!CheckCoercedCall(f, pn, RetType::Void, &_1, &_2))
@@ -5336,17 +5336,17 @@ CheckComma(FunctionCompiler &f, ParseNod
         return false;
 
     return true;
 }
 
 static bool
 CheckConditional(FunctionCompiler &f, ParseNode *ternary, MDefinition **def, Type *type)
 {
-    JS_ASSERT(ternary->isKind(PNK_CONDITIONAL));
+    MOZ_ASSERT(ternary->isKind(PNK_CONDITIONAL));
     ParseNode *cond = TernaryKid1(ternary);
     ParseNode *thenExpr = TernaryKid2(ternary);
     ParseNode *elseExpr = TernaryKid3(ternary);
 
     MDefinition *condDef;
     Type condType;
     if (!CheckExpr(f, cond, &condDef, &condType))
         return false;
@@ -5418,17 +5418,17 @@ IsValidIntMultiplyConstant(ModuleCompile
     }
 
     MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Bad literal");
 }
 
 static bool
 CheckMultiply(FunctionCompiler &f, ParseNode *star, MDefinition **def, Type *type)
 {
-    JS_ASSERT(star->isKind(PNK_STAR));
+    MOZ_ASSERT(star->isKind(PNK_STAR));
     ParseNode *lhs = BinaryLeft(star);
     ParseNode *rhs = BinaryRight(star);
 
     MDefinition *lhsDef;
     Type lhsType;
     if (!CheckExpr(f, lhs, &lhsDef, &lhsType))
         return false;
 
@@ -5461,17 +5461,17 @@ CheckMultiply(FunctionCompiler &f, Parse
 }
 
 static bool
 CheckAddOrSub(FunctionCompiler &f, ParseNode *expr, MDefinition **def, Type *type,
               unsigned *numAddOrSubOut = nullptr)
 {
     JS_CHECK_RECURSION_DONT_REPORT(f.cx(), return f.m().failOverRecursed());
 
-    JS_ASSERT(expr->isKind(PNK_ADD) || expr->isKind(PNK_SUB));
+    MOZ_ASSERT(expr->isKind(PNK_ADD) || expr->isKind(PNK_SUB));
     ParseNode *lhs = BinaryLeft(expr);
     ParseNode *rhs = BinaryRight(expr);
 
     MDefinition *lhsDef, *rhsDef;
     Type lhsType, rhsType;
     unsigned lhsNumAddOrSub, rhsNumAddOrSub;
 
     if (lhs->isKind(PNK_ADD) || lhs->isKind(PNK_SUB)) {
@@ -5523,17 +5523,17 @@ CheckAddOrSub(FunctionCompiler &f, Parse
     if (numAddOrSubOut)
         *numAddOrSubOut = numAddOrSub;
     return true;
 }
 
 static bool
 CheckDivOrMod(FunctionCompiler &f, ParseNode *expr, MDefinition **def, Type *type)
 {
-    JS_ASSERT(expr->isKind(PNK_DIV) || expr->isKind(PNK_MOD));
+    MOZ_ASSERT(expr->isKind(PNK_DIV) || expr->isKind(PNK_MOD));
     ParseNode *lhs = BinaryLeft(expr);
     ParseNode *rhs = BinaryRight(expr);
 
     MDefinition *lhsDef, *rhsDef;
     Type lhsType, rhsType;
     if (!CheckExpr(f, lhs, &lhsDef, &lhsType))
         return false;
     if (!CheckExpr(f, rhs, &rhsDef, &rhsType))
@@ -5576,18 +5576,18 @@ CheckDivOrMod(FunctionCompiler &f, Parse
 
     return f.failf(expr, "arguments to / or %% must both be double?, float?, signed, or unsigned; "
                    "%s and %s are given", lhsType.toChars(), rhsType.toChars());
 }
 
 static bool
 CheckComparison(FunctionCompiler &f, ParseNode *comp, MDefinition **def, Type *type)
 {
-    JS_ASSERT(comp->isKind(PNK_LT) || comp->isKind(PNK_LE) || comp->isKind(PNK_GT) ||
-              comp->isKind(PNK_GE) || comp->isKind(PNK_EQ) || comp->isKind(PNK_NE));
+    MOZ_ASSERT(comp->isKind(PNK_LT) || comp->isKind(PNK_LE) || comp->isKind(PNK_GT) ||
+               comp->isKind(PNK_GE) || comp->isKind(PNK_EQ) || comp->isKind(PNK_NE));
     ParseNode *lhs = BinaryLeft(comp);
     ParseNode *rhs = BinaryRight(comp);
 
     MDefinition *lhsDef, *rhsDef;
     Type lhsType, rhsType;
     if (!CheckExpr(f, lhs, &lhsDef, &lhsType))
         return false;
     if (!CheckExpr(f, rhs, &rhsDef, &rhsType))
@@ -5738,17 +5738,17 @@ CheckExpr(FunctionCompiler &f, ParseNode
 }
 
 static bool
 CheckStatement(FunctionCompiler &f, ParseNode *stmt, LabelVector *maybeLabels = nullptr);
 
 static bool
 CheckExprStatement(FunctionCompiler &f, ParseNode *exprStmt)
 {
-    JS_ASSERT(exprStmt->isKind(PNK_SEMI));
+    MOZ_ASSERT(exprStmt->isKind(PNK_SEMI));
     ParseNode *expr = UnaryKid(exprStmt);
 
     if (!expr)
         return true;
 
     MDefinition *_1;
     Type _2;
 
@@ -5756,17 +5756,17 @@ CheckExprStatement(FunctionCompiler &f, 
         return CheckCoercedCall(f, expr, RetType::Void, &_1, &_2);
 
     return CheckExpr(f, UnaryKid(exprStmt), &_1, &_2);
 }
 
 static bool
 CheckWhile(FunctionCompiler &f, ParseNode *whileStmt, const LabelVector *maybeLabels)
 {
-    JS_ASSERT(whileStmt->isKind(PNK_WHILE));
+    MOZ_ASSERT(whileStmt->isKind(PNK_WHILE));
     ParseNode *cond = BinaryLeft(whileStmt);
     ParseNode *body = BinaryRight(whileStmt);
 
     MBasicBlock *loopEntry;
     if (!f.startPendingLoop(whileStmt, &loopEntry, body))
         return false;
 
     MDefinition *condDef;
@@ -5788,17 +5788,17 @@ CheckWhile(FunctionCompiler &f, ParseNod
         return false;
 
     return f.closeLoop(loopEntry, afterLoop);
 }
 
 static bool
 CheckFor(FunctionCompiler &f, ParseNode *forStmt, const LabelVector *maybeLabels)
 {
-    JS_ASSERT(forStmt->isKind(PNK_FOR));
+    MOZ_ASSERT(forStmt->isKind(PNK_FOR));
     ParseNode *forHead = BinaryLeft(forStmt);
     ParseNode *body = BinaryRight(forStmt);
 
     if (!forHead->isKind(PNK_FORHEAD))
         return f.fail(forHead, "unsupported for-loop statement");
 
     ParseNode *maybeInit = TernaryKid1(forHead);
     ParseNode *maybeCond = TernaryKid2(forHead);
@@ -5845,17 +5845,17 @@ CheckFor(FunctionCompiler &f, ParseNode 
     }
 
     return f.closeLoop(loopEntry, afterLoop);
 }
 
 static bool
 CheckDoWhile(FunctionCompiler &f, ParseNode *whileStmt, const LabelVector *maybeLabels)
 {
-    JS_ASSERT(whileStmt->isKind(PNK_DOWHILE));
+    MOZ_ASSERT(whileStmt->isKind(PNK_DOWHILE));
     ParseNode *body = BinaryLeft(whileStmt);
     ParseNode *cond = BinaryRight(whileStmt);
 
     MBasicBlock *loopEntry;
     if (!f.startPendingLoop(whileStmt, &loopEntry, body))
         return false;
 
     if (!CheckStatement(f, body))
@@ -5873,17 +5873,17 @@ CheckDoWhile(FunctionCompiler &f, ParseN
         return f.failf(cond, "%s is not a subtype of int", condType.toChars());
 
     return f.branchAndCloseDoWhileLoop(condDef, loopEntry, NextNode(whileStmt));
 }
 
 static bool
 CheckLabel(FunctionCompiler &f, ParseNode *labeledStmt, LabelVector *maybeLabels)
 {
-    JS_ASSERT(labeledStmt->isKind(PNK_LABEL));
+    MOZ_ASSERT(labeledStmt->isKind(PNK_LABEL));
     PropertyName *label = LabeledStatementLabel(labeledStmt);
     ParseNode *stmt = LabeledStatementStatement(labeledStmt);
 
     if (maybeLabels) {
         if (!maybeLabels->append(label))
             return false;
         if (!CheckStatement(f, stmt, maybeLabels))
             return false;
@@ -5919,17 +5919,17 @@ CheckLeafCondition(FunctionCompiler &f, 
 static bool
 CheckIfCondition(FunctionCompiler &f, ParseNode *cond, ParseNode *thenStmt, ParseNode *elseOrJoinStmt,
                  MBasicBlock **thenBlock, MBasicBlock **elseOrJoinBlock);
 
 static bool
 CheckIfConditional(FunctionCompiler &f, ParseNode *conditional, ParseNode *thenStmt, ParseNode *elseOrJoinStmt,
                    MBasicBlock **thenBlock, MBasicBlock **elseOrJoinBlock)
 {
-    JS_ASSERT(conditional->isKind(PNK_CONDITIONAL));
+    MOZ_ASSERT(conditional->isKind(PNK_CONDITIONAL));
 
     // a ? b : c <=> (a && b) || (!a && c)
     // b is always referred to the AND condition, as we need A and B to reach this test,
     // c is always referred as the OR condition, as we reach it if we don't have A.
     ParseNode *cond = TernaryKid1(conditional);
     ParseNode *lhs = TernaryKid2(conditional);
     ParseNode *rhs = TernaryKid3(conditional);
 
@@ -5999,17 +5999,17 @@ CheckIfConditional(FunctionCompiler &f, 
         f.switchToElse(*ifFalseBlock);
         if (!CheckIfCondition(f, rhs, thenStmt, elseOrJoinStmt, thenBlock, elseOrJoinBlock))
             return false;
         f.assertCurrentBlockIs(*thenBlock);
     }
 
     // We might not be on the thenBlock in one case
     if (ifTrueBlock == elseOrJoinBlock) {
-        JS_ASSERT(skipAndTest && andTestLiteral == 0);
+        MOZ_ASSERT(skipAndTest && andTestLiteral == 0);
         f.switchToElse(*thenBlock);
     }
 
     // Check post-conditions
     f.assertCurrentBlockIs(*thenBlock);
     JS_ASSERT_IF(!f.inDeadCode(), *thenBlock && *elseOrJoinBlock);
     return true;
 }
@@ -6047,17 +6047,17 @@ CheckIf(FunctionCompiler &f, ParseNode *
     // Handle if/else-if chains using iteration instead of recursion. This
     // avoids blowing the C stack quota for long if/else-if chains and also
     // creates fewer MBasicBlocks at join points (by creating one join block
     // for the entire if/else-if chain).
     BlockVector thenBlocks(f.cx());
 
     ParseNode *nextStmt = NextNode(ifStmt);
   recurse:
-    JS_ASSERT(ifStmt->isKind(PNK_IF));
+    MOZ_ASSERT(ifStmt->isKind(PNK_IF));
     ParseNode *cond = TernaryKid1(ifStmt);
     ParseNode *thenStmt = TernaryKid2(ifStmt);
     ParseNode *elseStmt = TernaryKid3(ifStmt);
 
     MBasicBlock *thenBlock = nullptr, *elseBlock = nullptr;
     ParseNode *elseOrJoinStmt = elseStmt ? elseStmt : nextStmt;
 
     if (!CheckIfCondition(f, cond, thenStmt, elseOrJoinStmt, &thenBlock, &elseBlock))
@@ -6114,17 +6114,17 @@ CheckCaseExpr(FunctionCompiler &f, Parse
 
     return true;
 }
 
 static bool
 CheckDefaultAtEnd(FunctionCompiler &f, ParseNode *stmt)
 {
     for (; stmt; stmt = NextNode(stmt)) {
-        JS_ASSERT(stmt->isKind(PNK_CASE) || stmt->isKind(PNK_DEFAULT));
+        MOZ_ASSERT(stmt->isKind(PNK_CASE) || stmt->isKind(PNK_DEFAULT));
         if (stmt->isKind(PNK_DEFAULT) && NextNode(stmt) != nullptr)
             return f.fail(stmt, "default label must be at the end");
     }
 
     return true;
 }
 
 static bool
@@ -6160,17 +6160,17 @@ CheckSwitchRange(FunctionCompiler &f, Pa
 
     *tableLength = int32_t(i64);
     return true;
 }
 
 static bool
 CheckSwitch(FunctionCompiler &f, ParseNode *switchStmt)
 {
-    JS_ASSERT(switchStmt->isKind(PNK_SWITCH));
+    MOZ_ASSERT(switchStmt->isKind(PNK_SWITCH));
     ParseNode *switchExpr = BinaryLeft(switchStmt);
     ParseNode *switchBody = BinaryRight(switchStmt);
 
     if (!switchBody->isKind(PNK_STATEMENTLIST))
         return f.fail(switchBody, "switch body may not contain 'let' declarations");
 
     MDefinition *exprDef;
     Type exprType;
@@ -6284,17 +6284,17 @@ CheckReturn(FunctionCompiler &f, ParseNo
     else
         f.returnExpr(def);
     return true;
 }
 
 static bool
 CheckStatementList(FunctionCompiler &f, ParseNode *stmtList)
 {
-    JS_ASSERT(stmtList->isKind(PNK_STATEMENTLIST));
+    MOZ_ASSERT(stmtList->isKind(PNK_STATEMENTLIST));
 
     for (ParseNode *stmt = ListHead(stmtList); stmt; stmt = NextNode(stmt)) {
         if (!CheckStatement(f, stmt))
             return false;
     }
 
     return true;
 }
@@ -6326,17 +6326,17 @@ CheckStatement(FunctionCompiler &f, Pars
 }
 
 static bool
 ParseFunction(ModuleCompiler &m, ParseNode **fnOut)
 {
     TokenStream &tokenStream = m.tokenStream();
 
     DebugOnly<TokenKind> tk = tokenStream.getToken();
-    JS_ASSERT(tk == TOK_FUNCTION);
+    MOZ_ASSERT(tk == TOK_FUNCTION);
 
     RootedPropertyName name(m.cx());
 
     TokenKind tt = tokenStream.getToken();
     if (tt == TOK_NAME) {
         name = tokenStream.currentName();
     } else if (tt == TOK_YIELD) {
         if (!m.parser().checkYieldNameValidity())
@@ -6541,22 +6541,22 @@ CheckFunctionsSequential(ModuleCompiler 
 // on the helper thread state's asmJSCompilationInProgress.
 class ParallelCompilationGuard
 {
     bool parallelState_;
   public:
     ParallelCompilationGuard() : parallelState_(false) {}
     ~ParallelCompilationGuard() {
         if (parallelState_) {
-            JS_ASSERT(HelperThreadState().asmJSCompilationInProgress == true);
+            MOZ_ASSERT(HelperThreadState().asmJSCompilationInProgress == true);
             HelperThreadState().asmJSCompilationInProgress = false;
         }
     }
     bool claim() {
-        JS_ASSERT(!parallelState_);
+        MOZ_ASSERT(!parallelState_);
         if (!HelperThreadState().asmJSCompilationInProgress.compareExchange(false, true))
             return false;
         parallelState_ = true;
         return true;
     }
 };
 
 static bool
@@ -6647,18 +6647,18 @@ GetUnusedTask(ParallelGroupState &group,
 }
 
 static bool
 CheckFunctionsParallel(ModuleCompiler &m, ParallelGroupState &group)
 {
 #ifdef DEBUG
     {
         AutoLockHelperThreadState lock;
-        JS_ASSERT(HelperThreadState().asmJSWorklist().empty());
-        JS_ASSERT(HelperThreadState().asmJSFinishedList().empty());
+        MOZ_ASSERT(HelperThreadState().asmJSWorklist().empty());
+        MOZ_ASSERT(HelperThreadState().asmJSFinishedList().empty());
     }
 #endif
     HelperThreadState().resetAsmJSFailureState();
 
     for (unsigned i = 0; PeekToken(m.parser()) == TOK_FUNCTION; i++) {
         // Get exclusive access to an empty LifoAlloc from the thread group's pool.
         AsmJSParallelTask *task = nullptr;
         if (!GetUnusedTask(group, i, &task) && !GenerateCodeForFinishedJob(m, group, &task))
@@ -6683,39 +6683,39 @@ CheckFunctionsParallel(ModuleCompiler &m
         AsmJSParallelTask *ignored = nullptr;
         if (!GenerateCodeForFinishedJob(m, group, &ignored))
             return false;
     }
 
     if (!CheckAllFunctionsDefined(m))
         return false;
 
-    JS_ASSERT(group.outstandingJobs == 0);
-    JS_ASSERT(group.compiledJobs == m.numFunctions());
+    MOZ_ASSERT(group.outstandingJobs == 0);
+    MOZ_ASSERT(group.compiledJobs == m.numFunctions());
 #ifdef DEBUG
     {
         AutoLockHelperThreadState lock;
-        JS_ASSERT(HelperThreadState().asmJSWorklist().empty());
-        JS_ASSERT(HelperThreadState().asmJSFinishedList().empty());
+        MOZ_ASSERT(HelperThreadState().asmJSWorklist().empty());
+        MOZ_ASSERT(HelperThreadState().asmJSFinishedList().empty());
     }
 #endif
-    JS_ASSERT(!HelperThreadState().asmJSFailed());
+    MOZ_ASSERT(!HelperThreadState().asmJSFailed());
     return true;
 }
 
 static void
 CancelOutstandingJobs(ModuleCompiler &m, ParallelGroupState &group)
 {
     // This is failure-handling code, so it's not allowed to fail. The problem
     // is that all memory for compilation is stored in LifoAllocs maintained in
     // the scope of CheckFunctions() -- so in order for that function to safely
     // return, and thereby remove the LifoAllocs, none of that memory can be in
     // use or reachable by helpers.
 
-    JS_ASSERT(group.outstandingJobs >= 0);
+    MOZ_ASSERT(group.outstandingJobs >= 0);
     if (!group.outstandingJobs)
         return;
 
     AutoLockHelperThreadState lock;
 
     // From the compiling tasks, eliminate those waiting for helper assignation.
     group.outstandingJobs -= HelperThreadState().asmJSWorklist().length();
     HelperThreadState().asmJSWorklist().clear();
@@ -6723,28 +6723,28 @@ CancelOutstandingJobs(ModuleCompiler &m,
     // From the compiling tasks, eliminate those waiting for codegen.
     group.outstandingJobs -= HelperThreadState().asmJSFinishedList().length();
     HelperThreadState().asmJSFinishedList().clear();
 
     // Eliminate tasks that failed without adding to the finished list.
     group.outstandingJobs -= HelperThreadState().harvestFailedAsmJSJobs();
 
     // Any remaining tasks are therefore undergoing active compilation.
-    JS_ASSERT(group.outstandingJobs >= 0);
+    MOZ_ASSERT(group.outstandingJobs >= 0);
     while (group.outstandingJobs > 0) {
         HelperThreadState().wait(GlobalHelperThreadState::CONSUMER);
 
         group.outstandingJobs -= HelperThreadState().harvestFailedAsmJSJobs();
         group.outstandingJobs -= HelperThreadState().asmJSFinishedList().length();
         HelperThreadState().asmJSFinishedList().clear();
     }
 
-    JS_ASSERT(group.outstandingJobs == 0);
-    JS_ASSERT(HelperThreadState().asmJSWorklist().empty());
-    JS_ASSERT(HelperThreadState().asmJSFinishedList().empty());
+    MOZ_ASSERT(group.outstandingJobs == 0);
+    MOZ_ASSERT(HelperThreadState().asmJSWorklist().empty());
+    MOZ_ASSERT(HelperThreadState().asmJSFinishedList().empty());
 }
 
 static const size_t LIFO_ALLOC_PARALLEL_CHUNK_SIZE = 1 << 12;
 
 static bool
 CheckFunctions(ModuleCompiler &m)
 {
     // If parallel compilation isn't enabled (not enough cores, disabled by
@@ -6875,17 +6875,17 @@ CheckModuleExportFunction(ModuleCompiler
         return m.failName(returnExpr, "exported function name '%s' not found", funcName);
 
     return m.addExportedFunction(func, /* maybeFieldName = */ nullptr);
 }
 
 static bool
 CheckModuleExportObject(ModuleCompiler &m, ParseNode *object)
 {
-    JS_ASSERT(object->isKind(PNK_OBJECT));
+    MOZ_ASSERT(object->isKind(PNK_OBJECT));
 
     for (ParseNode *pn = ListHead(object); pn; pn = NextNode(pn)) {
         if (!IsNormalObjectField(m.cx(), pn))
             return m.fail(pn, "only normal object properties may be used in the export object literal");
 
         PropertyName *fieldName = ObjectNormalFieldName(m.cx(), pn);
 
         ParseNode *initNode = ObjectNormalFieldInitializer(m.cx(), pn);
@@ -6937,17 +6937,17 @@ CheckModuleReturn(ModuleCompiler &m)
     // mistaken as free variables and added to lexdeps. Clear these now.
     m.parser().pc->lexdeps->clear();
     return true;
 }
 
 static void
 AssertStackAlignment(MacroAssembler &masm, uint32_t alignment)
 {
-    JS_ASSERT((sizeof(AsmJSFrame) + masm.framePushed()) % alignment == 0);
+    MOZ_ASSERT((sizeof(AsmJSFrame) + masm.framePushed()) % alignment == 0);
     masm.assertStackAlignment(alignment);
 }
 
 static unsigned
 StackDecrementForCall(MacroAssembler &masm, uint32_t alignment, unsigned bytesToPush)
 {
     return StackDecrementForCall(alignment, sizeof(AsmJSFrame) + masm.framePushed(), bytesToPush);
 }
@@ -7017,17 +7017,17 @@ GenerateEntry(ModuleCompiler &m, unsigne
 #elif defined(JS_CODEGEN_X86)
     static const unsigned EntryFrameSize = sizeof(void*);
 #endif
 
     // Save all caller non-volatile registers before we clobber them here and in
     // the asm.js callee (which does not preserve non-volatile registers).
     masm.setFramePushed(0);
     masm.PushRegsInMask(NonVolatileRegs, NonVolatileSimdRegs);
-    JS_ASSERT(masm.framePushed() == FramePushedAfterSave);
+    MOZ_ASSERT(masm.framePushed() == FramePushedAfterSave);
 
     // ARM and MIPS have a globally-pinned GlobalReg (x64 uses RIP-relative
     // addressing, x86 uses immediates in effective addresses). For the
     // AsmJSGlobalRegBias addition, see Assembler-(mips,arm).h.
 #if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS)
     masm.movePtr(IntArgReg1, GlobalReg);
     masm.addPtr(Imm32(AsmJSGlobalRegBias), GlobalReg);
 #endif
@@ -7050,17 +7050,17 @@ GenerateEntry(ModuleCompiler &m, unsigne
     masm.movePtr(IntArgReg0, argv);
 #endif
     masm.Push(argv);
 
     // Save the stack pointer to the saved non-volatile registers. We will use
     // this on two paths: normal return and exceptional return. Since
     // loadAsmJSActivation uses GlobalReg, we must do this after loading
     // GlobalReg.
-    JS_ASSERT(masm.framePushed() == FramePushedForEntrySP);
+    MOZ_ASSERT(masm.framePushed() == FramePushedForEntrySP);
     masm.loadAsmJSActivation(scratch);
     masm.storePtr(StackPointer, Address(scratch, AsmJSActivation::offsetOfEntrySP()));
 
     // Dynamically align the stack since ABIStackAlignment is not necessarily
     // AsmJSStackAlignment. We'll use entrySP to recover the original stack
     // pointer on return.
     masm.andPtr(Imm32(~(AsmJSStackAlignment - 1)), StackPointer);
 
@@ -7162,17 +7162,17 @@ GenerateEntry(ModuleCompiler &m, unsigne
       case RetType::Float32x4:
         // We don't have control on argv alignment, do an unaligned access.
         masm.storeUnalignedFloat32x4(ReturnSimdReg, Address(argv, 0));
         break;
     }
 
     // Restore clobbered non-volatile registers of the caller.
     masm.PopRegsInMask(NonVolatileRegs, NonVolatileSimdRegs);
-    JS_ASSERT(masm.framePushed() == 0);
+    MOZ_ASSERT(masm.framePushed() == 0);
 
     masm.move32(Imm32(true), ReturnReg);
     masm.ret();
 
     return m.finishGeneratingEntry(exportIndex, &begin) && !masm.oom();
 }
 
 static void
@@ -7197,33 +7197,33 @@ FillArgumentArray(ModuleCompiler &m, con
                 Address src(StackPointer, offsetToCallerStackArgs + i->offsetFromArgBase());
 #if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
                 masm.load32(src, scratch);
                 masm.storeValue(JSVAL_TYPE_INT32, scratch, dstAddr);
 #else
                 masm.memIntToValue(src, dstAddr);
 #endif
             } else {
-                JS_ASSERT(i.mirType() == MIRType_Double);
+                MOZ_ASSERT(i.mirType() == MIRType_Double);
                 Address src(StackPointer, offsetToCallerStackArgs + i->offsetFromArgBase());
                 masm.loadDouble(src, ScratchDoubleReg);
                 masm.canonicalizeDouble(ScratchDoubleReg);
                 masm.storeDouble(ScratchDoubleReg, dstAddr);
             }
             break;
         }
     }
 }
 
 static bool
 GenerateFFIInterpExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit,
                       unsigned exitIndex, Label *throwLabel)
 {
     MacroAssembler &masm = m.masm();
-    JS_ASSERT(masm.framePushed() == 0);
+    MOZ_ASSERT(masm.framePushed() == 0);
 
     // Argument types for InvokeFromAsmJS_*:
     static const MIRType typeArray[] = { MIRType_Pointer,   // exitDatum
                                          MIRType_Int32,     // argc
                                          MIRType_Pointer }; // argv
     MIRTypeVector invokeArgTypes(m.cx());
     invokeArgTypes.infallibleAppend(typeArray, ArrayLength(typeArray));
 
@@ -7265,17 +7265,17 @@ GenerateFFIInterpExit(ModuleCompiler &m,
     Address argv(StackPointer, offsetToArgv);
     if (i->kind() == ABIArg::GPR) {
         masm.computeEffectiveAddress(argv, i->gpr());
     } else {
         masm.computeEffectiveAddress(argv, scratch);
         masm.storePtr(scratch, Address(StackPointer, i->offsetFromArgBase()));
     }
     i++;
-    JS_ASSERT(i.done());
+    MOZ_ASSERT(i.done());
 
     // Make the call, test whether it succeeded, and extract the return value.
     AssertStackAlignment(masm, ABIStackAlignment);
     switch (exit.sig().retType().which()) {
       case RetType::Void:
         masm.call(AsmJSImmPtr(AsmJSImm_InvokeFromAsmJS_Ignore));
         masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
         break;
@@ -7393,17 +7393,17 @@ GenerateFFIIonExit(ModuleCompiler &m, co
     // 4. |this| value
     masm.storeValue(UndefinedValue(), Address(StackPointer, argOffset));
     argOffset += sizeof(Value);
 
     // 5. Fill the arguments
     unsigned offsetToCallerStackArgs = framePushed + sizeof(AsmJSFrame);
     FillArgumentArray(m, exit.sig().args(), argOffset, offsetToCallerStackArgs, scratch);
     argOffset += exit.sig().args().length() * sizeof(Value);
-    JS_ASSERT(argOffset == offsetToIonArgs + ionArgBytes);
+    MOZ_ASSERT(argOffset == offsetToIonArgs + ionArgBytes);
 
     // 6. Store asm.js pinned registers
 #if defined(JS_CODEGEN_X64)
     unsigned savedHeapOffset = framePushed - sizeof(void*);
     masm.storePtr(HeapReg, Address(StackPointer, savedHeapOffset));
 #elif defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS)
     unsigned savedHeapOffset = framePushed - 1 * sizeof(void*);
     unsigned savedGlobalOffset = framePushed - 2 * sizeof(void*);
@@ -7411,17 +7411,17 @@ GenerateFFIIonExit(ModuleCompiler &m, co
     masm.storePtr(GlobalReg, Address(StackPointer, savedGlobalOffset));
 #endif
 
     {
         // Enable Activation.
         //
         // This sequence requires four registers, and needs to preserve the 'callee'
         // register, so there are five live registers.
-        JS_ASSERT(callee == AsmJSIonExitRegCallee);
+        MOZ_ASSERT(callee == AsmJSIonExitRegCallee);
         Register reg0 = AsmJSIonExitRegE0;
         Register reg1 = AsmJSIonExitRegE1;
         Register reg2 = AsmJSIonExitRegE2;
         Register reg3 = AsmJSIonExitRegE3;
 
         // The following is inlined:
         //   JSContext *cx = activation->cx();
         //   Activation *act = cx->mainThread().activation();
@@ -7452,18 +7452,18 @@ GenerateFFIIonExit(ModuleCompiler &m, co
     masm.callIonFromAsmJS(callee);
     AssertStackAlignment(masm, AsmJSStackAlignment);
 
     {
         // Disable Activation.
         //
         // This sequence needs three registers, and must preserve the JSReturnReg_Data and
         // JSReturnReg_Type, so there are five live registers.
-        JS_ASSERT(JSReturnReg_Data == AsmJSIonExitRegReturnData);
-        JS_ASSERT(JSReturnReg_Type == AsmJSIonExitRegReturnType);
+        MOZ_ASSERT(JSReturnReg_Data == AsmJSIonExitRegReturnData);
+        MOZ_ASSERT(JSReturnReg_Type == AsmJSIonExitRegReturnType);
         Register reg0 = AsmJSIonExitRegD0;
         Register reg1 = AsmJSIonExitRegD1;
         Register reg2 = AsmJSIonExitRegD2;
 
         // The following is inlined:
         //   rt->mainThread.activation()->active_ = false;
         //   rt->mainThread.jitTop = prevJitTop_;
         //   rt->mainThread.jitJSContext = prevJitJSContext_;
@@ -7477,17 +7477,17 @@ GenerateFFIIonExit(ModuleCompiler &m, co
         masm.loadPtr(Address(reg0, offsetOfActivation), reg1);
         masm.store8(Imm32(0), Address(reg1, JitActivation::offsetOfActiveUint8()));
         masm.loadPtr(Address(reg1, JitActivation::offsetOfPrevJitTop()), reg2);
         masm.storePtr(reg2, Address(reg0, offsetOfJitTop));
         masm.loadPtr(Address(reg1, JitActivation::offsetOfPrevJitJSContext()), reg2);
         masm.storePtr(reg2, Address(reg0, offsetOfJitJSContext));
     }
 
-    JS_ASSERT(masm.framePushed() == framePushed);
+    MOZ_ASSERT(masm.framePushed() == framePushed);
 #if defined(JS_CODEGEN_X64)
     masm.loadPtr(Address(StackPointer, savedHeapOffset), HeapReg);
 #elif defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS)
     masm.loadPtr(Address(StackPointer, savedHeapOffset), HeapReg);
     masm.loadPtr(Address(StackPointer, savedGlobalOffset), GlobalReg);
 #endif
 
     masm.branchTestMagic(Assembler::Equal, JSReturnOperand, throwLabel);
@@ -7528,17 +7528,17 @@ GenerateFFIIonExit(ModuleCompiler &m, co
         Address argv(StackPointer, offsetToCoerceArgv);
         if (i->kind() == ABIArg::GPR) {
             masm.computeEffectiveAddress(argv, i->gpr());
         } else {
             masm.computeEffectiveAddress(argv, scratch);
             masm.storePtr(scratch, Address(StackPointer, i->offsetFromArgBase()));
         }
         i++;
-        JS_ASSERT(i.done());
+        MOZ_ASSERT(i.done());
 
         // Call coercion function
         AssertStackAlignment(masm, ABIStackAlignment);
         switch (exit.sig().retType().which()) {
           case RetType::Signed:
             masm.call(AsmJSImmPtr(AsmJSImm_CoerceInPlace_ToInt32));
             masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
             masm.unboxInt32(Address(StackPointer, offsetToCoerceArgv), ReturnReg);
@@ -7551,17 +7551,17 @@ GenerateFFIIonExit(ModuleCompiler &m, co
           default:
             MOZ_CRASH("Unsupported convert type");
         }
 
         masm.jump(&done);
         masm.setFramePushed(0);
     }
 
-    JS_ASSERT(masm.framePushed() == 0);
+    MOZ_ASSERT(masm.framePushed() == 0);
 
     return m.finishGeneratingIonExit(exitIndex, &begin, &profilingReturn) && !masm.oom();
 }
 
 // See "asm.js FFI calls" comment above.
 static bool
 GenerateFFIExits(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit, unsigned exitIndex,
                  Label *throwLabel)
@@ -7586,17 +7586,17 @@ GenerateFFIExits(ModuleCompiler &m, cons
 //
 // NB: Since this thunk is being injected at system ABI callsites, it must
 //     preserve the argument registers (going in) and the return register
 //     (coming out) and preserve non-volatile registers.
 static bool
 GenerateBuiltinThunk(ModuleCompiler &m, AsmJSExit::BuiltinKind builtin)
 {
     MacroAssembler &masm = m.masm();
-    JS_ASSERT(masm.framePushed() == 0);
+    MOZ_ASSERT(masm.framePushed() == 0);
 
     MIRTypeVector argTypes(m.cx());
     switch (builtin) {
       case AsmJSExit::Builtin_ToInt32:
         argTypes.infallibleAppend(MIRType_Int32);
         break;
 #if defined(JS_CODEGEN_ARM)
       case AsmJSExit::Builtin_IDivMod:
@@ -7642,17 +7642,17 @@ GenerateBuiltinThunk(ModuleCompiler &m, 
 #if !defined(JS_CODEGEN_ARM)
         unsigned offsetToCallerStackArgs = sizeof(AsmJSFrame) + masm.framePushed();
         Address srcAddr(StackPointer, offsetToCallerStackArgs + i->offsetFromArgBase());
         Address dstAddr(StackPointer, i->offsetFromArgBase());
         if (i.mirType() == MIRType_Int32 || i.mirType() == MIRType_Float32) {
             masm.load32(srcAddr, ABIArgGenerator::NonArg_VolatileReg);
             masm.store32(ABIArgGenerator::NonArg_VolatileReg, dstAddr);
         } else {
-            JS_ASSERT(i.mirType() == MIRType_Double);
+            MOZ_ASSERT(i.mirType() == MIRType_Double);
             masm.loadDouble(srcAddr, ScratchDoubleReg);
             masm.storeDouble(ScratchDoubleReg, dstAddr);
         }
 #else
         MOZ_CRASH("Architecture should have enough registers for all builtin calls");
 #endif
     }
 
@@ -7759,17 +7759,17 @@ GenerateAsyncInterruptExit(ModuleCompile
     masm.branchIfFalseBool(ReturnReg, throwLabel);
 
     // This will restore stack to the address before the call.
     masm.movePtr(s0, StackPointer);
     masm.PopRegsInMask(AllRegsExceptSP);
 
     // Pop resumePC into PC. Clobber HeapReg to make the jump and restore it
     // during jump delay slot.
-    JS_ASSERT(Imm16::IsInSignedRange(AsmJSModule::heapGlobalDataOffset() - AsmJSGlobalRegBias));
+    MOZ_ASSERT(Imm16::IsInSignedRange(AsmJSModule::heapGlobalDataOffset() - AsmJSGlobalRegBias));
     masm.pop(HeapReg);
     masm.as_jr(HeapReg);
     masm.loadPtr(Address(GlobalReg, AsmJSModule::heapGlobalDataOffset() - AsmJSGlobalRegBias),
                  HeapReg);
 #elif defined(JS_CODEGEN_ARM)
     masm.setFramePushed(0);         // set to zero so we can use masm.framePushed() below
     masm.PushRegsInMask(RegisterSet(GeneralRegisterSet(Registers::AllMask & ~(1<<Registers::sp)), FloatRegisterSet(uint32_t(0))));   // save all GP registers,excep sp
 
@@ -7866,17 +7866,17 @@ GenerateThrowStub(ModuleCompiler &m, Lab
     Register scratch = ABIArgGenerator::NonArgReturnReg0;
     masm.loadAsmJSActivation(scratch);
     masm.storePtr(ImmWord(0), Address(scratch, AsmJSActivation::offsetOfFP()));
 
     masm.setFramePushed(FramePushedForEntrySP);
     masm.loadPtr(Address(scratch, AsmJSActivation::offsetOfEntrySP()), StackPointer);
     masm.Pop(scratch);
     masm.PopRegsInMask(NonVolatileRegs, NonVolatileSimdRegs);
-    JS_ASSERT(masm.framePushed() == 0);
+    MOZ_ASSERT(masm.framePushed() == 0);
 
     masm.mov(ImmWord(0), ReturnReg);
     masm.ret();
 
     return m.finishGeneratingInlineStub(throwLabel) && !masm.oom();
 }
 
 static bool
@@ -8057,17 +8057,17 @@ js::ValidateAsmJS(ExclusiveContext *cx, 
     if (!moduleObj)
         return false;
 
     FunctionBox *funbox = parser.pc->maybeFunction->pn_funbox;
     RootedFunction moduleFun(cx, NewAsmJSModuleFunction(cx, funbox->function(), moduleObj));
     if (!moduleFun)
         return false;
 
-    JS_ASSERT(funbox->function()->isInterpreted());
+    MOZ_ASSERT(funbox->function()->isInterpreted());
     funbox->object = moduleFun;
 
     *validated = true;
     Warn(parser, JSMSG_USE_ASM_TYPE_OK, compilationTimeReport.get());
     return NoExceptionPending(cx);
 }
 
 bool
--- a/js/src/asmjs/AsmJSValidate.h
+++ b/js/src/asmjs/AsmJSValidate.h
@@ -70,17 +70,17 @@ inline uint32_t
 RoundUpToNextValidAsmJSHeapLength(uint32_t length)
 {
     if (length <= 4 * 1024)
         return 4 * 1024;
 
     if (length <= 16 * 1024 * 1024)
         return mozilla::RoundUpPow2(length);
 
-    JS_ASSERT(length <= 0xff000000);
+    MOZ_ASSERT(length <= 0xff000000);
     return (length + 0x00ffffff) & ~0x00ffffff;
 }
 
 inline bool
 IsValidAsmJSHeapLength(uint32_t length)
 {
     bool valid = length >= 4 * 1024 &&
                  (IsPowerOfTwo(length) ||
--- a/js/src/builtin/Eval.cpp
+++ b/js/src/builtin/Eval.cpp
@@ -27,17 +27,17 @@ using JS::AutoCheckCannotGC;
 
 // We should be able to assert this for *any* fp->scopeChain().
 static void
 AssertInnerizedScopeChain(JSContext *cx, JSObject &scopeobj)
 {
 #ifdef DEBUG
     RootedObject obj(cx);
     for (obj = &scopeobj; obj; obj = obj->enclosingScope())
-        JS_ASSERT(GetInnerObject(obj) == obj);
+        MOZ_ASSERT(GetInnerObject(obj) == obj);
 #endif
 }
 
 static bool
 IsEvalCacheCandidate(JSScript *script)
 {
     // Make sure there are no inner objects which might use the wrong parent
     // and/or call scope by reusing the previous eval's script. Skip the
@@ -58,17 +58,17 @@ EvalCacheHashPolicy::hash(const EvalCach
     return AddToHash(hash, l.callerScript.get(), l.version, l.pc);
 }
 
 /* static */ bool
 EvalCacheHashPolicy::match(const EvalCacheEntry &cacheEntry, const EvalCacheLookup &l)
 {
     JSScript *script = cacheEntry.script;
 
-    JS_ASSERT(IsEvalCacheCandidate(script));
+    MOZ_ASSERT(IsEvalCacheCandidate(script));
 
     // Get the source string passed for safekeeping in the atom map
     // by the prior eval to frontend::CompileScript.
     JSAtom *keyStr = script->atoms[0];
 
     return EqualStrings(keyStr, l.str) &&
            cacheEntry.callerScript == l.callerScript &&
            script->getVersion() == l.version &&
@@ -120,27 +120,27 @@ class EvalScriptGuard
             script_ = p_->script;
             cx_->runtime()->evalCache.remove(p_);
             script_->uncacheForEval();
         }
     }
 
     void setNewScript(JSScript *script) {
         // JSScript::initFromEmitter has already called js_CallNewScriptHook.
-        JS_ASSERT(!script_ && script);
+        MOZ_ASSERT(!script_ && script);
         script_ = script;
         script_->setActiveEval();
     }
 
     bool foundScript() {
         return !!script_;
     }
 
     HandleScript script() {
-        JS_ASSERT(script_);
+        MOZ_ASSERT(script_);
         return script_;
     }
 };
 
 enum EvalJSONResult {
     EvalJSON_Failure,
     EvalJSON_Success,
     EvalJSON_NotJSON
@@ -239,18 +239,18 @@ enum EvalType { DIRECT_EVAL = EXECUTE_DI
 // or indirect eval (see ES5 10.4.2).  If this is an indirect eval, scopeobj
 // must be a global object.
 //
 // On success, store the completion value in call.rval and return true.
 static bool
 EvalKernel(JSContext *cx, const CallArgs &args, EvalType evalType, AbstractFramePtr caller,
            HandleObject scopeobj, jsbytecode *pc)
 {
-    JS_ASSERT((evalType == INDIRECT_EVAL) == !caller);
-    JS_ASSERT((evalType == INDIRECT_EVAL) == !pc);
+    MOZ_ASSERT((evalType == INDIRECT_EVAL) == !caller);
+    MOZ_ASSERT((evalType == INDIRECT_EVAL) == !pc);
     JS_ASSERT_IF(evalType == INDIRECT_EVAL, scopeobj->is<GlobalObject>());
     AssertInnerizedScopeChain(cx, *scopeobj);
 
     Rooted<GlobalObject*> scopeObjGlobal(cx, &scopeobj->global());
     if (!GlobalObject::isRuntimeCodeGenEnabled(cx, scopeObjGlobal)) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_CSP_BLOCKED_EVAL);
         return false;
     }
@@ -279,17 +279,17 @@ EvalKernel(JSContext *cx, const CallArgs
 
         // Direct calls to eval are supposed to see the caller's |this|. If we
         // haven't wrapped that yet, do so now, before we make a copy of it for
         // the eval code to use.
         if (!ComputeThis(cx, caller))
             return false;
         thisv = caller.thisValue();
     } else {
-        JS_ASSERT(args.callee().global() == *scopeobj);
+        MOZ_ASSERT(args.callee().global() == *scopeobj);
         staticLevel = 0;
 
         // Use the global as 'this', modulo outerization.
         JSObject *thisobj = JSObject::thisObject(cx, scopeobj);
         if (!thisobj)
             return false;
         thisv = ObjectValue(*thisobj);
     }
@@ -420,17 +420,17 @@ js::DirectEvalStringFromIon(JSContext *c
         if (!compiled)
             return false;
 
         esg.setNewScript(compiled);
     }
 
     // Primitive 'this' values should have been filtered out by Ion. If boxed,
     // the calling frame cannot be updated to store the new object.
-    JS_ASSERT(thisValue.isObject() || thisValue.isUndefined() || thisValue.isNull());
+    MOZ_ASSERT(thisValue.isObject() || thisValue.isUndefined() || thisValue.isNull());
 
     return ExecuteKernel(cx, esg.script(), *scopeobj, thisValue, ExecuteType(DIRECT_EVAL),
                          NullFramePtr() /* evalInFrame */, vp.address());
 }
 
 bool
 js::DirectEvalValueFromIon(JSContext *cx,
                            HandleObject scopeobj, HandleScript callerScript,
@@ -457,19 +457,19 @@ js::IndirectEval(JSContext *cx, unsigned
 
 bool
 js::DirectEval(JSContext *cx, const CallArgs &args)
 {
     // Direct eval can assume it was called from an interpreted or baseline frame.
     ScriptFrameIter iter(cx);
     AbstractFramePtr caller = iter.abstractFramePtr();
 
-    JS_ASSERT(caller.scopeChain()->global().valueIsEval(args.calleev()));
-    JS_ASSERT(JSOp(*iter.pc()) == JSOP_EVAL ||
-              JSOp(*iter.pc()) == JSOP_SPREADEVAL);
+    MOZ_ASSERT(caller.scopeChain()->global().valueIsEval(args.calleev()));
+    MOZ_ASSERT(JSOp(*iter.pc()) == JSOP_EVAL ||
+               JSOp(*iter.pc()) == JSOP_SPREADEVAL);
     JS_ASSERT_IF(caller.isFunctionFrame(),
                  caller.compartment() == caller.callee()->compartment());
 
     RootedObject scopeChain(cx, caller.scopeChain());
     return EvalKernel(cx, args, DIRECT_EVAL, caller, scopeChain, iter.pc());
 }
 
 bool
--- a/js/src/builtin/Intl.cpp
+++ b/js/src/builtin/Intl.cpp
@@ -396,18 +396,18 @@ udat_close(UDateFormat *format)
 
 static bool
 IntlInitialize(JSContext *cx, HandleObject obj, Handle<PropertyName*> initializer,
                HandleValue locales, HandleValue options)
 {
     RootedValue initializerValue(cx);
     if (!GlobalObject::getIntrinsicValue(cx, cx->global(), initializer, &initializerValue))
         return false;
-    JS_ASSERT(initializerValue.isObject());
-    JS_ASSERT(initializerValue.toObject().is<JSFunction>());
+    MOZ_ASSERT(initializerValue.isObject());
+    MOZ_ASSERT(initializerValue.toObject().is<JSFunction>());
 
     InvokeArgs args(cx);
     if (!args.init(3))
         return false;
 
     args.setCallee(initializerValue);
     args.setThis(NullValue());
     args[0].setObject(*obj);
@@ -472,18 +472,18 @@ intl_availableLocales(JSContext *cx, Cou
  * Returns the object holding the internal properties for obj.
  */
 static bool
 GetInternals(JSContext *cx, HandleObject obj, MutableHandleObject internals)
 {
     RootedValue getInternalsValue(cx);
     if (!GlobalObject::getIntrinsicValue(cx, cx->global(), cx->names().getInternals, &getInternalsValue))
         return false;
-    JS_ASSERT(getInternalsValue.isObject());
-    JS_ASSERT(getInternalsValue.toObject().is<JSFunction>());
+    MOZ_ASSERT(getInternalsValue.isObject());
+    MOZ_ASSERT(getInternalsValue.toObject().is<JSFunction>());
 
     InvokeArgs args(cx);
     if (!args.init(1))
         return false;
 
     args.setCallee(getInternalsValue);
     args.setThis(NullValue());
     args[0].setObject(*obj);
@@ -655,17 +655,17 @@ Collator(JSContext *cx, unsigned argc, V
     CallArgs args = CallArgsFromVp(argc, vp);
     return Collator(cx, args, args.isConstructing());
 }
 
 bool
 js::intl_Collator(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 2);
+    MOZ_ASSERT(args.length() == 2);
     // intl_Collator is an intrinsic for self-hosted JavaScript, so it cannot
     // be used with "new", but it still has to be treated as a constructor.
     return Collator(cx, args, true);
 }
 
 static void
 collator_finalize(FreeOp *fop, JSObject *obj)
 {
@@ -739,31 +739,31 @@ GlobalObject::initCollatorProto(JSContex
     global->setReservedSlot(COLLATOR_PROTO, ObjectValue(*proto));
     return true;
 }
 
 bool
 js::intl_Collator_availableLocales(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 0);
+    MOZ_ASSERT(args.length() == 0);
 
     RootedValue result(cx);
     if (!intl_availableLocales(cx, ucol_countAvailable, ucol_getAvailable, &result))
         return false;
     args.rval().set(result);
     return true;
 }
 
 bool
 js::intl_availableCollations(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
-    JS_ASSERT(args[0].isString());
+    MOZ_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args[0].isString());
 
     JSAutoByteString locale(cx, args[0].toString());
     if (!locale)
         return false;
     UErrorCode status = U_ZERO_ERROR;
     UEnumeration *values = ucol_getKeywordValuesForLocale("co", locale.ptr(), false, &status);
     if (U_FAILURE(status)) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_INTERNAL_INTL_ERROR);
@@ -894,17 +894,17 @@ NewUCollator(JSContext *cx, HandleObject
     if (equal(sensitivity, "base")) {
         uStrength = UCOL_PRIMARY;
     } else if (equal(sensitivity, "accent")) {
         uStrength = UCOL_SECONDARY;
     } else if (equal(sensitivity, "case")) {
         uStrength = UCOL_PRIMARY;
         uCaseLevel = UCOL_ON;
     } else {
-        JS_ASSERT(equal(sensitivity, "variant"));
+        MOZ_ASSERT(equal(sensitivity, "variant"));
         uStrength = UCOL_TERTIARY;
     }
 
     if (!JSObject::getProperty(cx, internals, internals, cx->names().ignorePunctuation, &value))
         return nullptr;
     // According to the ICU team, UCOL_SHIFTED causes punctuation to be
     // ignored. Looking at Unicode Technical Report 35, Unicode Locale Data
     // Markup Language, "shifted" causes whitespace and punctuation to be
@@ -924,17 +924,17 @@ NewUCollator(JSContext *cx, HandleObject
         JSAutoByteString caseFirst(cx, value.toString());
         if (!caseFirst)
             return nullptr;
         if (equal(caseFirst, "upper"))
             uCaseFirst = UCOL_UPPER_FIRST;
         else if (equal(caseFirst, "lower"))
             uCaseFirst = UCOL_LOWER_FIRST;
         else
-            JS_ASSERT(equal(caseFirst, "false"));
+            MOZ_ASSERT(equal(caseFirst, "false"));
     }
 
     UErrorCode status = U_ZERO_ERROR;
     UCollator *coll = ucol_open(icuLocale(locale.ptr()), &status);
     if (U_FAILURE(status)) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_INTERNAL_INTL_ERROR);
         return nullptr;
     }
@@ -952,18 +952,18 @@ NewUCollator(JSContext *cx, HandleObject
     }
 
     return coll;
 }
 
 static bool
 intl_CompareStrings(JSContext *cx, UCollator *coll, HandleString str1, HandleString str2, MutableHandleValue result)
 {
-    JS_ASSERT(str1);
-    JS_ASSERT(str2);
+    MOZ_ASSERT(str1);
+    MOZ_ASSERT(str2);
 
     if (str1 == str2) {
         result.setInt32(0);
         return true;
     }
 
     AutoStableStringChars stableChars1(cx);
     if (!stableChars1.initTwoByte(cx, str1))
@@ -989,20 +989,20 @@ intl_CompareStrings(JSContext *cx, UColl
     result.setInt32(res);
     return true;
 }
 
 bool
 js::intl_CompareStrings(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 3);
-    JS_ASSERT(args[0].isObject());
-    JS_ASSERT(args[1].isString());
-    JS_ASSERT(args[2].isString());
+    MOZ_ASSERT(args.length() == 3);
+    MOZ_ASSERT(args[0].isObject());
+    MOZ_ASSERT(args[1].isString());
+    MOZ_ASSERT(args[2].isString());
 
     RootedObject collator(cx, &args[0].toObject());
 
     // Obtain a UCollator object, cached if possible.
     // XXX Does this handle Collator instances from other globals correctly?
     bool isCollatorInstance = collator->getClass() == &CollatorClass;
     UCollator *coll;
     if (isCollatorInstance) {
@@ -1144,17 +1144,17 @@ NumberFormat(JSContext *cx, unsigned arg
     CallArgs args = CallArgsFromVp(argc, vp);
     return NumberFormat(cx, args, args.isConstructing());
 }
 
 bool
 js::intl_NumberFormat(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 2);
+    MOZ_ASSERT(args.length() == 2);
     // intl_NumberFormat is an intrinsic for self-hosted JavaScript, so it
     // cannot be used with "new", but it still has to be treated as a
     // constructor.
     return NumberFormat(cx, args, true);
 }
 
 static void
 numberFormat_finalize(FreeOp *fop, JSObject *obj)
@@ -1230,31 +1230,31 @@ GlobalObject::initNumberFormatProto(JSCo
     global->setReservedSlot(NUMBER_FORMAT_PROTO, ObjectValue(*proto));
     return true;
 }
 
 bool
 js::intl_NumberFormat_availableLocales(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 0);
+    MOZ_ASSERT(args.length() == 0);
 
     RootedValue result(cx);
     if (!intl_availableLocales(cx, unum_countAvailable, unum_getAvailable, &result))
         return false;
     args.rval().set(result);
     return true;
 }
 
 bool
 js::intl_numberingSystem(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
-    JS_ASSERT(args[0].isString());
+    MOZ_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args[0].isString());
 
     JSAutoByteString locale(cx, args[0].toString());
     if (!locale)
         return false;
 
     // There's no C API for numbering system, so use the C++ API and hope it
     // won't break. http://bugs.icu-project.org/trac/ticket/10039
     Locale ulocale(locale.ptr());
@@ -1332,23 +1332,23 @@ NewUNumberFormat(JSContext *cx, HandleOb
         JSAutoByteString currencyDisplay(cx, value.toString());
         if (!currencyDisplay)
             return nullptr;
         if (equal(currencyDisplay, "code")) {
             uStyle = UNUM_CURRENCY_ISO;
         } else if (equal(currencyDisplay, "symbol")) {
             uStyle = UNUM_CURRENCY;
         } else {
-            JS_ASSERT(equal(currencyDisplay, "name"));
+            MOZ_ASSERT(equal(currencyDisplay, "name"));
             uStyle = UNUM_CURRENCY_PLURAL;
         }
     } else if (equal(style, "percent")) {
         uStyle = UNUM_PERCENT;
     } else {
-        JS_ASSERT(equal(style, "decimal"));
+        MOZ_ASSERT(equal(style, "decimal"));
         uStyle = UNUM_DECIMAL;
     }
 
     RootedId id(cx, NameToId(cx->names().minimumSignificantDigits));
     bool hasP;
     if (!JSObject::hasProperty(cx, internals, id, &hasP))
         return nullptr;
     if (hasP) {
@@ -1450,19 +1450,19 @@ intl_FormatNumber(JSContext *cx, UNumber
     result.setString(str);
     return true;
 }
 
 bool
 js::intl_FormatNumber(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 2);
-    JS_ASSERT(args[0].isObject());
-    JS_ASSERT(args[1].isNumber());
+    MOZ_ASSERT(args.length() == 2);
+    MOZ_ASSERT(args[0].isObject());
+    MOZ_ASSERT(args[1].isNumber());
 
     RootedObject numberFormat(cx, &args[0].toObject());
 
     // Obtain a UNumberFormat object, cached if possible.
     bool isNumberFormatInstance = numberFormat->getClass() == &NumberFormatClass;
     UNumberFormat *nf;
     if (isNumberFormatInstance) {
         nf = static_cast<UNumberFormat*>(numberFormat->getReservedSlot(UNUMBER_FORMAT_SLOT).toPrivate());
@@ -1601,17 +1601,17 @@ DateTimeFormat(JSContext *cx, unsigned a
     CallArgs args = CallArgsFromVp(argc, vp);
     return DateTimeFormat(cx, args, args.isConstructing());
 }
 
 bool
 js::intl_DateTimeFormat(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 2);
+    MOZ_ASSERT(args.length() == 2);
     // intl_DateTimeFormat is an intrinsic for self-hosted JavaScript, so it
     // cannot be used with "new", but it still has to be treated as a
     // constructor.
     return DateTimeFormat(cx, args, true);
 }
 
 static void
 dateTimeFormat_finalize(FreeOp *fop, JSObject *obj)
@@ -1686,17 +1686,17 @@ GlobalObject::initDateTimeFormatProto(JS
     global->setReservedSlot(DATE_TIME_FORMAT_PROTO, ObjectValue(*proto));
     return true;
 }
 
 bool
 js::intl_DateTimeFormat_availableLocales(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 0);
+    MOZ_ASSERT(args.length() == 0);
 
     RootedValue result(cx);
     if (!intl_availableLocales(cx, udat_countAvailable, udat_getAvailable, &result))
         return false;
     args.rval().set(result);
     return true;
 }
 
@@ -1713,18 +1713,18 @@ bcp47CalendarName(const char *icuName)
         return "islamicc";
     return icuName;
 }
 
 bool
 js::intl_availableCalendars(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
-    JS_ASSERT(args[0].isString());
+    MOZ_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args[0].isString());
 
     JSAutoByteString locale(cx, args[0].toString());
     if (!locale)
         return false;
 
     RootedObject calendars(cx, NewDenseEmptyArray(cx));
     if (!calendars)
         return false;
@@ -1778,19 +1778,19 @@ js::intl_availableCalendars(JSContext *c
     args.rval().setObject(*calendars);
     return true;
 }
 
 bool
 js::intl_patternForSkeleton(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 2);
-    JS_ASSERT(args[0].isString());
-    JS_ASSERT(args[1].isString());
+    MOZ_ASSERT(args.length() == 2);
+    MOZ_ASSERT(args[0].isString());
+    MOZ_ASSERT(args[1].isString());
 
     JSAutoByteString locale(cx, args[0].toString());
     if (!locale)
         return false;
 
     JSFlatString *skeletonFlat = args[1].toString()->ensureFlat(cx);
     if (!skeletonFlat)
         return false;
@@ -1951,19 +1951,19 @@ intl_FormatDateTime(JSContext *cx, UDate
     result.setString(str);
     return true;
 }
 
 bool
 js::intl_FormatDateTime(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 2);
-    JS_ASSERT(args[0].isObject());
-    JS_ASSERT(args[1].isNumber());
+    MOZ_ASSERT(args.length() == 2);
+    MOZ_ASSERT(args[0].isObject());
+    MOZ_ASSERT(args[1].isNumber());
 
     RootedObject dateTimeFormat(cx, &args[0].toObject());
 
     // Obtain a UDateFormat object, cached if possible.
     bool isDateTimeFormatInstance = dateTimeFormat->getClass() == &DateTimeFormatClass;
     UDateFormat *df;
     if (isDateTimeFormatInstance) {
         df = static_cast<UDateFormat*>(dateTimeFormat->getReservedSlot(UDATE_FORMAT_SLOT).toPrivate());
@@ -2029,17 +2029,17 @@ static const JSFunctionSpec intl_static_
 
 /**
  * Initializes the Intl Object and its standard built-in properties.
  * Spec: ECMAScript Internationalization API Specification, 8.0, 8.1
  */
 JSObject *
 js_InitIntlClass(JSContext *cx, HandleObject obj)
 {
-    JS_ASSERT(obj->is<GlobalObject>());
+    MOZ_ASSERT(obj->is<GlobalObject>());
     Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
 
     // The constructors above need to be able to determine whether they've been
     // called with this being "the standard built-in Intl object". The global
     // object reserves slots to track standard built-in objects, but doesn't
     // normally keep references to non-constructors. This makes sure there is one.
     RootedObject Intl(cx, global->getOrCreateIntlObject(cx));
     if (!Intl)
--- a/js/src/builtin/MapObject.cpp
+++ b/js/src/builtin/MapObject.cpp
@@ -793,18 +793,18 @@ HashableValue::setValue(JSContext *cx, H
             value = DoubleNaNValue();
         } else {
             value = v;
         }
     } else {
         value = v;
     }
 
-    JS_ASSERT(value.isUndefined() || value.isNull() || value.isBoolean() || value.isNumber() ||
-              value.isString() || value.isSymbol() || value.isObject());
+    MOZ_ASSERT(value.isUndefined() || value.isNull() || value.isBoolean() || value.isNumber() ||
+               value.isString() || value.isSymbol() || value.isObject());
     return true;
 }
 
 HashNumber
 HashableValue::hash() const
 {
     // HashableValue::setValue normalizes values so that the SameValue relation
     // on HashableValues is the same as the == relationship on
@@ -815,18 +815,18 @@ HashableValue::hash() const
 bool
 HashableValue::operator==(const HashableValue &other) const
 {
     // Two HashableValues are equal if they have equal bits.
     bool b = (value.asRawBits() == other.value.asRawBits());
 
 #ifdef DEBUG
     bool same;
-    JS_ASSERT(SameValue(nullptr, value, other.value, &same));
-    JS_ASSERT(same == b);
+    MOZ_ASSERT(SameValue(nullptr, value, other.value, &same));
+    MOZ_ASSERT(same == b);
 #endif
     return b;
 }
 
 HashableValue
 HashableValue::mark(JSTracer *trc) const
 {
     HashableValue hv(*this);
@@ -886,17 +886,17 @@ MapIteratorObject::range()
 {
     return static_cast<ValueMap::Range *>(getSlot(RangeSlot).toPrivate());
 }
 
 inline MapObject::IteratorKind
 MapIteratorObject::kind() const
 {
     int32_t i = getSlot(KindSlot).toInt32();
-    JS_ASSERT(i == MapObject::Keys || i == MapObject::Values || i == MapObject::Entries);
+    MOZ_ASSERT(i == MapObject::Keys || i == MapObject::Values || i == MapObject::Entries);
     return MapObject::IteratorKind(i);
 }
 
 bool
 GlobalObject::initMapIteratorProto(JSContext *cx, Handle<GlobalObject *> global)
 {
     JSObject *base = GlobalObject::getOrCreateIteratorPrototype(cx, global);
     if (!base)
@@ -1118,18 +1118,18 @@ class OrderedHashTableRef : public gc::B
 {
     TableType *table;
     Value key;
 
   public:
     explicit OrderedHashTableRef(TableType *t, const Value &k) : table(t), key(k) {}
 
     void mark(JSTracer *trc) {
-        JS_ASSERT(UnbarrieredHashPolicy::hash(key) ==
-                  HashableValue::Hasher::hash(*reinterpret_cast<HashableValue*>(&key)));
+        MOZ_ASSERT(UnbarrieredHashPolicy::hash(key) ==
+                   HashableValue::Hasher::hash(*reinterpret_cast<HashableValue*>(&key)));
         Value prior = key;
         gc::MarkValueUnbarriered(trc, &key, "ordered hash table key");
         table->rekeyOneEntry(prior, key);
     }
 };
 #endif
 
 inline static void
@@ -1284,25 +1284,25 @@ MapObject::is(HandleValue v)
 #define ARG0_KEY(cx, args, key)                                               \
     AutoHashableValueRooter key(cx);                                          \
     if (args.length() > 0 && !key.setValue(cx, args[0]))                      \
         return false
 
 ValueMap &
 MapObject::extract(CallReceiver call)
 {
-    JS_ASSERT(call.thisv().isObject());
-    JS_ASSERT(call.thisv().toObject().hasClass(&MapObject::class_));
+    MOZ_ASSERT(call.thisv().isObject());
+    MOZ_ASSERT(call.thisv().toObject().hasClass(&MapObject::class_));
     return *call.thisv().toObject().as<MapObject>().getData();
 }
 
 bool
 MapObject::size_impl(JSContext *cx, CallArgs args)
 {
-    JS_ASSERT(MapObject::is(args.thisv()));
+    MOZ_ASSERT(MapObject::is(args.thisv()));
 
     ValueMap &map = extract(args);
     JS_STATIC_ASSERT(sizeof map.count() <= sizeof(uint32_t));
     args.rval().setNumber(map.count());
     return true;
 }
 
 bool
@@ -1310,17 +1310,17 @@ MapObject::size(JSContext *cx, unsigned 
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<MapObject::is, MapObject::size_impl>(cx, args);
 }
 
 bool
 MapObject::get_impl(JSContext *cx, CallArgs args)
 {
-    JS_ASSERT(MapObject::is(args.thisv()));
+    MOZ_ASSERT(MapObject::is(args.thisv()));
 
     ValueMap &map = extract(args);
     ARG0_KEY(cx, args, key);
 
     if (ValueMap::Entry *p = map.get(key))
         args.rval().set(p->value);
     else
         args.rval().setUndefined();
@@ -1332,17 +1332,17 @@ MapObject::get(JSContext *cx, unsigned a
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<MapObject::is, MapObject::get_impl>(cx, args);
 }
 
 bool
 MapObject::has_impl(JSContext *cx, CallArgs args)
 {
-    JS_ASSERT(MapObject::is(args.thisv()));
+    MOZ_ASSERT(MapObject::is(args.thisv()));
 
     ValueMap &map = extract(args);
     ARG0_KEY(cx, args, key);
     args.rval().setBoolean(map.has(key));
     return true;
 }
 
 bool
@@ -1350,17 +1350,17 @@ MapObject::has(JSContext *cx, unsigned a
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<MapObject::is, MapObject::has_impl>(cx, args);
 }
 
 bool
 MapObject::set_impl(JSContext *cx, CallArgs args)
 {
-    JS_ASSERT(MapObject::is(args.thisv()));
+    MOZ_ASSERT(MapObject::is(args.thisv()));
 
     ValueMap &map = extract(args);
     ARG0_KEY(cx, args, key);
     RelocatableValue rval(args.get(1));
     if (!map.put(key, rval)) {
         js_ReportOutOfMemory(cx);
         return false;
     }
@@ -1383,17 +1383,17 @@ MapObject::delete_impl(JSContext *cx, Ca
     // requires that no RelocatableValue objects pointing to heap values be
     // left alive in the ValueMap.
     //
     // OrderedHashMap::remove() doesn't destroy the removed entry. It merely
     // calls OrderedHashMap::MapOps::makeEmpty. But that is sufficient, because
     // makeEmpty clears the value by doing e->value = Value(), and in the case
     // of a ValueMap, Value() means RelocatableValue(), which is the same as
     // RelocatableValue(UndefinedValue()).
-    JS_ASSERT(MapObject::is(args.thisv()));
+    MOZ_ASSERT(MapObject::is(args.thisv()));
 
     ValueMap &map = extract(args);
     ARG0_KEY(cx, args, key);
     bool found;
     if (!map.remove(key, &found)) {
         js_ReportOutOfMemory(cx);
         return false;
     }
@@ -1535,17 +1535,17 @@ SetIteratorObject::range()
 {
     return static_cast<ValueSet::Range *>(getSlot(RangeSlot).toPrivate());
 }
 
 inline SetObject::IteratorKind
 SetIteratorObject::kind() const
 {
     int32_t i = getSlot(KindSlot).toInt32();
-    JS_ASSERT(i == SetObject::Values || i == SetObject::Entries);
+    MOZ_ASSERT(i == SetObject::Values || i == SetObject::Entries);
     return SetObject::IteratorKind(i);
 }
 
 bool
 GlobalObject::initSetIteratorProto(JSContext *cx, Handle<GlobalObject*> global)
 {
     JSObject *base = GlobalObject::getOrCreateIteratorPrototype(cx, global);
     if (!base)
@@ -1813,25 +1813,25 @@ bool
 SetObject::is(HandleValue v)
 {
     return v.isObject() && v.toObject().hasClass(&class_) && v.toObject().getPrivate();
 }
 
 ValueSet &
 SetObject::extract(CallReceiver call)
 {
-    JS_ASSERT(call.thisv().isObject());
-    JS_ASSERT(call.thisv().toObject().hasClass(&SetObject::class_));
+    MOZ_ASSERT(call.thisv().isObject());
+    MOZ_ASSERT(call.thisv().toObject().hasClass(&SetObject::class_));
     return *static_cast<SetObject&>(call.thisv().toObject()).getData();
 }
 
 bool
 SetObject::size_impl(JSContext *cx, CallArgs args)
 {
-    JS_ASSERT(is(args.thisv()));
+    MOZ_ASSERT(is(args.thisv()));
 
     ValueSet &set = extract(args);
     JS_STATIC_ASSERT(sizeof set.count() <= sizeof(uint32_t));
     args.rval().setNumber(set.count());
     return true;
 }
 
 bool
@@ -1839,17 +1839,17 @@ SetObject::size(JSContext *cx, unsigned 
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<SetObject::is, SetObject::size_impl>(cx, args);
 }
 
 bool
 SetObject::has_impl(JSContext *cx, CallArgs args)
 {
-    JS_ASSERT(is(args.thisv()));
+    MOZ_ASSERT(is(args.thisv()));
 
     ValueSet &set = extract(args);
     ARG0_KEY(cx, args, key);
     args.rval().setBoolean(set.has(key));
     return true;
 }
 
 bool
@@ -1857,17 +1857,17 @@ SetObject::has(JSContext *cx, unsigned a
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<SetObject::is, SetObject::has_impl>(cx, args);
 }
 
 bool
 SetObject::add_impl(JSContext *cx, CallArgs args)
 {
-    JS_ASSERT(is(args.thisv()));
+    MOZ_ASSERT(is(args.thisv()));
 
     ValueSet &set = extract(args);
     ARG0_KEY(cx, args, key);
     if (!set.put(key)) {
         js_ReportOutOfMemory(cx);
         return false;
     }
     WriteBarrierPost(cx->runtime(), &set, key.get());
@@ -1880,17 +1880,17 @@ SetObject::add(JSContext *cx, unsigned a
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<SetObject::is, SetObject::add_impl>(cx, args);
 }
 
 bool
 SetObject::delete_impl(JSContext *cx, CallArgs args)
 {
-    JS_ASSERT(is(args.thisv()));
+    MOZ_ASSERT(is(args.thisv()));
 
     ValueSet &set = extract(args);
     ARG0_KEY(cx, args, key);
     bool found;
     if (!set.remove(key, &found)) {
         js_ReportOutOfMemory(cx);
         return false;
     }
--- a/js/src/builtin/Object.cpp
+++ b/js/src/builtin/Object.cpp
@@ -869,17 +869,17 @@ obj_keys(JSContext *cx, unsigned argc, V
             str = Int32ToString<CanGC>(cx, JSID_TO_INT(id));
             if (!str)
                 return false;
         }
         namelist.infallibleAppend(StringValue(str));
     }
 
     // Step 11.
-    JS_ASSERT(props.length() <= UINT32_MAX);
+    MOZ_ASSERT(props.length() <= UINT32_MAX);
     JSObject *aobj = NewDenseCopiedArray(cx, uint32_t(namelist.length()), namelist.begin());
     if (!aobj)
         return false;
 
     args.rval().setObject(*aobj);
     return true;
 }
 
--- a/js/src/builtin/RegExp.cpp
+++ b/js/src/builtin/RegExp.cpp
@@ -21,17 +21,17 @@ using namespace js::types;
 
 using mozilla::ArrayLength;
 using mozilla::Maybe;
 
 bool
 js::CreateRegExpMatchResult(JSContext *cx, HandleString input, const MatchPairs &matches,
                             MutableHandleValue rval)
 {
-    JS_ASSERT(input);
+    MOZ_ASSERT(input);
 
     /*
      * Create the (slow) result array for a match.
      *
      * Array contents:
      *  0:              matched string
      *  1..pairCount-1: paren matches
      *  input:          input string
@@ -39,28 +39,28 @@ js::CreateRegExpMatchResult(JSContext *c
      */
 
     /* Get the templateObject that defines the shape and type of the output object */
     JSObject *templateObject = cx->compartment()->regExps.getOrCreateMatchResultTemplateObject(cx);
     if (!templateObject)
         return false;
 
     size_t numPairs = matches.length();
-    JS_ASSERT(numPairs > 0);
+    MOZ_ASSERT(numPairs > 0);
 
     RootedObject arr(cx, NewDenseFullyAllocatedArrayWithTemplate(cx, numPairs, templateObject));
     if (!arr)
         return false;
 
     /* Store a Value for each pair. */
     for (size_t i = 0; i < numPairs; i++) {
         const MatchPair &pair = matches[i];
 
         if (pair.isUndefined()) {
-            JS_ASSERT(i != 0); /* Since we had a match, first pair must be present. */
+            MOZ_ASSERT(i != 0); /* Since we had a match, first pair must be present. */
             arr->setDenseInitializedLength(i + 1);
             arr->initDenseElementWithType(cx, i, UndefinedValue());
         } else {
             JSLinearString *str = NewDependentString(cx, input, pair.start, pair.length());
             if (!str)
                 return false;
             arr->setDenseInitializedLength(i + 1);
 
@@ -76,21 +76,21 @@ js::CreateRegExpMatchResult(JSContext *c
     /* Set the |input| property. (TemplateObject positions it in slot 1) */
     arr->nativeSetSlot(1, StringValue(input));
 
 #ifdef DEBUG
     RootedValue test(cx);
     RootedId id(cx, NameToId(cx->names().index));
     if (!baseops::GetProperty(cx, arr, id, &test))
         return false;
-    JS_ASSERT(test == arr->nativeGetSlot(0));
+    MOZ_ASSERT(test == arr->nativeGetSlot(0));
     id = NameToId(cx->names().input);
     if (!baseops::GetProperty(cx, arr, id, &test))
         return false;
-    JS_ASSERT(test == arr->nativeGetSlot(1));
+    MOZ_ASSERT(test == arr->nativeGetSlot(1));
 #endif
 
     rval.setObject(*arr);
     return true;
 }
 
 static RegExpRunStatus
 ExecuteRegExpImpl(JSContext *cx, RegExpStatics *res, RegExpShared &re, HandleLinearString input,
@@ -311,17 +311,17 @@ MOZ_ALWAYS_INLINE bool
 IsRegExp(HandleValue v)
 {
     return v.isObject() && v.toObject().is<RegExpObject>();
 }
 
 MOZ_ALWAYS_INLINE bool
 regexp_compile_impl(JSContext *cx, CallArgs args)
 {
-    JS_ASSERT(IsRegExp(args.thisv()));
+    MOZ_ASSERT(IsRegExp(args.thisv()));
     RegExpObjectBuilder builder(cx, &args.thisv().toObject().as<RegExpObject>());
     return CompileRegExpObject(cx, builder, args);
 }
 
 static bool
 regexp_compile(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
@@ -350,17 +350,17 @@ regexp_construct(JSContext *cx, unsigned
 
     RegExpObjectBuilder builder(cx);
     return CompileRegExpObject(cx, builder, args);
 }
 
 MOZ_ALWAYS_INLINE bool
 regexp_toString_impl(JSContext *cx, CallArgs args)
 {
-    JS_ASSERT(IsRegExp(args.thisv()));
+    MOZ_ASSERT(IsRegExp(args.thisv()));
 
     JSString *str = args.thisv().toObject().as<RegExpObject>().toString(cx);
     if (!str)
         return false;
 
     args.rval().setString(str);
     return true;
 }
@@ -499,17 +499,17 @@ static const JSPropertySpec regexp_stati
     JS_PSG("$`", static_leftContext_getter, JSPROP_PERMANENT),
     JS_PSG("$'", static_rightContext_getter, JSPROP_PERMANENT),
     JS_PS_END
 };
 
 JSObject *
 js_InitRegExpClass(JSContext *cx, HandleObject obj)
 {
-    JS_ASSERT(obj->isNative());
+    MOZ_ASSERT(obj->isNative());
 
     Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
 
     RootedObject proto(cx, global->createBlankPrototype(cx, &RegExpObject::class_));
     if (!proto)
         return nullptr;
     proto->setPrivate(nullptr);
 
@@ -680,19 +680,19 @@ js::regexp_exec_raw(JSContext *cx, Handl
 {
     return regexp_exec_impl(cx, regexp, input, UpdateRegExpStatics, output);
 }
 
 bool
 js::regexp_exec_no_statics(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 2);
-    JS_ASSERT(IsRegExp(args[0]));
-    JS_ASSERT(args[1].isString());
+    MOZ_ASSERT(args.length() == 2);
+    MOZ_ASSERT(IsRegExp(args[0]));
+    MOZ_ASSERT(args[1].isString());
 
     RootedObject regexp(cx, &args[0].toObject());
     RootedString string(cx, args[1].toString());
 
     return regexp_exec_impl(cx, regexp, string, DontUpdateRegExpStatics, args.rval());
 }
 
 /* ES5 15.10.6.3. */
@@ -719,19 +719,19 @@ js::regexp_test(JSContext *cx, unsigned 
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod(cx, IsRegExp, regexp_test_impl, args);
 }
 
 bool
 js::regexp_test_no_statics(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 2);
-    JS_ASSERT(IsRegExp(args[0]));
-    JS_ASSERT(args[1].isString());
+    MOZ_ASSERT(args.length() == 2);
+    MOZ_ASSERT(IsRegExp(args[0]));
+    MOZ_ASSERT(args[1].isString());
 
     RootedObject regexp(cx, &args[0].toObject());
     RootedString string(cx, args[1].toString());
 
     RegExpRunStatus status = ExecuteRegExp(cx, regexp, string, nullptr, DontUpdateRegExpStatics);
     args.rval().setBoolean(status == RegExpRunStatus_Success);
     return status != RegExpRunStatus_Error;
 }
--- a/js/src/builtin/SIMD.cpp
+++ b/js/src/builtin/SIMD.cpp
@@ -699,28 +699,28 @@ SIMDObject::initClass(JSContext *cx, Han
     global->setFloat32x4TypeDescr(*float32x4Object);
     global->setInt32x4TypeDescr(*int32x4Object);
     return SIMD;
 }
 
 JSObject *
 js_InitSIMDClass(JSContext *cx, HandleObject obj)
 {
-    JS_ASSERT(obj->is<GlobalObject>());
+    MOZ_ASSERT(obj->is<GlobalObject>());
     Rooted<GlobalObject *> global(cx, &obj->as<GlobalObject>());
     return SIMDObject::initClass(cx, global);
 }
 
 template<typename V>
 JSObject *
 js::CreateSimd(JSContext *cx, typename V::Elem *data)
 {
     typedef typename V::Elem Elem;
     Rooted<TypeDescr*> typeDescr(cx, &V::GetTypeDescr(*cx->global()));
-    JS_ASSERT(typeDescr);
+    MOZ_ASSERT(typeDescr);
 
     Rooted<TypedObject *> result(cx, OutlineTypedObject::createZeroed(cx, typeDescr, 0));
     if (!result)
         return nullptr;
 
     Elem *resultMem = reinterpret_cast<Elem *>(result->typedMem());
     memcpy(resultMem, data, sizeof(Elem) * V::lanes);
     return result;
@@ -956,17 +956,17 @@ FuncWith(JSContext *cx, unsigned argc, V
 
     if (args[1].isNumber()) {
         Elem withAsNumber;
         if (!V::toType(cx, args[1], &withAsNumber))
             return false;
         for (unsigned i = 0; i < V::lanes; i++)
             result[i] = OpWith<Elem>::apply(i, withAsNumber, val[i]);
     } else {
-        JS_ASSERT(args[1].isBoolean());
+        MOZ_ASSERT(args[1].isBoolean());
         bool withAsBool = args[1].toBoolean();
         for (unsigned i = 0; i < V::lanes; i++)
             result[i] = OpWith<Elem>::apply(i, withAsBool, val[i]);
     }
     return StoreResult<V>(cx, args, result);
 }
 
 template<typename V>
@@ -979,34 +979,34 @@ FuncShuffle(JSContext *cx, unsigned argc
     if (args.length() != 2 && args.length() != 3)
         return ErrorBadArgs(cx);
 
     // Let L be V::Lanes. Each lane can contain L lanes, so the log2(L) first
     // bits select the first lane, the next log2(L) the second, and so on.
     const uint32_t SELECT_SHIFT = FloorLog2(V::lanes);
     const uint32_t SELECT_MASK  = V::lanes - 1;
     const int32_t MAX_MASK_VALUE = int32_t(pow(double(V::lanes), double(V::lanes))) - 1;
-    JS_ASSERT(MAX_MASK_VALUE > 0);
+    MOZ_ASSERT(MAX_MASK_VALUE > 0);
 
     Elem result[V::lanes];
     if (args.length() == 2) {
         if (!IsVectorObject<V>(args[0]) || !args[1].isInt32())
             return ErrorBadArgs(cx);
 
         Elem *val = TypedObjectMemory<Elem *>(args[0]);
         int32_t maskArg;
         if (!ToInt32(cx, args[1], &maskArg))
             return false;
         if (maskArg < 0 || maskArg > MAX_MASK_VALUE)
             return ErrorBadArgs(cx);
 
         for (unsigned i = 0; i < V::lanes; i++)
             result[i] = val[(maskArg >> (i * SELECT_SHIFT)) & SELECT_MASK];
     } else {
-        JS_ASSERT(args.length() == 3);
+        MOZ_ASSERT(args.length() == 3);
         if (!IsVectorObject<V>(args[0]) || !IsVectorObject<V>(args[1]) || !args[2].isInt32())
             return ErrorBadArgs(cx);
 
         Elem *val1 = TypedObjectMemory<Elem *>(args[0]);
         Elem *val2 = TypedObjectMemory<Elem *>(args[1]);
         int32_t maskArg;
         if (!ToInt32(cx, args[2], &maskArg))
             return false;
--- a/js/src/builtin/SymbolObject.cpp
+++ b/js/src/builtin/SymbolObject.cpp
@@ -186,17 +186,17 @@ IsSymbol(HandleValue v)
 }
 
 // ES6 rev 27 (2014 Aug 24) 19.4.3.2
 bool
 SymbolObject::toString_impl(JSContext *cx, CallArgs args)
 {
     // steps 1-3
     HandleValue thisv = args.thisv();
-    JS_ASSERT(IsSymbol(thisv));
+    MOZ_ASSERT(IsSymbol(thisv));
     Rooted<Symbol*> sym(cx, thisv.isSymbol()
                             ? thisv.toSymbol()
                             : thisv.toObject().as<SymbolObject>().unbox());
 
     // step 4
     return SymbolDescriptiveString(cx, sym, args.rval());
 }
 
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -721,17 +721,17 @@ class CountHeapTracer
     JSCountHeapNode     *traceList;
     JSCountHeapNode     *recycleList;
     bool                ok;
 };
 
 static void
 CountHeapNotify(JSTracer *trc, void **thingp, JSGCTraceKind kind)
 {
-    JS_ASSERT(trc->callback == CountHeapNotify);
+    MOZ_ASSERT(trc->callback == CountHeapNotify);
 
     CountHeapTracer *countTracer = (CountHeapTracer *)trc;
     void *thing = *thingp;
 
     if (!countTracer->ok)
         return;
 
     VisitedSet::AddPtr p = countTracer->visited.lookupForAdd(thing);
@@ -1159,17 +1159,17 @@ DisplayName(JSContext *cx, unsigned argc
 
 bool
 js::testingFunc_inParallelSection(JSContext *cx, unsigned argc, jsval *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // If we were actually *in* a parallel section, then this function
     // would be inlined to TRUE in ion-generated code.
-    JS_ASSERT(!InParallelSection());
+    MOZ_ASSERT(!InParallelSection());
     args.rval().setBoolean(false);
     return true;
 }
 
 static bool
 ShellObjectMetadataCallback(JSContext *cx, JSObject **pmetadata)
 {
     RootedObject obj(cx, NewBuiltinClassInstance(cx, &JSObject::class_));
@@ -1403,26 +1403,26 @@ class CloneBufferObject : public JSObjec
         return obj;
     }
 
     uint64_t *data() const {
         return static_cast<uint64_t*>(getReservedSlot(DATA_SLOT).toPrivate());
     }
 
     void setData(uint64_t *aData) {
-        JS_ASSERT(!data());
+        MOZ_ASSERT(!data());
         setReservedSlot(DATA_SLOT, PrivateValue(aData));
     }
 
     size_t nbytes() const {
         return getReservedSlot(LENGTH_SLOT).toInt32();
     }
 
     void setNBytes(size_t nbytes) {
-        JS_ASSERT(nbytes <= UINT32_MAX);
+        MOZ_ASSERT(nbytes <= UINT32_MAX);
         setReservedSlot(LENGTH_SLOT, Int32Value(nbytes));
     }
 
     // Discard an owned clone buffer.
     void discard() {
         if (data())
             JS_ClearStructuredClone(data(), nbytes(), nullptr, nullptr);
         setReservedSlot(DATA_SLOT, PrivateValue(nullptr));
@@ -1467,17 +1467,17 @@ class CloneBufferObject : public JSObjec
     setCloneBuffer(JSContext* cx, unsigned int argc, JS::Value* vp) {
         CallArgs args = CallArgsFromVp(argc, vp);
         return CallNonGenericMethod<is, setCloneBuffer_impl>(cx, args);
     }
 
     static bool
     getCloneBuffer_impl(JSContext* cx, CallArgs args) {
         Rooted<CloneBufferObject*> obj(cx, &args.thisv().toObject().as<CloneBufferObject>());
-        JS_ASSERT(args.length() == 0);
+        MOZ_ASSERT(args.length() == 0);
 
         if (!obj->data()) {
             args.rval().setUndefined();
             return true;
         }
 
         bool hasTransferable;
         if (!JS_StructuredCloneHasTransferables(obj->data(), obj->nbytes(), &hasTransferable))
--- a/js/src/builtin/TypedObject.cpp
+++ b/js/src/builtin/TypedObject.cpp
@@ -69,17 +69,17 @@ ToObjectIf(HandleValue value)
     if (!value.toObject().is<T>())
         return nullptr;
 
     return &value.toObject().as<T>();
 }
 
 static inline CheckedInt32 roundUpToAlignment(CheckedInt32 address, int32_t align)
 {
-    JS_ASSERT(IsPowerOfTwo(align));
+    MOZ_ASSERT(IsPowerOfTwo(align));
 
     // Note: Be careful to order operators such that we first make the
     // value smaller and then larger, so that we don't get false
     // overflow errors due to (e.g.) adding `align` and then
     // subtracting `1` afterwards when merely adding `align-1` would
     // not have overflowed. Note that due to the nature of two's
     // complement representation, if `address` is already aligned,
     // then adding `align-1` cannot itself cause an overflow.
@@ -379,17 +379,17 @@ ReferenceTypeDescr::typeName(Type type)
     MOZ_CRASH("Invalid type");
 }
 
 bool
 js::ReferenceTypeDescr::call(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
-    JS_ASSERT(args.callee().is<ReferenceTypeDescr>());
+    MOZ_ASSERT(args.callee().is<ReferenceTypeDescr>());
     Rooted<ReferenceTypeDescr *> descr(cx, &args.callee().as<ReferenceTypeDescr>());
 
     if (args.length() < 1) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr,
                              JSMSG_MORE_ARGS_NEEDED,
                              descr->typeName(), "0", "s");
         return false;
     }
@@ -1156,44 +1156,44 @@ StructTypeDescr::fieldName(size_t index)
     return fieldNames.getDenseElement(index).toString()->asAtom();
 }
 
 size_t
 StructTypeDescr::fieldOffset(size_t index) const
 {
     JSObject &fieldOffsets =
         getReservedSlot(JS_DESCR_SLOT_STRUCT_FIELD_OFFSETS).toObject();
-    JS_ASSERT(index < fieldOffsets.getDenseInitializedLength());
+    MOZ_ASSERT(index < fieldOffsets.getDenseInitializedLength());
     return AssertedCast<size_t>(fieldOffsets.getDenseElement(index).toInt32());
 }
 
 size_t
 StructTypeDescr::maybeForwardedFieldOffset(size_t index) const
 {
     JSObject &fieldOffsets =
         *MaybeForwarded(&getReservedSlot(JS_DESCR_SLOT_STRUCT_FIELD_OFFSETS).toObject());
-    JS_ASSERT(index < fieldOffsets.getDenseInitializedLength());
+    MOZ_ASSERT(index < fieldOffsets.getDenseInitializedLength());
     return AssertedCast<size_t>(fieldOffsets.getDenseElement(index).toInt32());
 }
 
 SizedTypeDescr&
 StructTypeDescr::fieldDescr(size_t index) const
 {
     JSObject &fieldDescrs =
         getReservedSlot(JS_DESCR_SLOT_STRUCT_FIELD_TYPES).toObject();
-    JS_ASSERT(index < fieldDescrs.getDenseInitializedLength());
+    MOZ_ASSERT(index < fieldDescrs.getDenseInitializedLength());
     return fieldDescrs.getDenseElement(index).toObject().as<SizedTypeDescr>();
 }
 
 SizedTypeDescr&
 StructTypeDescr::maybeForwardedFieldDescr(size_t index) const
 {
     JSObject &fieldDescrs =
         *MaybeForwarded(&getReservedSlot(JS_DESCR_SLOT_STRUCT_FIELD_TYPES).toObject());
-    JS_ASSERT(index < fieldDescrs.getDenseInitializedLength());
+    MOZ_ASSERT(index < fieldDescrs.getDenseInitializedLength());
     JSObject &descr =
         *MaybeForwarded(&fieldDescrs.getDenseElement(index).toObject());
     return descr.as<SizedTypeDescr>();
 }
 
 /******************************************************************************
  * Creating the TypedObject "module"
  *
@@ -1439,17 +1439,17 @@ GlobalObject::initTypedObjectModule(JSCo
     }
 
     return module;
 }
 
 JSObject *
 js_InitTypedObjectModuleObject(JSContext *cx, HandleObject obj)
 {
-    JS_ASSERT(obj->is<GlobalObject>());
+    MOZ_ASSERT(obj->is<GlobalObject>());
     Rooted<GlobalObject *> global(cx, &obj->as<GlobalObject>());
     return global->getOrCreateTypedObjectModule(cx);
 }
 
 JSObject *
 js_InitTypedObjectDummy(JSContext *cx, HandleObject obj)
 {
     /*
@@ -1471,28 +1471,28 @@ TypedObject::offset() const
     if (is<InlineOpaqueTypedObject>())
         return 0;
     return getReservedSlot(JS_BUFVIEW_SLOT_BYTEOFFSET).toInt32();
 }
 
 int32_t
 TypedObject::length() const
 {
-    JS_ASSERT(typeDescr().kind() == type::SizedArray ||
-              typeDescr().kind() == type::UnsizedArray);
+    MOZ_ASSERT(typeDescr().kind() == type::SizedArray ||
+               typeDescr().kind() == type::UnsizedArray);
 
     if (is<InlineOpaqueTypedObject>())
         return typeDescr().as<SizedArrayTypeDescr>().length();
     return as<OutlineTypedObject>().length();
 }
 
 uint8_t *
 TypedObject::typedMem() const
 {
-    JS_ASSERT(isAttached());
+    MOZ_ASSERT(isAttached());
 
     if (is<InlineOpaqueTypedObject>())
         return as<InlineOpaqueTypedObject>().inlineTypedMem();
     return as<OutlineTypedObject>().outOfLineTypedMem();
 }
 
 bool
 TypedObject::isAttached() const
@@ -1570,18 +1570,18 @@ PrototypeForTypeDescr(JSContext *cx, Han
 }
 
 /*static*/ OutlineTypedObject *
 OutlineTypedObject::createUnattachedWithClass(JSContext *cx,
                                               const Class *clasp,
                                               HandleTypeDescr type,
                                               int32_t length)
 {
-    JS_ASSERT(clasp == &TransparentTypedObject::class_ ||
-              clasp == &OutlineOpaqueTypedObject::class_);
+    MOZ_ASSERT(clasp == &TransparentTypedObject::class_ ||
+               clasp == &OutlineOpaqueTypedObject::class_);
 
     RootedObject proto(cx, PrototypeForTypeDescr(cx, type));
     if (!proto)
         return nullptr;
 
     RootedObject obj(cx, NewObjectWithClassProto(cx, clasp, proto, nullptr));
     if (!obj)
         return nullptr;
@@ -1592,42 +1592,42 @@ OutlineTypedObject::createUnattachedWith
     obj->initReservedSlot(JS_BUFVIEW_SLOT_OWNER, NullValue());
 
     return &obj->as<OutlineTypedObject>();
 }
 
 void
 OutlineTypedObject::attach(JSContext *cx, ArrayBufferObject &buffer, int32_t offset)
 {
-    JS_ASSERT(offset >= 0);
-    JS_ASSERT((size_t) (offset + size()) <= buffer.byteLength());
+    MOZ_ASSERT(offset >= 0);
+    MOZ_ASSERT((size_t) (offset + size()) <= buffer.byteLength());
 
     if (!buffer.addView(cx, this))
         CrashAtUnhandlableOOM("TypedObject::attach");
 
     InitArrayBufferViewDataPointer(this, &buffer, offset);
     setReservedSlot(JS_BUFVIEW_SLOT_BYTEOFFSET, Int32Value(offset));
     setReservedSlot(JS_BUFVIEW_SLOT_OWNER, ObjectValue(buffer));
 }
 
 void
 OutlineTypedObject::attach(JSContext *cx, TypedObject &typedObj, int32_t offset)
 {
-    JS_ASSERT(typedObj.isAttached());
+    MOZ_ASSERT(typedObj.isAttached());
 
     JSObject *owner = &typedObj;
     if (typedObj.is<OutlineTypedObject>()) {
         owner = &typedObj.as<OutlineTypedObject>().owner();
         offset += typedObj.offset();
     }
 
     if (owner->is<ArrayBufferObject>()) {
         attach(cx, owner->as<ArrayBufferObject>(), offset);
     } else {
-        JS_ASSERT(owner->is<InlineOpaqueTypedObject>());
+        MOZ_ASSERT(owner->is<InlineOpaqueTypedObject>());
         initPrivate(owner->as<InlineOpaqueTypedObject>().inlineTypedMem() + offset);
         PostBarrierTypedArrayObject(this);
 
         setReservedSlot(JS_BUFVIEW_SLOT_BYTEOFFSET, Int32Value(offset));
         setReservedSlot(JS_BUFVIEW_SLOT_OWNER, ObjectValue(*owner));
     }
 }
 
@@ -1651,18 +1651,18 @@ TypedObjLengthFromType(TypeDescr &descr)
     }
     MOZ_CRASH("Invalid kind");
 }
 
 /*static*/ OutlineTypedObject *
 OutlineTypedObject::createDerived(JSContext *cx, HandleSizedTypeDescr type,
                                   HandleTypedObject typedObj, int32_t offset)
 {
-    JS_ASSERT(offset <= typedObj->size());
-    JS_ASSERT(offset + type->size() <= typedObj->size());
+    MOZ_ASSERT(offset <= typedObj->size());
+    MOZ_ASSERT(offset + type->size() <= typedObj->size());
 
     int32_t length = TypedObjLengthFromType(*type);
 
     const js::Class *clasp = typedObj->is<TransparentTypedObject>()
                              ? &TransparentTypedObject::class_
                              : &OutlineOpaqueTypedObject::class_;
     Rooted<OutlineTypedObject*> obj(cx);
     obj = createUnattachedWithClass(cx, clasp, type, length);
@@ -1802,17 +1802,17 @@ OutlineTypedObject::obj_trace(JSTracer *
       }
     }
 }
 
 bool
 TypedObject::obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id,
                               MutableHandleObject objp, MutableHandleShape propp)
 {
-    JS_ASSERT(obj->is<TypedObject>());
+    MOZ_ASSERT(obj->is<TypedObject>());
 
     Rooted<TypeDescr*> descr(cx, &obj->as<TypedObject>().typeDescr());
     switch (descr->kind()) {
       case type::Scalar:
       case type::Reference:
       case type::Simd:
         break;
 
@@ -1864,17 +1864,17 @@ TypedObject::obj_lookupProperty(JSContex
     RootedId id(cx, NameToId(name));
     return obj_lookupGeneric(cx, obj, id, objp, propp);
 }
 
 bool
 TypedObject::obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index,
                                 MutableHandleObject objp, MutableHandleShape propp)
 {
-    JS_ASSERT(obj->is<TypedObject>());
+    MOZ_ASSERT(obj->is<TypedObject>());
     MarkNonNativePropertyFound(propp);
     objp.set(obj);
     return true;
 }
 
 static bool
 ReportPropertyError(JSContext *cx,
                     const unsigned errorNumber,
@@ -1921,17 +1921,17 @@ TypedObject::obj_defineElement(JSContext
         return false;
     return obj_defineGeneric(cx, obj, id, v, getter, setter, attrs);
 }
 
 bool
 TypedObject::obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject receiver,
                            HandleId id, MutableHandleValue vp)
 {
-    JS_ASSERT(obj->is<TypedObject>());
+    MOZ_ASSERT(obj->is<TypedObject>());
     Rooted<TypedObject *> typedObj(cx, &obj->as<TypedObject>());
 
     // Dispatch elements to obj_getElement:
     uint32_t index;
     if (js_IdIsIndex(id, &index))
         return obj_getElement(cx, obj, receiver, index, vp);
 
     // Handle everything else here:
@@ -1988,17 +1988,17 @@ TypedObject::obj_getProperty(JSContext *
     RootedId id(cx, NameToId(name));
     return obj_getGeneric(cx, obj, receiver, id, vp);
 }
 
 bool
 TypedObject::obj_getElement(JSContext *cx, HandleObject obj, HandleObject receiver,
                              uint32_t index, MutableHandleValue vp)
 {
-    JS_ASSERT(obj->is<TypedObject>());
+    MOZ_ASSERT(obj->is<TypedObject>());
     Rooted<TypedObject *> typedObj(cx, &obj->as<TypedObject>());
     Rooted<TypeDescr *> descr(cx, &typedObj->typeDescr());
 
     switch (descr->kind()) {
       case type::Scalar:
       case type::Reference:
       case type::Simd:
       case type::Struct:
@@ -2025,33 +2025,33 @@ TypedObject::obj_getElement(JSContext *c
 template<class T>
 /*static*/ bool
 TypedObject::obj_getArrayElement(JSContext *cx,
                                 Handle<TypedObject*> typedObj,
                                 Handle<TypeDescr*> typeDescr,
                                 uint32_t index,
                                 MutableHandleValue vp)
 {
-    JS_ASSERT(typeDescr->is<T>());
+    MOZ_ASSERT(typeDescr->is<T>());
 
     if (index >= (size_t) typedObj->length()) {
         vp.setUndefined();
         return true;
     }
 
     Rooted<SizedTypeDescr*> elementType(cx, &typeDescr->as<T>().elementType());
     size_t offset = elementType->size() * index;
     return Reify(cx, elementType, typedObj, offset, vp);
 }
 
 bool
 TypedObject::obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id,
                            MutableHandleValue vp, bool strict)
 {
-    JS_ASSERT(obj->is<TypedObject>());
+    MOZ_ASSERT(obj->is<TypedObject>());
     Rooted<TypedObject *> typedObj(cx, &obj->as<TypedObject>());
 
     uint32_t index;
     if (js_IdIsIndex(id, &index))
         return obj_setElement(cx, obj, index, vp, strict);
 
     switch (typedObj->typeDescr().kind()) {
       case type::Scalar:
@@ -2094,17 +2094,17 @@ TypedObject::obj_setProperty(JSContext *
     RootedId id(cx, NameToId(name));
     return obj_setGeneric(cx, obj, id, vp, strict);
 }
 
 bool
 TypedObject::obj_setElement(JSContext *cx, HandleObject obj, uint32_t index,
                            MutableHandleValue vp, bool strict)
 {
-    JS_ASSERT(obj->is<TypedObject>());
+    MOZ_ASSERT(obj->is<TypedObject>());
     Rooted<TypedObject *> typedObj(cx, &obj->as<TypedObject>());
     Rooted<TypeDescr *> descr(cx, &typedObj->typeDescr());
 
     switch (descr->kind()) {
       case type::Scalar:
       case type::Reference:
       case type::Simd:
       case type::Struct:
@@ -2123,17 +2123,17 @@ TypedObject::obj_setElement(JSContext *c
 template<class T>
 /*static*/ bool
 TypedObject::obj_setArrayElement(JSContext *cx,
                                 Handle<TypedObject*> typedObj,
                                 Handle<TypeDescr*> descr,
                                 uint32_t index,
                                 MutableHandleValue vp)
 {
-    JS_ASSERT(descr->is<T>());
+    MOZ_ASSERT(descr->is<T>());
 
     if (index >= (size_t) typedObj->length()) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage,
                              nullptr, JSMSG_TYPEDOBJECT_BINARYARRAY_BAD_INDEX);
         return false;
     }
 
     Rooted<SizedTypeDescr*> elementType(cx);
@@ -2242,17 +2242,17 @@ TypedObject::obj_deleteGeneric(JSContext
 }
 
 bool
 TypedObject::obj_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op,
                            MutableHandleValue statep, MutableHandleId idp)
 {
     int32_t index;
 
-    JS_ASSERT(obj->is<TypedObject>());
+    MOZ_ASSERT(obj->is<TypedObject>());
     Rooted<TypedObject *> typedObj(cx, &obj->as<TypedObject>());
     Rooted<TypeDescr *> descr(cx, &typedObj->typeDescr());
     switch (descr->kind()) {
       case type::Scalar:
       case type::Reference:
       case type::Simd:
         switch (enum_op) {
           case JSENUMERATE_INIT_ALL:
@@ -2278,17 +2278,17 @@ TypedObject::obj_enumerate(JSContext *cx
 
           case JSENUMERATE_NEXT:
             index = statep.toInt32();
 
             if (index < typedObj->length()) {
                 idp.set(INT_TO_JSID(index));
                 statep.setInt32(index + 1);
             } else {
-                JS_ASSERT(index == typedObj->length());
+                MOZ_ASSERT(index == typedObj->length());
                 statep.setNull();
             }
 
             break;
 
           case JSENUMERATE_DESTROY:
             statep.setNull();
             break;
@@ -2335,17 +2335,17 @@ OutlineTypedObject::offsetOfOwnerSlot()
 OutlineTypedObject::offsetOfDataSlot()
 {
 #ifdef DEBUG
     // Compute offset of private data based on TransparentTypedObject;
     // both OpaqueOutlineTypedObject and TransparentTypedObject have the same
     // number of slots, so no problem there.
     gc::AllocKind allocKind = gc::GetGCObjectKind(&TransparentTypedObject::class_);
     size_t nfixed = gc::GetGCKindSlots(allocKind);
-    JS_ASSERT(DATA_SLOT == nfixed - 1);
+    MOZ_ASSERT(DATA_SLOT == nfixed - 1);
 #endif
 
     return JSObject::getPrivateDataOffset(DATA_SLOT);
 }
 
 /* static */ size_t
 OutlineTypedObject::offsetOfByteOffsetSlot()
 {
@@ -2484,18 +2484,18 @@ LengthForType(TypeDescr &descr)
 }
 
 static bool
 CheckOffset(int32_t offset,
             int32_t size,
             int32_t alignment,
             int32_t bufferLength)
 {
-    JS_ASSERT(size >= 0);
-    JS_ASSERT(alignment >= 0);
+    MOZ_ASSERT(size >= 0);
+    MOZ_ASSERT(alignment >= 0);
 
     // No negative offsets.
     if (offset < 0)
         return false;
 
     // Offset (plus size) must be fully contained within the buffer.
     if (offset > bufferLength)
         return false;
@@ -2511,17 +2511,17 @@ CheckOffset(int32_t offset,
     return true;
 }
 
 /*static*/ bool
 TypedObject::constructSized(JSContext *cx, unsigned int argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
-    JS_ASSERT(args.callee().is<SizedTypeDescr>());
+    MOZ_ASSERT(args.callee().is<SizedTypeDescr>());
     Rooted<SizedTypeDescr*> callee(cx, &args.callee().as<SizedTypeDescr>());
 
     // Typed object constructors for sized types are overloaded in
     // three ways, in order of precedence:
     //
     //   new TypeObj()
     //   new TypeObj(buffer, [offset])
     //   new TypeObj(data)
@@ -2605,17 +2605,17 @@ TypedObject::constructSized(JSContext *c
     return false;
 }
 
 /*static*/ bool
 TypedObject::constructUnsized(JSContext *cx, unsigned int argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
-    JS_ASSERT(args.callee().is<TypeDescr>());
+    MOZ_ASSERT(args.callee().is<TypeDescr>());
     Rooted<UnsizedArrayTypeDescr*> callee(cx);
     callee = &args.callee().as<UnsizedArrayTypeDescr>();
 
     // Typed object constructors for unsized arrays are overloaded in
     // four ways, in order of precedence:
     //
     //   new TypeObj(buffer, [offset, [length]]) // [1]
     //   new TypeObj(length)                     // [1]
@@ -2764,37 +2764,37 @@ TypedObject::constructUnsized(JSContext 
 /******************************************************************************
  * Intrinsics
  */
 
 bool
 js::NewOpaqueTypedObject(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
-    JS_ASSERT(args[0].isObject() && args[0].toObject().is<SizedTypeDescr>());
+    MOZ_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args[0].isObject() && args[0].toObject().is<SizedTypeDescr>());
 
     Rooted<SizedTypeDescr*> descr(cx, &args[0].toObject().as<SizedTypeDescr>());
     int32_t length = TypedObjLengthFromType(*descr);
     Rooted<OutlineTypedObject*> obj(cx);
     obj = OutlineTypedObject::createUnattachedWithClass(cx, &OutlineOpaqueTypedObject::class_, descr, length);
     if (!obj)
         return false;
     args.rval().setObject(*obj);
     return true;
 }
 
 bool
 js::NewDerivedTypedObject(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 3);
-    JS_ASSERT(args[0].isObject() && args[0].toObject().is<SizedTypeDescr>());
-    JS_ASSERT(args[1].isObject() && args[1].toObject().is<TypedObject>());
-    JS_ASSERT(args[2].isInt32());
+    MOZ_ASSERT(args.length() == 3);
+    MOZ_ASSERT(args[0].isObject() && args[0].toObject().is<SizedTypeDescr>());
+    MOZ_ASSERT(args[1].isObject() && args[1].toObject().is<TypedObject>());
+    MOZ_ASSERT(args[2].isInt32());
 
     Rooted<SizedTypeDescr*> descr(cx, &args[0].toObject().as<SizedTypeDescr>());
     Rooted<TypedObject*> typedObj(cx, &args[1].toObject().as<TypedObject>());
     int32_t offset = args[2].toInt32();
 
     Rooted<TypedObject*> obj(cx);
     obj = OutlineTypedObject::createDerived(cx, descr, typedObj, offset);
     if (!obj)
@@ -2803,22 +2803,22 @@ js::NewDerivedTypedObject(JSContext *cx,
     args.rval().setObject(*obj);
     return true;
 }
 
 bool
 js::AttachTypedObject(ThreadSafeContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 3);
-    JS_ASSERT(args[2].isInt32());
+    MOZ_ASSERT(args.length() == 3);
+    MOZ_ASSERT(args[2].isInt32());
 
     OutlineTypedObject &handle = args[0].toObject().as<OutlineTypedObject>();
     TypedObject &target = args[1].toObject().as<TypedObject>();
-    JS_ASSERT(!handle.isAttached());
+    MOZ_ASSERT(!handle.isAttached());
     size_t offset = args[2].toInt32();
 
     if (cx->isForkJoinContext()) {
         LockedJSContext ncx(cx->asForkJoinContext());
         handle.attach(ncx, target, offset);
     } else {
         handle.attach(cx->asJSContext(), target, offset);
     }
@@ -2828,24 +2828,24 @@ js::AttachTypedObject(ThreadSafeContext 
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::AttachTypedObjectJitInfo,
                                       AttachTypedObjectJitInfo,
                                       js::AttachTypedObject);
 
 bool
 js::SetTypedObjectOffset(ThreadSafeContext *, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 2);
-    JS_ASSERT(args[0].isObject() && args[0].toObject().is<TypedObject>());
-    JS_ASSERT(args[1].isInt32());
+    MOZ_ASSERT(args.length() == 2);
+    MOZ_ASSERT(args[0].isObject() && args[0].toObject().is<TypedObject>());
+    MOZ_ASSERT(args[1].isInt32());
 
     OutlineTypedObject &typedObj = args[0].toObject().as<OutlineTypedObject>();
     int32_t offset = args[1].toInt32();
 
-    JS_ASSERT(typedObj.isAttached());
+    MOZ_ASSERT(typedObj.isAttached());
     int32_t oldOffset = typedObj.offset();
 
     typedObj.setPrivate((typedObj.typedMem() - oldOffset) + offset);
     typedObj.setReservedSlot(JS_BUFVIEW_SLOT_BYTEOFFSET, Int32Value(offset));
     args.rval().setUndefined();
     return true;
 }
 
@@ -2860,119 +2860,119 @@ js::intrinsic_SetTypedObjectOffset(JSCon
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::intrinsic_SetTypedObjectOffsetJitInfo,
                                       SetTypedObjectJitInfo,
                                       SetTypedObjectOffset);
 
 bool
 js::ObjectIsTypeDescr(ThreadSafeContext *, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
-    JS_ASSERT(args[0].isObject());
+    MOZ_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args[0].isObject());
     args.rval().setBoolean(args[0].toObject().is<TypeDescr>());
     return true;
 }
 
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::ObjectIsTypeDescrJitInfo, ObjectIsTypeDescrJitInfo,
                                       js::ObjectIsTypeDescr);
 
 bool
 js::ObjectIsTypedObject(ThreadSafeContext *, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
-    JS_ASSERT(args[0].isObject());
+    MOZ_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args[0].isObject());
     args.rval().setBoolean(args[0].toObject().is<TypedObject>());
     return true;
 }
 
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::ObjectIsTypedObjectJitInfo,
                                       ObjectIsTypedObjectJitInfo,
                                       js::ObjectIsTypedObject);
 
 bool
 js::ObjectIsOpaqueTypedObject(ThreadSafeContext *, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args.length() == 1);
     args.rval().setBoolean(!args[0].toObject().is<TransparentTypedObject>());
     return true;
 }
 
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::ObjectIsOpaqueTypedObjectJitInfo,
                                       ObjectIsOpaqueTypedObjectJitInfo,
                                       js::ObjectIsOpaqueTypedObject);
 
 bool
 js::ObjectIsTransparentTypedObject(ThreadSafeContext *, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args.length() == 1);
     args.rval().setBoolean(args[0].toObject().is<TransparentTypedObject>());
     return true;
 }
 
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::ObjectIsTransparentTypedObjectJitInfo,
                                       ObjectIsTransparentTypedObjectJitInfo,
                                       js::ObjectIsTransparentTypedObject);
 
 bool
 js::TypeDescrIsSimpleType(ThreadSafeContext *, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
-    JS_ASSERT(args[0].isObject());
-    JS_ASSERT(args[0].toObject().is<js::TypeDescr>());
+    MOZ_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args[0].isObject());
+    MOZ_ASSERT(args[0].toObject().is<js::TypeDescr>());
     args.rval().setBoolean(args[0].toObject().is<js::SimpleTypeDescr>());
     return true;
 }
 
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::TypeDescrIsSimpleTypeJitInfo,
                                       TypeDescrIsSimpleTypeJitInfo,
                                       js::TypeDescrIsSimpleType);
 
 bool
 js::TypeDescrIsArrayType(ThreadSafeContext *, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
-    JS_ASSERT(args[0].isObject());
-    JS_ASSERT(args[0].toObject().is<js::TypeDescr>());
+    MOZ_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args[0].isObject());
+    MOZ_ASSERT(args[0].toObject().is<js::TypeDescr>());
     JSObject& obj = args[0].toObject();
     args.rval().setBoolean(obj.is<js::SizedArrayTypeDescr>() ||
                            obj.is<js::UnsizedArrayTypeDescr>());
     return true;
 }
 
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::TypeDescrIsArrayTypeJitInfo,
                                       TypeDescrIsArrayTypeJitInfo,
                                       js::TypeDescrIsArrayType);
 
 bool
 js::TypeDescrIsSizedArrayType(ThreadSafeContext *, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
-    JS_ASSERT(args[0].isObject());
-    JS_ASSERT(args[0].toObject().is<js::TypeDescr>());
+    MOZ_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args[0].isObject());
+    MOZ_ASSERT(args[0].toObject().is<js::TypeDescr>());
     args.rval().setBoolean(args[0].toObject().is<js::SizedArrayTypeDescr>());
     return true;
 }
 
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::TypeDescrIsSizedArrayTypeJitInfo,
                                       TypeDescrIsSizedArrayTypeJitInfo,
                                       js::TypeDescrIsSizedArrayType);
 
 bool
 js::TypeDescrIsUnsizedArrayType(ThreadSafeContext *, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
-    JS_ASSERT(args[0].isObject());
-    JS_ASSERT(args[0].toObject().is<js::TypeDescr>());
+    MOZ_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args[0].isObject());
+    MOZ_ASSERT(args[0].toObject().is<js::TypeDescr>());
     args.rval().setBoolean(args[0].toObject().is<js::UnsizedArrayTypeDescr>());
     return true;
 }
 
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::TypeDescrIsUnsizedArrayTypeJitInfo,
                                       TypeDescrIsUnsizedArrayTypeJitInfo,
                                       js::TypeDescrIsUnsizedArrayType);
 
@@ -2988,70 +2988,70 @@ js::TypedObjectIsAttached(ThreadSafeCont
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::TypedObjectIsAttachedJitInfo,
                                       TypedObjectIsAttachedJitInfo,
                                       js::TypedObjectIsAttached);
 
 bool
 js::ClampToUint8(ThreadSafeContext *, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    JS_ASSERT(args.length() == 1);
-    JS_ASSERT(args[0].isNumber());
+    MOZ_ASSERT(args.length() == 1);
+    MOZ_ASSERT(args[0].isNumber());
     args.rval().setNumber(ClampDoubleToUint8(args[0].toNumber()));
     return true;
 }
 
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::ClampToUint8JitInfo, ClampToUint8JitInfo,
                                       js::ClampToUint8);
 
 bool
 js::GetTypedObjectModule(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     Rooted<GlobalObject*> global(cx, cx->global());
-    JS_ASSERT(global);
+    MOZ_ASSERT(global);
     args.rval().setObject(global->getTypedObjectModule());
     return true;
 }
 
 bool
 js::GetFloat32x4TypeDescr(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     Rooted<GlobalObject*> global(cx, cx->global());
-    JS_ASSERT(global);
+    MOZ_ASSERT(global);
     args.rval().setObject(global->float32x4TypeDescr());
     return true;
 }
 
 bool
 js::GetInt32x4TypeDescr(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     Rooted<GlobalObject*> global(cx, cx->global());
-    JS_ASSERT(global);
+    MOZ_ASSERT(global);
     args.rval().setObject(global->int32x4TypeDescr());
     return true;
 }
 
 #define JS_STORE_SCALAR_CLASS_IMPL(_constant, T, _name)                         \
 bool                                                                            \
 js::StoreScalar##T::Func(ThreadSafeContext *, unsigned argc, Value *vp)         \
 {                                                                               \
     CallArgs args = CallArgsFromVp(argc, vp);                                   \
-    JS_ASSERT(args.length() == 3);                                              \
-    JS_ASSERT(args[0].isObject() && args[0].toObject().is<TypedObject>());      \
-    JS_ASSERT(args[1].isInt32());                                               \
-    JS_ASSERT(args[2].isNumber());                                              \
+    MOZ_ASSERT(args.length() == 3);                                             \
+    MOZ_ASSERT(args[0].isObject() && args[0].toObject().is<TypedObject>());     \
+    MOZ_ASSERT(args[1].isInt32());                                              \
+    MOZ_ASSERT(args[2].isNumber());                                             \
                                                                                 \
     TypedObject &typedObj = args[0].toObject().as<TypedObject>();               \
     int32_t offset = args[1].toInt32();                                         \
                                                                                 \
     /* Should be guaranteed by the typed objects API: */                        \
-    JS_ASSERT(offset % MOZ_ALIGNOF(T) == 0);                                    \
+    MOZ_ASSERT(offset % MOZ_ALIGNOF(T) == 0);                                   \
                                                                                 \
     T *target = reinterpret_cast<T*>(typedObj.typedMem(offset));                \
     double d = args[2].toNumber();                                              \
     *target = ConvertScalar<T>(d);                                              \
     args.rval().setUndefined();                                                 \
     return true;                                                                \
 }                                                                               \
                                                                                 \
@@ -3059,73 +3059,73 @@ JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js
                                       StoreScalar##T,                           \
                                       js::StoreScalar##T::Func);
 
 #define JS_STORE_REFERENCE_CLASS_IMPL(_constant, T, _name)                      \
 bool                                                                            \
 js::StoreReference##T::Func(ThreadSafeContext *, unsigned argc, Value *vp)      \
 {                                                                               \
     CallArgs args = CallArgsFromVp(argc, vp);                                   \
-    JS_ASSERT(args.length() == 3);                                              \
-    JS_ASSERT(args[0].isObject() && args[0].toObject().is<TypedObject>());      \
-    JS_ASSERT(args[1].isInt32());                                               \
+    MOZ_ASSERT(args.length() == 3);                                             \
+    MOZ_ASSERT(args[0].isObject() && args[0].toObject().is<TypedObject>());     \
+    MOZ_ASSERT(args[1].isInt32());                                              \
                                                                                 \
     TypedObject &typedObj = args[0].toObject().as<TypedObject>();               \
     int32_t offset = args[1].toInt32();                                         \
                                                                                 \
     /* Should be guaranteed by the typed objects API: */                        \
-    JS_ASSERT(offset % MOZ_ALIGNOF(T) == 0);                                    \
+    MOZ_ASSERT(offset % MOZ_ALIGNOF(T) == 0);                                   \
                                                                                 \
     T *target = reinterpret_cast<T*>(typedObj.typedMem(offset));                \
     store(target, args[2]);                                                     \
     args.rval().setUndefined();                                                 \
     return true;                                                                \
 }                                                                               \
                                                                                 \
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::StoreReference##T::JitInfo,           \
                                       StoreReference##T,                        \
                                       js::StoreReference##T::Func);
 
 #define JS_LOAD_SCALAR_CLASS_IMPL(_constant, T, _name)                                  \
 bool                                                                                    \
 js::LoadScalar##T::Func(ThreadSafeContext *, unsigned argc, Value *vp)                  \
 {                                                                                       \
     CallArgs args = CallArgsFromVp(argc, vp);                                           \
-    JS_ASSERT(args.length() == 2);                                                      \
-    JS_ASSERT(args[0].isObject() && args[0].toObject().is<TypedObject>());              \
-    JS_ASSERT(args[1].isInt32());                                                       \
+    MOZ_ASSERT(args.length() == 2);                                                     \
+    MOZ_ASSERT(args[0].isObject() && args[0].toObject().is<TypedObject>());             \
+    MOZ_ASSERT(args[1].isInt32());                                                      \
                                                                                         \
     TypedObject &typedObj = args[0].toObject().as<TypedObject>();                       \
     int32_t offset = args[1].toInt32();                                                 \
                                                                                         \
     /* Should be guaranteed by the typed objects API: */                                \
-    JS_ASSERT(offset % MOZ_ALIGNOF(T) == 0);                                            \
+    MOZ_ASSERT(offset % MOZ_ALIGNOF(T) == 0);                                           \
                                                                                         \
     T *target = reinterpret_cast<T*>(typedObj.typedMem(offset));                        \
     args.rval().setNumber((double) *target);                                            \
     return true;                                                                        \
 }                                                                                       \
                                                                                         \
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::LoadScalar##T::JitInfo, LoadScalar##T,        \
                                       js::LoadScalar##T::Func);
 
 #define JS_LOAD_REFERENCE_CLASS_IMPL(_constant, T, _name)                       \
 bool                                                                            \
 js::LoadReference##T::Func(ThreadSafeContext *, unsigned argc, Value *vp)       \
 {                                                                               \
     CallArgs args = CallArgsFromVp(argc, vp);                                   \
-    JS_ASSERT(args.length() == 2);                                              \
-    JS_ASSERT(args[0].isObject() && args[0].toObject().is<TypedObject>());      \
-    JS_ASSERT(args[1].isInt32());                                               \
+    MOZ_ASSERT(args.length() == 2);                                             \
+    MOZ_ASSERT(args[0].isObject() && args[0].toObject().is<TypedObject>());     \
+    MOZ_ASSERT(args[1].isInt32());                                              \
                                                                                 \
     TypedObject &typedObj = args[0].toObject().as<TypedObject>();               \
     int32_t offset = args[1].toInt32();                                         \
                                                                                 \
     /* Should be guaranteed by the typed objects API: */                        \
-    JS_ASSERT(offset % MOZ_ALIGNOF(T) == 0);                                    \
+    MOZ_ASSERT(offset % MOZ_ALIGNOF(T) == 0);                                   \
                                                                                 \
     T *target = reinterpret_cast<T*>(typedObj.typedMem(offset));                \
     load(target, args.rval());                                                  \
     return true;                                                                \
 }                                                                               \
                                                                                 \
 JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(js::LoadReference##T::JitInfo,            \
                                       LoadReference##T,                         \
@@ -3139,24 +3139,24 @@ void
 StoreReferenceHeapValue::store(HeapValue *heap, const Value &v)
 {
     *heap = v;
 }
 
 void
 StoreReferenceHeapPtrObject::store(HeapPtrObject *heap, const Value &v)
 {
-    JS_ASSERT(v.isObjectOrNull()); // or else Store_object is being misused
+    MOZ_ASSERT(v.isObjectOrNull()); // or else Store_object is being misused
     *heap = v.toObjectOrNull();
 }
 
 void
 StoreReferenceHeapPtrString::store(HeapPtrString *heap, const Value &v)
 {
-    JS_ASSERT(v.isString()); // or else Store_string is being misused
+    MOZ_ASSERT(v.isString()); // or else Store_string is being misused
     *heap = v.toString();
 }
 
 void
 LoadReferenceHeapValue::load(HeapValue *heap,
                              MutableHandleValue v)
 {
     v.set(*heap);
@@ -3283,17 +3283,17 @@ js::MemoryInitVisitor::visitReference(Re
     }
 
     MOZ_CRASH("Invalid kind");
 }
 
 void
 SizedTypeDescr::initInstances(const JSRuntime *rt, uint8_t *mem, size_t length)
 {
-    JS_ASSERT(length >= 1);
+    MOZ_ASSERT(length >= 1);
 
     MemoryInitVisitor visitor(rt);
 
     // Initialize the 0th instance
     memset(mem, 0, size());
     if (opaque())
         visitReferences(*this, mem, visitor);
 
--- a/js/src/builtin/TypedObject.h
+++ b/js/src/builtin/TypedObject.h
@@ -643,17 +643,17 @@ class TypedObject : public ArrayBufferVi
     }
 
     uint8_t *typedMem(size_t offset) const {
         // It seems a bit surprising that one might request an offset
         // == size(), but it can happen when taking the "address of" a
         // 0-sized value. (In other words, we maintain the invariant
         // that `offset + size <= size()` -- this is always checked in
         // the caller's side.)
-        JS_ASSERT(offset <= (size_t) size());
+        MOZ_ASSERT(offset <= (size_t) size());
         return typedMem() + offset;
     }
 
     // Creates a new typed object whose memory is freshly allocated and
     // initialized with zeroes (or, in the case of references, an appropriate
     // default value).
     static TypedObject *createZeroed(JSContext *cx, HandleTypeDescr typeObj, int32_t length);
 
@@ -762,20 +762,20 @@ class InlineOpaqueTypedObject : public T
 {
   public:
     static const Class class_;
 
     static const size_t MaximumSize = JSObject::MAX_FIXED_SLOTS * sizeof(Value);
 
     static gc::AllocKind allocKindForTypeDescriptor(TypeDescr *descr) {
         size_t nbytes = descr->as<SizedTypeDescr>().size();
-        JS_ASSERT(nbytes <= MaximumSize);
+        MOZ_ASSERT(nbytes <= MaximumSize);
 
         size_t dataSlots = AlignBytes(nbytes, sizeof(Value) / sizeof(Value));
-        JS_ASSERT(nbytes <= dataSlots * sizeof(Value));
+        MOZ_ASSERT(nbytes <= dataSlots * sizeof(Value));
         return gc::GetGCObjectKind(dataSlots);
     }
 
     uint8_t *inlineTypedMem() const;
 
     static void obj_trace(JSTracer *trace, JSObject *object);
 
     static size_t offsetOfDataStart();
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -912,18 +912,18 @@ InitCTypeClass(JSContext* cx, HandleObje
                                       CTYPESCTOR_FLAGS);
   if (!fun)
     return nullptr;
 
   RootedObject ctor(cx, JS_GetFunctionObject(fun));
   RootedObject fnproto(cx);
   if (!JS_GetPrototype(cx, ctor, &fnproto))
     return nullptr;
-  JS_ASSERT(ctor);
-  JS_ASSERT(fnproto);
+  MOZ_ASSERT(ctor);
+  MOZ_ASSERT(fnproto);
 
   // Set up ctypes.CType.prototype.
   RootedObject prototype(cx, JS_NewObject(cx, &sCTypeProtoClass, fnproto, parent));
   if (!prototype)
     return nullptr;
 
   if (!JS_DefineProperty(cx, ctor, "prototype", prototype,
                          JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
@@ -963,17 +963,17 @@ static JSObject*
 InitCDataClass(JSContext* cx, HandleObject parent, HandleObject CTypeProto)
 {
   JSFunction* fun = JS_DefineFunction(cx, parent, "CData", ConstructAbstract, 0,
                       CTYPESCTOR_FLAGS);
   if (!fun)
     return nullptr;
 
   RootedObject ctor(cx, JS_GetFunctionObject(fun));
-  JS_ASSERT(ctor);
+  MOZ_ASSERT(ctor);
 
   // Set up ctypes.CData.__proto__ === ctypes.CType.prototype.
   // (Note that 'ctypes.CData instanceof Function' is still true, thanks to the
   // prototype chain.)
   if (!JS_SetPrototype(cx, ctor, CTypeProto))
     return nullptr;
 
   // Set up ctypes.CData.prototype.
@@ -1109,17 +1109,17 @@ InitInt64Class(JSContext* cx,
   RootedObject ctor(cx, JS_GetConstructor(cx, prototype));
   if (!ctor)
     return nullptr;
   if (!JS_FreezeObject(cx, ctor))
     return nullptr;
 
   // Redefine the 'join' function as an extended native and stash
   // ctypes.{Int64,UInt64}.prototype in a reserved slot of the new function.
-  JS_ASSERT(clasp == &sInt64ProtoClass || clasp == &sUInt64ProtoClass);
+  MOZ_ASSERT(clasp == &sInt64ProtoClass || clasp == &sUInt64ProtoClass);
   JSNative native = (clasp == &sInt64ProtoClass) ? Int64::Join : UInt64::Join;
   JSFunction* fun = js::DefineFunctionWithReserved(cx, ctor, "join", native,
                       2, CTYPESFN_FLAGS);
   if (!fun)
     return nullptr;
 
   js::SetFunctionNativeReserved(fun, SLOT_FN_INT64PROTO,
     OBJECT_TO_JSVAL(prototype));
@@ -1330,17 +1330,17 @@ IsCTypesGlobal(HandleValue v)
 {
   return v.isObject() && IsCTypesGlobal(&v.toObject());
 }
 
 // Get the JSCTypesCallbacks struct from the 'ctypes' object 'obj'.
 JSCTypesCallbacks*
 GetCallbacks(JSObject* obj)
 {
-  JS_ASSERT(IsCTypesGlobal(obj));
+  MOZ_ASSERT(IsCTypesGlobal(obj));
 
   jsval result = JS_GetReservedSlot(obj, SLOT_CALLBACKS);
   if (result.isUndefined())
     return nullptr;
 
   return static_cast<JSCTypesCallbacks*>(result.toPrivate());
 }
 
@@ -1414,18 +1414,18 @@ JS_InitCTypesClass(JSContext* cx, Handle
 
   // Seal the ctypes object, to prevent modification.
   return JS_FreezeObject(cx, ctypes);
 }
 
 JS_PUBLIC_API(void)
 JS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks* callbacks)
 {
-  JS_ASSERT(callbacks);
-  JS_ASSERT(IsCTypesGlobal(ctypesObj));
+  MOZ_ASSERT(callbacks);
+  MOZ_ASSERT(IsCTypesGlobal(ctypesObj));
 
   // Set the callbacks on a reserved slot.
   JS_SetReservedSlot(ctypesObj, SLOT_CALLBACKS, PRIVATE_TO_JSVAL(callbacks));
 }
 
 namespace js {
 
 JS_FRIEND_API(size_t)
@@ -1723,17 +1723,17 @@ jsvalToInteger(JSContext* cx, jsval val,
       return jsvalToInteger(cx, innerData, result);
     }
 
     return false;
   }
   if (val.isBoolean()) {
     // Implicitly promote boolean values to 0 or 1, like C.
     *result = val.toBoolean();
-    JS_ASSERT(*result == 0 || *result == 1);
+    MOZ_ASSERT(*result == 0 || *result == 1);
     return true;
   }
   // Don't silently convert null to an integer. It's probably a mistake.
   return false;
 }
 
 // Implicitly convert val to FloatType, allowing int, double,
 // Int64, UInt64, and CData numeric types 't' where all values of 't' are
@@ -2087,17 +2087,17 @@ IntegerToString(IntegerType i, int radix
     size_t index = sign * size_t(i - ii * IntegerType(radix));
     *--cp = "0123456789abcdefghijklmnopqrstuvwxyz"[index];
     i = ii;
   } while (i != 0);
 
   if (isNegative)
     *--cp = '-';
 
-  JS_ASSERT(cp >= buffer);
+  MOZ_ASSERT(cp >= buffer);
   result.append(cp, end);
 }
 
 template<class CharType>
 static size_t
 strnlen(const CharType* begin, size_t max)
 {
   for (const CharType* s = begin; s != begin + max; ++s)
@@ -2122,19 +2122,19 @@ static bool
 ConvertToJS(JSContext* cx,
             HandleObject typeObj,
             HandleObject parentObj,
             void* data,
             bool wantPrimitive,
             bool ownResult,
             MutableHandleValue result)
 {
-  JS_ASSERT(!parentObj || CData::IsCData(parentObj));
-  JS_ASSERT(!parentObj || !ownResult);
-  JS_ASSERT(!wantPrimitive || !ownResult);
+  MOZ_ASSERT(!parentObj || CData::IsCData(parentObj));
+  MOZ_ASSERT(!parentObj || !ownResult);
+  MOZ_ASSERT(!wantPrimitive || !ownResult);
 
   TypeCode typeCode = CType::GetTypeCode(typeObj);
 
   switch (typeCode) {
   case TYPE_void_t:
     result.setUndefined();
     break;
   case TYPE_bool:
@@ -2277,17 +2277,17 @@ static bool
 ImplicitConvert(JSContext* cx,
                 HandleValue val,
                 JSObject* targetType_,
                 void* buffer,
                 bool isArgument,
                 bool* freePointer)
 {
   RootedObject targetType(cx, targetType_);
-  JS_ASSERT(CType::IsSizeDefined(targetType));
+  MOZ_ASSERT(CType::IsSizeDefined(targetType));
 
   // First, check if val is either a CData object or a CDataFinalizer
   // of type targetType.
   JSObject* sourceData = nullptr;
   JSObject* sourceType = nullptr;
   RootedObject valObj(cx, nullptr);
   if (val.isObject()) {
     valObj = &val.toObject();
@@ -3246,17 +3246,17 @@ CType::Create(JSContext* cx,
               jsval size_,
               jsval align_,
               ffi_type* ffiType)
 {
   RootedString name(cx, name_);
   RootedValue size(cx, size_);
   RootedValue align(cx, align_);
   RootedObject parent(cx, JS_GetParent(typeProto));
-  JS_ASSERT(parent);
+  MOZ_ASSERT(parent);
 
   // Create a CType object with the properties and slots common to all CTypes.
   // Each type object 't' has:
   //   * [[Class]] "CType"
   //   * __proto__ === 'typeProto'; one of ctypes.{CType,PointerType,ArrayType,
   //     StructType}.prototype
   //   * A constructor which creates and returns a CData object, containing
   //     binary data of the given type.
@@ -3417,17 +3417,17 @@ CType::Trace(JSTracer* trc, JSObject* ob
   }
   case TYPE_function: {
     // Check if we have a FunctionInfo.
     slot = obj->getReservedSlot(SLOT_FNINFO);
     if (slot.isUndefined())
       return;
 
     FunctionInfo* fninfo = static_cast<FunctionInfo*>(slot.toPrivate());
-    JS_ASSERT(fninfo);
+    MOZ_ASSERT(fninfo);
 
     // Identify our objects to the tracer.
     JS_CallObjectTracer(trc, &fninfo->mABI, "abi");
     JS_CallObjectTracer(trc, &fninfo->mReturnType, "returnType");
     for (size_t i = 0; i < fninfo->mArgTypes.length(); ++i)
       JS_CallObjectTracer(trc, &fninfo->mArgTypes[i], "argType");
 
     break;
@@ -3448,26 +3448,26 @@ bool
 CType::IsCTypeProto(JSObject* obj)
 {
   return JS_GetClass(obj) == &sCTypeProtoClass;
 }
 
 TypeCode
 CType::GetTypeCode(JSObject* typeObj)
 {
-  JS_ASSERT(IsCType(typeObj));
+  MOZ_ASSERT(IsCType(typeObj));
 
   jsval result = JS_GetReservedSlot(typeObj, SLOT_TYPECODE);
   return TypeCode(result.toInt32());
 }
 
 bool
 CType::TypesEqual(JSObject* t1, JSObject* t2)
 {
-  JS_ASSERT(IsCType(t1) && IsCType(t2));
+  MOZ_ASSERT(IsCType(t1) && IsCType(t2));
 
   // Fast path: check for object equality.
   if (t1 == t2)
     return true;
 
   // First, perform shallow comparison.
   TypeCode c1 = GetTypeCode(t1);
   TypeCode c2 = GetTypeCode(t2);
@@ -3526,78 +3526,78 @@ CType::TypesEqual(JSObject* t1, JSObject
     // Shallow comparison is sufficient.
     return true;
   }
 }
 
 bool
 CType::GetSafeSize(JSObject* obj, size_t* result)
 {
-  JS_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::IsCType(obj));
 
   jsval size = JS_GetReservedSlot(obj, SLOT_SIZE);
 
   // The "size" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
   if (size.isInt32()) {
     *result = size.toInt32();
     return true;
   }
   if (size.isDouble()) {
     *result = Convert<size_t>(size.toDouble());
     return true;
   }
 
-  JS_ASSERT(size.isUndefined());
+  MOZ_ASSERT(size.isUndefined());
   return false;
 }
 
 size_t
 CType::GetSize(JSObject* obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::IsCType(obj));
 
   jsval size = JS_GetReservedSlot(obj, SLOT_SIZE);
 
-  JS_ASSERT(!size.isUndefined());
+  MOZ_ASSERT(!size.isUndefined());
 
   // The "size" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
   // For callers who know it can never be JSVAL_VOID, return a size_t directly.
   if (size.isInt32())
     return size.toInt32();
   return Convert<size_t>(size.toDouble());
 }
 
 bool
 CType::IsSizeDefined(JSObject* obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::IsCType(obj));
 
   jsval size = JS_GetReservedSlot(obj, SLOT_SIZE);
 
   // The "size" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
-  JS_ASSERT(size.isInt32() || size.isDouble() || size.isUndefined());
+  MOZ_ASSERT(size.isInt32() || size.isDouble() || size.isUndefined());
   return !size.isUndefined();
 }
 
 size_t
 CType::GetAlignment(JSObject* obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::IsCType(obj));
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_ALIGN);
   return static_cast<size_t>(slot.toInt32());
 }
 
 ffi_type*
 CType::GetFFIType(JSContext* cx, JSObject* obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::IsCType(obj));
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_FFITYPE);
 
   if (!slot.isUndefined()) {
     return static_cast<ffi_type*>(slot.toPrivate());
   }
 
   AutoPtr<ffi_type> result;
@@ -3618,17 +3618,17 @@ CType::GetFFIType(JSContext* cx, JSObjec
     return nullptr;
   JS_SetReservedSlot(obj, SLOT_FFITYPE, PRIVATE_TO_JSVAL(result.get()));
   return result.forget();
 }
 
 JSString*
 CType::GetName(JSContext* cx, HandleObject obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::IsCType(obj));
 
   jsval string = JS_GetReservedSlot(obj, SLOT_NAME);
   if (!string.isUndefined())
     return string.toString();
 
   // Build the type name lazily.
   JSString* name = BuildTypeName(cx, obj);
   if (!name)
@@ -3639,40 +3639,40 @@ CType::GetName(JSContext* cx, HandleObje
 
 JSObject*
 CType::GetProtoFromCtor(JSObject* obj, CTypeProtoSlot slot)
 {
   // Get ctypes.{Pointer,Array,Struct}Type.prototype from a reserved slot
   // on the type constructor.
   jsval protoslot = js::GetFunctionNativeReserved(obj, SLOT_FN_CTORPROTO);
   JSObject* proto = &protoslot.toObject();
-  JS_ASSERT(proto);
-  JS_ASSERT(CType::IsCTypeProto(proto));
+  MOZ_ASSERT(proto);
+  MOZ_ASSERT(CType::IsCTypeProto(proto));
 
   // Get the desired prototype.
   jsval result = JS_GetReservedSlot(proto, slot);
   return &result.toObject();
 }
 
 JSObject*
 CType::GetProtoFromType(JSContext* cx, JSObject* objArg, CTypeProtoSlot slot)
 {
-  JS_ASSERT(IsCType(objArg));
+  MOZ_ASSERT(IsCType(objArg));
   RootedObject obj(cx, objArg);
 
   // Get the prototype of the type object.
   RootedObject proto(cx);
   if (!JS_GetPrototype(cx, obj, &proto))
     return nullptr;
-  JS_ASSERT(proto);
-  JS_ASSERT(CType::IsCTypeProto(proto));
+  MOZ_ASSERT(proto);
+  MOZ_ASSERT(CType::IsCTypeProto(proto));
 
   // Get the requested ctypes.{Pointer,Array,Struct,Function}Type.prototype.
   jsval result = JS_GetReservedSlot(proto, slot);
-  JS_ASSERT(result.isObject());
+  MOZ_ASSERT(result.isObject());
   return &result.toObject();
 }
 
 bool
 CType::IsCTypeOrProto(HandleValue v)
 {
   if (!v.isObject())
     return false;
@@ -3822,22 +3822,22 @@ CType::ToSource(JSContext* cx, unsigned 
 
   args.rval().setString(result);
   return true;
 }
 
 bool
 CType::HasInstance(JSContext* cx, HandleObject obj, MutableHandleValue v, bool* bp)
 {
-  JS_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::IsCType(obj));
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_PROTO);
   JS::Rooted<JSObject*> prototype(cx, &slot.toObject());
-  JS_ASSERT(prototype);
-  JS_ASSERT(CData::IsCDataProto(prototype));
+  MOZ_ASSERT(prototype);
+  MOZ_ASSERT(CData::IsCDataProto(prototype));
 
   *bp = false;
   if (v.isPrimitive())
     return true;
 
   RootedObject proto(cx, &v.toObject());
   for (;;) {
     if (!JS_GetPrototype(cx, proto, &proto))
@@ -3850,27 +3850,27 @@ CType::HasInstance(JSContext* cx, Handle
     }
   }
   return true;
 }
 
 static JSObject*
 CType::GetGlobalCTypes(JSContext* cx, JSObject* objArg)
 {
-  JS_ASSERT(CType::IsCType(objArg));
+  MOZ_ASSERT(CType::IsCType(objArg));
 
   RootedObject obj(cx, objArg);
   RootedObject objTypeProto(cx);
   if (!JS_GetPrototype(cx, obj, &objTypeProto))
     return nullptr;
-  JS_ASSERT(objTypeProto);
-  JS_ASSERT(CType::IsCTypeProto(objTypeProto));
+  MOZ_ASSERT(objTypeProto);
+  MOZ_ASSERT(CType::IsCTypeProto(objTypeProto));
 
   jsval valCTypes = JS_GetReservedSlot(objTypeProto, SLOT_CTYPES);
-  JS_ASSERT(valCTypes.isObject());
+  MOZ_ASSERT(valCTypes.isObject());
   return &valCTypes.toObject();
 }
 
 /*******************************************************************************
 ** ABI implementation
 *******************************************************************************/
 
 bool
@@ -4063,20 +4063,20 @@ PointerType::ConstructData(JSContext* cx
 
   RootedObject fnObj(cx, &args[0].toObject());
   return FunctionType::ConstructData(cx, baseObj, result, fnObj, thisObj, errVal);
 }
 
 JSObject*
 PointerType::GetBaseType(JSObject* obj)
 {
-  JS_ASSERT(CType::GetTypeCode(obj) == TYPE_pointer);
+  MOZ_ASSERT(CType::GetTypeCode(obj) == TYPE_pointer);
 
   jsval type = JS_GetReservedSlot(obj, SLOT_TARGET_T);
-  JS_ASSERT(!type.isNull());
+  MOZ_ASSERT(!type.isNull());
   return &type.toObject();
 }
 
 bool
 PointerType::IsPointerType(HandleValue v)
 {
   if (!v.isObject())
     return false;
@@ -4410,71 +4410,71 @@ ArrayType::ConstructData(JSContext* cx,
   }
 
   return true;
 }
 
 JSObject*
 ArrayType::GetBaseType(JSObject* obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
-  JS_ASSERT(CType::GetTypeCode(obj) == TYPE_array);
+  MOZ_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::GetTypeCode(obj) == TYPE_array);
 
   jsval type = JS_GetReservedSlot(obj, SLOT_ELEMENT_T);
-  JS_ASSERT(!type.isNull());
+  MOZ_ASSERT(!type.isNull());
   return &type.toObject();
 }
 
 bool
 ArrayType::GetSafeLength(JSObject* obj, size_t* result)
 {
-  JS_ASSERT(CType::IsCType(obj));
-  JS_ASSERT(CType::GetTypeCode(obj) == TYPE_array);
+  MOZ_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::GetTypeCode(obj) == TYPE_array);
 
   jsval length = JS_GetReservedSlot(obj, SLOT_LENGTH);
 
   // The "length" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
   if (length.isInt32()) {
     *result = length.toInt32();
     return true;
   }
   if (length.isDouble()) {
     *result = Convert<size_t>(length.toDouble());
     return true;
   }
 
-  JS_ASSERT(length.isUndefined());
+  MOZ_ASSERT(length.isUndefined());
   return false;
 }
 
 size_t
 ArrayType::GetLength(JSObject* obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
-  JS_ASSERT(CType::GetTypeCode(obj) == TYPE_array);
+  MOZ_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::GetTypeCode(obj) == TYPE_array);
 
   jsval length = JS_GetReservedSlot(obj, SLOT_LENGTH);
 
-  JS_ASSERT(!length.isUndefined());
+  MOZ_ASSERT(!length.isUndefined());
 
   // The "length" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
   // For callers who know it can never be JSVAL_VOID, return a size_t directly.
   if (length.isInt32())
     return length.toInt32();
   return Convert<size_t>(length.toDouble());
 }
 
 ffi_type*
 ArrayType::BuildFFIType(JSContext* cx, JSObject* obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
-  JS_ASSERT(CType::GetTypeCode(obj) == TYPE_array);
-  JS_ASSERT(CType::IsSizeDefined(obj));
+  MOZ_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::GetTypeCode(obj) == TYPE_array);
+  MOZ_ASSERT(CType::IsSizeDefined(obj));
 
   JSObject* baseType = ArrayType::GetBaseType(obj);
   ffi_type* ffiBaseType = CType::GetFFIType(cx, baseType);
   if (!ffiBaseType)
     return nullptr;
 
   size_t length = ArrayType::GetLength(obj);
 
@@ -4546,17 +4546,17 @@ ArrayType::LengthGetter(JSContext* cx, J
   JSObject *obj = &args.thisv().toObject();
 
   // This getter exists for both CTypes and CDatas of the ArrayType persuasion.
   // If we're dealing with a CData, get the CType from it.
   if (CData::IsCData(obj))
     obj = CData::GetCType(obj);
 
   args.rval().set(JS_GetReservedSlot(obj, SLOT_LENGTH));
-  JS_ASSERT(args.rval().isNumber() || args.rval().isUndefined());
+  MOZ_ASSERT(args.rval().isNumber() || args.rval().isUndefined());
   return true;
 }
 
 bool
 ArrayType::Getter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
 {
   // This should never happen, but we'll check to be safe.
   if (!CData::IsCData(obj)) {
@@ -4958,19 +4958,19 @@ StructType::DefineInternal(JSContext* cx
   //  return false;
   JS_SetReservedSlot(typeObj, SLOT_PROTO, OBJECT_TO_JSVAL(prototype));
   return true;
 }
 
 ffi_type*
 StructType::BuildFFIType(JSContext* cx, JSObject* obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
-  JS_ASSERT(CType::GetTypeCode(obj) == TYPE_struct);
-  JS_ASSERT(CType::IsSizeDefined(obj));
+  MOZ_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::GetTypeCode(obj) == TYPE_struct);
+  MOZ_ASSERT(CType::IsSizeDefined(obj));
 
   const FieldInfoHash* fields = GetFieldInfo(obj);
   size_t len = fields->count();
 
   size_t structSize = CType::GetSize(obj);
   size_t structAlign = CType::GetAlignment(obj);
 
   AutoPtr<ffi_type> ffiType(cx->new_<ffi_type>());
@@ -4994,18 +4994,18 @@ StructType::BuildFFIType(JSContext* cx, 
       ffi_type* fieldType = CType::GetFFIType(cx, entry.value().mType);
       if (!fieldType)
         return nullptr;
       elements[entry.value().mIndex] = fieldType;
     }
 
   } else {
     // Represent an empty struct as having a size of 1 byte, just like C++.
-    JS_ASSERT(structSize == 1);
-    JS_ASSERT(structAlign == 1);
+    MOZ_ASSERT(structSize == 1);
+    MOZ_ASSERT(structAlign == 1);
     elements = cx->pod_malloc<ffi_type*>(2);
     if (!elements) {
       JS_ReportOutOfMemory(cx);
       return nullptr;
     }
     elements[0] = &ffi_type_uint8;
     elements[1] = nullptr;
   }
@@ -5015,19 +5015,19 @@ StructType::BuildFFIType(JSContext* cx, 
 #ifdef DEBUG
   // Perform a sanity check: the result of our struct size and alignment
   // calculations should match libffi's. We force it to do this calculation
   // by calling ffi_prep_cif.
   ffi_cif cif;
   ffiType->size = 0;
   ffiType->alignment = 0;
   ffi_status status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, ffiType.get(), nullptr);
-  JS_ASSERT(status == FFI_OK);
-  JS_ASSERT(structSize == ffiType->size);
-  JS_ASSERT(structAlign == ffiType->alignment);
+  MOZ_ASSERT(status == FFI_OK);
+  MOZ_ASSERT(structSize == ffiType->size);
+  MOZ_ASSERT(structAlign == ffiType->alignment);
 #else
   // Fill in the ffi_type's size and align fields. This makes libffi treat the
   // type as initialized; it will not recompute the values. (We assume
   // everything agrees; if it doesn't, we really want to know about it, which
   // is the purpose of the above debug-only check.)
   ffiType->size = structSize;
   ffiType->alignment = structAlign;
 #endif
@@ -5146,49 +5146,49 @@ StructType::ConstructData(JSContext* cx,
   JS_ReportError(cx, "constructor takes 0, 1, or %u arguments",
     fields->count());
   return false;
 }
 
 const FieldInfoHash*
 StructType::GetFieldInfo(JSObject* obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
-  JS_ASSERT(CType::GetTypeCode(obj) == TYPE_struct);
+  MOZ_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::GetTypeCode(obj) == TYPE_struct);
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_FIELDINFO);
-  JS_ASSERT(!slot.isUndefined() && slot.toPrivate());
+  MOZ_ASSERT(!slot.isUndefined() && slot.toPrivate());
 
   return static_cast<const FieldInfoHash*>(slot.toPrivate());
 }
 
 const FieldInfo*
 StructType::LookupField(JSContext* cx, JSObject* obj, JSFlatString *name)
 {
-  JS_ASSERT(CType::IsCType(obj));
-  JS_ASSERT(CType::GetTypeCode(obj) == TYPE_struct);
+  MOZ_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::GetTypeCode(obj) == TYPE_struct);
 
   FieldInfoHash::Ptr ptr = GetFieldInfo(obj)->lookup(name);
   if (ptr)
     return &ptr->value();
 
   JSAutoByteString bytes(cx, name);
   if (!bytes)
     return nullptr;
 
   JS_ReportError(cx, "%s does not name a field", bytes.ptr());
   return nullptr;
 }
 
 JSObject*
 StructType::BuildFieldsArray(JSContext* cx, JSObject* obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
-  JS_ASSERT(CType::GetTypeCode(obj) == TYPE_struct);
-  JS_ASSERT(CType::IsSizeDefined(obj));
+  MOZ_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::GetTypeCode(obj) == TYPE_struct);
+  MOZ_ASSERT(CType::IsSizeDefined(obj));
 
   const FieldInfoHash* fields = GetFieldInfo(obj);
   size_t len = fields->count();
 
   // Prepare a new array for the 'fields' property of the StructType.
   JS::AutoValueVector fieldsVec(cx);
   if (!fieldsVec.resize(len))
     return nullptr;
@@ -5427,17 +5427,17 @@ PrepareType(JSContext* cx, jsval type)
   }
 
   if (!CType::IsSizeDefined(result)) {
     JS_ReportError(cx, "Argument type must have defined size");
     return nullptr;
   }
 
   // libffi cannot pass types of zero size by value.
-  JS_ASSERT(CType::GetSize(result) != 0);
+  MOZ_ASSERT(CType::GetSize(result) != 0);
 
   return result;
 }
 
 static JSObject*
 PrepareReturnType(JSContext* cx, jsval type)
 {
   if (type.isPrimitive() || !CType::IsCType(type.toObjectOrNull())) {
@@ -5455,17 +5455,17 @@ PrepareReturnType(JSContext* cx, jsval t
   }
 
   if (typeCode != TYPE_void_t && !CType::IsSizeDefined(result)) {
     JS_ReportError(cx, "Return type must have defined size");
     return nullptr;
   }
 
   // libffi cannot pass types of zero size by value.
-  JS_ASSERT(typeCode == TYPE_void_t || CType::GetSize(result) != 0);
+  MOZ_ASSERT(typeCode == TYPE_void_t || CType::GetSize(result) != 0);
 
   return result;
 }
 
 static MOZ_ALWAYS_INLINE bool
 IsEllipsis(JSContext* cx, jsval v, bool* isEllipsis)
 {
   *isEllipsis = false;
@@ -5733,17 +5733,17 @@ FunctionType::CreateInternal(JSContext* 
 bool
 FunctionType::ConstructData(JSContext* cx,
                             HandleObject typeObj,
                             HandleObject dataObj,
                             HandleObject fnObj,
                             HandleObject thisObj,
                             jsval errVal)
 {
-  JS_ASSERT(CType::GetTypeCode(typeObj) == TYPE_function);
+  MOZ_ASSERT(CType::GetTypeCode(typeObj) == TYPE_function);
 
   PRFuncPtr* data = static_cast<PRFuncPtr*>(CData::GetData(dataObj));
 
   FunctionInfo* fninfo = FunctionType::GetFunctionInfo(typeObj);
   if (fninfo->mIsVariadic) {
     JS_ReportError(cx, "Can't declare a variadic callback function");
     return false;
   }
@@ -5962,21 +5962,21 @@ FunctionType::Call(JSContext* cx,
   // prepare a JS object from the result
   RootedObject returnType(cx, fninfo->mReturnType);
   return ConvertToJS(cx, returnType, NullPtr(), returnValue.mData, false, true, args.rval());
 }
 
 FunctionInfo*
 FunctionType::GetFunctionInfo(JSObject* obj)
 {
-  JS_ASSERT(CType::IsCType(obj));
-  JS_ASSERT(CType::GetTypeCode(obj) == TYPE_function);
+  MOZ_ASSERT(CType::IsCType(obj));
+  MOZ_ASSERT(CType::GetTypeCode(obj) == TYPE_function);
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_FNINFO);
-  JS_ASSERT(!slot.isUndefined() && slot.toPrivate());
+  MOZ_ASSERT(!slot.isUndefined() && slot.toPrivate());
 
   return static_cast<FunctionInfo*>(slot.toPrivate());
 }
 
 bool
 FunctionType::IsFunctionType(HandleValue v)
 {
   if (!v.isObject())
@@ -6052,40 +6052,40 @@ JSObject*
 CClosure::Create(JSContext* cx,
                  HandleObject typeObj,
                  HandleObject fnObj,
                  HandleObject thisObj,
                  jsval errVal_,
                  PRFuncPtr* fnptr)
 {
   RootedValue errVal(cx, errVal_);
-  JS_ASSERT(fnObj);
+  MOZ_ASSERT(fnObj);
 
   RootedObject result(cx, JS_NewObject(cx, &sCClosureClass, NullPtr(), NullPtr()));
   if (!result)
     return nullptr;
 
   // Get the FunctionInfo from the FunctionType.
   FunctionInfo* fninfo = FunctionType::GetFunctionInfo(typeObj);
-  JS_ASSERT(!fninfo->mIsVariadic);
-  JS_ASSERT(GetABICode(fninfo->mABI) != ABI_WINAPI);
+  MOZ_ASSERT(!fninfo->mIsVariadic);
+  MOZ_ASSERT(GetABICode(fninfo->mABI) != ABI_WINAPI);
 
   AutoPtr<ClosureInfo> cinfo(cx->new_<ClosureInfo>(JS_GetRuntime(cx)));
   if (!cinfo) {
     JS_ReportOutOfMemory(cx);
     return nullptr;
   }
 
   // Get the prototype of the FunctionType object, of class CTypeProto,
   // which stores our JSContext for use with the closure.
   RootedObject proto(cx);
   if (!JS_GetPrototype(cx, typeObj, &proto))
     return nullptr;
-  JS_ASSERT(proto);
-  JS_ASSERT(CType::IsCTypeProto(proto));
+  MOZ_ASSERT(proto);
+  MOZ_ASSERT(CType::IsCTypeProto(proto));
 
   // Get a JSContext for use with the closure.
   cinfo->cx = js::DefaultJSContext(JS_GetRuntime(cx));
 
   // Prepare the error sentinel value. It's important to do this now, because
   // we might be unable to convert the value to the proper type. If so, we want
   // the caller to know about it _now_, rather than some uncertain time in the
   // future when the error sentinel is actually needed.
@@ -6094,17 +6094,17 @@ CClosure::Create(JSContext* cx,
     // Make sure the callback returns something.
     if (CType::GetTypeCode(fninfo->mReturnType) == TYPE_void_t) {
       JS_ReportError(cx, "A void callback can't pass an error sentinel");
       return nullptr;
     }
 
     // With the exception of void, the FunctionType constructor ensures that
     // the return type has a defined size.
-    JS_ASSERT(CType::IsSizeDefined(fninfo->mReturnType));
+    MOZ_ASSERT(CType::IsSizeDefined(fninfo->mReturnType));
 
     // Allocate a buffer for the return value.
     size_t rvSize = CType::GetSize(fninfo->mReturnType);
     cinfo->errResult = result->zone()->pod_malloc<uint8_t>(rvSize);
     if (!cinfo->errResult)
       return nullptr;
 
     // Do the value conversion. This might fail, in which case we throw.