Bug 880565 (part 1) - Move isFunction() et al from jsobjinlines.h to jsobj.h and minimize the number of files that #include jsobjinlines.h. r=benjamin.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 05 Jun 2013 19:07:43 -0700
changeset 146622 b86a5ad596b74bcffb1615fc332e7b7e2a726408
parent 146621 dbd84e331bbb7d271bd62c626fe11b587efb1f8b
child 146623 7a56133fe3829886d594c8e1ac1768061f0eeaf9
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbenjamin
bugs880565
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 880565 (part 1) - Move isFunction() et al from jsobjinlines.h to jsobj.h and minimize the number of files that #include jsobjinlines.h. r=benjamin.
js/src/builtin/Iterator-inl.h
js/src/builtin/MapObject.cpp
js/src/builtin/Module.cpp
js/src/builtin/ParallelArray.cpp
js/src/builtin/RegExp.cpp
js/src/builtin/TestingFunctions.cpp
js/src/ctypes/CTypes.cpp
js/src/frontend/BytecodeCompiler.cpp
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/NameFunctions.cpp
js/src/frontend/Parser.cpp
js/src/frontend/SharedContext.h
js/src/gc/Iteration.cpp
js/src/gc/Marking.cpp
js/src/gc/RootMarking.cpp
js/src/gc/Verifier.cpp
js/src/gc/Zone.cpp
js/src/ion/AsmJS.cpp
js/src/ion/BytecodeAnalysis.cpp
js/src/ion/Ion.cpp
js/src/ion/Lowering.cpp
js/src/jsapi-tests/testBug604087.cpp
js/src/jsapi-tests/testFuncCallback.cpp
js/src/jsapi-tests/testGCFinalizeCallback.cpp
js/src/jsapi-tests/testOriginPrincipals.cpp
js/src/jsapi-tests/testStringBuffer.cpp
js/src/jsapi-tests/testVersion.cpp
js/src/jsapi-tests/testXDR.cpp
js/src/jsapi-tests/tests.h
js/src/jsapi.cpp
js/src/jsarray.cpp
js/src/jsatom.cpp
js/src/jsbool.cpp
js/src/jsboolinlines.h
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/jscntxtinlines.h
js/src/jscompartmentinlines.h
js/src/jsdate.cpp
js/src/jsdbgapi.cpp
js/src/jsfriendapi.cpp
js/src/jsfun.cpp
js/src/jsinfer.cpp
js/src/jsnum.cpp
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/json.cpp
js/src/jsonparser.cpp
js/src/jsopcode.cpp
js/src/jsscript.cpp
js/src/jsstr.cpp
js/src/jstypedarray.cpp
js/src/jswatchpoint.cpp
js/src/perf/jsperf.cpp
js/src/shell/js.cpp
js/src/vm/ArgumentsObject.cpp
js/src/vm/BooleanObject-inl.h
js/src/vm/Debugger-inl.h
js/src/vm/Debugger.cpp
js/src/vm/Debugger.h
js/src/vm/Interpreter.cpp
js/src/vm/NumberObject-inl.h
js/src/vm/ObjectImpl-inl.h
js/src/vm/ObjectImpl.cpp
js/src/vm/ObjectImpl.h
js/src/vm/RegExpObject-inl.h
js/src/vm/RegExpStatics-inl.h
js/src/vm/Shape-inl.h
js/src/vm/Stack-inl.h
js/src/vm/Stack.cpp
js/src/vm/Stack.h
js/src/vm/String-inl.h
js/src/vm/String.cpp
js/src/vm/StringObject-inl.h
js/src/vm/Xdr.cpp
js/src/vm/Xdr.h
--- a/js/src/builtin/Iterator-inl.h
+++ b/js/src/builtin/Iterator-inl.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 Iterator_inl_h_
 #define Iterator_inl_h_
 
 #include "jsiter.h"
-#include "jsobjinlines.h"
 
 inline bool
 JSObject::isPropertyIterator() const
 {
     return hasClass(&js::PropertyIteratorObject::class_);
 }
 
 inline js::PropertyIteratorObject &
--- a/js/src/builtin/MapObject.cpp
+++ b/js/src/builtin/MapObject.cpp
@@ -8,16 +8,17 @@
 
 #include "jscntxt.h"
 #include "jsiter.h"
 #include "jsobj.h"
 
 #include "gc/Marking.h"
 #include "js/Utility.h"
 #include "vm/GlobalObject.h"
+#include "vm/Interpreter.h"
 #include "vm/Stack.h"
 
 #include "jsobjinlines.h"
 
 using namespace js;
 
 using mozilla::DoubleIsInt32;
 using mozilla::IsNaN;
--- a/js/src/builtin/Module.cpp
+++ b/js/src/builtin/Module.cpp
@@ -1,16 +1,17 @@
 /* -*- 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/Module.h"
+
 #include "jsobjinlines.h"
-#include "builtin/Module.h"
 
 using namespace js;
 
 Class js::ModuleClass = {
     "Module",
     JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_IS_ANONYMOUS,
     JS_PropertyStub,        /* addProperty */
     JS_DeletePropertyStub,  /* delProperty */
--- a/js/src/builtin/ParallelArray.cpp
+++ b/js/src/builtin/ParallelArray.cpp
@@ -10,18 +10,16 @@
 
 #include "builtin/ParallelArray.h"
 
 #include "vm/ForkJoin.h"
 #include "vm/GlobalObject.h"
 #include "vm/String.h"
 #include "vm/ThreadPool.h"
 
-#include "jsobjinlines.h"
-
 #include "vm/Interpreter-inl.h"
 
 using namespace js;
 
 //
 // ParallelArrayObject
 //
 
--- a/js/src/builtin/RegExp.cpp
+++ b/js/src/builtin/RegExp.cpp
@@ -5,16 +5,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #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;
 
 using mozilla::ArrayLength;
 
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -6,23 +6,24 @@
 
 #include "jsapi.h"
 #include "jsbool.h"
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsfriendapi.h"
 #include "jsgc.h"
 #include "jsobj.h"
-#include "jsobjinlines.h"
 #include "jsprf.h"
 #include "jswrapper.h"
 
 #include "builtin/TestingFunctions.h"
 #include "vm/ForkJoin.h"
 
