Bug 888088 (part 7) - Fix #include ordering in the rest of js/src/*.{cpp,h}. r=nnethercote.
authorEmanuel Hoogeveen <emanuel.hoogeveen@gmail.com>
Tue, 23 Jul 2013 17:34:50 -0700
changeset 139749 20fa9344c91a440b77a9114bfc4e9c9af3e9af62
parent 139748 4cdcc55c9dde8f2352906816c4d4bf244742aeb6
child 139750 58309e4d17000097b9343f6deb7ef61400ddc4a3
push idunknown
push userunknown
push dateunknown
reviewersnnethercote
bugs888088
milestone25.0a1
Bug 888088 (part 7) - Fix #include ordering in the rest of js/src/*.{cpp,h}. r=nnethercote.
js/src/jsopcode.cpp
js/src/jsopcode.h
js/src/jsopcodeinlines.h
js/src/jsprf.cpp
js/src/jsprf.h
js/src/jspropertytree.cpp
js/src/jspubtd.h
js/src/jsreflect.cpp
js/src/jsreflect.h
js/src/jsscript.cpp
js/src/jsscriptinlines.h
js/src/jsstr.cpp
js/src/jsstr.h
js/src/jsstrinlines.h
js/src/jsutil.cpp
js/src/jsutil.h
js/src/jswatchpoint.h
js/src/jsweakcache.h
js/src/jsweakmap.h
js/src/jswin.h
js/src/jsworkers.cpp
js/src/perf/pm_linux.cpp
js/src/prmjtime.cpp
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -3,53 +3,51 @@
  * 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 bytecode descriptors, disassemblers, and (expression) decompilers.
  */
 
-#include "jsopcode.h"
+#include "jsopcodeinlines.h"
 
 #include "mozilla/Util.h"
 
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "jstypes.h"
-#include "jsutil.h"
-#include "jsprf.h"
 #include "jsanalyze.h"
 #include "jsapi.h"
 #include "jsatom.h"
+#include "jsautooplen.h"
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsfun.h"
 #include "jsnum.h"
 #include "jsobj.h"
+#include "jsprf.h"
 #include "jsscript.h"
 #include "jsstr.h"
+#include "jstypes.h"
+#include "jsutil.h"
 
 #include "frontend/BytecodeCompiler.h"
 #include "frontend/SourceNotes.h"
 #include "js/CharacterEncoding.h"
+#include "vm/ScopeObject.h"
 #include "vm/Shape.h"
-#include "vm/ScopeObject.h"
 #include "vm/StringBuffer.h"
 
 #include "jscntxtinlines.h"
 #include "jscompartmentinlines.h"
 #include "jsinferinlines.h"
-#include "jsopcodeinlines.h"
 #include "jsscriptinlines.h"
 
-#include "jsautooplen.h"
-
 using namespace js;
 using namespace js::gc;
 
 using js::frontend::IsIdentifier;
 using mozilla::ArrayLength;
 
 /*
  * Index limit must stay within 32 bits.
--- a/js/src/jsopcode.h
+++ b/js/src/jsopcode.h
@@ -5,17 +5,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef jsopcode_h
 #define jsopcode_h
 
 /*
  * JS bytecode definitions.
  */
+
 #include <stddef.h>
+
 #include "jsprvtd.h"
 #include "jspubtd.h"
 #include "jsutil.h"
 
 #include "frontend/SourceNotes.h"
 
 /*
  * JS operation bytecodes.
--- a/js/src/jsopcodeinlines.h
+++ b/js/src/jsopcodeinlines.h
@@ -2,17 +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 jsopcodeinlines_h
 #define jsopcodeinlines_h
 
+#include "jsopcode.h"
+
 #include "jsautooplen.h"
+#include "jsscript.h"
 
 namespace js {
 
 static inline unsigned
 GetDefCount(JSScript *script, unsigned offset)
 {
     JS_ASSERT(offset < script->length);
     jsbytecode *pc = script->code + offset;
--- a/js/src/jsprf.cpp
+++ b/js/src/jsprf.cpp
@@ -4,25 +4,27 @@
  * 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/. */
 
 /*
 ** Portable safe sprintf code.
 **
 ** Author: Kipp E.B. Hickman
 */
+
 #include "jsprf.h"
 
 #include <stdarg.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <stdlib.h>
-#include "jsutil.h"
+
 #include "jspubtd.h"
 #include "jsstr.h"
+#include "jsutil.h"
 
 using namespace js;
 
 /*
 ** Note: on some platforms va_list is defined as an array,
 ** and requires array notation.
 */
 #ifdef HAVE_VA_COPY
