Bug 634839 (part 2b) - Remove more unnecessary headers (as found by include-what-you-use) from SpiderMonkey. r=jorendorff.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 12 Jun 2013 22:20:27 -0700
changeset 135561 7c148efceaf94def80701e1d965af65a5b937599
parent 135560 4558994f91a0ec017def6e81dbd477c53391dcf0
child 135562 0c7d548ae1881ccb91c932c9ce34f6818aecf9b5
push id29716
push usernnethercote@mozilla.com
push dateWed, 19 Jun 2013 06:12:33 +0000
treeherdermozilla-inbound@7c148efceaf9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs634839
milestone24.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 634839 (part 2b) - Remove more unnecessary headers (as found by include-what-you-use) from SpiderMonkey. r=jorendorff.
js/src/assembler/assembler/AssemblerBufferWithConstantPool.h
js/src/builtin/RegExp.cpp
js/src/builtin/TestingFunctions.cpp
js/src/builtin/TestingFunctions.h
js/src/frontend/TokenStream.cpp
js/src/gc/RootMarking.cpp
js/src/gc/Statistics.cpp
js/src/gc/Statistics.h
js/src/gc/Verifier.cpp
js/src/gc/Zone.cpp
js/src/ion/AsmJS.cpp
js/src/ion/C1Spewer.cpp
js/src/ion/IonMacroAssembler.cpp
js/src/ion/IonMacroAssembler.h
js/src/ion/arm/LIR-arm.h
js/src/ion/x64/LIR-x64.h
js/src/ion/x86/LIR-x86.h
js/src/jsalloc.h
js/src/jsanalyze.cpp
js/src/jsanalyze.h
js/src/jsapi.cpp
js/src/jsarray.cpp
js/src/jsarray.h
js/src/jsatom.cpp
js/src/jsatom.h
js/src/jsbool.cpp
js/src/jsbool.h
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jscrashreport.cpp
js/src/jsdate.cpp
js/src/jsdate.h
js/src/jsdbgapi.cpp
js/src/jsdbgapi.h
js/src/jsdhash.h
js/src/jsexn.cpp
js/src/jsexn.h
js/src/jsfriendapi.cpp
js/src/jsfriendapi.h
js/src/jsfun.h
js/src/jsgc.cpp
js/src/jsgc.h
js/src/jsinfer.cpp
js/src/jsinfer.h
js/src/jsiter.cpp
js/src/jsiter.h
js/src/jsmath.cpp
js/src/jsmemorymetrics.cpp
js/src/jsnativestack.h
js/src/jsnum.cpp
js/src/jsnum.h
js/src/jsobj.cpp
js/src/jsworkers.cpp
js/src/jsworkers.h
js/src/vm/MatchPairs.h
js/src/vm/RegExpObject.cpp
js/src/vm/RegExpStatics.h
js/src/vm/SPSProfiler.cpp
js/src/vm/ScopeObject.h
js/src/vm/SelfHosting.cpp
js/src/vm/Shape.cpp
js/src/vm/Stack.cpp
js/src/vm/Stack.h
js/src/vm/String.h
js/src/vm/StringBuffer.h
js/src/vm/Unicode.h
js/src/vm/Xdr.cpp
js/src/yarr/YarrCanonicalizeUCS2.cpp
js/src/yarr/YarrCanonicalizeUCS2.h
js/src/yarr/YarrCanonicalizeUCS2.js
js/src/yarr/YarrInterpreter.cpp
js/src/yarr/YarrInterpreter.h
--- a/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h
+++ b/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h
@@ -34,17 +34,16 @@
 #include "assembler/wtf/Platform.h"
 
 #if ENABLE_ASSEMBLER
 
 #include "AssemblerBuffer.h"
 #include "assembler/wtf/SegmentedVector.h"
 #include "assembler/wtf/Assertions.h"
 
