Bug 850074 - Move SpiderMonkey stack rooting infrastructure to RootingAPI.h; r=billm
authorTerrence Cole <terrence@mozilla.com>
Tue, 12 Mar 2013 14:05:57 -0700
changeset 131002 d537ff6052e87bc375a7c34de41285bb8f54790c
parent 131001 14f64332f3ea0d051fe0ed9f94357a980221b8c6
child 131003 ad9ab32b68ab1d4e9e5cfd3d45b3c83beb582968
push id3582
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 20:50:56 +0000
treeherdermozilla-aurora@400370bbc9fa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs850074
milestone22.0a1
Bug 850074 - Move SpiderMonkey stack rooting infrastructure to RootingAPI.h; r=billm
js/public/RootingAPI.h
js/public/Value.h
js/src/Makefile.in
js/src/assembler/assembler/AssemblerBuffer.h
js/src/builtin/Intl.h
js/src/gc/Barrier.h
js/src/gc/Root.h
js/src/ion/C1Spewer.h
js/src/ion/CompilerRoot.h
js/src/ion/IonMacroAssembler.cpp
js/src/ion/JSONSpewer.h
js/src/jsapi-tests/tests.cpp
js/src/jsapi.h
js/src/jsboolinlines.h
js/src/jscompartment.cpp
js/src/jsgcinlines.h
js/src/jsinferinlines.h
js/src/jsobjinlines.h
js/src/jsscript.h
js/src/vm/PropertyKey.cpp
js/src/vm/Shape.h
js/src/vm/String.h
rename from js/src/gc/Root.h
rename to js/public/RootingAPI.h
--- a/js/public/Value.h
+++ b/js/public/Value.h
@@ -11,18 +11,18 @@
 #define js_Value_h___
 
 #include "mozilla/Attributes.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Likely.h"
 
 #include <limits> /* for std::numeric_limits */
 
-#include "gc/Root.h"
 #include "js/Anchor.h"
+#include "js/RootingAPI.h"
 #include "js/Utility.h"
 
 namespace JS { class Value; }
 
 /* JS::Value can store a full int32_t. */
 #define JSVAL_INT_BITS          32
 #define JSVAL_INT_MIN           ((int32_t)0x80000000)
 #define JSVAL_INT_MAX           ((int32_t)0x7fffffff)
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -171,26 +171,22 @@ INSTALLED_HEADERS = \
 		jsversion.h \
 		jswrapper.h \
 		$(NULL)
 
 ######################################################
 # BEGIN exported headers that are only exported
 #       because of inclusion by an INSTALLED_HEADER
 #
-EXPORTS_NAMESPACES += ds gc
+EXPORTS_NAMESPACES += ds
 
 EXPORTS_ds = \
 		BitArray.h \
 		$(NULL)
 
-EXPORTS_gc = \
-		Root.h \
-		$(NULL)
-
 ######################################################
 # BEGIN include exported headers from the JS engine
 #
 #       Ultimately, after cleansing INSTALLED_HEADERS,
 #       these will be the ONLY headers exported by
 #       the js engine
 #
 VPATH		+= \
@@ -207,16 +203,17 @@ EXPORTS_js = \
 		CharacterEncoding.h \
 		GCAPI.h \
 		HashTable.h \
 		HeapAPI.h \
 		LegacyIntTypes.h \
 		MemoryMetrics.h \
 		PropertyKey.h \
 		RequiredDefines.h \
+		RootingAPI.h \
 		TemplateLib.h \
 		Utility.h \
 		Value.h \
 		Vector.h \
 		$(NULL)
 
 ###############################################
 # BEGIN enable non-releasable features
--- a/js/src/assembler/assembler/AssemblerBuffer.h
+++ b/js/src/assembler/assembler/AssemblerBuffer.h
@@ -38,19 +38,19 @@
 #include <limits.h>
 #include "assembler/jit/ExecutableAllocator.h"
 #include "assembler/wtf/Assertions.h"
 
 #include <stdarg.h>
 #include "jsfriendapi.h"
 #include "jsopcode.h"
 
-#include "gc/Root.h"
+#include "ion/IonSpewer.h"
+#include "js/RootingAPI.h"
 #include "methodjit/Logging.h"
-#include "ion/IonSpewer.h"
 
 #define PRETTY_PRINT_OFFSET(os) (((os)<0)?"-":""), (((os)<0)?-(os):(os))
 
 #define FIXME_INSN_PRINTING                                 \
     do {                                                    \
         spew("FIXME insn printing %s:%d",                   \
              __FILE__, __LINE__);                           \
     } while (0)
--- a/js/src/builtin/Intl.h
+++ b/js/src/builtin/Intl.h
@@ -2,17 +2,17 @@
  *
  * 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 Intl_h___
 #define Intl_h___
 
