Bug 1187512 - Fix accumulated unified bustage in SpiderMonkey; r=jonco
authorTerrence Cole <terrence@mozilla.com>
Sat, 25 Jul 2015 15:43:22 -0700
changeset 254646 56fc13299fe6c72e341fab541bdad99835cc556e
parent 254645 dddcfde8f0858162c2a6ad3f97b7939983938e27
child 254647 3a2312bfa3f283ed7fc1a9436e4c7c1a9f0cec4d
push id14246
push userryanvm@gmail.com
push dateMon, 27 Jul 2015 14:44:11 +0000
treeherderfx-team@c2e8b03c28bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1187512
milestone42.0a1
Bug 1187512 - Fix accumulated unified bustage in SpiderMonkey; r=jonco
js/src/asmjs/AsmJSModule.cpp
js/src/asmjs/AsmJSModule.h
js/src/builtin/Reflect.cpp
js/src/builtin/TestingFunctions.cpp
js/src/gc/StoreBuffer.h
js/src/gc/Tracer.cpp
js/src/jit/BytecodeAnalysis.cpp
js/src/jit/IonAnalysis.cpp
js/src/jit/IonCaches.h
js/src/jit/JitSpewer.cpp
js/src/jit/JitSpewer.h
js/src/jit/JitcodeMap.cpp
js/src/jit/MIR.cpp
js/src/jit/ScalarReplacement.cpp
js/src/jit/x64/Trampoline-x64.cpp
js/src/vm/Printer.h
js/src/vm/ReceiverGuard.cpp
js/src/vm/Shape.cpp
js/src/vm/UnboxedObject.cpp
--- a/js/src/asmjs/AsmJSModule.cpp
+++ b/js/src/asmjs/AsmJSModule.cpp
@@ -1737,16 +1737,23 @@ AsmJSModule::changeHeap(Handle<ArrayBuff
         return false;
 
     AutoMutateCode amc(cx, *this, "AsmJSModule::changeHeap");
     restoreHeapToInitialState(maybeHeap_);
     initHeap(newHeap, cx);
     return true;
 }
 