+#include "jsobjinlines.h"
+
 #include "vm/Stack-inl.h"
 
 using namespace js;
 using namespace JS;
 
 using mozilla::ArrayLength;
 
 static JSBool
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -1,24 +1,22 @@
 /* -*- 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 "ctypes/CTypes.h"
+
 #include "mozilla/FloatingPoint.h"
-
-#include "CTypes.h"
-#include "Library.h"
-#include "jsnum.h"
-#include "jscompartment.h"
-#include "jsobjinlines.h"
+#include "mozilla/StandardInteger.h"
+
 #include <limits>
-
 #include <math.h>
+
 #if defined(XP_WIN) || defined(XP_OS2)
 #include <float.h>
 #endif
 
 #if defined(SOLARIS)
 #include <ieeefp.h>
 #endif
 
@@ -27,17 +25,22 @@
 #endif
 
 #if defined(XP_UNIX)
 #include <errno.h>
 #elif defined(XP_WIN)
 #include <windows.h>
 #endif
 
-#include "mozilla/StandardInteger.h"
+#include "jscompartment.h"
+#include "jsnum.h"
+#include "jsprf.h"
+#include "jstypedarray.h"
+
+#include "ctypes/Library.h"
 
 using namespace std;
 
 namespace js {
 namespace ctypes {
 
 size_t
 GetDeflatedUTF8StringLength(JSContext *maybecx, const jschar *chars,
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -9,16 +9,18 @@
 #include "jsscript.h"
 #include "frontend/BytecodeEmitter.h"
 #include "frontend/FoldConstants.h"
 #include "frontend/NameFunctions.h"
 #include "ion/AsmJS.h"
 #include "vm/GlobalObject.h"
 
 #include "jsinferinlines.h"
+#include "jsobjinlines.h"
+
 #include "frontend/ParseMaps-inl.h"
 #include "frontend/ParseNode-inl.h"
 #include "frontend/Parser-inl.h"
 #include "frontend/SharedContext-inl.h"
 #include "vm/Probes-inl.h"
 
 using namespace js;
 using namespace js::frontend;
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -36,16 +36,17 @@
 #include "frontend/Parser.h"
 #include "frontend/TokenStream.h"
 #include "ion/AsmJS.h"
 #include "vm/Debugger.h"
 #include "vm/RegExpObject.h"
 #include "vm/Shape.h"
 
 #include "jsatominlines.h"
+#include "jsobjinlines.h"
 #include "jsscriptinlines.h"
 
 #include "frontend/ParseMaps-inl.h"
 #include "frontend/ParseNode-inl.h"
 #include "frontend/SharedContext-inl.h"
 #include "vm/Shape-inl.h"
 
 using namespace js;
--- a/js/src/frontend/NameFunctions.cpp
+++ b/js/src/frontend/NameFunctions.cpp
@@ -3,20 +3,23 @@
  * 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 "frontend/NameFunctions.h"
 
 #include "jsfun.h"
 #include "jsprf.h"
+
 #include "frontend/BytecodeCompiler.h"
 #include "frontend/ParseNode.h"
 #include "frontend/SharedContext.h"
 
+#include "jsfuninlines.h"
+
 #include "vm/String-inl.h"
 #include "vm/StringBuffer.h"
 
 using namespace js;
 using namespace js::frontend;
 
 class NameResolver
 {
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -43,16 +43,17 @@
 #include "frontend/FoldConstants.h"
 #include "frontend/ParseMaps.h"
 #include "frontend/TokenStream.h"
 #include "gc/Marking.h"
 #include "vm/Interpreter.h"
 #include "vm/Shape.h"
 
 #include "jsatominlines.h"
+#include "jsobjinlines.h"
 #include "jsscriptinlines.h"
 
 #include "frontend/ParseMaps-inl.h"
 #include "frontend/ParseNode-inl.h"
 #include "frontend/Parser-inl.h"
 #include "frontend/SharedContext-inl.h"
 
 #include "vm/NumericConversions.h"
--- a/js/src/frontend/SharedContext.h
+++ b/js/src/frontend/SharedContext.h
@@ -179,19 +179,19 @@ class GlobalSharedContext : public Share
 
   public:
     inline GlobalSharedContext(JSContext *cx, JSObject *scopeChain, bool strict);
 
     ObjectBox *toObjectBox() { return NULL; }
     JSObject *scopeChain() const { return scopeChain_; }
 };
 
-
-class ModuleBox : public ObjectBox, public SharedContext {
-public:
+class ModuleBox : public ObjectBox, public SharedContext
+{
+  public:
     Bindings bindings;
 
     ModuleBox(JSContext *cx, ObjectBox *traceListHead, Module *module,
               ParseContext<FullParseHandler> *pc);
     ObjectBox *toObjectBox() { return this; }
     Module *module() const { return &object->asModule(); }
 };
 
--- a/js/src/gc/Iteration.cpp
+++ b/js/src/gc/Iteration.cpp
@@ -7,17 +7,16 @@
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jsgc.h"
 #include "jsprf.h"
 
 #include "js/HashTable.h"
 #include "gc/GCInternals.h"
 
-#include "jsobjinlines.h"
 #include "jsgcinlines.h"
 
 using namespace js;
 using namespace js::gc;
 
 void
 js::TraceRuntime(JSTracer *trc)
 {
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -5,22 +5,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/DebugOnly.h"
 
 #include "jsprf.h"
 #include "jsstr.h"
 
 #include "gc/Marking.h"
-#include "gc/Nursery-inl.h"
+#include "ion/IonCode.h"
 #include "vm/Shape.h"
 
-#include "jsobjinlines.h"
+#include "jscompartmentinlines.h"
 
-#include "ion/IonCode.h"
+#include "gc/Nursery-inl.h"
 #include "vm/Shape-inl.h"
 #include "vm/String-inl.h"
 
 using namespace js;
 using namespace js::gc;
 
 using mozilla::DebugOnly;
 
--- a/js/src/gc/RootMarking.cpp
+++ b/js/src/gc/RootMarking.cpp
@@ -14,26 +14,26 @@
 #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"
 #include "jsobjinlines.h"
-#include "ion/IonCode.h"
 
 #ifdef MOZ_VALGRIND
 # include <valgrind/memcheck.h>
 #endif
 
 using namespace js;
 using namespace js::gc;
 
--- a/js/src/gc/Verifier.cpp
+++ b/js/src/gc/Verifier.cpp
@@ -11,17 +11,16 @@
 #include "jsutil.h"
 #include "jswatchpoint.h"
 
 #include "mozilla/Util.h"
 
 #include "js/HashTable.h"
 #include "gc/GCInternals.h"
 
-#include "jsobjinlines.h"
 #include "jsgcinlines.h"
 
 #ifdef MOZ_VALGRIND
 # include <valgrind/memcheck.h>
 #endif
 
 using namespace js;
 using namespace js::gc;
--- a/js/src/gc/Zone.cpp
+++ b/js/src/gc/Zone.cpp
@@ -14,17 +14,16 @@
 #include "gc/GCInternals.h"
 
 #ifdef JS_ION
 #include "ion/BaselineJIT.h"
 #include "ion/IonCompartment.h"
 #include "ion/Ion.h"
 #endif
 
-#include "jsobjinlines.h"
 #include "jsgcinlines.h"
 
 using namespace js;
 using namespace js::gc;
 
 JS::Zone::Zone(JSRuntime *rt)
   : rt(rt),
     allocator(this),
--- a/js/src/ion/AsmJS.cpp
+++ b/js/src/ion/AsmJS.cpp
@@ -6,17 +6,16 @@
 
 #include "jsmath.h"
 #include "jsworkers.h"
 
 #include "frontend/ParseNode.h"
 #include "ion/AsmJS.h"
 #include "ion/AsmJSModule.h"
 
-#include "jsobjinlines.h"
 #include "frontend/ParseNode-inl.h"
 
 using namespace js;
 using namespace js::frontend;
 using namespace mozilla;
 
 #include "ion/PerfSpewer.h"
 #include "ion/CodeGenerator.h"
--- a/js/src/ion/BytecodeAnalysis.cpp
+++ b/js/src/ion/BytecodeAnalysis.cpp
@@ -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/. */
 
 #include "ion/BytecodeAnalysis.h"
 #include "jsopcode.h"
 #include "jsopcodeinlines.h"