-#include "gc/Root.h"
+#include "js/RootingAPI.h"
 
 struct JSContext;
 class JSObject;
 
 /*
  * The Intl module specified by standard ECMA-402,
  * ECMAScript Internationalization API Specification.
  */
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -6,18 +6,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef jsgc_barrier_h___
 #define jsgc_barrier_h___
 
 #include "jsapi.h"
 
 #include "gc/Heap.h"
-#include "gc/Root.h"
 #include "js/HashTable.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
  *   - writes to array slots
--- a/js/src/ion/C1Spewer.h
+++ b/js/src/ion/C1Spewer.h
@@ -5,19 +5,20 @@
  * 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
 
 #ifndef jsion_c1spewer_h__
 #define jsion_c1spewer_h__
 
-#include "gc/Root.h"
 #include "jsscript.h"
 
+#include "js/RootingAPI.h"
+
 namespace js {
 namespace ion {
 
 class MDefinition;
 class MInstruction;
 class MBasicBlock;
 class MIRGraph;
 class LinearScanAllocator;
--- a/js/src/ion/CompilerRoot.h
+++ b/js/src/ion/CompilerRoot.h
@@ -4,17 +4,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/. */
 
 #if !defined(jsion_ion_gc_h__) && defined(JS_ION)
 #define jsion_ion_gc_h__
 
 #include "jscntxt.h"
-#include "gc/Root.h"
+
+#include "js/RootingAPI.h"
 
 namespace js {
 namespace ion {
 
 // Roots a read-only GCThing for the lifetime of a single compilation.
 // Each root is maintained in a linked list that is walked over during tracing.
 // The CompilerRoot must be heap-allocated and may not go out of scope.
 template <typename T>
--- a/js/src/ion/IonMacroAssembler.cpp
+++ b/js/src/ion/IonMacroAssembler.cpp
@@ -1,21 +1,23 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=4 sw=4 et 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 "jsinfer.h"
+
+#include "ion/Bailouts.h"
+#include "ion/IonMacroAssembler.h"
+#include "js/RootingAPI.h"
+#include "vm/ForkJoin.h"
+
 #include "jsinferinlines.h"
-#include "IonMacroAssembler.h"
-#include "gc/Root.h"
-#include "Bailouts.h"
-#include "vm/ForkJoin.h"
 
 using namespace js;
 using namespace js::ion;
 
 // Emulate a TypeSet logic from a Type object to avoid duplicating the guard
 // logic.
 class TypeWrapper {
     types::Type t_;
--- a/js/src/ion/JSONSpewer.h
+++ b/js/src/ion/JSONSpewer.h
@@ -5,19 +5,20 @@
  * 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 js_ion_jsonspewer_h__
 #define js_ion_jsonspewer_h__
 
 #include <stdio.h>
 
-#include "gc/Root.h"
 #include "jsscript.h"
 
+#include "js/RootingAPI.h"
+
 class JSScript;
 
 namespace js {
 namespace ion {
 
 class MDefinition;
 class MInstruction;
 class MBasicBlock;
--- a/js/src/jsapi-tests/tests.cpp
+++ b/js/src/jsapi-tests/tests.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sw=4 et tw=78:
  *
  * 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 "tests.h"
-#include "gc/Root.h"
+#include "js/RootingAPI.h"
 #include "jsobj.h"
 #include <stdio.h>
 
 JSAPITest *JSAPITest::list;
 
 bool JSAPITest::init()
 {
     rt = createRuntime();
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -20,21 +20,21 @@
 #include <stddef.h>
 #include <stdio.h>
 
 #include "js-config.h"
 #include "jsalloc.h"
 #include "jspubtd.h"
 #include "jsutil.h"
 
-#include "gc/Root.h"
 #include "js/Anchor.h"
 #include "js/CharacterEncoding.h"
 #include "js/HashTable.h"
 #include "js/PropertyKey.h"
+#include "js/RootingAPI.h"
 #include "js/Utility.h"
 #include "js/Value.h"
 #include "js/Vector.h"
 
 /************************************************************************/
 
 namespace JS {
 
--- a/js/src/jsboolinlines.h
+++ b/js/src/jsboolinlines.h
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef jsboolinlines_h___
 #define jsboolinlines_h___
 
 #include "mozilla/Assertions.h"
 #include "mozilla/Likely.h"
 
-#include "gc/Root.h"
+#include "js/RootingAPI.h"
 
 #include "jsobjinlines.h"
 
 #include "vm/BooleanObject-inl.h"
 
 namespace js {
 
 bool BooleanGetPrimitiveValueSlow(JSContext *, HandleObject, Value *);
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -17,22 +17,22 @@
 #include "jswatchpoint.h"
 #include "jswrapper.h"
 
 #if ENABLE_YARR_JIT
 #include "assembler/jit/ExecutableAllocator.h"
 #endif
 #include "assembler/wtf/Platform.h"
 #include "gc/Marking.h"
-#include "gc/Root.h"
 #ifdef JS_ION
 #include "ion/IonCompartment.h"
 #include "ion/Ion.h"
 #endif
 #include "js/MemoryMetrics.h"
+#include "js/RootingAPI.h"
 #include "methodjit/MethodJIT.h"
 #include "methodjit/PolyIC.h"
 #include "methodjit/MonoIC.h"
 #include "methodjit/Retcon.h"
 #include "vm/Debugger.h"
 #include "vm/ForkJoin.h"
 #include "yarr/BumpPointerAllocator.h"
 
--- a/js/src/jsgcinlines.h
+++ b/js/src/jsgcinlines.h
@@ -7,17 +7,17 @@
 #ifndef jsgcinlines_h___
 #define jsgcinlines_h___
 
 #include "jsgc.h"
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jslock.h"
 
-#include "gc/Root.h"
+#include "js/RootingAPI.h"
 #include "js/TemplateLib.h"
 #include "vm/Shape.h"
 
 namespace js {
 
 class Shape;
 
 /*
--- a/js/src/jsinferinlines.h
+++ b/js/src/jsinferinlines.h
@@ -7,21 +7,21 @@
 /* Inline members for javascript type inference. */
 
 #include "jsarray.h"
 #include "jsanalyze.h"
 #include "jscompartment.h"
 #include "jsinfer.h"
 #include "jsprf.h"
 
-#include "gc/Root.h"
-#include "vm/GlobalObject.h"
 #ifdef JS_ION
 #include "ion/IonFrames.h"
 #endif
+#include "js/RootingAPI.h"
+#include "vm/GlobalObject.h"
 
 #include "vm/Stack-inl.h"
 
 #ifndef jsinferinlines_h___
 #define jsinferinlines_h___
 
 inline bool
 js::TaggedProto::isObject() const
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -23,18 +23,18 @@
 #include "jsstr.h"
 #include "jstypedarray.h"
 #include "jswrapper.h"
 
 #include "builtin/MapObject.h"
 #include "builtin/Iterator-inl.h"
 #include "gc/Barrier.h"
 #include "gc/Marking.h"
-#include "gc/Root.h"
 #include "js/MemoryMetrics.h"
+#include "js/RootingAPI.h"
 #include "js/TemplateLib.h"
 #include "vm/BooleanObject.h"
 #include "vm/GlobalObject.h"
 #include "vm/Shape.h"
 #include "vm/NumberObject.h"
 #include "vm/RegExpStatics.h"
 #include "vm/StringObject.h"
 
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -5,22 +5,23 @@
  * 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 jsscript_h___
 #define jsscript_h___
 /*
  * JS script descriptor.
  */
+
 #include "jsdbgapi.h"
 #include "jsinfer.h"
 #include "jsopcode.h"
 
 #include "gc/Barrier.h"
-#include "gc/Root.h"
+#include "js/RootingAPI.h"
 #include "vm/Shape.h"
 
 ForwardDeclareJS(Script);
 
 namespace js {
 
 namespace ion {
     struct IonScript;
--- a/js/src/vm/PropertyKey.cpp
+++ b/js/src/vm/PropertyKey.cpp
@@ -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/. */
 
 /* PropertyKey implementation details. */
 
 #include "mozilla/Assertions.h"
 
-#include "gc/Root.h"
 #include "js/PropertyKey.h"
+#include "js/RootingAPI.h"
 #include "js/Value.h"
 #include "vm/String.h"
 
 #include "jsinferinlines.h"
 #include "jsatominlines.h"
 
 using namespace js;
 
--- a/js/src/vm/Shape.h
+++ b/js/src/vm/Shape.h
@@ -10,19 +10,19 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/GuardObjects.h"
 
 #include "jsobj.h"
 #include "jspropertytree.h"
 #include "jstypes.h"
 
+#include "gc/Heap.h"
 #include "js/HashTable.h"
-#include "gc/Heap.h"
-#include "gc/Root.h"
+#include "js/RootingAPI.h"
 
 #ifdef _MSC_VER
 #pragma warning(push)
 #pragma warning(disable:4800)
 #pragma warning(push)
 #pragma warning(disable:4100) /* Silence unreferenced formal parameter warnings */
 #endif
 
--- a/js/src/vm/String.h
+++ b/js/src/vm/String.h
@@ -6,26 +6,25 @@
  * 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 "js/CharacterEncoding.h"
-
 #include "jsapi.h"
 #include "jsatom.h"
 #include "jsfriendapi.h"
 #include "jsstr.h"
 
 #include "gc/Barrier.h"
 #include "gc/Heap.h"
-#include "gc/Root.h"
+#include "js/CharacterEncoding.h"
+#include "js/RootingAPI.h"
 
 ForwardDeclareJS(String);
 class JSDependentString;
 class JSUndependedString;
 class JSExtensibleString;
 class JSExternalString;
 ForwardDeclareJS(LinearString);
 class JSStableString;