--- a/js/src/jsprf.h
+++ b/js/src/jsprf.h
@@ -19,19 +19,21 @@
 **      %lld, %llu, %llx, %llX, %llo - 64 bit versions of above
 **      %s - ascii string
 **      %hs - ucs2 string
 **      %c - character
 **      %p - pointer (deals with machine dependent pointer size)
 **      %f - float
 **      %g - float
 */
-#include "jstypes.h"
+
+#include <stdarg.h>
 #include <stdio.h>
-#include <stdarg.h>
+
+#include "jstypes.h"
 
 /*
 ** sprintf into a fixed size buffer. Guarantees that a NUL is at the end
 ** of the buffer. Returns the length of the written output, NOT including
 ** the NUL, or (uint32_t)-1 if an error occurs.
 */
 extern JS_PUBLIC_API(uint32_t) JS_snprintf(char *out, uint32_t outlen, const char *fmt, ...);
 
--- a/js/src/jspropertytree.cpp
+++ b/js/src/jspropertytree.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 "jspropertytree.h"
 
-#include "jstypes.h"
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jsgc.h"
+#include "jstypes.h"
 
 #include "vm/Shape.h"
 
 #include "jsgcinlines.h"
 
 #include "vm/Shape-inl.h"
 
 using namespace js;
--- a/js/src/jspubtd.h
+++ b/js/src/jspubtd.h
@@ -6,21 +6,21 @@
 
 #ifndef jspubtd_h
 #define jspubtd_h
 
 /*
  * JS public API typedefs.
  */
 
+#include "mozilla/PodOperations.h"
+
 #include "jsprototypes.h"
 #include "jstypes.h"
 