+size_t
+AsmJSModule::heapLength() const
+{
+    MOZ_ASSERT(isDynamicallyLinked());
+    return maybeHeap_ ? maybeHeap_->byteLength() : 0;
+}
+
 void
 AsmJSModule::setProfilingEnabled(bool enabled, JSContext* cx)
 {
     MOZ_ASSERT(isDynamicallyLinked());
 
     if (profilingEnabled_ == enabled)
         return;
 
--- a/js/src/asmjs/AsmJSModule.h
+++ b/js/src/asmjs/AsmJSModule.h
@@ -1566,20 +1566,17 @@ class AsmJSModule
     uint8_t* maybeHeap() const {
         MOZ_ASSERT(isDynamicallyLinked());
         return heapDatum();
     }
     ArrayBufferObjectMaybeShared* maybeHeapBufferObject() const {
         MOZ_ASSERT(isDynamicallyLinked());
         return maybeHeap_;
     }
-    size_t heapLength() const {
-        MOZ_ASSERT(isDynamicallyLinked());
-        return maybeHeap_ ? maybeHeap_->byteLength() : 0;
-    }
+    size_t heapLength() const;
     bool profilingEnabled() const {
         MOZ_ASSERT(isDynamicallyLinked());
         return profilingEnabled_;
     }
     void setProfilingEnabled(bool enabled, JSContext* cx);
     void setInterrupted(bool interrupted) {
         MOZ_ASSERT(isDynamicallyLinked());
         interrupted_ = interrupted;
--- a/js/src/builtin/Reflect.cpp
+++ b/js/src/builtin/Reflect.cpp
@@ -1,20 +1,24 @@
 /* -*- 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/Reflect.h"
 
+#include "jsarray.h"
 #include "jscntxt.h"
 
+#include "vm/ArgumentsObject.h"
 #include "vm/Stack.h"
 
+#include "vm/Interpreter-inl.h"
+
 using namespace js;
 
 
 /*** Reflect methods *****************************************************************************/
 
 /*
  * ES draft rev 32 (2015 Feb 2) 7.3.17 CreateListFromArrayLike.
  * The elementTypes argument is not supported. The result list is
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -1450,17 +1450,17 @@ js::testingFunc_inIon(JSContext* cx, uns
 
         args.rval().setString(error);
         return true;
     }
 
     ScriptFrameIter iter(cx);
     if (iter.isIon()) {
         // Reset the counter of the IonScript's script.
-        JitFrameIterator jitIter(cx);
+        jit::JitFrameIterator jitIter(cx);
         ++jitIter;
         jitIter.script()->resetWarmUpResetCounter();
     } else {
         // Check if we missed multiple attempts at compiling the innermost script.
         JSScript* script = cx->currentScript();
         if (script && script->getWarmUpResetCount() >= 20) {
             JSString* error = JS_NewStringCopyZ(cx, "Compilation is being repeatedly prevented. Giving up.");
             if (!error)
--- a/js/src/gc/StoreBuffer.h
+++ b/js/src/gc/StoreBuffer.h
@@ -445,17 +445,17 @@ class StoreBuffer
     void assertHasCellEdge(Cell** cellp) {
         CellPtrEdge cpe(cellp);
 
         MOZ_ASSERT(bufferCell.has(this, CellPtrEdge(cellp)) ||
                    !CellPtrEdge(cellp).maybeInRememberedSet(nursery_));
 
     }
 
-    void assertHasValueEdge(Value* vp) {
+    void assertHasValueEdge(JS::Value* vp) {
         MOZ_ASSERT(bufferVal.has(this, ValueEdge(vp)) ||
                    !ValueEdge(vp).maybeInRememberedSet(nursery_));
     }
 
     void setShouldCancelIonCompilations() {
         cancelIonCompilations_ = true;
     }
 
--- a/js/src/gc/Tracer.cpp
+++ b/js/src/gc/Tracer.cpp
@@ -19,16 +19,17 @@
 
 #include "gc/GCInternals.h"
 #include "gc/Marking.h"
 #include "gc/Zone.h"
 
 #include "vm/Shape.h"
 #include "vm/Symbol.h"
 
+#include "jscompartmentinlines.h"
 #include "jsgcinlines.h"
 
 #include "vm/ObjectGroup-inl.h"
 
 using namespace js;
 using namespace js::gc;
 using mozilla::DebugOnly;
 
--- a/js/src/jit/BytecodeAnalysis.cpp
+++ b/js/src/jit/BytecodeAnalysis.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 "jit/BytecodeAnalysis.h"
 
 #include "jsopcode.h"
 #include "jit/JitSpewer.h"
 #include "jsopcodeinlines.h"
+#include "jsscriptinlines.h"
 
 using namespace js;
 using namespace js::jit;
 
 BytecodeAnalysis::BytecodeAnalysis(TempAllocator& alloc, JSScript* script)
   : script_(script),
     infos_(alloc),
     usesScopeChain_(false),
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -13,16 +13,17 @@
 #include "jit/IonBuilder.h"
 #include "jit/IonOptimizationLevels.h"
 #include "jit/LIR.h"
 #include "jit/Lowering.h"
 #include "jit/MIRGraph.h"
 
 #include "jsobjinlines.h"
 #include "jsopcodeinlines.h"
+#include "jsscriptinlines.h"
 
 using namespace js;
 using namespace js::jit;
 
 using mozilla::DebugOnly;
 
 static bool
 SplitCriticalEdgesForBlock(MIRGraph& graph, MBasicBlock* block)
--- a/js/src/jit/IonCaches.h
+++ b/js/src/jit/IonCaches.h
@@ -9,16 +9,17 @@
 
 #if defined(JS_CODEGEN_ARM)
 # include "jit/arm/Assembler-arm.h"
 #elif defined(JS_CODEGEN_ARM64)
 # include "jit/arm64/Assembler-arm64.h"
 #elif defined(JS_CODEGEN_MIPS)
 # include "jit/mips/Assembler-mips.h"
 #endif
+#include "jit/JitCompartment.h"
 #include "jit/Registers.h"
 #include "jit/shared/Assembler-shared.h"
 #include "js/TrackedOptimizationInfo.h"
 
 #include "vm/TypedArrayCommon.h"
 
 namespace js {
 namespace jit {
--- a/js/src/jit/JitSpewer.cpp
+++ b/js/src/jit/JitSpewer.cpp
@@ -7,16 +7,17 @@
 #ifdef DEBUG
 
 #include "jit/JitSpewer.h"
 
 #include "mozilla/Atomics.h"
 
 #include "jit/Ion.h"
 #include "jit/MIR.h"
+#include "jit/MIRGenerator.h"
 
 #include "vm/HelperThreads.h"
 
 #ifndef JIT_SPEW_DIR
 # if defined(_WIN32)
 #  define JIT_SPEW_DIR ""
 # elif defined(__ANDROID__)
 #  define JIT_SPEW_DIR "/data/local/tmp/"
@@ -233,16 +234,25 @@ IonSpewer::~IonSpewer()
 {
     if (!inited_)
         return;
 
     jsonOutput_.printf("\n]}\n");
     release();
 }
 
+GraphSpewer::GraphSpewer(TempAllocator *alloc)
+  : graph_(nullptr),
+    c1Printer_(alloc->lifoAlloc()),
+    jsonPrinter_(alloc->lifoAlloc()),
+    c1Spewer_(c1Printer_),
+    jsonSpewer_(jsonPrinter_)
+{
+}
+
 void
 GraphSpewer::init(MIRGraph* graph, JSScript* function)
 {
     MOZ_ASSERT(!isSpewing());
     if (!ionspewer.isEnabled())
         return;
 
     if (!FilterContainsLocation(function)) {
--- a/js/src/jit/JitSpewer.h
+++ b/js/src/jit/JitSpewer.h
@@ -111,23 +111,17 @@ class GraphSpewer
   private:
     MIRGraph* graph_;
     LSprinter c1Printer_;
     LSprinter jsonPrinter_;
     C1Spewer c1Spewer_;
     JSONSpewer jsonSpewer_;
 
   public:
-    explicit GraphSpewer(TempAllocator *alloc)
-      : graph_(nullptr),
-        c1Printer_(alloc->lifoAlloc()),
-        jsonPrinter_(alloc->lifoAlloc()),
-        c1Spewer_(c1Printer_),
-        jsonSpewer_(jsonPrinter_)
-    { }
+    explicit GraphSpewer(TempAllocator *alloc);
 
     bool isSpewing() const {
         return graph_;
     }
     void init(MIRGraph* graph, JSScript* function);
     void beginFunction(JSScript* function);
     void spewPass(const char* pass);
     void spewPass(const char* pass, BacktrackingAllocator* ra);
--- a/js/src/jit/JitcodeMap.cpp
+++ b/js/src/jit/JitcodeMap.cpp
@@ -3,33 +3,36 @@
  * 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 "jit/JitcodeMap.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MathAlgorithms.h"
+#include "mozilla/Maybe.h"
 #include "mozilla/SizePrintfMacros.h"
 #include "mozilla/UniquePtr.h"
+
 #include "jsprf.h"
+
 #include "gc/Marking.h"
 #include "gc/Statistics.h"
-
 #include "jit/BaselineJIT.h"
 #include "jit/JitSpewer.h"
-
 #include "js/Vector.h"
 #include "vm/SPSProfiler.h"
+
 #include "jsscriptinlines.h"
 
+using mozilla::Maybe;
+
 namespace js {
 namespace jit {
 
-
 static inline JitcodeRegionEntry
 RegionAtAddr(const JitcodeGlobalEntry::IonEntry& entry, void* ptr,
              uint32_t* ptrOffset)
 {
     MOZ_ASSERT(entry.containsPointer(ptr));
     *ptrOffset = reinterpret_cast<uint8_t*>(ptr) -
                  reinterpret_cast<uint8_t*>(entry.nativeStartAddr());
 
@@ -1047,17 +1050,17 @@ JitcodeGlobalEntry::IonCacheEntry::forEa
 {
     JitcodeGlobalEntry entry;
     RejoinEntry(rt, *this, nativeStartAddr(), &entry);
     if (!entry.hasTrackedOptimizations())
         return;
     entry.forEachOptimizationAttempt(rt, index, op);
 
     // Record the outcome associated with the stub.
-    op(TrackedStrategy::InlineCache_OptimizedStub, trackedOutcome_);
+    op(JS::TrackedStrategy::InlineCache_OptimizedStub, trackedOutcome_);
 }
 
 void
 JitcodeGlobalEntry::IonCacheEntry::forEachOptimizationTypeInfo(
         JSRuntime *rt, uint8_t index,
         IonTrackedOptimizationsTypeInfo::ForEachOpAdapter& op)
 {
     JitcodeGlobalEntry entry;
--- a/js/src/jit/MIR.cpp
+++ b/js/src/jit/MIR.cpp
@@ -20,16 +20,17 @@
 #include "jit/IonBuilder.h"
 #include "jit/JitSpewer.h"
 #include "jit/MIRGraph.h"
 #include "jit/RangeAnalysis.h"
 #include "js/Conversions.h"
 
 #include "jsatominlines.h"
 #include "jsobjinlines.h"
+#include "jsscriptinlines.h"
 
 #include "jit/AtomicOperations-inl.h"
 
 using namespace js;
 using namespace js::jit;
 
 using JS::ToInt32;
 
--- a/js/src/jit/ScalarReplacement.cpp
+++ b/js/src/jit/ScalarReplacement.cpp
@@ -10,16 +10,18 @@
 
 #include "jit/IonAnalysis.h"
 #include "jit/JitSpewer.h"
 #include "jit/MIR.h"
 #include "jit/MIRGenerator.h"
 #include "jit/MIRGraph.h"
 #include "vm/UnboxedObject.h"
 
+#include "jsobjinlines.h"
+
 namespace js {
 namespace jit {
 
 template <typename MemoryView>
 class EmulateStateOf
 {
   private:
     typedef typename MemoryView::BlockState BlockState;
--- a/js/src/jit/x64/Trampoline-x64.cpp
+++ b/js/src/jit/x64/Trampoline-x64.cpp
@@ -9,16 +9,18 @@
 #include "jit/JitFrames.h"
 #include "jit/Linker.h"
 #ifdef JS_ION_PERF
 # include "jit/PerfSpewer.h"
 #endif
 #include "jit/VMFunctions.h"
 #include "jit/x64/SharedICHelpers-x64.h"
 
+#include "jit/MacroAssembler-inl.h"
+
 using namespace js;
 using namespace js::jit;
 
 // All registers to save and restore. This includes the stack pointer, since we
 // use the ability to reference register values on the stack by index.
 static const LiveRegisterSet AllRegs =
     LiveRegisterSet(GeneralRegisterSet(Registers::AllMask),
                          FloatRegisterSet(FloatRegisters::AllMask));
--- a/js/src/vm/Printer.h
+++ b/js/src/vm/Printer.h
@@ -3,16 +3,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 vm_Printer_h
 #define vm_Printer_h
 
 #include <stdarg.h>
+#include <stddef.h>
 #include <stdio.h>
 
 class JSString;
 
 namespace js {
 
 class ExclusiveContext;
 class LifoAlloc;
--- a/js/src/vm/ReceiverGuard.cpp
+++ b/js/src/vm/ReceiverGuard.cpp
@@ -3,16 +3,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/. */
 
 #include "vm/ReceiverGuard.h"
 
 #include "builtin/TypedObject.h"
 #include "vm/UnboxedObject.h"
+#include "jsobjinlines.h"
 
 using namespace js;
 
 ReceiverGuard::ReceiverGuard(JSObject* obj)
   : group(nullptr), shape(nullptr)
 {
     if (obj) {
         if (obj->is<UnboxedPlainObject>()) {
--- a/js/src/vm/Shape.cpp
+++ b/js/src/vm/Shape.cpp
@@ -15,16 +15,17 @@
 #include "jsatom.h"
 #include "jscntxt.h"
 #include "jshashutil.h"
 #include "jsobj.h"
 
 #include "js/HashTable.h"
 
 #include "jscntxtinlines.h"
+#include "jscompartmentinlines.h"
 #include "jsobjinlines.h"
 
 #include "vm/NativeObject-inl.h"
 #include "vm/Runtime-inl.h"
 
 using namespace js;
 using namespace js::gc;
 
--- a/js/src/vm/UnboxedObject.cpp
+++ b/js/src/vm/UnboxedObject.cpp
@@ -333,17 +333,17 @@ UnboxedPlainObject::trace(JSTracer* trc,
 
 /* static */ UnboxedExpandoObject*
 UnboxedPlainObject::ensureExpando(JSContext* cx, Handle<UnboxedPlainObject*> obj)
 {
     if (obj->expando_)
         return obj->expando_;
 
     UnboxedExpandoObject* expando =
-        NewObjectWithGivenProto<UnboxedExpandoObject>(cx, nullptr, AllocKind::OBJECT4);
+        NewObjectWithGivenProto<UnboxedExpandoObject>(cx, nullptr, gc::AllocKind::OBJECT4);
     if (!expando)
         return nullptr;
 
     // If the expando is tenured then the original object must also be tenured.
     // Otherwise barriers triggered on the original object for writes to the
     // expando (as can happen in the JIT) won't see the tenured->nursery edge.
     // See WholeCellEdges::mark.
     MOZ_ASSERT_IF(!IsInsideNursery(expando), !IsInsideNursery(obj));