-#include "jsobjinlines.h"
 
 using namespace js;
 using namespace js::ion;
 
 BytecodeAnalysis::BytecodeAnalysis(JSScript *script)
   : script_(script),
     infos_()
 {
--- a/js/src/ion/Ion.cpp
+++ b/js/src/ion/Ion.cpp
@@ -37,17 +37,16 @@
 #elif defined(JS_CPU_X64)
 # include "x64/Lowering-x64.h"
 #elif defined(JS_CPU_ARM)
 # include "arm/Lowering-arm.h"
 #endif
 #include "gc/Marking.h"
 #include "jsgcinlines.h"
 #include "jsinferinlines.h"
-#include "jsobjinlines.h"
 #include "vm/Stack-inl.h"
 #include "ion/IonFrames-inl.h"
 #include "ion/CompilerRoot.h"
 #include "ExecutionModeInlines.h"
 #include "AsmJS.h"
 #include "AsmJSModule.h"
 
 #if JS_TRACE_LOGGING
--- a/js/src/ion/Lowering.cpp
+++ b/js/src/ion/Lowering.cpp
@@ -8,17 +8,16 @@
 #include "Lowering.h"
 #include "MIR.h"
 #include "MIRGraph.h"
 #include "IonSpewer.h"
 #include "RangeAnalysis.h"
 #include "jsanalyze.h"
 #include "jsbool.h"
 #include "jsnum.h"
-#include "jsobjinlines.h"
 #include "shared/Lowering-shared-inl.h"
 #include "mozilla/DebugOnly.h"
 
 using namespace js;
 using namespace ion;
 
 bool
 LIRGenerator::visitParameter(MParameter *param)
--- a/js/src/jsapi-tests/testBug604087.cpp
+++ b/js/src/jsapi-tests/testBug604087.cpp
@@ -2,17 +2,16 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  *
  * Tests JS_TransplantObject
  */
 /* 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 "jsobj.h"
 #include "jswrapper.h"
 
 #include "jsobjinlines.h"
 
 struct OuterWrapper : js::Wrapper
 {
--- a/js/src/jsapi-tests/testFuncCallback.cpp
+++ b/js/src/jsapi-tests/testFuncCallback.cpp
@@ -1,18 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "tests.h"
 #include "jsfun.h"
 #include "jscntxt.h"
 
-#include "jsobjinlines.h"
-
 #ifdef MOZ_TRACE_JSCALLS
 
 static int depth = 0;
 static int enters = 0;
 static int leaves = 0;
 static int interpreted = 0;
 
 static void
--- a/js/src/jsapi-tests/testGCFinalizeCallback.cpp
+++ b/js/src/jsapi-tests/testGCFinalizeCallback.cpp
@@ -4,16 +4,18 @@
 
 #include "tests.h"
 
 #include <stdarg.h>
 
 #include "jsfriendapi.h"
 #include "jscntxt.h"
 
+#include "vm/ObjectImpl-inl.h"
+
 const unsigned BufferSize = 20;
 static unsigned FinalizeCalls = 0;
 static JSFinalizeStatus StatusBuffer[BufferSize];
 static bool IsCompartmentGCBuffer[BufferSize];
 
 static void
 FinalizeCallback(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartmentGC)
 {
--- a/js/src/jsapi-tests/testOriginPrincipals.cpp
+++ b/js/src/jsapi-tests/testOriginPrincipals.cpp
@@ -1,15 +1,14 @@
 /* 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 "jsdbgapi.h"
-#include "jsobjinlines.h"
 
 JSPrincipals *sOriginPrincipalsInErrorReporter = NULL;
 
 static void
 ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report)
 {
     sOriginPrincipalsInErrorReporter = report->originPrincipals;
 }
--- a/js/src/jsapi-tests/testStringBuffer.cpp
+++ b/js/src/jsapi-tests/testStringBuffer.cpp
@@ -7,18 +7,16 @@
 
 
 #include "tests.h"
 
 #include "jsatom.h"
 
 #include "vm/StringBuffer.h"
 
-#include "jsobjinlines.h"
-
 BEGIN_TEST(testStringBuffer_finishString)
 {
     JSString *str = JS_NewStringCopyZ(cx, "foopy");
     CHECK(str);
 
     JS::Rooted<JSAtom*> atom(cx, js::AtomizeString<js::CanGC>(cx, str));
     CHECK(atom);
 
--- a/js/src/jsapi-tests/testVersion.cpp
+++ b/js/src/jsapi-tests/testVersion.cpp
@@ -2,17 +2,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 "tests.h"
 #include "jsscript.h"
 #include "jscntxt.h"
 
 #include "jscntxtinlines.h"
-#include "jsobjinlines.h"
 
 using namespace js;
 
 struct VersionFixture;
 
 /*
  * Fast-native callbacks for use from JS.
  * They set their results on the current fixture instance.
--- a/js/src/jsapi-tests/testXDR.cpp
+++ b/js/src/jsapi-tests/testXDR.cpp
@@ -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/. */
 
 #include "tests.h"
 #include "jsscript.h"
 #include "jsstr.h"
 #include "jsfriendapi.h"
 
+#include "jsscriptinlines.h"
+
 static JSScript *
 CompileScriptForPrincipalsVersionOrigin(JSContext *cx, JS::HandleObject obj,
                                         JSPrincipals *principals, JSPrincipals *originPrincipals,
                                         const char *bytes, size_t nbytes,
                                         const char *filename, unsigned lineno,
                                         JSVersion version)
 {
     size_t nchars;
--- a/js/src/jsapi-tests/tests.h
+++ b/js/src/jsapi-tests/tests.h
@@ -7,17 +7,16 @@
 #include "mozilla/Util.h"
 
 #include "jsapi.h"
 #include "jsprvtd.h"
 #include "jsalloc.h"
 
 // For js::gc::AutoSuppressGC
 #include "jsgc.h"
-#include "jsobjinlines.h"
 #include "jsgcinlines.h"
 
 #include "js/Vector.h"
 
 #include <errno.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -72,17 +72,16 @@
 #include "vm/NumericConversions.h"
 #include "vm/Shape.h"
 #include "vm/StringBuffer.h"
 #include "vm/Xdr.h"
 #include "yarr/BumpPointerAllocator.h"
 
 #include "jsatominlines.h"
 #include "jsinferinlines.h"
-#include "jsobjinlines.h"
 #include "jsscriptinlines.h"
 
 #include "vm/Interpreter-inl.h"
 #include "vm/ObjectImpl-inl.h"
 #include "vm/RegExpObject-inl.h"
 #include "vm/RegExpStatics-inl.h"
 #include "vm/Shape-inl.h"
 #include "vm/String-inl.h"
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -28,17 +28,16 @@
 #include "vm/ForkJoin.h"
 #include "vm/Interpreter.h"
 #include "vm/NumericConversions.h"
 #include "vm/Shape.h"
 #include "vm/StringBuffer.h"
 
 #include "jsatominlines.h"
 #include "jscntxtinlines.h"
-#include "jsobjinlines.h"
 #include "jsstrinlines.h"
 
 #include "vm/ArgumentsObject-inl.h"
 #include "vm/Interpreter-inl.h"
 #include "vm/ObjectImpl-inl.h"
 
 using namespace js;
 using namespace js::gc;
--- a/js/src/jsatom.cpp
+++ b/js/src/jsatom.cpp
@@ -21,16 +21,17 @@
 #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"
 
 using namespace js;
 using namespace js::gc;
 
 using mozilla::ArrayEnd;
 using mozilla::ArrayLength;
--- a/js/src/jsbool.cpp
+++ b/js/src/jsbool.cpp
@@ -16,17 +16,16 @@
 #include "jscntxt.h"
 #include "jsversion.h"
 #include "jsobj.h"
 
 #include "vm/GlobalObject.h"
 #include "vm/StringBuffer.h"
 
 #include "jsboolinlines.h"
-#include "jsobjinlines.h"
 
 #include "vm/BooleanObject-inl.h"
 #include "vm/GlobalObject-inl.h"
 
 using namespace js;
 using namespace js::types;
 
 Class js::BooleanClass = {
--- a/js/src/jsboolinlines.h
+++ b/js/src/jsboolinlines.h
@@ -7,18 +7,16 @@
 #ifndef jsboolinlines_h___
 #define jsboolinlines_h___
 
 #include "mozilla/Assertions.h"
 #include "mozilla/Likely.h"
 
 #include "js/RootingAPI.h"
 
-#include "jsobjinlines.h"
-
 #include "vm/BooleanObject-inl.h"
 
 namespace js {
 
 bool BooleanGetPrimitiveValueSlow(JSContext *, HandleObject, Value *);
 
 inline bool
 BooleanGetPrimitiveValue(JSContext *cx, HandleObject obj, Value *vp)
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -22,16 +22,17 @@
 # include <string>
 #endif  // ANDROID
 
 #include "mozilla/Util.h"
 
 #include "jstypes.h"
 #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"
@@ -47,17 +48,16 @@
 #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 "jscompartment.h"
 #include "jsobjinlines.h"
 
 using namespace js;
 using namespace js::gc;
 
 using mozilla::DebugOnly;
 using mozilla::PodArrayZero;
 using mozilla::PodZero;
@@ -1459,16 +1459,28 @@ JSContext::mark(JSTracer *trc)
     if (isExceptionPending())
         MarkValueRoot(trc, &exception, "exception");
 
     TraceCycleDetectionSet(trc, cycleDetectorSet);
 
     MarkValueRoot(trc, &iterValue, "iterValue");
 }
 
+JSVersion
+JSContext::findVersion() const
+{
+    if (hasVersionOverride)
+        return versionOverride;
+
+    if (JSScript *script = stack.currentScript(NULL, js::ContextStack::ALLOW_CROSS_COMPARTMENT))
+        return script->getVersion();
+
+    return defaultVersion;
+}
+
 #if defined JS_THREADSAFE && defined DEBUG
 
 JS::AutoCheckRequestDepth::AutoCheckRequestDepth(JSContext *cx)
     : cx(cx)
 {
     JS_ASSERT(cx->runtime()->requestDepth || cx->runtime()->isHeapBusy());
     cx->runtime()->assertValidThread();
     cx->runtime()->checkRequestDepth++;
@@ -1476,8 +1488,23 @@ JS::AutoCheckRequestDepth::AutoCheckRequ
 
 JS::AutoCheckRequestDepth::~AutoCheckRequestDepth()
 {
     JS_ASSERT(cx->runtime()->checkRequestDepth != 0);
     cx->runtime()->checkRequestDepth--;
 }
 
 #endif
+
+#ifdef JS_CRASH_DIAGNOSTICS
+void CompartmentChecker::check(StackFrame *fp)
+{
+    if (fp)
+        check(fp->scopeChain());
+}
+
+void CompartmentChecker::check(AbstractFramePtr frame)
+{
+    if (frame)
+        check(frame.scopeChain());
+}
+#endif
+
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -352,17 +352,17 @@ class NewObjectCache
     /*
      * Return a new object from a cache hit produced by a lookup method, or
      * NULL if returning the object could possibly trigger GC (does not
      * indicate failure).
      */
     inline JSObject *newObjectFromHit(JSContext *cx, EntryIndex entry, js::gc::InitialHeap heap);
 
     /* Fill an entry after a cache miss. */
-    inline void fillProto(EntryIndex entry, Class *clasp, js::TaggedProto proto, gc::AllocKind kind, JSObject *obj);
+    void fillProto(EntryIndex entry, Class *clasp, js::TaggedProto proto, gc::AllocKind kind, JSObject *obj);
     inline void fillGlobal(EntryIndex entry, Class *clasp, js::GlobalObject *global, gc::AllocKind kind, JSObject *obj);
     inline void fillType(EntryIndex entry, Class *clasp, js::types::TypeObject *type, gc::AllocKind kind, JSObject *obj);
 
     /* Invalidate any entries which might produce an object with shape/proto. */
     void invalidateEntriesForShape(JSContext *cx, HandleShape shape, HandleObject proto);
 
   private:
     inline bool lookup(Class *clasp, gc::Cell *key, gc::AllocKind kind, EntryIndex *pentry);
@@ -1524,17 +1524,21 @@ struct JSContext : js::ContextFriendFiel
 {
     explicit JSContext(JSRuntime *rt);
     JSContext *thisDuringConstruction() { return this; }
     ~JSContext();
 
     JSRuntime *runtime() const { return runtime_; }
     JSCompartment *compartment() const { return compartment_; }
 
-    inline JS::Zone *zone() const;
+    inline JS::Zone *zone() const {
+        JS_ASSERT_IF(!compartment(), !zone_);
+        JS_ASSERT_IF(compartment(), js::GetCompartmentZone(compartment()) == zone_);
+        return zone_;
+    }
     js::PerThreadData &mainThread() { return runtime()->mainThread; }
 
   private:
     /* See JSContext::findVersion. */
     JSVersion           defaultVersion;      /* script compilation version */
     JSVersion           versionOverride;     /* supercedes defaultVersion when valid */
     bool                hasVersionOverride;
 
@@ -1690,17 +1694,17 @@ struct JSContext : js::ContextFriendFiel
     /*
      * Return:
      * - The override version, if there is an override version.
      * - The newest scripted frame's version, if there is such a frame.
      * - The default version.
      *
      * Note: if this ever shows up in a profile, just add caching!
      */
-    inline JSVersion findVersion() const;
+    JSVersion findVersion() const;
 
     void setOptions(unsigned opts) {
         JS_ASSERT((opts & JSOPTION_MASK) == opts);
         options_ = opts;
     }
 
     unsigned options() const { return options_; }
 
@@ -1757,17 +1761,19 @@ struct JSContext : js::ContextFriendFiel
   public:
     JSGenerator *innermostGenerator() const { return innermostGenerator_; }
     void enterGenerator(JSGenerator *gen);
     void leaveGenerator(JSGenerator *gen);
 
     void *onOutOfMemory(void *p, size_t nbytes) {
         return runtime()->onOutOfMemory(p, nbytes, this);
     }
-    void updateMallocCounter(size_t nbytes);
+    void updateMallocCounter(size_t nbytes) {
+        runtime()->updateMallocCounter(zone(), nbytes);
+    }
     void reportAllocationOverflow() {
         js_ReportAllocationOverflow(this);
     }
 
     bool isExceptionPending() {
         return throwing;
     }
 
--- a/js/src/jscntxtinlines.h
+++ b/js/src/jscntxtinlines.h
@@ -15,16 +15,18 @@
 #include "builtin/Object.h" // For js::obj_construct
 #include "frontend/ParseMaps.h"
 #include "vm/Interpreter.h"
 #include "vm/Probes.h"
 #include "vm/RegExpObject.h"
 
 #include "jsgcinlines.h"
 
+#include "vm/ObjectImpl-inl.h"
+
 namespace js {
 
 inline void
 NewObjectCache::staticAsserts()
 {
     JS_STATIC_ASSERT(NewObjectCache::MAX_OBJ_SIZE == sizeof(JSObject_Slots16));
     JS_STATIC_ASSERT(gc::FINALIZE_OBJECT_LAST == gc::FINALIZE_OBJECT16_BACKGROUND);
 }
@@ -81,37 +83,39 @@ NewObjectCache::fill(EntryIndex entry_, 
     entry->key = key;
     entry->kind = kind;
 
     entry->nbytes = gc::Arena::thingSize(kind);
     js_memcpy(&entry->templateObject, obj, entry->nbytes);
 }
 
 inline void
-NewObjectCache::fillProto(EntryIndex entry, Class *clasp, js::TaggedProto proto, gc::AllocKind kind, JSObject *obj)
-{
-    JS_ASSERT_IF(proto.isObject(), !proto.toObject()->isGlobal());
-    JS_ASSERT(obj->getTaggedProto() == proto);
-    return fill(entry, clasp, proto.raw(), kind, obj);
-}
-
-inline void
 NewObjectCache::fillGlobal(EntryIndex entry, Class *clasp, js::GlobalObject *global, gc::AllocKind kind, JSObject *obj)
 {
     //JS_ASSERT(global == obj->getGlobal());
     return fill(entry, clasp, global, kind, obj);
 }
 
 inline void
 NewObjectCache::fillType(EntryIndex entry, Class *clasp, js::types::TypeObject *type, gc::AllocKind kind, JSObject *obj)
 {
     JS_ASSERT(obj->type() == type);
     return fill(entry, clasp, type, kind, obj);
 }
 
+inline void
+NewObjectCache::copyCachedToObject(JSObject *dst, JSObject *src, gc::AllocKind kind)
+{
+    js_memcpy(dst, src, gc::Arena::thingSize(kind));
+#ifdef JSGC_GENERATIONAL
+    Shape::writeBarrierPost(dst->shape_, &dst->shape_);
+    types::TypeObject::writeBarrierPost(dst->type_, &dst->type_);
+#endif
+}
+
 inline JSObject *
 NewObjectCache::newObjectFromHit(JSContext *cx, EntryIndex entry_, js::gc::InitialHeap heap)
 {
     // The new object cache does not account for metadata attached via callbacks.
     JS_ASSERT(!cx->compartment()->objectMetadataCallback);
 
     JS_ASSERT(unsigned(entry_) < mozilla::ArrayLength(entries));
     Entry *entry = &entries[entry_];
@@ -243,25 +247,18 @@ class CompartmentChecker
         }
     }
 
     void check(JSScript *script) {
         if (script)
             check(script->compartment());
     }
 
-    void check(StackFrame *fp) {
-        if (fp)
-            check(fp->scopeChain());
-    }
-
-    void check(AbstractFramePtr frame) {
-        if (frame)
-            check(frame.scopeChain());
-    }
+    void check(StackFrame *fp);
+    void check(AbstractFramePtr frame);
 };
 #endif /* JS_CRASH_DIAGNOSTICS */
 
 /*
  * Don't perform these checks when called from a finalizer. The checking
  * depends on other objects not having been swept yet.
  */
 #define START_ASSERT_SAME_COMPARTMENT()                                       \
@@ -460,28 +457,16 @@ CallSetter(JSContext *cx, HandleObject o
 
     RootedId nid(cx, INT_TO_JSID(shortid));
 
     return CallJSPropertyOpSetter(cx, op, obj, nid, strict, vp);
 }
 
 }  /* namespace js */
 
-inline JSVersion
-JSContext::findVersion() const
-{
-    if (hasVersionOverride)
-        return versionOverride;
-
-    if (JSScript *script = stack.currentScript(NULL, js::ContextStack::ALLOW_CROSS_COMPARTMENT))
-        return script->getVersion();
-
-    return defaultVersion;
-}
-
 inline bool
 JSContext::canSetDefaultVersion() const
 {
     return !stack.hasfp() && !hasVersionOverride;
 }
 
 inline void
 JSContext::overrideVersion(JSVersion newVersion)
@@ -584,30 +569,16 @@ JSContext::leaveCompartment(JSCompartmen
         setCompartment(oldCompartment);
     else
         setCompartment(defaultCompartmentObject_->compartment());
 
     if (throwing)
         wrapPendingException();
 }
 
-inline JS::Zone *
-JSContext::zone() const
-{
-    JS_ASSERT_IF(!compartment(), !zone_);
-    JS_ASSERT_IF(compartment(), compartment()->zone() == zone_);
-    return zone_;
-}
-
-inline void
-JSContext::updateMallocCounter(size_t nbytes)
-{
-    runtime()->updateMallocCounter(zone(), nbytes);
-}
-
 inline void
 JSContext::setCompartment(JSCompartment *comp)
 {
     compartment_ = comp;
     zone_ = comp ? comp->zone() : NULL;
 }
 
 #endif /* jscntxtinlines_h___ */
--- a/js/src/jscompartmentinlines.h
+++ b/js/src/jscompartmentinlines.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 jscompartment_inlines_h___
 #define jscompartment_inlines_h___
 
 #include "jscompartment.h"
 
+#include "jscntxtinlines.h"
+
 inline void
 JSCompartment::initGlobal(js::GlobalObject &global)
 {
     JS_ASSERT(global.compartment() == this);
     JS_ASSERT(!global_);
     global_ = &global;
 }
 
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -33,27 +33,26 @@
 #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"
 
-#include "js/Date.h"
-
 using namespace js;
 using namespace js::types;
 
 using mozilla::ArrayLength;
 using mozilla::IsFinite;
 using mozilla::IsNaN;
 
 /*
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -30,17 +30,16 @@
 #include "vm/Shape.h"
 
 #ifdef JS_ION
 #include "ion/AsmJSModule.h"
 #endif
 
 #include "jsatominlines.h"
 #include "jsinferinlines.h"
-#include "jsobjinlines.h"
 #include "jsscriptinlines.h"
 
 #include "vm/Debugger-inl.h"
 #include "vm/Interpreter-inl.h"
 #include "vm/Stack-inl.h"
 
 using namespace js;
 using namespace js::gc;
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -8,16 +8,17 @@
 
 #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 "builtin/TestingFunctions.h"
 
 #include "jsobjinlines.h"
 
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -30,17 +30,16 @@
 #include "gc/Marking.h"
 #include "vm/Interpreter.h"
 #include "vm/Shape.h"
 #include "vm/StringBuffer.h"
 #include "vm/Xdr.h"
 
 #include "jsfuninlines.h"
 #include "jsinferinlines.h"
-#include "jsobjinlines.h"
 #include "jsscriptinlines.h"
 
 #include "vm/Interpreter-inl.h"
 #include "vm/Stack-inl.h"
 
 #ifdef JS_ION
 #include "ion/Ion.h"
 #include "ion/IonFrameIterator.h"
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -27,18 +27,18 @@
 #include "gc/Marking.h"
 #include "js/MemoryMetrics.h"
 #include "vm/Shape.h"
 
 #include "jsanalyzeinlines.h"
 #include "jsatominlines.h"
 #include "jsgcinlines.h"
 #include "jsinferinlines.h"
+#include "jsopcodeinlines.h"
 #include "jsobjinlines.h"
-#include "jsopcodeinlines.h"
 #include "jsscriptinlines.h"
 
 #include "vm/Stack-inl.h"
 
 #ifdef __SUNPRO_CC
 #include <alloca.h>
 #endif
 
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -37,17 +37,16 @@
 #include "jsdtoa.h"
 #include "jsobj.h"
 #include "jsstr.h"
 #include "vm/GlobalObject.h"
 #include "vm/NumericConversions.h"
 #include "vm/StringBuffer.h"
 
 #include "jsatominlines.h"
-#include "jsobjinlines.h"
 #include "jsstrinlines.h"
 #include "vm/NumberObject-inl.h"
 #include "vm/String-inl.h"
 
 using namespace js;
 using namespace js::types;
 
 using mozilla::PodCopy;
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -1278,16 +1278,25 @@ NewObject(JSContext *cx, Class *clasp, t
      */
     if (clasp->trace && !(clasp->flags & JSCLASS_IMPLEMENTS_BARRIERS))
         cx->runtime()->gcIncrementalEnabled = false;
 
     Probes::createObject(cx, obj);
     return obj;
 }
 
+void
+NewObjectCache::fillProto(EntryIndex entry, Class *clasp, js::TaggedProto proto,
+                          gc::AllocKind kind, JSObject *obj)
+{
+    JS_ASSERT_IF(proto.isObject(), !proto.toObject()->isGlobal());
+    JS_ASSERT(obj->getTaggedProto() == proto);
+    return fill(entry, clasp, proto.raw(), kind, obj);
+}
+
 JSObject *
 js::NewObjectWithGivenProto(JSContext *cx, js::Class *clasp,
                             js::TaggedProto proto_, JSObject *parent_,
                             gc::AllocKind allocKind, NewObjectKind newKind)
 {
     Rooted<TaggedProto> proto(cx, proto_);
     RootedObject parent(cx, parent_);
 
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -458,17 +458,16 @@ class JSObject : public js::ObjectImpl
      * 1. obj->getProto() returns the prototype, but asserts if obj is a proxy.
      * 2. obj->getTaggedProto() returns a TaggedProto, which can be tested to
      *    check if the proto is an object, NULL, or lazily computed.
      * 3. JSObject::getProto(cx, obj, &proto) computes the proto of an object.
      *    If obj is a proxy and the proto is lazy, this code may allocate or
      *    GC in order to compute the proto. Currently, it will not run JS code.
      */
     inline JSObject *getProto() const;
-    using js::ObjectImpl::getTaggedProto;
     static inline bool getProto(JSContext *cx, js::HandleObject obj,
                                 js::MutableHandleObject protop);
 
     inline void setType(js::types::TypeObject *newType);
 
     js::types::TypeObject *getNewType(JSContext *cx, js::Class *clasp, JSFunction *fun = NULL);
 
 #ifdef DEBUG
@@ -534,17 +533,16 @@ class JSObject : public js::ObjectImpl
      */
     inline JSObject *enclosingScope();
 
     /* Access the metadata on an object. */
     inline JSObject *getMetadata() const;
     static bool setMetadata(JSContext *cx, js::HandleObject obj, js::HandleObject newMetadata);
 
     inline js::GlobalObject &global() const;
-    using js::ObjectImpl::compartment;
 
     /* Remove the type (and prototype) or parent from a new object. */
     static inline bool clearType(JSContext *cx, js::HandleObject obj);
     static bool clearParent(JSContext *cx, js::HandleObject obj);
 
     /*
      * ES5 meta-object properties and operations.
      */
@@ -965,80 +963,82 @@ class JSObject : public js::ObjectImpl
      *
      * SpiderMonkey has not been completely switched to the isX/asX/XObject
      * pattern so in some cases there is no XObject class and the engine
      * instead pokes directly at reserved slots and getPrivate. In such cases,
      * consider adding the missing XObject class.
      */
 
     /* Direct subtypes of JSObject: */
-    inline bool isArray() const;
-    inline bool isArguments() const;
-    inline bool isArrayBuffer() const;
-    inline bool isDataView() const;
-    inline bool isDate() const;
-    inline bool isElementIterator() const;
-    inline bool isError() const;
-    inline bool isFunction() const;
-    inline bool isGenerator() const;
-    inline bool isGlobal() const;
-    inline bool isMapIterator() const;
-    inline bool isModule() const;
-    inline bool isObject() const;
-    inline bool isPrimitive() const;
+    inline bool isArray()            const { return hasClass(&js::ArrayClass); }
+    inline bool isArguments()        const { return isNormalArguments() || isStrictArguments(); }
+    inline bool isArrayBuffer()      const { return hasClass(&js::ArrayBufferClass); }
+    inline bool isDataView()         const { return hasClass(&js::DataViewClass); }
+    inline bool isDate()             const { return hasClass(&js::DateClass); }
+    inline bool isElementIterator()  const { return hasClass(&js::ElementIteratorClass); }
+    inline bool isError()            const { return hasClass(&js::ErrorClass); }
+    inline bool isFunction()         const { return hasClass(&js::FunctionClass); }
+    inline bool isGenerator()        const { return hasClass(&js::GeneratorClass); }
+    inline bool isGlobal()           const;
+    inline bool isMapIterator()      const { return hasClass(&js::MapIteratorClass); }
+    inline bool isModule()           const { return hasClass(&js::ModuleClass); }
+    inline bool isObject()           const { return hasClass(&js::ObjectClass); }
+    inline bool isPrimitive()        const { return isNumber() || isString() || isBoolean(); }
     inline bool isPropertyIterator() const;
     using js::ObjectImpl::isProxy;
-    inline bool isRegExp() const;
-    inline bool isRegExpStatics() const;
-    inline bool isScope() const;
-    inline bool isScript() const;
-    inline bool isScriptSource() const;
-    inline bool isSetIterator() const;
-    inline bool isStopIteration() const;
-    inline bool isTypedArray() const;
-    inline bool isWeakMap() const;
+    inline bool isRegExp()           const { return hasClass(&js::RegExpClass); }
+    inline bool isRegExpStatics()    const { return hasClass(&js::RegExpStaticsClass); }
+    inline bool isScope()            const { return isCall() || isDeclEnv() || isNestedScope(); }
+    inline bool isScriptSource()     const { return hasClass(&js::ScriptSourceClass); }
+    inline bool isSetIterator()      const { return hasClass(&js::SetIteratorClass); }
+    inline bool isStopIteration()    const { return hasClass(&js::StopIterationClass); }
+    inline bool isTypedArray()       const;
+    inline bool isWeakMap()          const { return hasClass(&js::WeakMapClass); }
 
     /* Subtypes of ScopeObject. */
-    inline bool isBlock() const;
-    inline bool isCall() const;
-    inline bool isDeclEnv() const;
-    inline bool isNestedScope() const;
-    inline bool isWith() const;
+    inline bool isBlock()       const { return hasClass(&js::BlockClass); }
+    inline bool isCall()        const { return hasClass(&js::CallClass); }
+    inline bool isDeclEnv()     const { return hasClass(&js::DeclEnvClass); }
+    inline bool isNestedScope() const { return isBlock() || isWith(); }
+    inline bool isWith()        const { return hasClass(&js::WithClass); }
     inline bool isClonedBlock() const;
     inline bool isStaticBlock() const;
 
     /* Subtypes of PrimitiveObject. */
-    inline bool isBoolean() const;
-    inline bool isNumber() const;
-    inline bool isString() const;
+    inline bool isBoolean() const { return hasClass(&js::BooleanClass); }
+    inline bool isNumber()  const { return hasClass(&js::NumberClass); }
+    inline bool isString()  const { return hasClass(&js::StringClass); }
 
     /* Subtypes of ArgumentsObject. */
-    inline bool isNormalArguments() const;
-    inline bool isStrictArguments() const;
+    inline bool isNormalArguments() const { return hasClass(&js::NormalArgumentsObjectClass); }
+    inline bool isStrictArguments() const { return hasClass(&js::StrictArgumentsObjectClass); }
 
     /* Subtypes of Proxy. */
-    inline bool isDebugScope() const;
-    inline bool isWrapper() const;
-    inline bool isFunctionProxy() const;
+    inline bool isDebugScope()              const;
+    inline bool isWrapper()                 const;
+    inline bool isFunctionProxy()           const { return hasClass(&js::FunctionProxyClass); }
     inline bool isCrossCompartmentWrapper() const;
 
     inline js::ArgumentsObject &asArguments();
     inline js::ArrayBufferObject &asArrayBuffer();
     inline const js::ArgumentsObject &asArguments() const;
     inline js::BlockObject &asBlock();
     inline js::BooleanObject &asBoolean();
     inline js::CallObject &asCall();
     inline js::ClonedBlockObject &asClonedBlock();
     inline js::DataViewObject &asDataView();
     inline js::DeclEnvObject &asDeclEnv();
     inline js::DebugScopeObject &asDebugScope();
     inline js::GlobalObject &asGlobal();
     inline js::MapObject &asMap();
     inline js::MapIteratorObject &asMapIterator();
-    inline js::Module &asModule();
+    js::Module &asModule() {
+        JS_ASSERT(isModule());
+        return *reinterpret_cast<js::Module *>(this);
+    }
     inline js::NestedScopeObject &asNestedScope();
     inline js::NormalArgumentsObject &asNormalArguments();
     inline js::NumberObject &asNumber();
     inline js::PropertyIteratorObject &asPropertyIterator();
     inline const js::PropertyIteratorObject &asPropertyIterator() const;
     inline js::RegExpObject &asRegExp();
     inline js::ScopeObject &asScope();
     inline js::SetObject &asSet();
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -867,50 +867,19 @@ inline bool JSObject::isIndexed() const
     return lastProperty()->hasObjectFlag(js::BaseShape::INDEXED);
 }
 
 inline bool JSObject::watched() const
 {
     return lastProperty()->hasObjectFlag(js::BaseShape::WATCHED);
 }
 
-inline bool JSObject::isArray() const { return hasClass(&js::ArrayClass); }
-inline bool JSObject::isArguments() const { return isNormalArguments() || isStrictArguments(); }
-inline bool JSObject::isArrayBuffer() const { return hasClass(&js::ArrayBufferClass); }
-inline bool JSObject::isBlock() const { return hasClass(&js::BlockClass); }
-inline bool JSObject::isBoolean() const { return hasClass(&js::BooleanClass); }
-inline bool JSObject::isCall() const { return hasClass(&js::CallClass); }
 inline bool JSObject::isClonedBlock() const { return isBlock() && !!getProto(); }
-inline bool JSObject::isDataView() const { return hasClass(&js::DataViewClass); }
-inline bool JSObject::isDate() const { return hasClass(&js::DateClass); }
-inline bool JSObject::isDeclEnv() const { return hasClass(&js::DeclEnvClass); }
-inline bool JSObject::isElementIterator() const { return hasClass(&js::ElementIteratorClass); }
-inline bool JSObject::isError() const { return hasClass(&js::ErrorClass); }
-inline bool JSObject::isFunction() const { return hasClass(&js::FunctionClass); }
-inline bool JSObject::isFunctionProxy() const { return hasClass(&js::FunctionProxyClass); }
-inline bool JSObject::isGenerator() const { return hasClass(&js::GeneratorClass); }
-inline bool JSObject::isMapIterator() const { return hasClass(&js::MapIteratorClass); }
-inline bool JSObject::isModule() const { return hasClass(&js::ModuleClass); }
-inline bool JSObject::isNestedScope() const { return isBlock() || isWith(); }
-inline bool JSObject::isNormalArguments() const { return hasClass(&js::NormalArgumentsObjectClass); }
-inline bool JSObject::isNumber() const { return hasClass(&js::NumberClass); }
-inline bool JSObject::isObject() const { return hasClass(&js::ObjectClass); }
-inline bool JSObject::isPrimitive() const { return isNumber() || isString() || isBoolean(); }
-inline bool JSObject::isRegExp() const { return hasClass(&js::RegExpClass); }
-inline bool JSObject::isRegExpStatics() const { return hasClass(&js::RegExpStaticsClass); }
-inline bool JSObject::isScope() const { return isCall() || isDeclEnv() || isNestedScope(); }
-inline bool JSObject::isScriptSource() const { return hasClass(&js::ScriptSourceClass); }
-inline bool JSObject::isSetIterator() const { return hasClass(&js::SetIteratorClass); }
 inline bool JSObject::isStaticBlock() const { return isBlock() && !getProto(); }
-inline bool JSObject::isStopIteration() const { return hasClass(&js::StopIterationClass); }
-inline bool JSObject::isStrictArguments() const { return hasClass(&js::StrictArgumentsObjectClass); }
-inline bool JSObject::isString() const { return hasClass(&js::StringClass); }
 inline bool JSObject::isTypedArray() const { return IsTypedArrayClass(getClass()); }
-inline bool JSObject::isWeakMap() const { return hasClass(&js::WeakMapClass); }
-inline bool JSObject::isWith() const { return hasClass(&js::WithClass); }
 
 inline js::NumberObject &
 JSObject::asNumber()
 {
     JS_ASSERT(isNumber());
     return *static_cast<js::NumberObject *>(this);
 }
 
@@ -923,23 +892,16 @@ JSObject::asString()
 
 inline js::ScriptSourceObject &
 JSObject::asScriptSource()
 {
     JS_ASSERT(isScriptSource());
     return *static_cast<js::ScriptSourceObject *>(this);
 }
 
-inline js::Module &
-JSObject::asModule()
-{
-    JS_ASSERT(isModule());
-    return *static_cast<js::Module *>(this);
-}
-
 inline bool
 JSObject::isDebugScope() const
 {
     extern bool js_IsDebugScopeSlow(JSObject *obj);
     return getClass() == &js::ObjectProxyClass && js_IsDebugScopeSlow(const_cast<JSObject*>(this));
 }
 
 /* static */ inline JSObject *
@@ -1527,26 +1489,16 @@ class AutoPropertyDescriptorRooter : pri
         getter = desc->getter;
         setter = desc->setter;
         value = desc->value;
     }
 
     friend void AutoGCRooter::trace(JSTracer *trc);
 };
 
