Bug 1592992 - Part 17: Remove includes for jsutil.h. r=jonco
authorAndré Bargull <andre.bargull@gmail.com>
Fri, 08 Nov 2019 11:09:40 +0000
changeset 501269 e7051eca20f58f94b68a371bb9ec2f795049e03f
parent 501268 1f4c3e6e6c7e5032c043c78fb9710152b07b929f
child 501270 75f180647de362e3673d5fb9f19efeaecc14213e
push id36784
push userrgurzau@mozilla.com
push dateFri, 08 Nov 2019 21:36:09 +0000
treeherdermozilla-central@f414b9e6d857 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1592992
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1592992 - Part 17: Remove includes for jsutil.h. r=jonco And handle the fallout of missing #includes when compiling a non-unified build. Differential Revision: https://phabricator.services.mozilla.com/D51376
js/src/builtin/Array.cpp
js/src/builtin/JSON.cpp
js/src/builtin/String.cpp
js/src/builtin/TypedObject.cpp
js/src/debugger/Object.cpp
js/src/ds/Fifo.h
js/src/ds/FixedLengthVector.h
js/src/ds/LifoAlloc.h
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/ParseNodeVerify.h
js/src/gc/ArenaList.h
js/src/gc/FindSCCs.h
js/src/gc/GC.cpp
js/src/gc/GCParallelTask.h
js/src/gc/Heap.h
js/src/gc/Nursery.cpp
js/src/gc/PublicIterators.h
js/src/gc/Scheduling.h
js/src/gc/Statistics.cpp
js/src/gc/Tracer.cpp
js/src/gc/ZoneAllocator.h
js/src/jit/BaselineBailouts.cpp
js/src/jit/InlineList.h
js/src/jit/JitFrames.cpp
js/src/jit/ProcessExecutableMemory.cpp
js/src/jit/ProcessExecutableMemory.h
js/src/jit/arm/Assembler-arm.cpp
js/src/jit/arm64/Assembler-arm64.cpp
js/src/jit/arm64/vixl/MozAssembler-vixl.cpp
js/src/jit/mips-shared/Assembler-mips-shared.cpp
js/src/jit/shared/LIR-shared.h
js/src/jsapi.cpp
js/src/jsdate.cpp
js/src/jsexn.cpp
js/src/jsutil.cpp
js/src/shell/js.cpp
js/src/shell/jsoptparse.cpp
js/src/shell/jsoptparse.h
js/src/threading/LockGuard.h
js/src/threading/Mutex.cpp
js/src/threading/ProtectedData.h
js/src/threading/Thread.h
js/src/threading/ThreadId.h
js/src/threading/posix/PosixThread.cpp
js/src/threading/windows/WindowsThread.cpp
js/src/util/DoubleToString.cpp
js/src/util/Text.h
js/src/vm/ArrayBufferObject.cpp
js/src/vm/BytecodeUtil.cpp
js/src/vm/Compression.cpp
js/src/vm/DateTime.cpp
js/src/vm/Iteration.cpp
js/src/vm/JSObject.cpp
js/src/vm/JSScript.cpp
js/src/vm/Printer.cpp
js/src/vm/RegExpObject.cpp
js/src/vm/Scope.h
js/src/vm/Stack.h
js/src/vm/Time.cpp
js/src/vm/TypeSet.h
js/src/vm/TypedArrayObject.cpp
js/src/vm/Xdr.cpp
js/src/wasm/AsmJS.cpp
--- a/js/src/builtin/Array.cpp
+++ b/js/src/builtin/Array.cpp
@@ -14,17 +14,16 @@
 #include "mozilla/TextUtils.h"
 
 #include <algorithm>
 
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "jsnum.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "ds/Sort.h"
 #include "gc/Heap.h"
 #include "jit/InlinableNatives.h"
 #include "js/Class.h"
 #include "js/Conversions.h"
 #include "js/PropertySpec.h"
 #include "util/Poison.h"
--- a/js/src/builtin/JSON.cpp
+++ b/js/src/builtin/JSON.cpp
@@ -10,17 +10,16 @@
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Range.h"
 #include "mozilla/ScopeExit.h"
 
 #include <algorithm>
 
 #include "jsnum.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "builtin/Array.h"
 #include "builtin/BigInt.h"
 #include "js/PropertySpec.h"
 #include "js/StableStringChars.h"
 #include "util/StringBuffer.h"
 #include "vm/Interpreter.h"
 #include "vm/JSAtom.h"
--- a/js/src/builtin/String.cpp
+++ b/js/src/builtin/String.cpp
@@ -19,17 +19,16 @@
 #include <algorithm>
 #include <limits>
 #include <string.h>
 #include <type_traits>
 
 #include "jsapi.h"
 #include "jsnum.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "builtin/Array.h"
 #include "builtin/Boolean.h"
 #if ENABLE_INTL_API
 #  include "builtin/intl/CommonFunctions.h"
 #endif
 #include "builtin/RegExp.h"
 #include "jit/InlinableNatives.h"
