Bug 912411 (part 3) - Remove lots of jsapi.h includes in SpiderMonkey. r=luke.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 05 Sep 2013 16:08:57 -0700
changeset 158706 c1262e2db2912441cc4f7326e2c1ab161c8b947c
parent 158705 053f6a2c5e293a0c34618591f02dd58e7ce56381
child 158707 ef3fb1cc922e49ddac0b5b05243aab3a0475ed2c
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs912411
milestone26.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 912411 (part 3) - Remove lots of jsapi.h includes in SpiderMonkey. r=luke.
js/src/builtin/MapObject.h
js/src/builtin/ParallelArray.h
js/src/ctypes/CTypes.h
js/src/ctypes/Library.h
js/src/ds/IdValuePair.h
js/src/gc/Barrier.h
js/src/gc/GCInternals.h
js/src/gc/Verifier.cpp
js/src/gdb/gdb-tests.cpp
js/src/gdb/gdb-tests.h
js/src/gdb/tests/test-JSObject.cpp
js/src/gdb/tests/test-Root.cpp
js/src/gdb/tests/test-jsid.cpp
js/src/gdb/tests/test-jsval.cpp
js/src/jsapi-tests/tests.h
js/src/jsatom.cpp
js/src/jsatom.h
js/src/jsbool.h
js/src/jsgc.h
js/src/jsinfer.h
js/src/json.h
js/src/jsonparser.h
js/src/jsopcode.h
js/src/jsweakmap.h
js/src/shell/jsheaptools.h
js/src/vm/Debugger.h
js/src/vm/Interpreter-inl.h
js/src/vm/TypedArrayObject.h
--- a/js/src/builtin/MapObject.h
+++ b/js/src/builtin/MapObject.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 builtin_MapObject_h
 #define builtin_MapObject_h
 