-#include "mozilla/PodOperations.h"
-
 #if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) || defined(DEBUG)
 # define JSGC_TRACK_EXACT_ROOTS
 #endif
 
 namespace JS {
 
 /*
  * Allow headers to reference JS::Value without #including the whole jsapi.h.
--- a/js/src/jsreflect.cpp
+++ b/js/src/jsreflect.cpp
@@ -3,34 +3,35 @@
  * 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 reflection package. */
 
 #include "jsreflect.h"
 
-#include <stdlib.h>
-
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Util.h"
 
-#include "jspubtd.h"
+#include <stdlib.h>
+
 #include "jsarray.h"
 #include "jsatom.h"
 #include "jsobj.h"
+#include "jspubtd.h"
 
 #include "frontend/Parser.h"
-#include "frontend/ParseNode-inl.h"
 #include "frontend/TokenStream.h"
 #include "js/CharacterEncoding.h"
 #include "vm/RegExpObject.h"
 
 #include "jsobjinlines.h"
 
+#include "frontend/ParseNode-inl.h"
+
 using namespace js;
 using namespace js::frontend;
 
 using mozilla::ArrayLength;
 using mozilla::DebugOnly;
 
 char const * const js::aopNames[] = {
     "=",    /* AOP_ASSIGN */
--- a/js/src/jsreflect.h
+++ b/js/src/jsreflect.h
@@ -6,16 +6,17 @@
 
 /*
  * JS reflection package.
  */
 #ifndef jsreflect_h
 #define jsreflect_h
 
 #include <stdlib.h>
+
 #include "jspubtd.h"
 
 namespace js {
 
 enum ASTType {
     AST_ERROR = -1,
 #define ASTDEF(ast, str, method) ast,
 #include "jsast.tbl"
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -3,48 +3,47 @@
  * 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 script operations.
  */
 
-#include "jsscript.h"
-
-#include <string.h>
+#include "jsscriptinlines.h"
 
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/PodOperations.h"
 
-#include "jstypes.h"
-#include "jsutil.h"
+#include <string.h>
+
 #include "jsapi.h"
 #include "jsatom.h"
 #include "jscntxt.h"
 #include "jsdbgapi.h"
 #include "jsfun.h"
 #include "jsgc.h"
 #include "jsopcode.h"
-
-#include "gc/Marking.h"
+#include "jstypes.h"
+#include "jsutil.h"
+
 #include "frontend/BytecodeEmitter.h"
+#include "gc/Marking.h"
+#include "ion/BaselineJIT.h"
 #include "ion/IonCode.h"
-#include "ion/BaselineJIT.h"
 #include "vm/Debugger.h"
 #include "vm/Interpreter.h"
 #include "vm/Shape.h"
 #include "vm/Xdr.h"
 
 #include "jsfuninlines.h"
 #include "jsinferinlines.h"
-#include "jsscriptinlines.h"
-
+
+#include "vm/Runtime-inl.h"
 #include "vm/ScopeObject-inl.h"
-#include "vm/Runtime-inl.h"
 #include "vm/Stack-inl.h"
 
 using namespace js;
 using namespace js::gc;
 using namespace js::frontend;
 
 using mozilla::PodCopy;
 using mozilla::PodZero;
--- a/js/src/jsscriptinlines.h
+++ b/js/src/jsscriptinlines.h
@@ -2,21 +2,22 @@
  * 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 jsscriptinlines_h
 #define jsscriptinlines_h
 
+#include "jsscript.h"
+
 #include "jsautooplen.h"
 #include "jscntxt.h"
 #include "jsfun.h"
 #include "jsopcode.h"
-#include "jsscript.h"
 
 #include "ion/AsmJS.h"
 #include "vm/GlobalObject.h"
 #include "vm/RegExpObject.h"
 #include "vm/Shape.h"
 
 #include "jscompartmentinlines.h"
 
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -10,56 +10,56 @@
  * In order to avoid unnecessary js_LockGCThing/js_UnlockGCThing calls, these
  * native methods store strings (possibly newborn) converted from their 'this'
  * parameter and arguments on the stack: 'this' conversions at argv[-1], arg
  * conversions at their index (argv[0], argv[1]).  This is a legitimate method
  * of rooting things that might lose their newborn root due to subsequent GC
  * allocations in the same native method.
  */
 
-#include "jsstr.h"
+#include "jsstrinlines.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/PodOperations.h"
 
 #include <stdlib.h>
 #include <string.h>
-#include "jstypes.h"
-#include "jsutil.h"
-#include "jsprf.h"
+
 #include "jsapi.h"
 #include "jsarray.h"
 #include "jsatom.h"
+#include "jsautooplen.h"
 #include "jsbool.h"
 #include "jscntxt.h"
 #include "jsgc.h"
 #include "jsnum.h"
 #include "jsobj.h"
 #include "jsopcode.h"
+#include "jsprf.h"
+#include "jstypes.h"
+#include "jsutil.h"
 #include "jsversion.h"
 
 #include "builtin/RegExp.h"
 #include "vm/GlobalObject.h"
 #include "vm/Interpreter.h"
 #include "vm/NumericConversions.h"
 #include "vm/RegExpObject.h"
 #include "vm/RegExpStatics.h"
 #include "vm/ScopeObject.h"
 #include "vm/Shape.h"
 #include "vm/StringBuffer.h"
 
 #include "jsinferinlines.h"
-#include "jsstrinlines.h"
-#include "jsautooplen.h"        // generated headers last
 
 #include "vm/Interpreter-inl.h"
+#include "vm/String-inl.h"
 #include "vm/StringObject-inl.h"
-#include "vm/String-inl.h"
 
 using namespace js;
 using namespace js::gc;
 using namespace js::types;
 using namespace js::unicode;
 
 using mozilla::CheckedInt;
 using mozilla::IsNaN;
--- a/js/src/jsstr.h
+++ b/js/src/jsstr.h
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef jsstr_h
 #define jsstr_h
 
 #include "mozilla/PodOperations.h"
 
 #include <ctype.h>
+
 #include "jsapi.h"
 #include "jsatom.h"
 #include "jslock.h"
 #include "jsutil.h"
 
 #include "js/HashTable.h"
 #include "vm/Unicode.h"
 
--- a/js/src/jsstrinlines.h
+++ b/js/src/jsstrinlines.h
@@ -10,16 +10,17 @@
 #include "jsstr.h"
 
 #include "mozilla/Attributes.h"
 
 #include "jsatom.h"
 
 #include "jscntxtinlines.h"
 #include "jsgcinlines.h"
+
 #include "vm/String-inl.h"
 
 namespace js {
 
 class RopeBuilder {
     JSContext *cx;
     RootedString res;
 
--- a/js/src/jsutil.cpp
+++ b/js/src/jsutil.cpp
@@ -8,16 +8,17 @@
 
 #include "jsutil.h"
 
 #include "mozilla/Assertions.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/PodOperations.h"
 
 #include <stdio.h>
+
 #include "jstypes.h"
 
 #ifdef WIN32
 #    include "jswin.h"
 #endif
 
 #include "js/Utility.h"
 
--- a/js/src/jsutil.h
+++ b/js/src/jsutil.h
@@ -10,22 +10,22 @@
 
 #ifndef jsutil_h
 #define jsutil_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Compiler.h"
 #include "mozilla/GuardObjects.h"
 
-#include "js/Utility.h"
-
 #ifdef USE_ZLIB
 #include <zlib.h>
 #endif
 
+#include "js/Utility.h"
+
 /* Forward declarations. */
 struct JSContext;
 
 static JS_ALWAYS_INLINE void *
 js_memcpy(void *dst_, const void *src_, size_t len)
 {
     char *dst = (char *) dst_;
     const char *src = (const char *) src_;
--- a/js/src/jswatchpoint.h
+++ b/js/src/jswatchpoint.h
@@ -3,19 +3,19 @@
  * 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 jswatchpoint_h
 #define jswatchpoint_h
 
 #include "jsalloc.h"
-#include "jsprvtd.h"
 #include "jsapi.h"
 #include "jsfriendapi.h"
+#include "jsprvtd.h"
 
 #include "gc/Barrier.h"
 #include "js/HashTable.h"
 
 namespace js {
 
 struct WatchKey {
     WatchKey() {}
--- a/js/src/jsweakcache.h
+++ b/js/src/jsweakcache.h
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef jsweakcache_h
 #define jsweakcache_h
 
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jsobj.h"
+
 #include "gc/Marking.h"
 
 namespace js {
 
 // A WeakCache is used to map a key to a value similar to an HashMap except
 // that its entries are garbage collected.  An entry is kept as long as
 // both the key and value are marked.
 //
--- a/js/src/jsweakmap.h
+++ b/js/src/jsweakmap.h
@@ -3,18 +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/. */
 
 #ifndef jsweakmap_h
 #define jsweakmap_h
 
 #include "jsapi.h"
+#include "jscompartment.h"
 #include "jsfriendapi.h"
-#include "jscompartment.h"
 #include "jsobj.h"
 
 #include "gc/Marking.h"
 #include "js/HashTable.h"
 
 namespace js {
 
 // A subclass template of js::HashMap whose keys and values may be garbage-collected. When
--- a/js/src/jswin.h
+++ b/js/src/jswin.h
@@ -6,16 +6,17 @@
 
 #ifndef jswin_h
 #define jswin_h
 
 /*
  * This file is a wrapper around <windows.h> to prevent the mangling of
  * various function names throughout the codebase.
  */
+
 #ifdef XP_WIN
 # include <windows.h>
 # undef GetProp
 # undef SetProp
 # undef CONST
 # undef STRICT
 # undef LEGACY
 # undef THIS
--- a/js/src/jsworkers.cpp
+++ b/js/src/jsworkers.cpp
@@ -9,18 +9,18 @@
 #include "mozilla/DebugOnly.h"
 
 #include "prmjtime.h"
 
 #include "frontend/BytecodeCompiler.h"
 
 #ifdef JS_WORKER_THREADS
 # include "ion/AsmJS.h"
+# include "ion/ExecutionModeInlines.h"
 # include "ion/IonBuilder.h"
-# include "ion/ExecutionModeInlines.h"
 #endif
 
 #include "jscntxtinlines.h"
 #include "jscompartmentinlines.h"
 
 #include "vm/ObjectImpl-inl.h"
 
 using namespace js;
--- a/js/src/perf/pm_linux.cpp
+++ b/js/src/perf/pm_linux.cpp
@@ -1,29 +1,30 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "perf/jsperf.h"
-#include "jsutil.h"
-
-using namespace js;
-
 /* This variant of nsIPerfMeasurement uses the perf_event interface
  * added in Linux 2.6.31.  We key compilation of this file off the
  * existence of <linux/perf_event.h>.
  */
 
+#include <errno.h>
 #include <linux/perf_event.h>
-#include <sys/syscall.h>
+#include <string.h>
 #include <sys/ioctl.h>
-#include <errno.h>
+#include <sys/syscall.h>
 #include <unistd.h>
-#include <string.h>
+
+#include "jsutil.h"
+
+#include "perf/jsperf.h"
+
+using namespace js;
 
 // As of July 2010, this system call has not been added to the
 // C library, so we have to provide our own wrapper function.
 // If this code runs on a kernel that does not implement the
 // system call (2.6.30 or older) nothing unpredictable will
 // happen - it will just always fail and return -1.
 static int
 sys_perf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu,
--- a/js/src/prmjtime.cpp
+++ b/js/src/prmjtime.cpp
@@ -9,21 +9,20 @@
 #include "mozilla/MathAlgorithms.h"
 
 #ifdef SOLARIS
 #define _REENTRANT 1
 #endif
 #include <string.h>
 #include <time.h>
 
+#include "jsprf.h"
+#include "jslock.h"
 #include "jstypes.h"
 #include "jsutil.h"
-
-#include "jsprf.h"
-#include "jslock.h"
 #include "prmjtime.h"
 
 #define PRMJ_DO_MILLISECONDS 1
 
 #ifdef XP_OS2
 #include <sys/timeb.h>
 #endif
 #ifdef XP_WIN