-#include "jsnum.h"
 #define ASSEMBLER_HAS_CONSTANT_POOL 1
 
 namespace JSC {
 
 /*
     On a constant pool 4 or 8 bytes data can be stored. The values can be
     constants or addresses. The addresses should be 32 or 64 bits. The constants
     should be double-precisions float or integer numbers which are hard to be
--- a/js/src/builtin/RegExp.cpp
+++ b/js/src/builtin/RegExp.cpp
@@ -1,20 +1,20 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "builtin/RegExp.h"
+
 #include "jscntxt.h"
 
 #include "vm/StringBuffer.h"
 
-#include "builtin/RegExp.h"
-
 #include "jsobjinlines.h"
 
 #include "vm/RegExpObject-inl.h"
 #include "vm/RegExpStatics-inl.h"
 
 using namespace js;
 using namespace js::types;
 
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -1,30 +1,28 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "builtin/TestingFunctions.h"
+
 #include "jsapi.h"
-#include "jsbool.h"
 #include "jscntxt.h"
-#include "jscompartment.h"
 #include "jsfriendapi.h"
 #include "jsgc.h"
 #include "jsobj.h"
 #include "jsprf.h"
 #include "jswrapper.h"
 
-#include "builtin/TestingFunctions.h"
+#include "ion/AsmJS.h"
 #include "vm/ForkJoin.h"
 
-#include "jsobjinlines.h"
-
-#include "vm/Stack-inl.h"
+#include "vm/ObjectImpl-inl.h"
 
 using namespace js;
 using namespace JS;
 
 using mozilla::ArrayLength;
 
 static JSBool
 GetBuildConfiguration(JSContext *cx, unsigned argc, jsval *vp)
--- a/js/src/builtin/TestingFunctions.h
+++ b/js/src/builtin/TestingFunctions.h
@@ -2,16 +2,18 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 TestingFunctions_h__
 #define TestingFunctions_h__
 
+#include "jsapi.h"
+
 namespace js {
 
 bool
 DefineTestingFunctions(JSContext *cx, JSHandleObject obj);
 
 JSBool
 testingFunc_inParallelSection(JSContext *cx, unsigned argc, jsval *vp);
 
--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -2,51 +2,38 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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/. */
 
 /*
  * JS lexical scanner.
  */
-#include <stdio.h>      /* first to avoid trouble on some systems */
-#include <errno.h>
-#include <limits.h>
-#include <math.h>
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
+
+#include "frontend/TokenStream.h"
 
 #include "mozilla/PodOperations.h"
 
-#include "jstypes.h"
-#include "jsutil.h"
-#include "jsprf.h"
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+
 #include "jsapi.h"
 #include "jsatom.h"
 #include "jscntxt.h"
-#include "jsversion.h"
 #include "jsexn.h"
 #include "jsnum.h"
 #include "jsopcode.h"
 #include "jsscript.h"
 
 #include "frontend/BytecodeCompiler.h"
-#include "frontend/Parser.h"
-#include "frontend/TokenStream.h"
 #include "js/CharacterEncoding.h"
 #include "vm/Keywords.h"
-#include "vm/RegExpObject.h"
 #include "vm/StringBuffer.h"
 
-#include "jsscriptinlines.h"
-
 using namespace js;
 using namespace js::frontend;
 using namespace js::unicode;
 
 using mozilla::PodAssign;
 using mozilla::PodCopy;
 using mozilla::PodZero;
 
--- a/js/src/gc/RootMarking.cpp
+++ b/js/src/gc/RootMarking.cpp
@@ -1,30 +1,28 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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/Attributes.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Util.h"
 
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jsgc.h"
 #include "jsonparser.h"
 #include "jsprf.h"
 #include "jswatchpoint.h"
 
 #include "builtin/MapObject.h"
 #include "frontend/BytecodeCompiler.h"
 #include "gc/GCInternals.h"
 #include "gc/Marking.h"
-#include "ion/IonCode.h"
 #ifdef JS_ION
 # include "ion/IonMacroAssembler.h"
 # include "ion/IonFrameIterator.h"
 #endif
 #include "js/HashTable.h"
 #include "vm/Debugger.h"
 
 #include "jsgcinlines.h"
--- a/js/src/gc/Statistics.cpp
+++ b/js/src/gc/Statistics.cpp
@@ -7,28 +7,22 @@
 #include "gc/Statistics.h"
 
 #include <stdio.h>
 #include <stdarg.h>
 
 #include "mozilla/PodOperations.h"
 
 #include "jscntxt.h"
-#include "jscompartment.h"
-#include "jscrashformat.h"
 #include "jscrashreport.h"
 #include "jsprf.h"
 #include "jsutil.h"
 #include "prmjtime.h"
 #include "gc/Memory.h"
 
-#include "jscntxtinlines.h"
-#include "gc/Barrier-inl.h"
-#include "vm/Probes-inl.h"
-
 using namespace js;
 using namespace js::gcstats;
 
 using mozilla::PodArrayZero;
 
 /* Except for the first and last, slices of less than 42ms are not reported. */
 static const int64_t SLICE_MIN_REPORT_TIME = 42 * PRMJ_USEC_PER_MSEC;
 
--- a/js/src/gc/Statistics.h
+++ b/js/src/gc/Statistics.h
@@ -2,25 +2,21 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 jsgc_statistics_h___
 #define jsgc_statistics_h___
 
-#include <string.h>
-
 #include "mozilla/DebugOnly.h"
-#include "mozilla/GuardObjects.h"
 #include "mozilla/PodOperations.h"
 
 #include "jsfriendapi.h"
 #include "jspubtd.h"
-#include "jsutil.h"
 
 #include "js/GCAPI.h"
 
 struct JSCompartment;
 
 namespace js {
 namespace gcstats {
 
--- a/js/src/gc/Verifier.cpp
+++ b/js/src/gc/Verifier.cpp
@@ -1,27 +1,23 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "jsapi.h"
 #include "jscntxt.h"
+#include "jscompartment.h"
 #include "jsgc.h"
 #include "jsprf.h"
-#include "jsutil.h"
-#include "jswatchpoint.h"
-
-#include "mozilla/Util.h"
 
 #include "js/HashTable.h"
 #include "gc/GCInternals.h"
-
-#include "jsgcinlines.h"
+#include "gc/Zone.h"
 
 #ifdef MOZ_VALGRIND
 # include <valgrind/memcheck.h>
 #endif
 
 using namespace js;
 using namespace js::gc;
 using namespace mozilla;
--- a/js/src/gc/Zone.cpp
+++ b/js/src/gc/Zone.cpp
@@ -1,22 +1,18 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "jsapi.h"
 #include "jscntxt.h"
 #include "jsgc.h"
-#include "jsprf.h"
 
 #include "vm/Debugger.h"
-#include "js/HashTable.h"
-#include "gc/GCInternals.h"
 
 #ifdef JS_ION
 #include "ion/BaselineJIT.h"
 #include "ion/IonCompartment.h"
 #include "ion/Ion.h"
 #endif
 
 #include "jsgcinlines.h"
--- a/js/src/ion/AsmJS.cpp
+++ b/js/src/ion/AsmJS.cpp
@@ -1,38 +1,38 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "jsmath.h"
 #include "jsworkers.h"
+#include "prmjtime.h"
 
 #include "frontend/ParseNode.h"
 #include "ion/AsmJS.h"
 #include "ion/AsmJSModule.h"
 
 #include "frontend/ParseNode-inl.h"
 
-using namespace js;
-using namespace js::frontend;
-using namespace mozilla;
-
 #include "ion/PerfSpewer.h"
 #include "ion/CodeGenerator.h"
 #include "ion/MIR.h"
 #include "ion/MIRGraph.h"
 
-using namespace js::ion;
-
 #ifdef MOZ_VTUNE
 # include "jitprofiling.h"
 #endif
 
+using namespace js;
+using namespace js::frontend;
+using namespace js::ion;
+using namespace mozilla;
+
 /*****************************************************************************/
 // ParseNode utilities
 
 static inline ParseNode *
 NextNode(ParseNode *pn)
 {
     return pn->pn_next;
 }
--- a/js/src/ion/C1Spewer.cpp
+++ b/js/src/ion/C1Spewer.cpp
@@ -2,23 +2,26 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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/. */
 
 #ifdef DEBUG
 
 #include <stdarg.h>
+#include <time.h>
+
 #include "IonBuilder.h"
 #include "Ion.h"
 #include "C1Spewer.h"
 #include "MIRGraph.h"
 #include "LIR.h"
+#include "LinearScan.h"
+
 #include "jsscriptinlines.h"
-#include "LinearScan.h"
 
 using namespace js;
 using namespace js::ion;
 
 bool
 C1Spewer::init(const char *path)
 {
     spewout_ = fopen(path, "w");
--- a/js/src/ion/IonMacroAssembler.cpp
+++ b/js/src/ion/IonMacroAssembler.cpp
@@ -1,16 +1,19 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "ion/IonMacroAssembler.h"
+
 #include "jsinfer.h"
 
+#include "ion/AsmJS.h"
 #include "ion/Bailouts.h"
 #include "ion/BaselineIC.h"
 #include "ion/BaselineJIT.h"
 #include "ion/BaselineRegisters.h"
 #include "ion/IonMacroAssembler.h"
 #include "ion/MIR.h"
 #include "js/RootingAPI.h"
 #include "vm/ForkJoin.h"
--- a/js/src/ion/IonMacroAssembler.h
+++ b/js/src/ion/IonMacroAssembler.h
@@ -4,33 +4,32 @@
  * 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 jsion_macro_assembler_h__
 #define jsion_macro_assembler_h__
 
 #ifdef JS_ION
 
+#include "jstypedarray.h"
+#include "jscompartment.h"
+
 #if defined(JS_CPU_X86)
 # include "ion/x86/MacroAssembler-x86.h"
 #elif defined(JS_CPU_X64)
 # include "ion/x64/MacroAssembler-x64.h"
 #elif defined(JS_CPU_ARM)
 # include "ion/arm/MacroAssembler-arm.h"
 #endif
+#include "ion/AsmJS.h"
 #include "ion/IonCompartment.h"
 #include "ion/IonInstrumentation.h"
 #include "ion/ParallelFunctions.h"
 #include "ion/VMFunctions.h"
-
 #include "vm/ForkJoin.h"
-
-#include "jstypedarray.h"
-#include "jscompartment.h"
-
 #include "vm/Shape.h"
 
 namespace js {
 namespace ion {
 
 // The public entrypoint for emitting assembly. Note that a MacroAssembler can
 // use cx->lifoAlloc, so take care not to interleave masm use with other
 // lifoAlloc use if one will be destroyed before the other.
--- a/js/src/ion/arm/LIR-arm.h
+++ b/js/src/ion/arm/LIR-arm.h
@@ -2,18 +2,16 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 jsion_lir_arm_h__
 #define jsion_lir_arm_h__
 
-#include "ion/LIR.h"
-
 namespace js {
 namespace ion {
 
 class LBox : public LInstructionHelper<2, 1, 0>
 {
     MIRType type_;
 
   public:
--- a/js/src/ion/x64/LIR-x64.h
+++ b/js/src/ion/x64/LIR-x64.h
@@ -2,18 +2,16 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 jsion_lir_x64_h__
 #define jsion_lir_x64_h__
 
-#include "ion/LIR.h"
-
 namespace js {
 namespace ion {
 
 // Given a typed input, returns an untyped box.
 class LBox : public LInstructionHelper<1, 1, 0>
 {
     MIRType type_;
 
--- a/js/src/ion/x86/LIR-x86.h
+++ b/js/src/ion/x86/LIR-x86.h
@@ -2,18 +2,16 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 jsion_lir_x86_h__
 #define jsion_lir_x86_h__
 
-#include "ion/LIR.h"
-
 namespace js {
 namespace ion {
 
 class LBox : public LInstructionHelper<2, 1, 0>
 {
     MIRType type_;
 
   public:
--- a/js/src/jsalloc.h
+++ b/js/src/jsalloc.h
@@ -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/. */
 
 #ifndef jsalloc_h_
 #define jsalloc_h_
 
 #include "js/Utility.h"
-#include "jstypes.h"
 
 struct JSContext;
 
 namespace js {
 
 /*
  * Allocation policies.  These model the concept:
  *  - public copy constructor, assignment, destructor
--- a/js/src/jsanalyze.cpp
+++ b/js/src/jsanalyze.cpp
@@ -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/. */
 
 #include "jsanalyze.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/PodOperations.h"
 
-#include "jsautooplen.h"
 #include "jscompartment.h"
 #include "jscntxt.h"
 
 #include "jsanalyzeinlines.h"
 #include "jsinferinlines.h"
 #include "jsopcodeinlines.h"
 
 using namespace js;
--- a/js/src/jsanalyze.h
+++ b/js/src/jsanalyze.h
@@ -5,28 +5,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Definitions for javascript analysis. */
 
 #ifndef jsanalyze_h___
 #define jsanalyze_h___
 
 #include "mozilla/PodOperations.h"
-#include "mozilla/TypeTraits.h"
 
-#include "jsautooplen.h"
 #include "jscompartment.h"
 #include "jscntxt.h"
 #include "jsinfer.h"
 #include "jsscript.h"
 
-#include "ds/LifoAlloc.h"
-#include "js/TemplateLib.h"
-#include "vm/ScopeObject.h"
-
 class JSScript;
 
 namespace js {
 namespace analyze {
 
 /*
  * There are three analyses we can perform on a JSScript, outlined below.
  * The results of all three are stored in ScriptAnalysis, but the analyses
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -6,49 +6,45 @@
 
 /*
  * JavaScript API.
  */
 
 #include "jsapi.h"
 
 #include "mozilla/FloatingPoint.h"
-#include "mozilla/GuardObjects.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/ThreadLocal.h"
 
 #include <ctype.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
 
 #include "jstypes.h"
 #include "jsutil.h"
-#include "jsclist.h"
 #include "jsprf.h"
 #include "jsarray.h"
 #include "jsatom.h"
 #include "jsbool.h"
 #include "jsclone.h"
 #include "jscntxt.h"
-#include "jsversion.h"
 #include "jsdate.h"
 #include "jsdtoa.h"
 #include "jsexn.h"
 #include "jsfun.h"
 #include "jsgc.h"
 #include "jsiter.h"
 #include "jslock.h"
 #include "jsmath.h"
 #include "jsnativestack.h"
 #include "jsnum.h"
 #include "json.h"
 #include "jsobj.h"
-#include "jsopcode.h"
 #include "jsproxy.h"
 #include "jsscript.h"
 #include "jsstr.h"
 #include "prmjtime.h"
 #include "jsweakmap.h"
 #include "jswrapper.h"
 #include "jstypedarray.h"
 #ifdef JS_THREADSAFE
@@ -61,16 +57,17 @@
 #include "builtin/RegExp.h"
 #include "builtin/ParallelArray.h"
 #include "frontend/BytecodeCompiler.h"
 #include "frontend/FullParseHandler.h"  // for JS_BufferIsCompileableUnit
 #include "frontend/Parser.h" // for JS_BufferIsCompileableUnit
 #include "gc/Marking.h"
 #include "gc/Memory.h"
 #include "ion/AsmJS.h"
+#include "ion/PcScriptCache.h"
 #include "js/CharacterEncoding.h"
 #include "vm/Debugger.h"
 #include "vm/Interpreter.h"
 #include "vm/NumericConversions.h"
 #include "vm/Shape.h"
 #include "vm/StringBuffer.h"
 #include "vm/Xdr.h"
 #include "yarr/BumpPointerAllocator.h"
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -6,18 +6,16 @@
 
 #include "jsarray.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/Util.h"
 
-#include <stdlib.h>
-
 #include "jsapi.h"
 #include "jsatom.h"
 #include "jscntxt.h"
 #include "jsfriendapi.h"
 #include "jsfun.h"
 #include "jsiter.h"
 #include "jsnum.h"
 #include "jsobj.h"
--- a/js/src/jsarray.h
+++ b/js/src/jsarray.h
@@ -4,19 +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/. */
 
 /* JS Array interface. */
 
 #ifndef jsarray_h___
 #define jsarray_h___
 
-#include "jsatom.h"
-#include "jscntxt.h"
-#include "jsprvtd.h"
 #include "jspubtd.h"
 #include "jsobj.h"
 
 namespace js {
 /* 2^32-2, inclusive */
 const uint32_t MAX_ARRAY_INDEX = 4294967294u;
 }
 
--- a/js/src/jsatom.cpp
+++ b/js/src/jsatom.cpp
@@ -4,28 +4,25 @@
  * 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/. */
 
 /*
  * JS atom table.
  */
 #include "jsatom.h"
 
-#include <stdlib.h>
-#include <string.h>
-
 #include "mozilla/RangedPtr.h"
 #include "mozilla/Util.h"
 
+#include <string.h>
+
 #include "jsapi.h"
 #include "jscntxt.h"
-#include "jslock.h"
 #include "jsstr.h"
 #include "jstypes.h"
-#include "jsversion.h"
 
 #include "gc/Marking.h"
 #include "vm/Xdr.h"
 
 #include "jsatominlines.h"
 #include "jscompartmentinlines.h"
 
 #include "vm/String-inl.h"
--- a/js/src/jsatom.h
+++ b/js/src/jsatom.h
@@ -7,22 +7,18 @@
 #ifndef jsatom_h___
 #define jsatom_h___
 
 #include "mozilla/HashFunctions.h"
 
 #include <stddef.h>
 #include "jsalloc.h"
 #include "jsapi.h"
-#include "jsfriendapi.h"
-#include "jsprototypes.h"
 #include "jsprvtd.h"
 #include "jspubtd.h"
-#include "jslock.h"
-#include "jsversion.h"
 
 #include "gc/Barrier.h"
 #include "js/HashTable.h"
 #include "vm/CommonPropertyNames.h"
 
 struct JSIdArray {
     int length;
     js::HeapId vector[1];    /* actually, length jsid words */
--- a/js/src/jsbool.cpp
+++ b/js/src/jsbool.cpp
@@ -9,17 +9,16 @@
  */
 
 #include "jsbool.h"
 
 #include "jstypes.h"
 #include "jsapi.h"
 #include "jsatom.h"
 #include "jscntxt.h"
-#include "jsversion.h"
 #include "jsobj.h"
 
 #include "vm/GlobalObject.h"
 #include "vm/StringBuffer.h"
 
 #include "jsboolinlines.h"
 
 #include "vm/BooleanObject-inl.h"
--- a/js/src/jsbool.h
+++ b/js/src/jsbool.h
@@ -6,17 +6,16 @@
 
 #ifndef jsbool_h___
 #define jsbool_h___
 /*
  * JS boolean interface.
  */
 
 #include "jsapi.h"
-#include "jsobj.h"
 
 extern JSObject *
 js_InitBooleanClass(JSContext *cx, js::HandleObject obj);
 
 extern JSString *
 js_BooleanToString(JSContext *cx, JSBool b);
 
 namespace js {
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -28,32 +28,30 @@
 #include "jsprf.h"
 #include "jsatom.h"
 #include "jscompartment.h"
 #include "jsdbgapi.h"
 #include "jsexn.h"
 #include "jsfun.h"
 #include "jsgc.h"
 #include "jsiter.h"
-#include "jslock.h"
 #include "jsmath.h"
 #include "jsobj.h"
 #include "jsopcode.h"
 #include "jspubtd.h"
 #include "jsscript.h"
 #include "jsstr.h"
 #include "jsworkers.h"
 #ifdef JS_ION
 #include "ion/Ion.h"
 #endif
 
 #include "gc/Marking.h"
 #include "js/CharacterEncoding.h"
 #include "js/MemoryMetrics.h"
-#include "frontend/ParseMaps.h"
 #include "vm/Shape.h"
 #include "yarr/BumpPointerAllocator.h"
 
 #include "jscntxtinlines.h"
 #include "jsobjinlines.h"
 
 using namespace js;
 using namespace js::gc;
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -4,49 +4,39 @@
  * 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/. */
 
 /* JS execution context. */
 
 #ifndef jscntxt_h___
 #define jscntxt_h___
 
-#include "mozilla/Attributes.h"
-#include "mozilla/GuardObjects.h"
 #include "mozilla/LinkedList.h"
 #include "mozilla/PodOperations.h"
 
 #include <string.h>
+#include <setjmp.h>
 
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "jsprvtd.h"
 #include "jsatom.h"
 #include "jsclist.h"
 #include "jsgc.h"
-#include "jspropertytree.h"
-#include "jsprototypes.h"
-#include "jsutil.h"
-#include "prmjtime.h"
 
 #include "ds/LifoAlloc.h"
 #include "frontend/ParseMaps.h"
-#include "gc/Nursery.h"
 #include "gc/Statistics.h"
-#include "gc/StoreBuffer.h"
 #include "js/HashTable.h"
 #include "js/Vector.h"
-#include "ion/AsmJS.h"
 #include "vm/DateTime.h"
 #include "vm/SPSProfiler.h"
 #include "vm/Stack.h"
 #include "vm/ThreadPool.h"
 
-#include "ion/PcScriptCache.h"
-
 #ifdef _MSC_VER
 #pragma warning(push)
 #pragma warning(disable:4100) /* Silence unreferenced formal parameter warnings */
 #pragma warning(push)
 #pragma warning(disable:4355) /* Silence warning about "this" used in base member initializer list */
 #endif
 
 struct DtoaState;
@@ -122,21 +112,24 @@ class AutoCycleDetector
 
 /* Updates references in the cycle detection set if the GC moves them. */
 extern void
 TraceCycleDetectionSet(JSTracer *trc, ObjectSet &set);
 
 class MathCache;
 
 namespace ion {
+class IonActivation;
 class IonRuntime;
+struct PcScriptCache;
 }
 
+class AsmJSActivation;
+class InterpreterFrames;
 class WeakMapBase;
-class InterpreterFrames;
 class WorkerThreadState;
 
 /*
  * GetSrcNote cache to avoid O(n^2) growth in finding a source note for a
  * given pc in a script. We use the script->code pointer to tag the cache,
  * instead of the script address itself, so that source notes are always found
  * by offset from the bytecode with which they were generated.
  */
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -6,17 +6,16 @@
 
 #include "jscompartment.h"
 
 #include "mozilla/DebugOnly.h"
 
 #include "jscntxt.h"
 #include "jsgc.h"
 #include "jsiter.h"
-#include "jsmath.h"
 #include "jsproxy.h"
 #include "jswatchpoint.h"
 #include "jswrapper.h"
 
 #include "gc/Marking.h"
 #ifdef JS_ION
 #include "ion/IonCompartment.h"
 #endif
--- a/js/src/jscompartment.h
+++ b/js/src/jscompartment.h
@@ -2,22 +2,19 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 jscompartment_h___
 #define jscompartment_h___
 
-#include "mozilla/Attributes.h"
-#include "mozilla/GuardObjects.h"
 #include "mozilla/Util.h"
 
 #include "jscntxt.h"
-#include "jsfun.h"
 #include "jsgc.h"
 #include "jsobj.h"
 
 #include "gc/Zone.h"
 #include "vm/GlobalObject.h"
 #include "vm/RegExpObject.h"
 #include "vm/Shape.h"
 
--- a/js/src/jscrashreport.cpp
+++ b/js/src/jscrashreport.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jscrashreport.h"
 
 #include <time.h>
 
 #include "jsapi.h"
 #include "jscrashformat.h"
+#include "jsutil.h"
 
 using namespace js;
 using namespace js::crash;
 
 const static int stack_snapshot_max_size = 32768;
 
 #if defined(XP_WIN)
 
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -18,32 +18,29 @@
  *  resident date-turnover routine to the proper handling of
  *  December 31 on leap years (when it is Day 366).  That
  *  might have been left to the operator."
  *
  * Frederick Brooks, 'The Second-System Effect'.
  */
 
 #include <ctype.h>
-#include <locale.h>
 #include <math.h>
 #include <string.h>
 
 #include "jstypes.h"
 #include "jsprf.h"
 #include "prmjtime.h"
 #include "jsutil.h"
 #include "jsapi.h"
-#include "jsversion.h"
 #include "jscntxt.h"
 #include "jsnum.h"
 #include "jsobj.h"
 #include "jsstr.h"
 
-#include "js/Date.h"
 #include "vm/DateTime.h"
 #include "vm/GlobalObject.h"
 #include "vm/Interpreter.h"
 #include "vm/NumericConversions.h"
 #include "vm/String.h"
 #include "vm/StringBuffer.h"
 
 #include "jsobjinlines.h"
--- a/js/src/jsdate.h
+++ b/js/src/jsdate.h
@@ -6,23 +6,21 @@
 
 /*
  * JS Date class interface.
  */
 
 #ifndef jsdate_h___
 #define jsdate_h___
 
-#include "mozilla/FloatingPoint.h"
-
-#include <math.h>
-
 #include "jsapi.h"
 #include "jstypes.h"
 
+#include "js/Date.h"
+
 extern "C" {
 class JSObject;
 struct JSContext;
 }
 
 extern JSObject *
 js_InitDateClass(JSContext *cx, js::HandleObject obj);
 
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -6,30 +6,31 @@
 
 /*
  * JS debugging API.
  */
 
 #include "jsdbgapi.h"
 
 #include <string.h>
+
 #include "jsprvtd.h"
 #include "jstypes.h"
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jsfun.h"
 #include "jsgc.h"
 #include "jsobj.h"
 #include "jsopcode.h"
 #include "jsscript.h"
 #include "jsstr.h"
 #include "jswatchpoint.h"
-#include "jswrapper.h"
 
 #include "frontend/SourceNotes.h"
+#include "ion/AsmJS.h"
 #include "vm/Debugger.h"
 #include "vm/Interpreter.h"
 #include "vm/Shape.h"
 
 #ifdef JS_ION
 #include "ion/AsmJSModule.h"
 #endif
 
--- a/js/src/jsdbgapi.h
+++ b/js/src/jsdbgapi.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 jsdbgapi_h___
 #define jsdbgapi_h___
 /*
  * JS debugger API.
  */
-#include "jsapi.h"
 #include "jsprvtd.h"
 
 namespace JS {
 
 struct FrameDescription
 {
     JSScript *script;
     unsigned lineno;
--- a/js/src/jsdhash.h
+++ b/js/src/jsdhash.h
@@ -8,17 +8,18 @@
 #define jsdhash_h___
 
 /*
  * Double hashing, a la Knuth 6.
  *
  * Try to keep this file in sync with xpcom/glue/pldhash.h.
  */
 #include "jstypes.h"
-#include "jsutil.h"
+
+#include "js/Utility.h"
 
 #if defined(__GNUC__) && defined(__i386__) && !defined(XP_OS2)
 #define JS_DHASH_FASTCALL __attribute__ ((regparm (3),stdcall))
 #elif defined(XP_WIN)
 #define JS_DHASH_FASTCALL __fastcall
 #else
 #define JS_DHASH_FASTCALL
 #endif
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -4,27 +4,25 @@
  * 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/. */
 
 /*
  * JS standard exception implementation.
  */
 #include "jsexn.h"
 
-#include <stdlib.h>
 #include <string.h>
 
 #include "mozilla/PodOperations.h"
 #include "mozilla/Util.h"
 
 #include "jstypes.h"
 #include "jsutil.h"
 #include "jsapi.h"
 #include "jscntxt.h"
-#include "jsversion.h"
 #include "jsfun.h"
 #include "jsnum.h"
 #include "jsobj.h"
 #include "jsscript.h"
 
 #include "gc/Marking.h"
 #include "vm/GlobalObject.h"
 #include "vm/StringBuffer.h"
--- a/js/src/jsexn.h
+++ b/js/src/jsexn.h
@@ -6,17 +6,17 @@
 
 /*
  * JS runtime exception classes.
  */
 
 #ifndef jsexn_h___
 #define jsexn_h___
 
-#include "jsobj.h"
+#include "jsapi.h"
 
 /*
  * Initialize the exception constructor/prototype hierarchy.
  */
 extern JSObject *
 js_InitExceptionClasses(JSContext *cx, js::HandleObject obj);
 
 /*
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -1,27 +1,27 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "jsfriendapi.h"
 
-#include "mozilla/GuardObjects.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/StandardInteger.h"
 
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsgc.h"
 #include "jsobj.h"
 #include "jswrapper.h"
 #include "jsweakmap.h"
 #include "jswatchpoint.h"
+#include "prmjtime.h"
 
 #include "builtin/TestingFunctions.h"
 
 #include "jsobjinlines.h"
 
 using namespace js;
 using namespace JS;
 
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -2,20 +2,17 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 jsfriendapi_h___
 #define jsfriendapi_h___
 
-#include "mozilla/GuardObjects.h"
-
 #include "jsclass.h"
-#include "jscpucfg.h"
 #include "jspubtd.h"
 #include "jsprvtd.h"
 
 #include "js/CallArgs.h"
 
 /*
  * This macro checks if the stack pointer has exceeded a given limit. If
  * |tolerance| is non-zero, it returns true only if the stack pointer has
--- a/js/src/jsfun.h
+++ b/js/src/jsfun.h
@@ -5,20 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef jsfun_h___
 #define jsfun_h___
 /*
  * JS function definitions.
  */
 #include "jsprvtd.h"
-#include "jspubtd.h"
 #include "jsobj.h"
-#include "jsatom.h"
-#include "jsstr.h"
 
 #include "gc/Barrier.h"
 
 namespace js { class FunctionExtended; }
 
 class JSFunction : public JSObject
 {
   public:
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -3,16 +3,18 @@
  * 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/. */
 
 /* JS Mark-and-Sweep Garbage Collector. */
 
 #include "jsgc.h"
 
+#include "prmjtime.h"
+
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Util.h"
 
 /*
  * This code implements a mark-and-sweep garbage collector. The mark phase is
  * incremental. Most sweeping is done on a background thread. A GC is divided
  * into slices as follows:
  *
--- a/js/src/jsgc.h
+++ b/js/src/jsgc.h
@@ -4,36 +4,30 @@
  * 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/. */
 
 /* JS Garbage Collector. */
 
 #ifndef jsgc_h___
 #define jsgc_h___
 
-#include <setjmp.h>
-
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Util.h"
 
 #include "jsalloc.h"
 #include "jsclass.h"
-#include "jstypes.h"
-#include "jsprvtd.h"
+#include "jslock.h"
 #include "jspubtd.h"
-#include "jslock.h"
-#include "jsutil.h"
-#include "jsversion.h"
+#include "jsscript.h"
+#include "jstypes.h"
 
-#include "ds/BitArray.h"
 #include "gc/Heap.h"
-#include "gc/Statistics.h"
+#include "js/GCAPI.h"
 #include "js/HashTable.h"
 #include "js/Vector.h"
-#include "js/TemplateLib.h"
 
 struct JSAtom;
 struct JSCompartment;
 struct JSFunction;
 struct JSFlatString;
 struct JSLinearString;
 
 namespace js {
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -5,24 +5,24 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jsinfer.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/PodOperations.h"
 
 #include "jsapi.h"
-#include "jsautooplen.h"
 #include "jsfriendapi.h"
 #include "jsgc.h"
 #include "jsobj.h"
 #include "jsscript.h"
 #include "jscntxt.h"
 #include "jsstr.h"
 #include "jsworkers.h"
+#include "prmjtime.h"
 
 #ifdef JS_ION
 #include "ion/BaselineJIT.h"
 #include "ion/Ion.h"
 #include "ion/IonCompartment.h"
 #endif
 #include "gc/Marking.h"
 #include "js/MemoryMetrics.h"
--- a/js/src/jsinfer.h
+++ b/js/src/jsinfer.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/. */
 
 /* Definitions related to javascript type inference. */
 
 #ifndef jsinfer_h___
 #define jsinfer_h___
 
-#include "mozilla/Attributes.h"
-
 #include "jsalloc.h"
 #include "jsfriendapi.h"
 
 #include "ds/LifoAlloc.h"
 #include "gc/Barrier.h"
 #include "gc/Heap.h"
 #include "js/HashTable.h"
 #include "js/Vector.h"
--- a/js/src/jsiter.cpp
+++ b/js/src/jsiter.cpp
@@ -12,24 +12,22 @@
 #include "mozilla/Util.h"
 
 #include "jstypes.h"
 #include "jsutil.h"
 #include "jsapi.h"
 #include "jsarray.h"
 #include "jsatom.h"
 #include "jscntxt.h"
-#include "jsversion.h"
 #include "jsgc.h"
 #include "jsobj.h"
 #include "jsopcode.h"
 #include "jsproxy.h"
 #include "jsscript.h"
 
-#include "ds/Sort.h"
 #include "gc/Marking.h"
 #include "vm/GlobalObject.h"
 #include "vm/Interpreter.h"
 #include "vm/Shape.h"
 
 #include "jsinferinlines.h"
 #include "jsobjinlines.h"
 
--- a/js/src/jsiter.h
+++ b/js/src/jsiter.h
@@ -6,19 +6,16 @@
 
 #ifndef jsiter_h___
 #define jsiter_h___
 
 /*
  * JavaScript iterators.
  */
 #include "jscntxt.h"
-#include "jsprvtd.h"
-#include "jspubtd.h"
-#include "jsversion.h"
 
 #include "gc/Barrier.h"
 #include "vm/Stack.h"
 
 /*
  * For cacheable native iterators, whether the iterator is currently active.
  * Not serialized by XDR.
  */
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -10,34 +10,33 @@
 
 #if defined(XP_WIN)
 /* _CRT_RAND_S must be #defined before #including stdlib.h to get rand_s(). */
 #define _CRT_RAND_S
 #endif
 
 #include "jsmath.h"
 
+#include "jslibmath.h"
+
 #include "mozilla/Constants.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/MathAlgorithms.h"
 
 #include <fcntl.h>
-#include <stdlib.h>
 
 #ifdef XP_UNIX
 # include <unistd.h>
 #endif
 
 #include "jstypes.h"
 #include "prmjtime.h"
 #include "jsapi.h"
 #include "jsatom.h"
 #include "jscntxt.h"
-#include "jsversion.h"
-#include "jslibmath.h"
 #include "jscompartment.h"
 
 #include "jsobjinlines.h"
 
 using namespace js;
 
 using mozilla::Abs;
 using mozilla::DoubleIsInt32;
--- a/js/src/jsmemorymetrics.cpp
+++ b/js/src/jsmemorymetrics.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "js/MemoryMetrics.h"
 
-#include "mozilla/Assertions.h"
 #include "mozilla/DebugOnly.h"
 
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsgc.h"
 #include "jsobj.h"
 #include "jsscript.h"
--- a/js/src/jsnativestack.h
+++ b/js/src/jsnativestack.h
@@ -2,18 +2,17 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 jsnativestack_h__
 #define jsnativestack_h__
 
-#include "jspubtd.h"
-#include "jsutil.h"
+#include "js/Utility.h"
 
 namespace js {
 
 extern void *
 GetNativeStackBaseImpl();
 
 inline uintptr_t
 GetNativeStackBase()
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -10,35 +10,30 @@
 
 #include "jsnum.h"
 
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/RangedPtr.h"
 
 #include "double-conversion.h"
-// Avoid warnings about ASSERT being defined by the assembler as well.
-#undef ASSERT
 
 #ifdef XP_OS2
 #define _PC_53  PC_53
 #define _MCW_EM MCW_EM
 #define _MCW_PC MCW_PC
 #endif
 #include <locale.h>
-#include <limits.h>
 #include <math.h>
 #include <string.h>
 
 #include "jstypes.h"
-#include "jsutil.h"
 #include "jsapi.h"
 #include "jsatom.h"
 #include "jscntxt.h"
-#include "jsversion.h"
 #include "jsdtoa.h"
 #include "jsobj.h"
 #include "jsstr.h"
 #include "vm/GlobalObject.h"
 #include "vm/NumericConversions.h"
 #include "vm/StringBuffer.h"
 
 #include "jsatominlines.h"
--- a/js/src/jsnum.h
+++ b/js/src/jsnum.h
@@ -4,19 +4,17 @@
  * 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 jsnum_h___
 #define jsnum_h___
 
 #include "mozilla/FloatingPoint.h"
 
-#include <math.h>
-
-#include "jsobj.h"
+#include "jscntxt.h"
 
 #include "vm/NumericConversions.h"
 
 extern double js_PositiveInfinity;
 extern double js_NegativeInfinity;
 
 namespace js {
 
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -4,34 +4,32 @@
  * 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/. */
 
 /*
  * JS object implementation.
  */
 #include "jsobjinlines.h"
 
-#include <stdlib.h>
 #include <string.h>
 
 #include "mozilla/Util.h"
 
 #include "jstypes.h"
 #include "jsutil.h"
 #include "jsprf.h"
 #include "jsapi.h"
 #include "jsarray.h"
 #include "jsatom.h"
 #include "jscntxt.h"
 #include "jsfun.h"
 #include "jsgc.h"
 #include "jsiter.h"
 #include "jsnum.h"
 #include "jsopcode.h"
-#include "jsprototypes.h"
 #include "jsproxy.h"
 #include "jsscript.h"
 #include "jsstr.h"
 #include "jsdbgapi.h"
 #include "jswatchpoint.h"
 #include "jswrapper.h"
 #include "frontend/BytecodeCompiler.h"
 #include "gc/Marking.h"
@@ -39,23 +37,20 @@
 #include "js/MemoryMetrics.h"
 #include "vm/Interpreter.h"
 #include "vm/Shape.h"
 
 #include "jsatominlines.h"
 #include "jsboolinlines.h"
 #include "jscntxtinlines.h"
 #include "jscompartmentinlines.h"
-#include "jsobjinlines.h"
-#include "jsscriptinlines.h"
 #include "jstypedarrayinlines.h"
 #include "builtin/Iterator-inl.h"
 #include "vm/BooleanObject-inl.h"
 #include "vm/NumberObject-inl.h"
-#include "vm/Probes-inl.h"
 #include "vm/RegExpStatics-inl.h"
 #include "vm/Shape-inl.h"
 #include "vm/StringObject-inl.h"
 
 using namespace js;
 using namespace js::gc;
 using namespace js::types;
 
--- a/js/src/jsworkers.cpp
+++ b/js/src/jsworkers.cpp
@@ -3,16 +3,18 @@
  * 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 "jsworkers.h"
 
 #include "mozilla/DebugOnly.h"
 
+#include "prmjtime.h"
+
 #ifdef JS_PARALLEL_COMPILATION
 # include "ion/AsmJS.h"
 # include "ion/IonBuilder.h"
 # include "ion/ExecutionModeInlines.h"
 #endif
 
 using namespace js;
 
--- a/js/src/jsworkers.h
+++ b/js/src/jsworkers.h
@@ -18,16 +18,18 @@
 
 #include "jscntxt.h"
 #include "jslock.h"
 
 #include "ion/Ion.h"
 
 namespace js {
 
+struct AsmJSParallelTask;
+
 namespace ion {
   class IonBuilder;
 }
 
 #if defined(JS_THREADSAFE) && defined(JS_ION)
 # define JS_PARALLEL_COMPILATION
 
 struct WorkerThread;
--- a/js/src/vm/MatchPairs.h
+++ b/js/src/vm/MatchPairs.h
@@ -2,16 +2,18 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 MatchPairs_h__
 #define MatchPairs_h__
 
+#include "ds/LifoAlloc.h"
+
 /*
  * RegExp match results are succinctly represented by pairs of integer
  * indices delimiting (start, limit] segments of the input string.
  *
  * The pair count for a given RegExp match is the capturing parentheses
  * count plus one for the "0 capturing paren" whole text match.
  */
 
--- a/js/src/vm/RegExpObject.cpp
+++ b/js/src/vm/RegExpObject.cpp
@@ -1,24 +1,26 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "vm/RegExpObject.h"
+
 #include "frontend/TokenStream.h"
+
 #include "vm/MatchPairs.h"
-#include "vm/RegExpStatics.h"
 #include "vm/StringBuffer.h"
-#include "vm/Xdr.h"
 
 #include "jsobjinlines.h"
 
 #include "vm/RegExpObject-inl.h"
 #include "vm/RegExpStatics-inl.h"
+#include "vm/Xdr.h"
 
 using namespace js;
 using js::frontend::TokenStream;
 
 JS_STATIC_ASSERT(IgnoreCaseFlag == JSREG_FOLD);
 JS_STATIC_ASSERT(GlobalFlag == JSREG_GLOB);
 JS_STATIC_ASSERT(MultilineFlag == JSREG_MULTILINE);
 JS_STATIC_ASSERT(StickyFlag == JSREG_STICKY);
--- a/js/src/vm/RegExpStatics.h
+++ b/js/src/vm/RegExpStatics.h
@@ -2,26 +2,21 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 RegExpStatics_h__
 #define RegExpStatics_h__
 
-#include "mozilla/GuardObjects.h"
-
-#include "jscntxt.h"
+#include <stddef.h>
 
-#include "gc/Barrier.h"
-#include "gc/Marking.h"
-#include "js/Vector.h"
+#include "jspubtd.h"
 
-#include "vm/MatchPairs.h"
-#include "vm/RegExpObject.h"
+#include "js/Utility.h"
 
 namespace js {
 
 class PreserveRegExpStatics;
 class RegExpStatics;
 
 size_t SizeOfRegExpStaticsData(const JSObject *obj, JSMallocSizeOfFun mallocSizeOf);
 
--- a/js/src/vm/SPSProfiler.cpp
+++ b/js/src/vm/SPSProfiler.cpp
@@ -9,18 +9,16 @@
 #include "jsnum.h"
 #include "jsscript.h"
 
 #include "vm/SPSProfiler.h"
 #include "vm/StringBuffer.h"
 
 #include "ion/BaselineJIT.h"
 
-#include "jsscriptinlines.h"
-
 using namespace js;
 
 using mozilla::DebugOnly;
 
 SPSProfiler::SPSProfiler(JSRuntime *rt)
   : rt(rt),
     stack_(NULL),
     size_(NULL),
--- a/js/src/vm/ScopeObject.h
+++ b/js/src/vm/ScopeObject.h
@@ -2,18 +2,16 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 ScopeObject_h___
 #define ScopeObject_h___
 
-#include "mozilla/GuardObjects.h"
-
 #include "jscntxt.h"
 #include "jsobj.h"
 #include "jsweakmap.h"
 
 #include "gc/Barrier.h"
 
 namespace js {
 
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -10,23 +10,20 @@
 #include "jsfriendapi.h"
 
 #include "builtin/Intl.h"
 #include "builtin/ParallelArray.h"
 #include "gc/Marking.h"
 
 #include "vm/ForkJoin.h"
 #include "vm/Interpreter.h"
-#include "vm/ThreadPool.h"
 
 #include "jsfuninlines.h"
 #include "jstypedarrayinlines.h"
 
-#include "ion/BaselineJIT.h"
-
 #include "vm/BooleanObject-inl.h"
 #include "vm/NumberObject-inl.h"
 #include "vm/RegExpObject-inl.h"
 #include "vm/StringObject-inl.h"
 
 #include "selfhosted.out.h"
 
 using namespace js;
--- a/js/src/vm/Shape.cpp
+++ b/js/src/vm/Shape.cpp
@@ -1,39 +1,27 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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/. */
 
 /* JS symbol tables. */
 
-#include <stdlib.h>
-#include <string.h>
-
 #include "mozilla/DebugOnly.h"
 #include "mozilla/PodOperations.h"
 
-#include "jstypes.h"
-#include "jsclist.h"
-#include "jsutil.h"
 #include "jsapi.h"
 #include "jsatom.h"
 #include "jscntxt.h"
-#include "jsdbgapi.h"
-#include "jslock.h"
-#include "jsnum.h"
 #include "jsobj.h"
-#include "jsstr.h"
 
 #include "js/HashTable.h"
-#include "js/MemoryMetrics.h"
 #include "vm/Shape.h"
 
-#include "jsatominlines.h"
 #include "jscntxtinlines.h"
 #include "jsobjinlines.h"
 
 #include "vm/Shape-inl.h"
 
 using namespace js;
 using namespace js::gc;
 
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -1,31 +1,25 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "vm/Stack.h"
 
-#include "mozilla/DebugOnly.h"
 #include "mozilla/PodOperations.h"
 
 #include "jscntxt.h"
-#include "jsopcode.h"
 
 #include "gc/Marking.h"
 #ifdef JS_ION
 #include "ion/BaselineFrame.h"
-#include "ion/IonFrames.h"
 #include "ion/IonCompartment.h"
 #endif
-#include "vm/ForkJoin.h"
-
-#include "jsgcinlines.h"
 
 #include "vm/Interpreter-inl.h"
 #include "vm/Stack-inl.h"
 #include "vm/Probes-inl.h"
 
 /* Includes to get to low-level memory-mapping functionality. */
 #ifdef XP_WIN
 # include "jswin.h"
@@ -41,17 +35,16 @@
 #  else
 #   define MAP_ANONYMOUS 0
 #  endif
 # endif
 #endif
 
 using namespace js;
 
-using mozilla::DebugOnly;
 using mozilla::PodCopy;
 
 /*****************************************************************************/
 
 void
 StackFrame::initExecuteFrame(JSScript *script, StackFrame *prevLink, AbstractFramePtr prev,
                              FrameRegs *regs, const Value &thisv, JSObject &scopeChain,
                              ExecuteType type)
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -2,20 +2,20 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 Stack_h__
 #define Stack_h__
 
+#include "jsautooplen.h"
 #include "jsfun.h"
 #include "jsscript.h"
 #include "ion/IonFrameIterator.h"
-#include "jsautooplen.h"
 
 struct JSContext;
 struct JSCompartment;
 
 namespace js {
 
 class StackFrame;
 class FrameRegs;
--- a/js/src/vm/String.h
+++ b/js/src/vm/String.h
@@ -2,22 +2,19 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 String_h_
 #define String_h_
 
-#include "mozilla/Attributes.h"
-#include "mozilla/GuardObjects.h"
 #include "mozilla/PodOperations.h"
 
 #include "jsapi.h"
-#include "jsatom.h"
 #include "jsfriendapi.h"
 #include "jsstr.h"
 
 #include "gc/Barrier.h"
 #include "gc/Heap.h"
 #include "js/CharacterEncoding.h"
 #include "js/RootingAPI.h"
 
--- a/js/src/vm/StringBuffer.h
+++ b/js/src/vm/StringBuffer.h
@@ -2,17 +2,16 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 StringBuffer_h___
 #define StringBuffer_h___
 
-#include "mozilla/Attributes.h"
 #include "mozilla/DebugOnly.h"
 
 #include "jscntxt.h"
 
 #include "js/Vector.h"
 
 namespace js {
 
--- a/js/src/vm/Unicode.h
+++ b/js/src/vm/Unicode.h
@@ -2,24 +2,18 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 Unicode_h__
 #define Unicode_h__
 
-#include "mozilla/StandardInteger.h"
-
 #include "jspubtd.h"
 
-#ifdef DEBUG
-#include <stdio.h> /* For EOF */
-#endif
-
 extern const bool js_isidstart[];
 extern const bool js_isident[];
 extern const bool js_isspace[];
 
 namespace js {
 namespace unicode {
 
 /*
--- a/js/src/vm/Xdr.cpp
+++ b/js/src/vm/Xdr.cpp
@@ -1,38 +1,29 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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/DebugOnly.h"
-
-#include "jsversion.h"
+#include "vm/Xdr.h"
 
 #include <string.h>
-#include "jstypes.h"
-#include "jsutil.h"
-#include "jsdhash.h"
+
 #include "jsprf.h"
 #include "jsapi.h"
 #include "jscntxt.h"
-#include "jsnum.h"
 #include "jsscript.h"
-#include "jsstr.h"
 
-#include "vm/Xdr.h"
 #include "vm/Debugger.h"
 
 #include "jsscriptinlines.h"
 
 using namespace js;
 
-using mozilla::DebugOnly;
-
 void
 XDRBuffer::freeBuffer()
 {
     js_free(base);
 #ifdef DEBUG
     memset(this, 0xe2, sizeof *this);
 #endif
 }
--- a/js/src/yarr/YarrCanonicalizeUCS2.cpp
+++ b/js/src/yarr/YarrCanonicalizeUCS2.cpp
@@ -24,20 +24,19 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
 // DO NOT EDIT! - this file autogenerated by YarrCanonicalizeUCS2.js
 
 #include "YarrCanonicalizeUCS2.h"
 
-namespace JSC { namespace Yarr {
+#include <stddef.h>
 
-#include <stddef.h>
-#include "mozilla/StandardInteger.h"
+namespace JSC { namespace Yarr {
 
 const uint16_t ucs2CharacterSet0[] = { 0x01c4u, 0x01c5u, 0x01c6u, 0 };
 const uint16_t ucs2CharacterSet1[] = { 0x01c7u, 0x01c8u, 0x01c9u, 0 };
 const uint16_t ucs2CharacterSet2[] = { 0x01cau, 0x01cbu, 0x01ccu, 0 };
 const uint16_t ucs2CharacterSet3[] = { 0x01f1u, 0x01f2u, 0x01f3u, 0 };
 const uint16_t ucs2CharacterSet4[] = { 0x0392u, 0x03b2u, 0x03d0u, 0 };
 const uint16_t ucs2CharacterSet5[] = { 0x0395u, 0x03b5u, 0x03f5u, 0 };
 const uint16_t ucs2CharacterSet6[] = { 0x0398u, 0x03b8u, 0x03d1u, 0 };
--- a/js/src/yarr/YarrCanonicalizeUCS2.h
+++ b/js/src/yarr/YarrCanonicalizeUCS2.h
@@ -24,18 +24,18 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
 #ifndef YarrCanonicalizeUCS2_H
 #define YarrCanonicalizeUCS2_H
 
 #include "mozilla/StandardInteger.h"
+
 #include "wtfbridge.h"
-#include "assembler/wtf/Assertions.h"
 
 namespace JSC { namespace Yarr {
 
 // This set of data (autogenerated using YarrCanonicalizeUCS2.js into YarrCanonicalizeUCS2.cpp)
 // provides information for each UCS2 code point as to the set of code points that it should
 // match under the ES5.1 case insensitive RegExp matching rules, specified in 15.10.2.8.
 enum UCS2CanonicalizationType {
     CanonicalizeUnique,               // No canonically equal values, e.g. 0x0.
--- a/js/src/yarr/YarrCanonicalizeUCS2.js
+++ b/js/src/yarr/YarrCanonicalizeUCS2.js
@@ -169,24 +169,22 @@ var copyright = (
     " * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE"      + "\n" +
     " * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. "      + "\n" +
     " */");
 
 print(copyright);
 print();
 print("// DO NOT EDIT! - this file autogenerated by YarrCanonicalizeUCS2.js");
 print();
-print('#include "wtfbridge.h"');
 print('#include "YarrCanonicalizeUCS2.h"');
-print('#include "assembler/wtf/Assertions.h"');
+print();
+print('#include <stddef.h>');
 print();
 print("namespace JSC { namespace Yarr {");
 print();
-print('#include "mozilla/StandardInteger.h"');
-print();
 
 for (i in characterSetInfo) {
     var characters = ""
     var set = characterSetInfo[i];
     for (var j in set)
         characters += hex(set[j]) + ", ";
     print("uint16_t ucs2CharacterSet" + i + "[] = { " + characters + "0 };");
 }
--- a/js/src/yarr/YarrInterpreter.cpp
+++ b/js/src/yarr/YarrInterpreter.cpp
@@ -27,20 +27,16 @@
  */
 
 #include "YarrInterpreter.h"
 
 #include "Yarr.h"
 #include "YarrCanonicalizeUCS2.h"
 #include "BumpPointerAllocator.h"
 
-#ifndef NDEBUG
-#include <stdio.h>
-#endif
-
 using namespace WTF;
 
 namespace JSC { namespace Yarr {
 
 template<typename CharType>
 class Interpreter {
 public:
     struct ParenthesesDisjunctionContext;
--- a/js/src/yarr/YarrInterpreter.h
+++ b/js/src/yarr/YarrInterpreter.h
@@ -24,17 +24,18 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
 #ifndef YarrInterpreter_h
 #define YarrInterpreter_h
 
 #include "jscntxt.h"
-#include "YarrPattern.h"
+
+#include "yarr/YarrPattern.h"
 
 namespace WTF {
 class BumpPointerAllocator;
 }
 using WTF::BumpPointerAllocator;
 
 namespace JSC { namespace Yarr {