-#include "jsapi.h"
 #include "jsobj.h"
 
 #include "vm/Runtime.h"
 
 namespace js {
 
 /*
  * Comparing two ropes for equality can fail. The js::HashTable template
--- a/js/src/builtin/ParallelArray.h
+++ b/js/src/builtin/ParallelArray.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 builtin_ParallelArray_h
 #define builtin_ParallelArray_h
 
-#include "jsapi.h"
 #include "jsobj.h"
 
 #include "jit/Ion.h"
 
 namespace js {
 
 class ParallelArrayObject : public JSObject
 {
--- a/js/src/ctypes/CTypes.h
+++ b/js/src/ctypes/CTypes.h
@@ -2,17 +2,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 ctypes_CTypes_h
 #define ctypes_CTypes_h
 
 #include "ffi.h"
-#include "jsapi.h"
 #include "jscntxt.h"
 #include "prlink.h"
 
 #include "js/HashTable.h"
 
 namespace js {
 namespace ctypes {
 
--- a/js/src/ctypes/Library.h
+++ b/js/src/ctypes/Library.h
@@ -1,36 +1,37 @@
 /* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* 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 ctypes_Library_h
 #define ctypes_Library_h
 
-#include "jsapi.h"
+#include "js/TypeDecls.h"
 
+struct JSCTypesCallbacks;
 struct PRLibrary;
 
 namespace js {
 namespace ctypes {
 
 enum LibrarySlot {
   SLOT_LIBRARY = 0,
   LIBRARY_SLOTS
 };
 
 namespace Library
 {
-  bool Name(JSContext* cx, unsigned argc, jsval *vp);
+  bool Name(JSContext* cx, unsigned argc, JS::Value *vp);
 
-  JSObject* Create(JSContext* cx, jsval path, JSCTypesCallbacks* callbacks);
+  JSObject* Create(JSContext* cx, JS::Value path, JSCTypesCallbacks* callbacks);
 
   bool IsLibrary(JSObject* obj);
   PRLibrary* GetLibrary(JSObject* obj);
 
-  bool Open(JSContext* cx, unsigned argc, jsval* vp);
+  bool Open(JSContext* cx, unsigned argc, JS::Value* vp);
 }
 
 }
 }
 
 #endif /* ctypes_Library_h */
--- a/js/src/ds/IdValuePair.h
+++ b/js/src/ds/IdValuePair.h
@@ -4,16 +4,18 @@
  * 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 ds_IdValuePair_h
 #define ds_IdValuePair_h
 
 #include "NamespaceImports.h"
 
+#include "js/Id.h"
+
 namespace js {
 
 struct IdValuePair
 {
     jsid id;
     Value value;
 
     IdValuePair() {}
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -2,21 +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 gc_Barrier_h
 #define gc_Barrier_h
 
-#include "jsapi.h"
 #include "NamespaceImports.h"
 
 #include "gc/Heap.h"
 #include "js/HashTable.h"
+#include "js/Id.h"
 #include "js/RootingAPI.h"
 
 /*
  * A write barrier is a mechanism used by incremental or generation GCs to
  * ensure that every value that needs to be marked is marked. In general, the
  * write barrier should be invoked whenever a write can cause the set of things
  * traced through by the GC to change. This includes:
  *   - writes to object properties
--- a/js/src/gc/GCInternals.h
+++ b/js/src/gc/GCInternals.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 gc_GCInternals_h
 #define gc_GCInternals_h
 
-#include "jsapi.h"
 #include "jsworkers.h"
 
 #include "vm/Runtime.h"
 
 namespace js {
 namespace gc {
 
 void
--- a/js/src/gc/Verifier.cpp
+++ b/js/src/gc/Verifier.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/. */
 
 #ifdef MOZ_VALGRIND
 # include <valgrind/memcheck.h>
 #endif
 
-#include "jsapi.h"
 #include "jscntxt.h"
 #include "jsgc.h"
 #include "jsprf.h"
 
 #include "gc/GCInternals.h"
 #include "gc/Zone.h"
 #include "js/HashTable.h"
 
--- a/js/src/gdb/gdb-tests.cpp
+++ b/js/src/gdb/gdb-tests.cpp
@@ -2,16 +2,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/. */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "gdb-tests.h"
+#include "jsapi.h"
 #include "jsfriendapi.h"
 
 using namespace JS;
 
 /* The class of the global object. */
 JSClass global_class = {
     "global", JSCLASS_GLOBAL_FLAGS,
     JS_PropertyStub,  JS_DeletePropertyStub, JS_PropertyStub,  JS_StrictPropertyStub,
--- a/js/src/gdb/gdb-tests.h
+++ b/js/src/gdb/gdb-tests.h
@@ -15,17 +15,16 @@
 // - js/src/gdb/mozilla holds the actual GDB SpiderMonkey support code.
 // - Each '.py' file in js/src/gdb/tests is a unit test for the above.
 // - Each '.cpp' file in js/src/gdb/tests is C++ code for one of the unit tests
 //   to run.
 //
 // (So the .cpp files are two steps removed from being anything one would
 // actually run.)
 
-#include "jsapi.h"
 #include "NamespaceImports.h"
 
 void breakpoint();
 
 struct GDBFragment {
     GDBFragment() {
         next = allFragments;
         allFragments = this;
--- a/js/src/gdb/tests/test-JSObject.cpp
+++ b/js/src/gdb/tests/test-JSObject.cpp
@@ -1,9 +1,10 @@
 #include "gdb-tests.h"
+#include "jsapi.h"
 
 FRAGMENT(JSObject, simple) {
   JS::Rooted<JSObject *> glob(cx, JS::CurrentGlobalOrNull(cx));
   JS::Rooted<JSObject *> plain(cx, JS_NewObject(cx, 0, 0, 0));
   JS::Rooted<JSObject *> func(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0,
                                                               JS::CurrentGlobalOrNull(cx), "dys"));
   JS::Rooted<JSObject *> anon(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0,
                                                               JS::CurrentGlobalOrNull(cx), 0));
--- a/js/src/gdb/tests/test-Root.cpp
+++ b/js/src/gdb/tests/test-Root.cpp
@@ -1,9 +1,10 @@
 #include "gdb-tests.h"
+#include "jsapi.h"
 
 FRAGMENT(Root, null) {
   JS::Rooted<JSObject *> null(cx, NULL);
 
   breakpoint();
 
   (void) null;
 }
--- a/js/src/gdb/tests/test-jsid.cpp
+++ b/js/src/gdb/tests/test-jsid.cpp
@@ -1,9 +1,10 @@
 #include "gdb-tests.h"
+#include "jsapi.h"
 
 FRAGMENT(jsid, simple) {
   JS::Rooted<JSString *> string(cx, JS_NewStringCopyZ(cx, "moon"));
   JS::Rooted<JSString *> interned(cx, JS_InternJSString(cx, string));
   JS::Rooted<jsid> string_id(cx, INTERNED_STRING_TO_JSID(cx, interned));
   jsid int_id = INT_TO_JSID(1729);
   jsid void_id = JSID_VOID;
   JS::Rooted<jsid> object_id(cx, OBJECT_TO_JSID(JS::CurrentGlobalOrNull(cx)));
--- a/js/src/gdb/tests/test-jsval.cpp
+++ b/js/src/gdb/tests/test-jsval.cpp
@@ -1,9 +1,10 @@
 #include "gdb-tests.h"
+#include "jsapi.h"
 
 FRAGMENT(jsval, simple) {
   JS::Rooted<jsval> fortytwo(cx, INT_TO_JSVAL(42));
   JS::Rooted<jsval> negone(cx, INT_TO_JSVAL(-1));
   JS::Rooted<jsval> undefined(cx, JSVAL_VOID);
   JS::Rooted<jsval> null(cx, JSVAL_NULL);
   JS::Rooted<jsval> js_true(cx, JSVAL_TRUE);
   JS::Rooted<jsval> js_false(cx, JSVAL_FALSE);
--- a/js/src/jsapi-tests/tests.h
+++ b/js/src/jsapi-tests/tests.h
@@ -10,17 +10,16 @@
 #include "mozilla/Util.h"
 
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "jsalloc.h"
-#include "jsapi.h"
 #include "jscntxt.h"
 #include "jsgc.h"
 
 #include "js/Vector.h"
 
 /* Note: Aborts on OOM. */
 class JSAPITestString {
     js::Vector<char, 0, js::SystemAllocPolicy> chars;
--- a/js/src/jsatom.cpp
+++ b/js/src/jsatom.cpp
@@ -10,17 +10,16 @@
 
 #include "jsatominlines.h"
 
 #include "mozilla/RangedPtr.h"
 #include "mozilla/Util.h"
 
 #include <string.h>
 
-#include "jsapi.h"
 #include "jscntxt.h"
 #include "jsstr.h"
 #include "jstypes.h"
 
 #include "gc/Marking.h"
 #include "vm/Xdr.h"
 
 #include "jscntxtinlines.h"
--- a/js/src/jsatom.h
+++ b/js/src/jsatom.h
@@ -4,21 +4,24 @@
  * 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 jsatom_h
 #define jsatom_h
 
 #include "mozilla/HashFunctions.h"
 
+#include "jsalloc.h"
+
 #include "gc/Barrier.h"
 #include "gc/Rooting.h"
 #include "vm/CommonPropertyNames.h"
 
 class JSAtom;
+class JSAutoByteString;
 
 struct JSIdArray {
     int length;
     js::HeapId vector[1];    /* actually, length jsid words */
 };
 
 namespace js {
 
--- 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 "NamespaceImports.h"
 
 extern JSObject *
 js_InitBooleanClass(JSContext *cx, js::HandleObject obj);
 
 extern JSString *
 js_BooleanToString(js::ExclusiveContext *cx, bool b);
 
--- a/js/src/jsgc.h
+++ b/js/src/jsgc.h
@@ -7,17 +7,16 @@
 /* JS Garbage Collector. */
 
 #ifndef jsgc_h
 #define jsgc_h
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MemoryReporting.h"
 
-#include "jsapi.h"
 #include "jslock.h"
 #include "jsobj.h"
 
 #include "js/GCAPI.h"
 #include "js/Vector.h"
 
 class JSAtom;
 struct JSCompartment;
--- a/js/src/jsinfer.h
+++ b/js/src/jsinfer.h
@@ -6,22 +6,24 @@
 
 /* Definitions related to javascript type inference. */
 
 #ifndef jsinfer_h
 #define jsinfer_h
 
 #include "mozilla/MemoryReporting.h"
 
+#include "jsalloc.h"
 #include "jsfriendapi.h"
 
 #include "ds/IdValuePair.h"
 #include "ds/LifoAlloc.h"
 #include "gc/Barrier.h"
 #include "js/Utility.h"
+#include "js/Vector.h"
 
 namespace js {
 
 class TypeRepresentation;
 
 class TaggedProto
 {
   public:
--- a/js/src/json.h
+++ b/js/src/json.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 json_h
 #define json_h
 
-#include "jsapi.h"
 #include "NamespaceImports.h"
 
 #include "js/RootingAPI.h"
 
 namespace js {
 class StringBuffer;
 }
 
--- a/js/src/jsonparser.h
+++ b/js/src/jsonparser.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 jsonparser_h
 #define jsonparser_h
 
 #include "mozilla/Attributes.h"
 
-#include "jsapi.h"
-
 #include "ds/IdValuePair.h"
 #include "vm/String.h"
 
 namespace js {
 
 class MOZ_STACK_CLASS JSONParser : private AutoGCRooter
 {
   public:
--- a/js/src/jsopcode.h
+++ b/js/src/jsopcode.h
@@ -6,17 +6,16 @@
 
 #ifndef jsopcode_h
 #define jsopcode_h
 
 /*
  * JS bytecode definitions.
  */
 
-#include "jsapi.h"
 #include "jsbytecode.h"
 #include "NamespaceImports.h"
 
 #include "frontend/SourceNotes.h"
 
 /*
  * JS operation bytecodes.
  */
--- a/js/src/jsweakmap.h
+++ b/js/src/jsweakmap.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 jsweakmap_h
 #define jsweakmap_h
 
-#include "jsapi.h"
 #include "jscompartment.h"
 #include "jsfriendapi.h"
 #include "jsobj.h"
 
 #include "gc/Marking.h"
 #include "js/HashTable.h"
 
 namespace js {
--- a/js/src/shell/jsheaptools.h
+++ b/js/src/shell/jsheaptools.h
@@ -4,15 +4,15 @@
  * 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_jsheaptools_h
 #define shell_jsheaptools_h
 
 #ifdef DEBUG
 
-#include "jsapi.h"
+#include "js/TypeDecls.h"
 
-bool FindReferences(JSContext *cx, unsigned argc, jsval *vp);
+bool FindReferences(JSContext *cx, unsigned argc, JS::Value *vp);
 
 #endif /* DEBUG */
 
 #endif /* shell_jsheaptools_h */
--- a/js/src/vm/Debugger.h
+++ b/js/src/vm/Debugger.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 vm_Debugger_h
 #define vm_Debugger_h
 
 #include "mozilla/LinkedList.h"
 
-#include "jsapi.h"
 #include "jsclist.h"
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsweakmap.h"
 
 #include "gc/Barrier.h"
 #include "js/HashTable.h"
 #include "vm/GlobalObject.h"
--- a/js/src/vm/Interpreter-inl.h
+++ b/js/src/vm/Interpreter-inl.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 vm_Interpreter_inl_h
 #define vm_Interpreter_inl_h
 
 #include "vm/Interpreter.h"
 
-#include "jsapi.h"
 #include "jscompartment.h"
 #include "jsinfer.h"
 #include "jsnum.h"
 #include "jsstr.h"
 
 #include "jit/Ion.h"
 #include "jit/IonCompartment.h"
 #include "vm/ArgumentsObject.h"
--- a/js/src/vm/TypedArrayObject.h
+++ b/js/src/vm/TypedArrayObject.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 vm_TypedArrayObject_h
 #define vm_TypedArrayObject_h
 
-#include "jsapi.h"
 #include "jsobj.h"
 
 #include "builtin/TypeRepresentation.h"
 #include "gc/Barrier.h"
 #include "js/Class.h"
 
 typedef struct JSProperty JSProperty;