--- a/js/src/builtin/TypedObject.cpp
+++ b/js/src/builtin/TypedObject.cpp
@@ -6,18 +6,16 @@
 
 #include "builtin/TypedObject-inl.h"
 
 #include "mozilla/Casting.h"
 #include "mozilla/CheckedInt.h"
 
 #include <algorithm>
 
-#include "jsutil.h"
-
 #include "gc/Marking.h"
 #include "js/CharacterEncoding.h"
 #include "js/PropertySpec.h"
 #include "js/Vector.h"
 #include "util/StringBuffer.h"
 #include "vm/GlobalObject.h"
 #include "vm/JSFunction.h"
 #include "vm/JSObject.h"
--- a/js/src/debugger/Object.cpp
+++ b/js/src/debugger/Object.cpp
@@ -13,17 +13,16 @@
 
 #include <algorithm>
 #include <string.h>     // for size_t, strlen
 #include <type_traits>  // for remove_reference<>::type
 #include <utility>      // for move
 
 #include "jsapi.h"        // for CallArgs, RootedObject, Rooted
 #include "jsfriendapi.h"  // for GetErrorMessage
-#include "jsutil.h"       // for Min
 
 #include "builtin/Array.h"       // for NewDenseCopiedArray
 #include "debugger/Debugger.h"   // for Completion, Debugger
 #include "debugger/NoExecute.h"  // for LeaveDebuggeeNoExecute
 #include "debugger/Script.h"     // for DebuggerScript
 #include "debugger/Source.h"     // for DebuggerSource
 #include "gc/Barrier.h"          // for ImmutablePropertyNamePtr
 #include "gc/Rooting.h"          // for RootedDebuggerObject
--- a/js/src/ds/Fifo.h
+++ b/js/src/ds/Fifo.h
@@ -6,18 +6,16 @@
 
 #ifndef js_Fifo_h
 #define js_Fifo_h
 
 #include "mozilla/Move.h"
 
 #include <algorithm>
 