-inline void
-NewObjectCache::copyCachedToObject(JSObject *dst, JSObject *src, gc::AllocKind kind)
-{
-    js_memcpy(dst, src, gc::Arena::thingSize(kind));
-#ifdef JSGC_GENERATIONAL
-    Shape::writeBarrierPost(dst->shape_, &dst->shape_);
-    types::TypeObject::writeBarrierPost(dst->type_, &dst->type_);
-#endif
-}
-
 static inline bool
 CanBeFinalizedInBackground(gc::AllocKind kind, Class *clasp)
 {
     JS_ASSERT(kind <= gc::FINALIZE_OBJECT_LAST);
     /* If the class has no finalizer or a finalizer that is safe to call on
      * a different thread, we change the finalize kind. For example,
      * FINALIZE_OBJECT0 calls the finalizer on the main thread,
      * FINALIZE_OBJECT0_BACKGROUND calls the finalizer on the gcHelperThread.
--- a/js/src/json.cpp
+++ b/js/src/json.cpp
@@ -20,17 +20,16 @@
 #include "jstypes.h"
 #include "jsutil.h"
 
 #include "vm/Interpreter.h"
 #include "vm/StringBuffer.h"
 
 #include "jsatominlines.h"
 #include "jsboolinlines.h"
-#include "jsobjinlines.h"
 
 using namespace js;
 using namespace js::gc;
 using namespace js::types;
 
 using mozilla::IsFinite;
 using mozilla::Maybe;
 
--- a/js/src/jsonparser.cpp
+++ b/js/src/jsonparser.cpp
@@ -4,16 +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/. */
 
 #include "jsonparser.h"
 
 #include "mozilla/RangedPtr.h"
 
 #include "jsarray.h"
+#include "jscompartment.h"
 #include "jsnum.h"
 
 #include "vm/StringBuffer.h"
 
 #include "jsobjinlines.h"
 
 using namespace js;
 
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -14,38 +14,42 @@
 
 #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 "jscntxt.h"
+#include "jscompartment.h"
 #include "jsfun.h"
 #include "jsnum.h"
 #include "jsobj.h"
 #include "jsscript.h"
 #include "jsstr.h"
 
 #include "frontend/BytecodeCompiler.h"
 #include "frontend/SourceNotes.h"
 #include "js/CharacterEncoding.h"
 #include "vm/Shape.h"
 #include "vm/StringBuffer.h"
 
 #include "jscntxtinlines.h"
 #include "jsobjinlines.h"
+#include "jscompartmentinlines.h"
 #include "jsopcodeinlines.h"
 
 #include "jsautooplen.h"
 
 #include "vm/RegExpObject-inl.h"
+#include "vm/ScopeObject-inl.h"
 
 using namespace js;
 using namespace js::gc;
 
 using js::frontend::IsIdentifier;
 using mozilla::ArrayLength;
 
 /*
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -29,17 +29,16 @@
 #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 "jsinferinlines.h"
-#include "jsobjinlines.h"
 #include "jsscriptinlines.h"
 
 #include "vm/Interpreter-inl.h"
 #include "vm/RegExpObject-inl.h"
 
 using namespace js;
 using namespace js::gc;
 using namespace js::frontend;
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -42,17 +42,16 @@
 #include "vm/GlobalObject.h"
 #include "vm/Interpreter.h"
 #include "vm/NumericConversions.h"
 #include "vm/RegExpObject.h"
 #include "vm/Shape.h"
 #include "vm/StringBuffer.h"
 
 #include "jsinferinlines.h"
-#include "jsobjinlines.h"
 #include "jsstrinlines.h"
 #include "jsautooplen.h"        // generated headers last
 
 #include "vm/Interpreter-inl.h"
 #include "vm/RegExpObject-inl.h"
 #include "vm/RegExpStatics-inl.h"
 #include "vm/StringObject-inl.h"
 #include "vm/String-inl.h"
--- a/js/src/jstypedarray.cpp
+++ b/js/src/jstypedarray.cpp
@@ -25,17 +25,16 @@
 #include "gc/Barrier.h"
 #include "gc/Marking.h"
 #include "vm/GlobalObject.h"
 #include "vm/Interpreter.h"
 #include "vm/NumericConversions.h"
 
 #include "jsatominlines.h"
 #include "jsinferinlines.h"
-#include "jsobjinlines.h"
 #include "jstypedarrayinlines.h"
 
 #include "vm/GlobalObject-inl.h"
 
 # ifdef XP_WIN
 #  include "jswin.h"
 # else
 #  include <sys/mman.h>
--- a/js/src/jswatchpoint.cpp
+++ b/js/src/jswatchpoint.cpp
@@ -2,19 +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/. */
 
 #include "jswatchpoint.h"
 
 #include "jsatom.h"
+#include "jscompartment.h"
 
 #include "gc/Marking.h"
 
+#include "jsgcinlines.h"
 #include "jsobjinlines.h"
 
 using namespace js;
 using namespace js::gc;
 
 inline HashNumber
 DefaultHasher<WatchKey>::hash(const Lookup &key)
 {
--- a/js/src/perf/jsperf.cpp
+++ b/js/src/perf/jsperf.cpp
@@ -3,17 +3,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 "jsperf.h"
 
 #include "jscntxt.h" /* for error messages */
 #include "jsobj.h" /* for unwrapping without a context */
 
-#include "jsobjinlines.h"
 #include "vm/ObjectImpl-inl.h"
 
 using JS::PerfMeasurement;
 
 // You cannot forward-declare a static object in C++, so instead
 // we have to forward-declare the helper functions that refer to it.
 static PerfMeasurement* GetPM(JSContext* cx, JSHandleObject obj, const char* fname);
 static PerfMeasurement* GetPMFromThis(JSContext* cx, jsval* vp);
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -47,17 +47,16 @@
 #include "vm/Shape.h"
 
 #include "prmjtime.h"
 
 #include "jsoptparse.h"
 #include "jsheaptools.h"
 
 #include "jsinferinlines.h"
-#include "jsobjinlines.h"
 #include "jsscriptinlines.h"
 #include "ion/Ion.h"
 
 #include "vm/Interpreter-inl.h"
 
 #ifdef XP_UNIX
 #include <unistd.h>
 #include <sys/types.h>
--- a/js/src/vm/ArgumentsObject.cpp
+++ b/js/src/vm/ArgumentsObject.cpp
@@ -13,17 +13,17 @@
 #include "vm/Xdr.h"
 
 #include "jsobjinlines.h"
 
 #include "gc/Barrier-inl.h"
 #include "vm/Stack-inl.h"
 #include "vm/ArgumentsObject-inl.h"
 
-#if  defined(JS_ION)
+#if defined(JS_ION)
 #include "ion/IonFrames.h"
 #endif
 
 using namespace js;
 using namespace js::gc;
 
 static void
 CopyStackFrameArguments(const AbstractFramePtr frame, HeapValue *dst, unsigned totalArgs)
--- a/js/src/vm/BooleanObject-inl.h
+++ b/js/src/vm/BooleanObject-inl.h
@@ -2,19 +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 BooleanObject_inl_h___
 #define BooleanObject_inl_h___
 
-#include "jsobjinlines.h"
+#include "vm/BooleanObject.h"
 
-#include "vm/BooleanObject.h"
+#include "jsobjinlines.h"
 
 inline js::BooleanObject &
 JSObject::asBoolean()
 {
     JS_ASSERT(isBoolean());
     return *static_cast<js::BooleanObject *>(this);
 }
 
--- a/js/src/vm/Debugger-inl.h
+++ b/js/src/vm/Debugger-inl.h
@@ -6,17 +6,17 @@
 
 #ifndef Debugger_inl_h__
 #define Debugger_inl_h__
 
 #include "vm/Debugger.h"
 
 #include "vm/Stack-inl.h"
 
-bool
+inline bool
 js::Debugger::onLeaveFrame(JSContext *cx, AbstractFramePtr frame, bool ok)
 {
     /* Traps must be cleared from eval frames, see slowPathOnLeaveFrame. */
     bool evalTraps = frame.isEvalFrame() &&
                      frame.script()->hasAnyBreakpointsOrStepMode();
     if (!cx->compartment()->getDebuggees().empty() || evalTraps)
         ok = slowPathOnLeaveFrame(cx, frame, ok);
     return ok;
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -16,18 +16,18 @@
 #include "jswrapper.h"
 
 #include "frontend/BytecodeCompiler.h"
 #include "gc/Marking.h"
 #include "ion/BaselineJIT.h"
 #include "js/Vector.h"
 
 #include "jsgcinlines.h"
-#include "jsobjinlines.h"
 #include "jsopcodeinlines.h"
+
 #include "gc/FindSCCs-inl.h"
 #include "vm/Interpreter-inl.h"
 #include "vm/Stack-inl.h"
 
 using namespace js;
 
 using js::frontend::IsIdentifier;
 using mozilla::ArrayLength;
--- a/js/src/vm/Debugger.h
+++ b/js/src/vm/Debugger.h
@@ -417,17 +417,17 @@ class Debugger : private mozilla::Linked
     static bool handleBaselineOsr(JSContext *cx, StackFrame *from, ion::BaselineFrame *to);
 
     /************************************* Functions for use by Debugger.cpp. */
 
     inline bool observesEnterFrame() const;
     inline bool observesNewScript() const;
     inline bool observesNewGlobalObject() const;
     inline bool observesGlobal(GlobalObject *global) const;
-    inline bool observesFrame(AbstractFramePtr frame) const;
+    bool observesFrame(AbstractFramePtr frame) const;
     bool observesScript(JSScript *script) const;
 
     /*
      * If env is NULL, call vp->setNull() and return true. Otherwise, find or
      * create a Debugger.Environment object for the given Env. On success,
      * store the Environment object in *vp and return true.
      */
     bool wrapEnvironment(JSContext *cx, Handle<Env*> env, MutableHandleValue vp);
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -37,19 +37,19 @@
 #include "ion/BaselineJIT.h"
 #include "ion/Ion.h"
 #include "vm/Debugger.h"
 #include "vm/Shape.h"
 
 #include "jsatominlines.h"
 #include "jsboolinlines.h"
 #include "jsinferinlines.h"
-#include "jsobjinlines.h"
 #include "jsopcodeinlines.h"
 #include "jsscriptinlines.h"
+
 #include "builtin/Iterator-inl.h"
 #include "ion/IonFrames-inl.h"
 #include "vm/Interpreter-inl.h"
 #include "vm/Probes-inl.h"
 #include "vm/Stack-inl.h"
 
 #include "jsautooplen.h"
 
--- a/js/src/vm/NumberObject-inl.h
+++ b/js/src/vm/NumberObject-inl.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 NumberObject_inl_h___
 #define NumberObject_inl_h___
 
 #include "NumberObject.h"
 
+#include "jsobjinlines.h"
+
 namespace js {
 
 inline NumberObject *
 NumberObject::create(JSContext *cx, double d)
 {
     JSObject *obj = NewBuiltinClassInstance(cx, &NumberClass);
     if (!obj)
         return NULL;
--- a/js/src/vm/ObjectImpl-inl.h
+++ b/js/src/vm/ObjectImpl-inl.h
@@ -199,34 +199,16 @@ js::ObjectImpl::invalidateSlotRange(uint
 #ifdef DEBUG
     HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
     getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
     Debug_SetSlotRangeToCrashOnTouch(fixedStart, fixedEnd);
     Debug_SetSlotRangeToCrashOnTouch(slotsStart, slotsEnd);
 #endif /* DEBUG */
 }
 
-inline void
-js::ObjectImpl::initializeSlotRange(uint32_t start, uint32_t length)
-{
-    /*
-     * No bounds check, as this is used when the object's shape does not
-     * reflect its allocated slots (updateSlotsForSpan).
-     */
-    HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
-    getSlotRangeUnchecked(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
-
-    JSRuntime *rt = runtime();
-    uint32_t offset = start;
-    for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
-        sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
-    for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
-        sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
-}
-
 inline bool
 js::ObjectImpl::isNative() const
 {
     return lastProperty()->isNative();
 }
 
 inline bool
 js::ObjectImpl::isProxy() const
@@ -327,22 +309,16 @@ js::ObjectImpl::numDynamicSlots() const
 }
 
 inline JSClass *
 js::ObjectImpl::getJSClass() const
 {
     return Jsvalify(getClass());
 }
 
-inline bool
-js::ObjectImpl::hasClass(const Class *c) const
-{
-    return getClass() == c;
-}
-
 inline const js::ObjectOps *
 js::ObjectImpl::getOps() const
 {
     return &getClass()->ops;
 }
 
 inline bool
 js::ObjectImpl::isDelegate() const
@@ -451,48 +427,16 @@ js::ObjectImpl::writeBarrierPost(ObjectI
 {
 #ifdef JSGC_GENERATIONAL
     if (IsNullTaggedPointer(obj))
         return;
     obj->runtime()->gcStoreBuffer.putCell((Cell **)addr);
 #endif
 }
 
-inline bool
-js::ObjectImpl::hasPrivate() const
-{
-    return getClass()->hasPrivate();
-}
-
-inline void *&
-js::ObjectImpl::privateRef(uint32_t nfixed) const
-{
-    /*
-     * The private pointer of an object can hold any word sized value.
-     * Private pointers are stored immediately after the last fixed slot of
-     * the object.
-     */
-    MOZ_ASSERT(nfixed == numFixedSlots());
-    MOZ_ASSERT(hasPrivate());
-    HeapSlot *end = &fixedSlots()[nfixed];
-    return *reinterpret_cast<void**>(end);
-}
-
-inline void *
-js::ObjectImpl::getPrivate() const
-{
-    return privateRef(numFixedSlots());
-}
-
-inline void *
-js::ObjectImpl::getPrivate(uint32_t nfixed) const
-{
-    return privateRef(nfixed);
-}
-
 inline void
 js::ObjectImpl::setPrivate(void *data)
 {
     void **pprivate = &privateRef(numFixedSlots());
     privateWriteBarrierPre(pprivate);
     *pprivate = data;
 }
 
--- a/js/src/vm/ObjectImpl.cpp
+++ b/js/src/vm/ObjectImpl.cpp
@@ -8,16 +8,17 @@
 #include "mozilla/Attributes.h"
 
 #include "js/TemplateLib.h"
 #include "js/Value.h"
 #include "vm/Debugger.h"
 #include "vm/ObjectImpl.h"
 
 #include "jsatominlines.h"
+#include "jsobjinlines.h"
 
 #include "gc/Barrier-inl.h"
 #include "gc/Marking.h"
 #include "vm/ObjectImpl-inl.h"
 #include "vm/Shape-inl.h"
 
 using namespace js;
 
@@ -243,16 +244,34 @@ js::ObjectImpl::checkShapeConsistency()
             }
             prev = shape;
         }
     }
 }
 #endif
 
 void
+js::ObjectImpl::initializeSlotRange(uint32_t start, uint32_t length)
+{
+    /*
+     * No bounds check, as this is used when the object's shape does not
+     * reflect its allocated slots (updateSlotsForSpan).
+     */
+    HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
+    getSlotRangeUnchecked(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
+
+    JSRuntime *rt = runtime();
+    uint32_t offset = start;
+    for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
+        sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
+    for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
+        sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
+}
+
+void
 js::ObjectImpl::initSlotRange(uint32_t start, const Value *vector, uint32_t length)
 {
     JSRuntime *rt = runtime();
     HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
     getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
     for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
         sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, start++, *vector++);
     for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
--- a/js/src/vm/ObjectImpl.h
+++ b/js/src/vm/ObjectImpl.h
@@ -1246,17 +1246,17 @@ class ObjectImpl : public gc::Cell
                              HeapSlot **slotsStart, HeapSlot **slotsEnd);
 
   protected:
     friend struct GCMarker;
     friend class Shape;
     friend class NewObjectCache;
 
     inline void invalidateSlotRange(uint32_t start, uint32_t count);
-    inline void initializeSlotRange(uint32_t start, uint32_t count);
+    void initializeSlotRange(uint32_t start, uint32_t count);
 
     /*
      * Initialize a flat array of slots to this object at a start slot.  The
      * caller must ensure that are enough slots.
      */
     void initSlotRange(uint32_t start, const Value *vector, uint32_t length);
 
     /*
@@ -1367,17 +1367,19 @@ class ObjectImpl : public gc::Cell
     inline Shape *nativeLookupPure(PropertyId pid);
     inline Shape *nativeLookupPure(PropertyName *name);
 
     inline bool nativeContainsPure(jsid id);
     inline bool nativeContainsPure(PropertyName* name);
     inline bool nativeContainsPure(Shape* shape);
 
     inline JSClass *getJSClass() const;
-    inline bool hasClass(const Class *c) const;
+    inline bool hasClass(const Class *c) const {
+        return getClass() == c;
+    }
     inline const ObjectOps *getOps() const;
 
     /*
      * An object is a delegate if it is on another object's prototype or scope
      * chain, and therefore the delegate might be asked implicitly to get or
      * set a property on behalf of another object. Delegates may be accessed
      * directly too, as may any object, but only those objects linked after the
      * head of any prototype or scope chain are flagged as delegates. This
@@ -1504,27 +1506,43 @@ class ObjectImpl : public gc::Cell
     static inline void writeBarrierPre(ObjectImpl *obj);
     static inline void writeBarrierPost(ObjectImpl *obj, void *addr);
     inline void privateWriteBarrierPre(void **oldval);
     inline void privateWriteBarrierPost(void **pprivate);
     void markChildren(JSTracer *trc);
 
     /* Private data accessors. */
 
-    inline void *&privateRef(uint32_t nfixed) const; /* XXX should be private, not protected! */
+    inline void *&privateRef(uint32_t nfixed) const { /* XXX should be private, not protected! */
+        /*
+         * The private pointer of an object can hold any word sized value.
+         * Private pointers are stored immediately after the last fixed slot of
+         * the object.
+         */
+        MOZ_ASSERT(nfixed == numFixedSlots());
+        MOZ_ASSERT(hasPrivate());
+        HeapSlot *end = &fixedSlots()[nfixed];
+        return *reinterpret_cast<void**>(end);
+    }
 
-    inline bool hasPrivate() const;
-    inline void *getPrivate() const;
+    inline bool hasPrivate() const {
+        return getClass()->hasPrivate();
+    }
+    inline void *getPrivate() const {
+        return privateRef(numFixedSlots());
+    }
     inline void setPrivate(void *data);
     inline void setPrivateGCThing(gc::Cell *cell);
     inline void setPrivateUnbarriered(void *data);
     inline void initPrivate(void *data);
 
     /* Access private data for an object with a known number of fixed slots. */
-    inline void *getPrivate(uint32_t nfixed) const;
+    inline void *getPrivate(uint32_t nfixed) const {
+        return privateRef(nfixed);
+    }
 
     /* JIT Accessors */
     static size_t offsetOfShape() { return offsetof(ObjectImpl, shape_); }
     HeapPtrShape *addressOfShape() { return &shape_; }
 
     static size_t offsetOfType() { return offsetof(ObjectImpl, type_); }
     HeapPtrTypeObject *addressOfType() { return &type_; }
 
--- a/js/src/vm/RegExpObject-inl.h
+++ b/js/src/vm/RegExpObject-inl.h
@@ -6,17 +6,16 @@
 
 #ifndef RegExpObject_inl_h___
 #define RegExpObject_inl_h___
 
 #include "mozilla/Util.h"
 
 #include "RegExpObject.h"
 
-#include "jsobjinlines.h"
 #include "jsstrinlines.h"
 
 #include "String-inl.h"
 
 inline js::RegExpObject &
 JSObject::asRegExp()
 {
     JS_ASSERT(isRegExp());
--- a/js/src/vm/RegExpStatics-inl.h
+++ b/js/src/vm/RegExpStatics-inl.h
@@ -2,19 +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 RegExpStatics_inl_h__
 #define RegExpStatics_inl_h__
 
-#include "RegExpStatics.h"
+#include "vm/RegExpStatics.h"
 
 #include "gc/Marking.h"
+
+#include "jsinferinlines.h"
+
 #include "vm/String-inl.h"
 
 namespace js {
 
 class RegExpStatics
 {
     /* The latest RegExp output, set after execution. */
     VectorMatchPairs        matches;
--- a/js/src/vm/Shape-inl.h
+++ b/js/src/vm/Shape-inl.h
@@ -17,19 +17,19 @@
 #include "jsgc.h"
 #include "jsobj.h"
 
 #include "gc/Marking.h"
 #include "vm/ArgumentsObject.h"
 #include "vm/ScopeObject.h"
 #include "vm/StringObject.h"
 
+#include "jsatominlines.h"
 #include "jscntxtinlines.h"
 #include "jsgcinlines.h"
-#include "jsobjinlines.h"
 
 #include "vm/ScopeObject-inl.h"
 
 namespace js {
 
 static inline void
 GetterSetterWriteBarrierPost(JSRuntime *rt, JSObject **objp)
 {
--- a/js/src/vm/Stack-inl.h
+++ b/js/src/vm/Stack-inl.h
@@ -436,29 +436,16 @@ AbstractFramePtr::setReturnValue(const V
     }
 #ifdef JS_ION
     asBaselineFrame()->setReturnValue(rval);
 #else
     JS_NOT_REACHED("Invalid frame");
 #endif
 }
 
-inline bool
-AbstractFramePtr::hasPushedSPSFrame() const
-{
-    if (isStackFrame())
-        return asStackFrame()->hasPushedSPSFrame();
-#ifdef JS_ION
-    return asBaselineFrame()->hasPushedSPSFrame();
-#else
-    JS_NOT_REACHED("Invalid frame");
-    return false;
-#endif
-}
-
 inline JSObject *
 AbstractFramePtr::scopeChain() const
 {
     if (isStackFrame())
         return asStackFrame()->scopeChain();
 #ifdef JS_ION
     return asBaselineFrame()->scopeChain();
 #else
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -1,30 +1,32 @@
 /* -*- 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/Stack.h"
 #include "vm/ForkJoin.h"
 
 #include "jsgcinlines.h"
-#include "jsobjinlines.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"
 #elif defined(XP_OS2)
@@ -1821,16 +1823,29 @@ AbstractFramePtr::evalPrevScopeChain(JSC
     // Eval frames are not compiled by Ion, though their caller might be.
     AllFramesIter iter(cx);
     while (iter.isIon() || iter.abstractFramePtr() != *this)
         ++iter;
     ++iter;
     return iter.scopeChain();
 }
 
+bool
+AbstractFramePtr::hasPushedSPSFrame() const
+{
+    if (isStackFrame())
+        return asStackFrame()->hasPushedSPSFrame();
+#ifdef JS_ION
+    return asBaselineFrame()->hasPushedSPSFrame();
+#else
+    JS_NOT_REACHED("Invalid frame");
+    return false;
+#endif
+}
+
 #ifdef DEBUG
 void
 js::CheckLocalUnaliased(MaybeCheckAliasing checkAliasing, JSScript *script,
                         StaticBlockObject *maybeBlock, unsigned i)
 {
     if (!checkAliasing)
         return;
 
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -228,17 +228,17 @@ class AbstractFramePtr
 
     JSObject *evalPrevScopeChain(JSContext *cx) const;
 
     inline void *maybeHookData() const;
     inline void setHookData(void *data) const;
     inline Value returnValue() const;
     inline void setReturnValue(const Value &rval) const;
 
-    inline bool hasPushedSPSFrame() const;
+    bool hasPushedSPSFrame() const;
 
     inline void popBlock(JSContext *cx) const;
     inline void popWith(JSContext *cx) const;
 };
 
 class NullFramePtr : public AbstractFramePtr
 {
   public:
--- a/js/src/vm/String-inl.h
+++ b/js/src/vm/String-inl.h
@@ -10,17 +10,16 @@
 #include "vm/String.h"
 
 #include "mozilla/PodOperations.h"
 
 #include "jscntxt.h"
 #include "gc/Marking.h"
 
 #include "jsgcinlines.h"
-#include "jsobjinlines.h"
 
 namespace js {
 
 template <AllowGC allowGC>
 static JS_ALWAYS_INLINE JSInlineString *
 NewShortString(JSContext *cx, JS::Latin1Chars chars)
 {
     size_t len = chars.length();
--- a/js/src/vm/String.cpp
+++ b/js/src/vm/String.cpp
@@ -1,24 +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/String.h"
+
 #include "mozilla/PodOperations.h"
 #include "mozilla/RangedPtr.h"
 
 #include "gc/Marking.h"
 
-#include "String.h"
+#include "jscompartmentinlines.h"
+
 #include "String-inl.h"
 
-#include "jsobjinlines.h"
-
 using namespace js;
 
 using mozilla::PodCopy;
 using mozilla::RangedPtr;
 
 bool
 JSString::isShort() const
 {
--- a/js/src/vm/StringObject-inl.h
+++ b/js/src/vm/StringObject-inl.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 StringObject_inl_h___
 #define StringObject_inl_h___
 
 #include "StringObject.h"
 
+#include "jsobjinlines.h"
+
 namespace js {
 
 inline bool
 StringObject::init(JSContext *cx, HandleString str)
 {
     JS_ASSERT(numFixedSlots() == 2);
 
     Rooted<StringObject *> self(cx, this);
--- a/js/src/vm/Xdr.cpp
+++ b/js/src/vm/Xdr.cpp
@@ -14,20 +14,20 @@
 #include "jsdhash.h"
 #include "jsprf.h"
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jsnum.h"
 #include "jsscript.h"
 #include "jsstr.h"
 
-#include "Xdr.h"
-#include "Debugger.h"
+#include "vm/Xdr.h"
+#include "vm/Debugger.h"
 
-#include "jsobjinlines.h"
+#include "jsscriptinlines.h"
 
 using namespace js;
 
 using mozilla::DebugOnly;
 
 void
 XDRBuffer::freeBuffer()
 {
@@ -134,16 +134,34 @@ XDRState<mode>::codeScript(MutableHandle
         CallNewScriptHook(cx(), script, NullPtr());
         Debugger::onNewScript(cx(), script, NULL);
         scriptp.set(script);
     }
 
     return true;
 }
 
+template<XDRMode mode>
+void
+XDRState<mode>::initScriptPrincipals(JSScript *script)
+{
+    JS_ASSERT(mode == XDR_DECODE);
+
+    /* The origin principals must be normalized at this point. */
+    JS_ASSERT_IF(principals, originPrincipals);
+    JS_ASSERT(!script->originPrincipals);
+    if (principals)
+        JS_ASSERT(script->principals() == principals);
+
+    if (originPrincipals) {
+        script->originPrincipals = originPrincipals;
+        JS_HoldPrincipals(originPrincipals);
+    }
+}
+
 XDRDecoder::XDRDecoder(JSContext *cx, const void *data, uint32_t length,
                        JSPrincipals *principals, JSPrincipals *originPrincipals)
   : XDRState<XDR_DECODE>(cx)
 {
     buf.setData(data, length);
     this->principals = principals;
     this->originPrincipals = JSScript::normalizeOriginPrincipals(principals, originPrincipals);
 }
--- a/js/src/vm/Xdr.h
+++ b/js/src/vm/Xdr.h
@@ -206,30 +206,17 @@ class XDRState {
         return true;
     }
 
     bool codeChars(jschar *chars, size_t nchars);
 
     bool codeFunction(JS::MutableHandleObject objp);
     bool codeScript(MutableHandleScript scriptp);
 
-    void initScriptPrincipals(JSScript *script) {
-        JS_ASSERT(mode == XDR_DECODE);
-
-        /* The origin principals must be normalized at this point. */
-        JS_ASSERT_IF(principals, originPrincipals);
-        JS_ASSERT(!script->originPrincipals);
-        if (principals)
-            JS_ASSERT(script->principals() == principals);
-
-        if (originPrincipals) {
-            script->originPrincipals = originPrincipals;
-            JS_HoldPrincipals(originPrincipals);
-        }
-    }
+    void initScriptPrincipals(JSScript *script);
 };
 
 class XDREncoder : public XDRState<XDR_ENCODE> {
   public:
     XDREncoder(JSContext *cx)
       : XDRState<XDR_ENCODE>(cx) {
     }