-#include "jsutil.h"
-
 #include "js/Vector.h"
 
 namespace js {
 
 // A first-in-first-out queue container type. Fifo calls constructors and
 // destructors of all elements added so non-PODs may be used safely. |Fifo|
 // stores the first |MinInlineCapacity| elements in-place before resorting to
 // dynamic allocation.
--- a/js/src/ds/FixedLengthVector.h
+++ b/js/src/ds/FixedLengthVector.h
@@ -8,17 +8,17 @@
 #define ds_FixedLengthVector_h
 
 #include "mozilla/Assertions.h"             // MOZ_ASSERT
 #include "mozilla/Attributes.h"             // MOZ_MUST_USE
 #include "mozilla/OperatorNewExtensions.h"  // mozilla::KnownNotNull
 
 #include <stddef.h>  // size_t
 
-#include "jsutil.h"        // js_free
+#include "js/Utility.h"    // js_free
 #include "vm/JSContext.h"  // JSContext
 
 namespace js {
 
 // A dynamically-allocated fixed-length vector with bounds checking assertions.
 template <typename T>
 class FixedLengthVector {
   // The pointer to the storage.
--- a/js/src/ds/LifoAlloc.h
+++ b/js/src/ds/LifoAlloc.h
@@ -20,18 +20,16 @@
 #include <new>
 #include <stddef.h>  // size_t
 
 // This data structure supports stacky LIFO allocation (mark/release and
 // LifoAllocScope). It does not maintain one contiguous segment; instead, it
 // maintains a bunch of linked memory segments. In order to prevent malloc/free
 // thrashing, unused segments are deallocated when garbage collection occurs.
 
-#include "jsutil.h"
-
 #include "js/UniquePtr.h"
 #include "util/Memory.h"
 #include "util/Poison.h"
 
 namespace js {
 
 namespace detail {
 
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -20,17 +20,16 @@
 #include "mozilla/Unused.h"         // mozilla::Unused
 #include "mozilla/Variant.h"        // mozilla::AsVariant
 
 #include <algorithm>
 #include <string.h>
 
 #include "jsnum.h"    // NumberToAtom
 #include "jstypes.h"  // JS_BIT
-#include "jsutil.h"   // Min
 
 #include "ds/Nestable.h"                         // Nestable
 #include "frontend/BytecodeControlStructures.h"  // NestableControl, BreakableControl, LabelControl, LoopControl, TryFinallyControl
 #include "frontend/CallOrNewEmitter.h"           // CallOrNewEmitter
 #include "frontend/CForEmitter.h"                // CForEmitter
 #include "frontend/DefaultEmitter.h"             // DefaultEmitter
 #include "frontend/DoWhileEmitter.h"             // DoWhileEmitter
 #include "frontend/ElemOpEmitter.h"              // ElemOpEmitter
--- a/js/src/frontend/ParseNodeVerify.h
+++ b/js/src/frontend/ParseNodeVerify.h
@@ -2,17 +2,16 @@
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef frontend_ParseNodeVerify_h
 #define frontend_ParseNodeVerify_h
 
-#include "jsutil.h"                       // JS_CRASH_DIAGNOSTICS
 #include "ds/LifoAlloc.h"                 // LifoAlloc
 #include "frontend/ParseNode.h"           // ParseNode
 #include "frontend/SyntaxParseHandler.h"  // SyntaxParseHandler::Node
 
 namespace js {
 namespace frontend {
 
 // In most builds, examine the given ParseNode and crash if it's not
--- a/js/src/gc/ArenaList.h
+++ b/js/src/gc/ArenaList.h
@@ -7,16 +7,18 @@
 /*
  * GC-internal definitions of ArenaList and associated heap data structures.
  */
 
 #ifndef gc_ArenaList_h
 #define gc_ArenaList_h
 
 #include "gc/AllocKind.h"
+#include "js/GCAPI.h"
+#include "js/HeapAPI.h"
 #include "js/SliceBudget.h"
 #include "js/TypeDecls.h"
 #include "threading/ProtectedData.h"
 
 namespace js {
 
 class Nursery;
 class TenuringTracer;
--- a/js/src/gc/FindSCCs.h
+++ b/js/src/gc/FindSCCs.h
@@ -7,17 +7,16 @@
 #ifndef gc_FindSCCs_h
 #define gc_FindSCCs_h
 
 #include "mozilla/Move.h"
 
 #include <algorithm>
 
 #include "jsfriendapi.h"
-#include "jsutil.h"
 
 #include "js/HashTable.h"
 
 namespace js {
 namespace gc {
 
 template <typename Node>
 struct GraphNodeBase {
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -207,17 +207,16 @@
 #ifndef XP_WIN
 #  include <sys/mman.h>
 #  include <unistd.h>
 #endif
 
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "builtin/FinalizationGroupObject.h"
 #include "debugger/DebugAPI.h"
 #include "gc/FindSCCs.h"
 #include "gc/FreeOp.h"
 #include "gc/GCInternals.h"
 #include "gc/GCLock.h"
 #include "gc/GCTrace.h"
--- a/js/src/gc/GCParallelTask.h
+++ b/js/src/gc/GCParallelTask.h
@@ -6,20 +6,25 @@
 
 #ifndef gc_GCParallelTask_h
 #define gc_GCParallelTask_h
 
 #include "mozilla/LinkedList.h"
 #include "mozilla/Move.h"
 
 #include "js/TypeDecls.h"
+#include "js/Utility.h"
 #include "threading/ProtectedData.h"
 
 namespace js {
 
+namespace gc {
+class GCRuntime;
+}
+
 class AutoLockHelperThreadState;
 struct HelperThread;
 
 // A generic task used to dispatch work to the helper thread system.
 // Users supply a function pointer to call.
 //
 // Note that we don't use virtual functions here because destructors can write
 // the vtable pointer on entry, which can causes races if synchronization
--- a/js/src/gc/Heap.h
+++ b/js/src/gc/Heap.h
@@ -5,18 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef gc_Heap_h
 #define gc_Heap_h
 
 #include "mozilla/Atomics.h"
 #include "mozilla/DebugOnly.h"
 
-#include "jsutil.h"
-
 #include "ds/BitArray.h"
 #include "gc/AllocKind.h"
 #include "gc/GCEnum.h"
 #include "js/TypeDecls.h"
 #include "util/Poison.h"
 
 namespace js {
 
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -9,18 +9,16 @@
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/Move.h"
 #include "mozilla/Unused.h"
 
 #include <algorithm>
 
-#include "jsutil.h"
-
 #include "builtin/MapObject.h"
 #include "debugger/DebugAPI.h"
 #include "gc/FreeOp.h"
 #include "gc/GCInternals.h"
 #include "gc/Memory.h"
 #include "gc/PublicIterators.h"
 #include "jit/JitFrames.h"
 #include "jit/JitRealm.h"
--- a/js/src/gc/PublicIterators.h
+++ b/js/src/gc/PublicIterators.h
@@ -13,16 +13,18 @@
 
 #include "mozilla/Maybe.h"
 
 #include "jstypes.h"
 #include "gc/GCRuntime.h"
 #include "gc/Zone.h"
 #include "vm/Compartment.h"
 
+struct JSRuntime;
+
 namespace JS {
 class JS_PUBLIC_API Realm;
 }
 
 namespace js {
 
 // Accessing the atoms zone can be dangerous because helper threads may be
 // accessing it concurrently to the main thread, so it's better to skip the
--- a/js/src/gc/Scheduling.h
+++ b/js/src/gc/Scheduling.h
@@ -307,17 +307,20 @@
 
 #ifndef gc_Scheduling_h
 #define gc_Scheduling_h
 
 #include "mozilla/Atomics.h"
 #include "mozilla/DebugOnly.h"
 
 #include "gc/GCEnum.h"
+#include "js/AllocPolicy.h"
+#include "js/GCAPI.h"
 #include "js/HashTable.h"
+#include "js/HeapAPI.h"
 #include "js/SliceBudget.h"
 #include "threading/ProtectedData.h"
 
 namespace js {
 
 class AutoLockGC;
 class ZoneAllocPolicy;
 
--- a/js/src/gc/Statistics.cpp
+++ b/js/src/gc/Statistics.cpp
@@ -11,18 +11,16 @@
 #include "mozilla/Sprintf.h"
 #include "mozilla/TimeStamp.h"
 
 #include <algorithm>
 #include <stdarg.h>
 #include <stdio.h>
 #include <type_traits>
 
-#include "jsutil.h"
-
 #include "debugger/DebugAPI.h"
 #include "gc/GC.h"
 #include "gc/Memory.h"
 #include "util/Text.h"
 #include "vm/HelperThreads.h"
 #include "vm/Runtime.h"
 #include "vm/Time.h"
 
--- a/js/src/gc/Tracer.cpp
+++ b/js/src/gc/Tracer.cpp
@@ -3,17 +3,16 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "gc/Tracer.h"
 
 #include "mozilla/DebugOnly.h"
 
-#include "jsutil.h"
 #include "NamespaceImports.h"
 
 #include "gc/GCInternals.h"
 #include "gc/PublicIterators.h"
 #include "gc/Zone.h"
 #include "util/Memory.h"
 #include "util/Text.h"
 #include "vm/BigIntType.h"
--- a/js/src/gc/ZoneAllocator.h
+++ b/js/src/gc/ZoneAllocator.h
@@ -9,16 +9,18 @@
  */
 
 #ifndef gc_ZoneAllocator_h
 #define gc_ZoneAllocator_h
 
 #include "jstypes.h"
 #include "gc/Cell.h"
 #include "gc/Scheduling.h"
+#include "js/GCAPI.h"
+#include "js/HeapAPI.h"
 #include "vm/MallocProvider.h"
 
 namespace JS {
 class JS_PUBLIC_API Zone;
 }  // namespace JS
 
 namespace js {
 
--- a/js/src/jit/BaselineBailouts.cpp
+++ b/js/src/jit/BaselineBailouts.cpp
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ScopeExit.h"
 
-#include "jsutil.h"
-
 #include "debugger/DebugAPI.h"
 #include "jit/arm/Simulator-arm.h"
 #include "jit/BaselineFrame.h"
 #include "jit/BaselineIC.h"
 #include "jit/BaselineJIT.h"
 #include "jit/CompileInfo.h"
 #include "jit/Ion.h"
 #include "jit/JitSpewer.h"
--- a/js/src/jit/InlineList.h
+++ b/js/src/jit/InlineList.h
@@ -2,17 +2,17 @@
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef jit_InlineList_h
 #define jit_InlineList_h
 
-#include "jsutil.h"
+#include "mozilla/Assertions.h"
 
 namespace js {
 
 template <typename T>
 class InlineForwardList;
 template <typename T>
 class InlineForwardListIterator;
 
--- a/js/src/jit/JitFrames.cpp
+++ b/js/src/jit/JitFrames.cpp
@@ -5,18 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jit/JitFrames-inl.h"
 
 #include "mozilla/ScopeExit.h"
 
 #include <algorithm>
 
-#include "jsutil.h"
-
 #include "gc/Marking.h"
 #include "jit/BaselineDebugModeOSR.h"
 #include "jit/BaselineFrame.h"
 #include "jit/BaselineIC.h"
 #include "jit/BaselineJIT.h"
 #include "jit/Ion.h"
 #include "jit/JitcodeMap.h"
 #include "jit/JitRealm.h"
--- a/js/src/jit/ProcessExecutableMemory.cpp
+++ b/js/src/jit/ProcessExecutableMemory.cpp
@@ -12,17 +12,16 @@
 #include "mozilla/Maybe.h"
 #include "mozilla/TaggedAnonymousMemory.h"
 #include "mozilla/XorShift128PlusRNG.h"
 
 #include <errno.h>
 
 #include "jsfriendapi.h"
 #include "jsmath.h"
-#include "jsutil.h"
 
 #include "gc/Memory.h"
 #ifdef JS_CODEGEN_ARM64
 #  include "jit/arm64/vixl/Cpu-vixl.h"
 #endif
 #include "jit/AtomicOperations.h"
 #include "threading/LockGuard.h"
 #include "threading/Mutex.h"
--- a/js/src/jit/ProcessExecutableMemory.h
+++ b/js/src/jit/ProcessExecutableMemory.h
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef jit_ProcessExecutableMemory_h
 #define jit_ProcessExecutableMemory_h
 
 #include "mozilla/Attributes.h"
 
-#include "jsutil.h"
 #include "util/Poison.h"
 
 namespace js {
 namespace jit {
 
 // Limit on the number of bytes of executable memory to prevent JIT spraying
 // attacks.
 #if JS_BITS_PER_WORD == 32
--- a/js/src/jit/arm/Assembler-arm.cpp
+++ b/js/src/jit/arm/Assembler-arm.cpp
@@ -6,18 +6,16 @@
 
 #include "jit/arm/Assembler-arm.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/Sprintf.h"
 
-#include "jsutil.h"
-
 #include "gc/Marking.h"
 #include "jit/arm/disasm/Disasm-arm.h"
 #include "jit/arm/MacroAssembler-arm.h"
 #include "jit/ExecutableAllocator.h"
 #include "jit/JitRealm.h"
 #include "jit/MacroAssembler.h"
 #include "vm/Realm.h"
 
--- a/js/src/jit/arm64/Assembler-arm64.cpp
+++ b/js/src/jit/arm64/Assembler-arm64.cpp
@@ -5,18 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jit/arm64/Assembler-arm64.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/Maybe.h"
 
-#include "jsutil.h"
-
 #include "gc/Marking.h"
 #include "jit/arm64/Architecture-arm64.h"
 #include "jit/arm64/MacroAssembler-arm64.h"
 #include "jit/arm64/vixl/Disasm-vixl.h"
 #include "jit/ExecutableAllocator.h"
 #include "jit/JitRealm.h"
 #include "vm/Realm.h"
 
--- a/js/src/jit/arm64/vixl/MozAssembler-vixl.cpp
+++ b/js/src/jit/arm64/vixl/MozAssembler-vixl.cpp
@@ -19,18 +19,16 @@
 // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "jsutil.h"
-
 #include "jit/arm64/vixl/Assembler-vixl.h"
 #include "jit/Label.h"
 
 namespace vixl {
 
 using LabelDoc = js::jit::DisassemblerSpew::LabelDoc;
 
 // Assembler
--- a/js/src/jit/mips-shared/Assembler-mips-shared.cpp
+++ b/js/src/jit/mips-shared/Assembler-mips-shared.cpp
@@ -4,18 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jit/mips-shared/Assembler-mips-shared.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MathAlgorithms.h"
 
-#include "jsutil.h"
-
 #include "gc/Marking.h"
 #include "jit/ExecutableAllocator.h"
 #include "jit/JitRealm.h"
 #include "vm/Realm.h"
 
 using mozilla::DebugOnly;
 
 using namespace js;
--- a/js/src/jit/shared/LIR-shared.h
+++ b/js/src/jit/shared/LIR-shared.h
@@ -2,18 +2,16 @@
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef jit_shared_LIR_shared_h
 #define jit_shared_LIR_shared_h
 
-#include "jsutil.h"
-
 #include "jit/AtomicOp.h"
 #include "jit/shared/Assembler-shared.h"
 #include "util/Memory.h"
 
 // This file declares LIR instructions that are common to every platform.
 
 namespace js {
 namespace jit {
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -23,17 +23,16 @@
 #include <string.h>
 
 #include "jsdate.h"
 #include "jsexn.h"
 #include "jsfriendapi.h"
 #include "jsmath.h"
 #include "jsnum.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "builtin/Array.h"
 #include "builtin/AtomicsObject.h"
 #include "builtin/Boolean.h"
 #include "builtin/Eval.h"
 #include "builtin/FinalizationGroupObject.h"
 #include "builtin/JSON.h"
 #include "builtin/MapObject.h"
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -27,17 +27,16 @@
 #include <algorithm>
 #include <math.h>
 #include <string.h>
 
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "jsnum.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "js/Conversions.h"
 #include "js/Date.h"
 #include "js/LocaleSensitive.h"
 #include "js/PropertySpec.h"
 #include "js/Wrapper.h"
 #include "util/StringBuffer.h"
 #include "util/Text.h"
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -14,17 +14,16 @@
 #include "mozilla/Sprintf.h"
 
 #include <string.h>
 #include <utility>
 
 #include "jsapi.h"
 #include "jsnum.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "gc/FreeOp.h"
 #include "gc/Marking.h"
 #include "js/CharacterEncoding.h"
 #include "js/PropertySpec.h"
 #include "js/UniquePtr.h"
 #include "js/Warnings.h"  // JS::{,Set}WarningReporter
 #include "js/Wrapper.h"
--- a/js/src/jsutil.cpp
+++ b/js/src/jsutil.cpp
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Various JS utility functions. */
 
-#include "jsutil.h"
-
 #include "mozilla/Assertions.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/ThreadLocal.h"
 
 #include <stdio.h>
 
 #include "jstypes.h"
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -55,17 +55,16 @@
 #endif
 #ifdef XP_LINUX
 #  include <sys/prctl.h>
 #endif
 
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "jstypes.h"
-#include "jsutil.h"
 #ifndef JS_WITHOUT_NSPR
 #  include "prerror.h"
 #  include "prlink.h"
 #endif
 #include "shellmoduleloader.out.h"
 
 #include "builtin/Array.h"
 #include "builtin/MapObject.h"
--- a/js/src/shell/jsoptparse.cpp
+++ b/js/src/shell/jsoptparse.cpp
@@ -4,18 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "shell/jsoptparse.h"
 
 #include <algorithm>
 #include <stdarg.h>
 
-#include "jsutil.h"
-
 #include "util/Unicode.h"
 
 using namespace js;
 using namespace js::cli;
 using namespace js::cli::detail;
 
 const char OptionParser::prognameMeta[] = "{progname}";
 
--- a/js/src/shell/jsoptparse.h
+++ b/js/src/shell/jsoptparse.h
@@ -4,18 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef shell_jsoptparse_h
 #define shell_jsoptparse_h
 
 #include <stdio.h>
 
-#include "jsutil.h"
-
 #include "js/AllocPolicy.h"
 #include "js/Vector.h"
 
 namespace js {
 namespace cli {
 
 namespace detail {
 
--- a/js/src/threading/LockGuard.h
+++ b/js/src/threading/LockGuard.h
@@ -2,16 +2,18 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef threading_LockGuard_h
 #define threading_LockGuard_h
 
+#include "mozilla/Attributes.h"
+
 namespace js {
 
 template <typename Mutex>
 class MOZ_RAII UnlockGuard;
 
 template <typename Mutex>
 class MOZ_RAII LockGuard {
   friend class UnlockGuard<Mutex>;
--- a/js/src/threading/Mutex.cpp
+++ b/js/src/threading/Mutex.cpp
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "threading/Mutex.h"
 
-#include "jsutil.h"
-
 using namespace js;
 
 #ifdef DEBUG
 
 MOZ_THREAD_LOCAL(js::Mutex*) js::Mutex::HeldMutexStack;
 
 /* static */
 bool js::Mutex::Init() { return HeldMutexStack.init(); }
--- a/js/src/threading/ProtectedData.h
+++ b/js/src/threading/ProtectedData.h
@@ -3,21 +3,22 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef threading_ProtectedData_h
 #define threading_ProtectedData_h
 
 #include "jstypes.h"
-#include "jsutil.h"
 #include "threading/LockGuard.h"
 #include "threading/Mutex.h"
 #include "threading/ThreadId.h"
 
+struct JS_PUBLIC_API JSContext;
+
 namespace JS {
 class JS_PUBLIC_API Zone;
 }
 
 namespace js {
 
 // This file provides classes for encapsulating pieces of data with a check
 // that ensures the data is only accessed if certain conditions are met.
--- a/js/src/threading/Thread.h
+++ b/js/src/threading/Thread.h
@@ -10,19 +10,18 @@
 #include "mozilla/Atomics.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Tuple.h"
 
 #include <stdint.h>
 #include <utility>
 
-#include "jsutil.h"
-
 #include "js/Initialization.h"
+#include "js/Utility.h"
 #include "threading/LockGuard.h"
 #include "threading/Mutex.h"
 #include "threading/ThreadId.h"
 #include "vm/MutexIDs.h"
 
 #ifdef XP_WIN
 #  define THREAD_RETURN_TYPE unsigned int
 #  define THREAD_CALL_API __stdcall
--- a/js/src/threading/ThreadId.h
+++ b/js/src/threading/ThreadId.h
@@ -2,18 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef threading_ThreadId_h
 #define threading_ThreadId_h
 
-#include "jsutil.h"
-
 namespace js {
 
 class ThreadId {
   class PlatformData;
   void* platformData_[2];
 
  public:
   ThreadId();
--- a/js/src/threading/posix/PosixThread.cpp
+++ b/js/src/threading/posix/PosixThread.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Assertions.h"
 
-#include "jsutil.h"
+#include "js/Utility.h"
 #include "threading/posix/ThreadPlatformData.h"
 #include "threading/Thread.h"
 
 namespace js {
 
 inline ThreadId::PlatformData* ThreadId::platformData() {
   static_assert(sizeof platformData_ >= sizeof(PlatformData),
                 "platformData_ is too small");
--- a/js/src/threading/windows/WindowsThread.cpp
+++ b/js/src/threading/windows/WindowsThread.cpp
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "jsutil.h"
 #include "threading/Thread.h"
 #include "threading/windows/ThreadPlatformData.h"
 
 namespace js {
 
 inline ThreadId::PlatformData* ThreadId::platformData() {
   static_assert(sizeof platformData_ >= sizeof(PlatformData),
                 "platformData_ is too small");
--- a/js/src/util/DoubleToString.cpp
+++ b/js/src/util/DoubleToString.cpp
@@ -8,18 +8,18 @@
  * Portable double to alphanumeric string and back converters.
  */
 
 #include "util/DoubleToString.h"
 
 #include "mozilla/EndianUtils.h"
 
 #include "jstypes.h"
-#include "jsutil.h"
 
+#include "js/Utility.h"
 #include "util/Memory.h"
 
 using namespace js;
 
 #if MOZ_LITTLE_ENDIAN
 #  define IEEE_8087
 #else
 #  define IEEE_MC68k
--- a/js/src/util/Text.h
+++ b/js/src/util/Text.h
@@ -16,17 +16,16 @@
 
 #include <algorithm>
 #include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <string>
 #include <type_traits>
 
-#include "jsutil.h"
 #include "NamespaceImports.h"
 
 #include "js/Utility.h"
 #include "util/Unicode.h"
 #include "vm/Printer.h"
 
 class JSLinearString;
 
--- a/js/src/vm/ArrayBufferObject.cpp
+++ b/js/src/vm/ArrayBufferObject.cpp
@@ -25,17 +25,16 @@
 #ifdef MOZ_VALGRIND
 #  include <valgrind/memcheck.h>
 #endif
 
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "jsnum.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "builtin/Array.h"
 #include "builtin/DataViewObject.h"
 #include "gc/Barrier.h"
 #include "gc/Memory.h"
 #include "js/ArrayBuffer.h"
 #include "js/Conversions.h"
 #include "js/MemoryMetrics.h"
--- a/js/src/vm/BytecodeUtil.cpp
+++ b/js/src/vm/BytecodeUtil.cpp
@@ -20,17 +20,16 @@
 #include <algorithm>
 #include <inttypes.h>
 #include <stdio.h>
 #include <string.h>
 
 #include "jsapi.h"
 #include "jsnum.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "frontend/BytecodeCompiler.h"
 #include "frontend/SourceNotes.h"
 #include "js/CharacterEncoding.h"
 #include "js/Printf.h"
 #include "js/Symbol.h"
 #include "util/Memory.h"
 #include "util/StringBuffer.h"
--- a/js/src/vm/Compression.cpp
+++ b/js/src/vm/Compression.cpp
@@ -6,18 +6,16 @@
 
 #include "vm/Compression.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MemoryChecking.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/ScopeExit.h"
 
-#include "jsutil.h"
-
 #include "js/Utility.h"
 #include "util/Memory.h"
 
 using namespace js;
 
 static void* zlib_alloc(void* cx, uInt items, uInt size) {
   return js_calloc(items, size);
 }
--- a/js/src/vm/DateTime.cpp
+++ b/js/src/vm/DateTime.cpp
@@ -16,18 +16,16 @@
 #include <cstring>
 #include <time.h>
 
 #if !defined(XP_WIN)
 #  include <limits.h>
 #  include <unistd.h>
 #endif /* !defined(XP_WIN) */
 
-#include "jsutil.h"
-
 #include "js/Date.h"
 #include "threading/ExclusiveData.h"
 
 #if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
 #  include "unicode/basictz.h"
 #  include "unicode/locid.h"
 #  include "unicode/timezone.h"
 #  include "unicode/unistr.h"
--- a/js/src/vm/Iteration.cpp
+++ b/js/src/vm/Iteration.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/Unused.h"
 
 #include <algorithm>
 #include <new>
 
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "builtin/Array.h"
 #include "builtin/SelfHostingDefines.h"
 #include "ds/Sort.h"
 #include "gc/FreeOp.h"
 #include "gc/Marking.h"
 #include "js/PropertySpec.h"
 #include "js/Proxy.h"
--- a/js/src/vm/JSObject.cpp
+++ b/js/src/vm/JSObject.cpp
@@ -19,17 +19,16 @@
 #include <algorithm>
 #include <string.h>
 
 #include "jsapi.h"
 #include "jsexn.h"
 #include "jsfriendapi.h"
 #include "jsnum.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "builtin/Array.h"
 #include "builtin/BigInt.h"
 #include "builtin/Eval.h"
 #include "builtin/Object.h"
 #include "builtin/String.h"
 #include "builtin/Symbol.h"
 #include "builtin/WeakSetObject.h"
--- a/js/src/vm/JSScript.cpp
+++ b/js/src/vm/JSScript.cpp
@@ -23,17 +23,16 @@
 #include <algorithm>
 #include <new>
 #include <string.h>
 #include <type_traits>
 #include <utility>
 
 #include "jsapi.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "frontend/BytecodeCompiler.h"
 #include "frontend/BytecodeEmitter.h"
 #include "frontend/SharedContext.h"
 #include "gc/FreeOp.h"
 #include "jit/BaselineJIT.h"
 #include "jit/Ion.h"
 #include "jit/IonCode.h"
--- a/js/src/vm/Printer.cpp
+++ b/js/src/vm/Printer.cpp
@@ -8,18 +8,16 @@
 
 #include "mozilla/PodOperations.h"
 #include "mozilla/Printf.h"
 #include "mozilla/RangedPtr.h"
 
 #include <stdarg.h>
 #include <stdio.h>
 
-#include "jsutil.h"
-
 #include "ds/LifoAlloc.h"
 #include "js/CharacterEncoding.h"
 #include "util/Memory.h"
 #include "util/Text.h"
 #include "util/Windows.h"
 #include "vm/JSContext.h"
 
 using mozilla::PodCopy;
--- a/js/src/vm/RegExpObject.cpp
+++ b/js/src/vm/RegExpObject.cpp
@@ -6,20 +6,16 @@
 
 #include "vm/RegExpObject.h"
 
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/PodOperations.h"
 
 #include <algorithm>
 
-#ifdef DEBUG
-#  include "jsutil.h"
-#endif
-
 #include "builtin/RegExp.h"
 #include "builtin/SelfHostingDefines.h"  // REGEXP_*_FLAG
 #include "frontend/TokenStream.h"
 #include "gc/HashUtil.h"
 #ifdef DEBUG
 #  include "irregexp/RegExpBytecode.h"
 #endif
 #include "irregexp/RegExpParser.h"
--- a/js/src/vm/Scope.h
+++ b/js/src/vm/Scope.h
@@ -8,18 +8,16 @@
 #define vm_Scope_h
 
 #include "mozilla/Maybe.h"
 #include "mozilla/TypeTraits.h"
 #include "mozilla/Variant.h"
 
 #include <stddef.h>
 
-#include "jsutil.h"
-
 #include "gc/DeletePolicy.h"
 #include "gc/Heap.h"
 #include "gc/Policy.h"
 #include "js/UbiNode.h"
 #include "js/UniquePtr.h"
 #include "util/Poison.h"
 #include "vm/BytecodeUtil.h"
 #include "vm/JSObject.h"
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -11,18 +11,16 @@
 #include "mozilla/HashFunctions.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/MaybeOneOf.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Variant.h"
 
 #include <algorithm>
 
-#include "jsutil.h"
-
 #include "gc/Rooting.h"
 #ifdef CHECK_OSIPOINT_REGISTERS
 #  include "jit/Registers.h"  // for RegisterDump
 #endif
 #include "jit/JSJitFrameIter.h"
 #include "js/RootingAPI.h"
 #include "js/TypeDecls.h"
 #include "js/UniquePtr.h"
--- a/js/src/vm/Time.cpp
+++ b/js/src/vm/Time.cpp
@@ -14,17 +14,16 @@
 #ifdef SOLARIS
 #  define _REENTRANT 1
 #endif
 #include <algorithm>
 #include <string.h>
 #include <time.h>
 
 #include "jstypes.h"
-#include "jsutil.h"
 
 #ifdef XP_WIN
 #  include <windef.h>
 #  include <winbase.h>
 #  include <crtdbg.h>   /* for _CrtSetReportMode */
 #  include <mmsystem.h> /* for timeBegin/EndPeriod */
 #  include <stdlib.h>   /* for _set_invalid_parameter_handler */
 #endif
--- a/js/src/vm/TypeSet.h
+++ b/js/src/vm/TypeSet.h
@@ -12,17 +12,16 @@
 #include "mozilla/Assertions.h"  // MOZ_ASSERT
 #include "mozilla/Attributes.h"  // MOZ_ALWAYS_INLINE
 #include "mozilla/Likely.h"      // MOZ_UNLIKELY
 
 #include <stdint.h>  // intptr_t, uintptr_t, uint8_t, uint32_t
 #include <stdio.h>   // FILE
 
 #include "jstypes.h"  // JS_BITS_PER_WORD, JS_PUBLIC_API
-#include "jsutil.h"   // JS_CRASH_DIAGNOSTICS
 
 #include "jit/IonTypes.h"      // jit::MIRType
 #include "js/GCAnnotations.h"  // JS_HAZ_GC_POINTER
 #include "js/Id.h"
 #include "js/TracingAPI.h"   // JSTracer
 #include "js/TypeDecls.h"    // IF_BIGINT
 #include "js/Utility.h"      // UniqueChars
 #include "js/Value.h"        // JSVAL_TYPE_*
--- a/js/src/vm/TypedArrayObject.cpp
+++ b/js/src/vm/TypedArrayObject.cpp
@@ -17,17 +17,16 @@
 #include <string.h>
 #ifndef XP_WIN
 #  include <sys/mman.h>
 #endif
 
 #include "jsapi.h"
 #include "jsnum.h"
 #include "jstypes.h"
-#include "jsutil.h"
 
 #include "builtin/Array.h"
 #include "builtin/DataViewObject.h"
 #include "builtin/TypedObjectConstants.h"
 #include "gc/Barrier.h"
 #include "gc/Marking.h"
 #include "jit/InlinableNatives.h"
 #include "js/Conversions.h"
--- a/js/src/vm/Xdr.cpp
+++ b/js/src/vm/Xdr.cpp
@@ -11,17 +11,16 @@
 #include "mozilla/Utf8.h"
 
 #include <algorithm>  // std::transform
 #include <string.h>
 #include <type_traits>  // std::is_same
 #include <utility>      // std::move
 
 #include "jsapi.h"
-#include "jsutil.h"
 
 #include "debugger/DebugAPI.h"
 #include "js/BuildId.h"  // JS::BuildIdCharVector
 #include "vm/EnvironmentObject.h"
 #include "vm/JSContext.h"
 #include "vm/JSScript.h"
 #include "vm/TraceLogging.h"
 
--- a/js/src/wasm/AsmJS.cpp
+++ b/js/src/wasm/AsmJS.cpp
@@ -27,17 +27,16 @@
 #include "mozilla/Unused.h"
 #include "mozilla/Utf8.h"  // mozilla::Utf8Unit
 #include "mozilla/Variant.h"
 
 #include <algorithm>
 #include <new>
 
 #include "jsmath.h"
-#include "jsutil.h"
 
 #include "frontend/ParseNode.h"
 #include "frontend/Parser.h"
 #include "gc/Policy.h"
 #include "js/BuildId.h"  // JS::BuildIdCharVector
 #include "js/MemoryMetrics.h"
 #include "js/Printf.h"
 #include "js/SourceText.h"