Bug 1119230 - yet more JIT bits for PJS. r=shu
authorLars T Hansen <lhansen@mozilla.com>
Wed, 14 Jan 2015 09:21:59 +0100
changeset 250836 d43317c1d73f526adff9fcf10f29d38d5b089830
parent 250835 2ff00342d08842421b5f84b73c1e9ed315588cf1
child 250837 572ae21637214b0c283b8be8dce86ebc5e42a61b
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1119230
milestone38.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 1119230 - yet more JIT bits for PJS. r=shu
js/src/jit/BaselineBailouts.cpp
js/src/jit/BaselineJIT.cpp
js/src/jit/ExecutionMode-inl.h
js/src/jit/Ion.cpp
js/src/jit/IonBuilder.cpp
js/src/jit/IonCode.h
js/src/jit/IonTypes.h
js/src/jit/JitCompartment.h
js/src/jit/MIRGraph.h
js/src/jit/arm/Simulator-arm.cpp
js/src/jit/mips/Simulator-mips.cpp
js/src/jsinfer.cpp
js/src/jsinfer.h
js/src/jsscript.h
js/src/vm/ForkJoin.cpp
--- a/js/src/jit/BaselineBailouts.cpp
+++ b/js/src/jit/BaselineBailouts.cpp
@@ -1814,17 +1814,16 @@ jit::FinishBailoutToBaseline(BaselineBai
       case Bailout_Hole:
       case Bailout_NegativeIndex:
       case Bailout_NonInt32Input:
       case Bailout_NonNumericInput:
       case Bailout_NonBooleanInput:
       case Bailout_NonObjectInput:
       case Bailout_NonStringInput:
       case Bailout_NonSymbolInput:
-      case Bailout_GuardThreadExclusive:
       case Bailout_InitialState:
       case Bailout_Debugger:
         // Do nothing.
         break;
 
       // Invalid assumption based on baseline code.
       case Bailout_OverflowInvalidate:
       case Bailout_NonStringInputInvalidate:
--- a/js/src/jit/BaselineJIT.cpp
+++ b/js/src/jit/BaselineJIT.cpp
@@ -265,26 +265,17 @@ CanEnterBaselineJIT(JSContext *cx, Handl
 
     if (!cx->compartment()->ensureJitCompartmentExists(cx))
         return Method_Error;
 
     if (script->hasBaselineScript())
         return Method_Compiled;
 
     // Check script warm-up counter.
-    //
-    // Also eagerly compile if we are in parallel warmup, the point of which
-    // is to gather type information so that the script may be compiled for
-    // parallel execution. We want to avoid the situation of OSRing during
-    // warm-up and only gathering type information for the loop, and not the
-    // rest of the function.
-    if (cx->runtime()->forkJoinWarmup > 0) {
-        if (osrFrame)
-            return Method_Skipped;
-    } else if (script->incWarmUpCounter() <= js_JitOptions.baselineWarmUpThreshold) {
+    if (script->incWarmUpCounter() <= js_JitOptions.baselineWarmUpThreshold) {
         return Method_Skipped;
     }
 
     if (script->isCallsiteClone()) {
         // Ensure the original function is compiled too, so that bailouts from
         // Ion code have a BaselineScript to resume into.
         RootedScript original(cx, script->donorFunction()->nonLazyScript());
         MOZ_ASSERT(original != script);
--- a/js/src/jit/ExecutionMode-inl.h
+++ b/js/src/jit/ExecutionMode-inl.h
@@ -14,85 +14,78 @@
 namespace js {
 namespace jit {
 
 static inline bool
 HasIonScript(JSScript *script, ExecutionMode cmode)
 {
     switch (cmode) {
       case SequentialExecution: return script->hasIonScript();
-      case ParallelExecution: return script->hasParallelIonScript();
       default:;
     }
     MOZ_CRASH("No such execution mode");
 }
 
 static inline IonScript *
 GetIonScript(JSScript *script, ExecutionMode cmode)
 {
     switch (cmode) {
       case SequentialExecution: return script->maybeIonScript();
-      case ParallelExecution: return script->maybeParallelIonScript();
       default:;
     }
     MOZ_CRASH("No such execution mode");
 }
 
 static inline void
 SetIonScript(JSContext *cx, JSScript *script, ExecutionMode cmode, IonScript *ionScript)
 {
     switch (cmode) {
       case SequentialExecution: script->setIonScript(cx, ionScript); return;
-      case ParallelExecution: script->setParallelIonScript(ionScript); return;
       default:;
     }
     MOZ_CRASH("No such execution mode");
 }
 
 static inline size_t
 OffsetOfIonInJSScript(ExecutionMode cmode)
 {
     switch (cmode) {
       case SequentialExecution: return JSScript::offsetOfIonScript();
-      case ParallelExecution: return JSScript::offsetOfParallelIonScript();
       default:;
     }
     MOZ_CRASH("No such execution mode");
 }
 
 static inline bool
 CanIonCompile(JSScript *script, ExecutionMode cmode)
 {
     switch (cmode) {
       case SequentialExecution: return script->canIonCompile();
-      case ParallelExecution: return script->canParallelIonCompile();
       case DefinitePropertiesAnalysis: return true;
       case ArgumentsUsageAnalysis: return true;
       default:;
     }
     MOZ_CRASH("No such execution mode");
 }
 
 static inline bool
 CompilingOffThread(JSScript *script, ExecutionMode cmode)
 {
     switch (cmode) {
       case SequentialExecution: return script->isIonCompilingOffThread();
-      case ParallelExecution: return script->isParallelIonCompilingOffThread();
       default:;
     }
     MOZ_CRASH("No such execution mode");
 }
 
 static inline bool
 CompilingOffThread(HandleScript script, ExecutionMode cmode)
 {
     switch (cmode) {
       case SequentialExecution: return script->isIonCompilingOffThread();
-      case ParallelExecution: return script->isParallelIonCompilingOffThread();
       default:;
     }
     MOZ_CRASH("No such execution mode");
 }
 
 } // namespace jit
 } // namespace js
 
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -369,25 +369,23 @@ JitRuntime::patchIonBackedges(JSRuntime 
 
 JitCompartment::JitCompartment()
   : stubCodes_(nullptr),
     baselineCallReturnAddr_(nullptr),
     baselineGetPropReturnAddr_(nullptr),
     baselineSetPropReturnAddr_(nullptr),
     stringConcatStub_(nullptr),
     regExpExecStub_(nullptr),
-    regExpTestStub_(nullptr),
-    activeParallelEntryScripts_(nullptr)
+    regExpTestStub_(nullptr)
 {
 }
 
 JitCompartment::~JitCompartment()
 {
     js_delete(stubCodes_);
-    js_delete(activeParallelEntryScripts_);
 }
 
 bool
 JitCompartment::initialize(JSContext *cx)
 {
     stubCodes_ = cx->new_<ICStubCodeMap>(cx);
     if (!stubCodes_ || !stubCodes_->init())
         return false;
@@ -402,47 +400,16 @@ JitCompartment::ensureIonStubsExist(JSCo
         stringConcatStub_ = generateStringConcatStub(cx);
         if (!stringConcatStub_)
             return false;
     }
 
     return true;
 }
 
-bool
-JitCompartment::notifyOfActiveParallelEntryScript(JSContext *cx, HandleScript script)
-{
-    // Fast path. The isParallelEntryScript bit guarantees that the script is
-    // already in the set.
-    if (script->parallelIonScript()->isParallelEntryScript()) {
-        MOZ_ASSERT(activeParallelEntryScripts_ && activeParallelEntryScripts_->has(script));
-        script->parallelIonScript()->resetParallelAge();
-        return true;
-    }
-
-    if (!activeParallelEntryScripts_) {
-        ScriptSet *scripts = js_new<ScriptSet>();
-        if (!scripts || !scripts->init()) {
-            js_delete(scripts);
-            js_ReportOutOfMemory(cx);
-            return false;
-        }
-        activeParallelEntryScripts_ = scripts;
-    }
-
-    script->parallelIonScript()->setIsParallelEntryScript();
-    return activeParallelEntryScripts_->put(script);
-}
-
-bool
-JitCompartment::hasRecentParallelActivity() const
-{
-    return activeParallelEntryScripts_ && !activeParallelEntryScripts_->empty();
-}
-
 void
 jit::FinishOffThreadBuilder(JSContext *cx, IonBuilder *builder)
 {
     ExecutionMode executionMode = builder->info().executionMode();
 
     // Clean the references to the pending IonBuilder, if we just finished it.
     if (builder->script()->hasIonScript() && builder->script()->pendingIonBuilder() == builder)
         builder->script()->setPendingIonBuilder(cx, nullptr);
@@ -547,49 +514,16 @@ JitRuntime::Mark(JSTracer *trc)
     }
 }
 
 void
 JitCompartment::mark(JSTracer *trc, JSCompartment *compartment)
 {
     // Free temporary OSR buffer.
     trc->runtime()->jitRuntime()->freeOsrTempData();
-
-    // Mark scripts with parallel IonScripts if we should preserve them.
-    if (activeParallelEntryScripts_) {
-        for (ScriptSet::Enum e(*activeParallelEntryScripts_); !e.empty(); e.popFront()) {
-            JSScript *script = e.front();
-
-            // If the script has since been invalidated or was attached by an
-            // off-thread helper too late (i.e., the ForkJoin finished with
-            // warmup doing all the work), remove it.
-            if (!script->hasParallelIonScript() ||
-                !script->parallelIonScript()->isParallelEntryScript())
-            {
-                e.removeFront();
-                continue;
-            }
-
-            // Check and increment the age. If the script is below the max
-            // age, mark it.
-            //
-            // Subtlety: We depend on the tracing of the parallel IonScript's
-            // callTargetEntries to propagate the parallel age to the entire
-            // call graph.
-            if (!trc->runtime()->gc.shouldCleanUpEverything() &&
-                script->parallelIonScript()->shouldPreserveParallelCode(IonScript::IncreaseAge))
-            {
-                MarkScript(trc, const_cast<PreBarrieredScript *>(&e.front()), "par-script");
-                MOZ_ASSERT(script == e.front());
-            } else {
-                script->parallelIonScript()->clearIsParallelEntryScript();
-                e.removeFront();
-            }
-        }
-    }
 }
 
 void
 JitCompartment::sweep(FreeOp *fop, JSCompartment *compartment)
 {
     // Cancel any active or pending off thread compilations. Note that the
     // MIR graph does not hold any nursery pointers, so there's no need to
     // do this for minor GCs.
@@ -611,26 +545,16 @@ JitCompartment::sweep(FreeOp *fop, JSCom
     if (stringConcatStub_ && !IsJitCodeMarked(&stringConcatStub_))
         stringConcatStub_ = nullptr;
 
     if (regExpExecStub_ && !IsJitCodeMarked(&regExpExecStub_))
         regExpExecStub_ = nullptr;
 
     if (regExpTestStub_ && !IsJitCodeMarked(&regExpTestStub_))
         regExpTestStub_ = nullptr;
-
-    if (activeParallelEntryScripts_) {
-        for (ScriptSet::Enum e(*activeParallelEntryScripts_); !e.empty(); e.popFront()) {
-            JSScript *script = e.front();
-            if (!IsScriptMarked(&script))
-                e.removeFront();
-            else
-                MOZ_ASSERT(script == e.front());
-        }
-    }
 }
 
 void
 JitCompartment::toggleBarriers(bool enabled)
 {
     // Toggle barriers in compartment wide stubs that have patchable pre barriers.
     if (regExpExecStub_)
         regExpExecStub_->togglePreBarriers(enabled);
@@ -776,17 +700,16 @@ IonScript::IonScript()
     deoptTable_(nullptr),
     osrPc_(nullptr),
     osrEntryOffset_(0),
     skipArgCheckEntryOffset_(0),
     invalidateEpilogueOffset_(0),
     invalidateEpilogueDataOffset_(0),
     numBailouts_(0),
     hasUncompiledCallTarget_(false),
-    isParallelEntryScript_(false),
     hasSPSInstrumentation_(false),
     recompiling_(false),
     runtimeData_(0),
     runtimeSize_(0),
     cacheIndex_(0),
     cacheEntries_(0),
     safepointIndexOffset_(0),
     safepointIndexEntries_(0),
@@ -801,17 +724,16 @@ IonScript::IonScript()
     snapshots_(0),
     snapshotsListSize_(0),
     snapshotsRVATableSize_(0),
     constantTable_(0),
     constantEntries_(0),
     backedgeList_(0),
     backedgeEntries_(0),
     invalidationCount_(0),
-    parallelAge_(0),
     recompileInfo_(),
     osrPcMismatchCounter_(0),
     pendingBuilder_(nullptr)
 {
 }
 
 IonScript *
 IonScript::New(JSContext *cx, types::RecompileInfo recompileInfo,
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -668,22 +668,20 @@ IonBuilder::build()
     if (!current)
         return false;
 
 #ifdef DEBUG
     if (info().executionModeIsAnalysis()) {
         JitSpew(JitSpew_IonScripts, "Analyzing script %s:%d (%p) %s",
                 script()->filename(), script()->lineno(), (void *)script(),
                 ExecutionModeString(info().executionMode()));
-    } else if (info().executionMode() == SequentialExecution && script()->hasIonScript()) {
-        JitSpew(JitSpew_IonScripts, "Recompiling script %s:%d (%p) (warmup-counter=%d, level=%s)",
-                script()->filename(), script()->lineno(), (void *)script(),
-                (int)script()->getWarmUpCount(), OptimizationLevelString(optimizationInfo().level()));
     } else {
-        JitSpew(JitSpew_IonScripts, "Compiling script %s:%d (%p) (warmup-counter=%d, level=%s)",
+        MOZ_ASSERT(info().executionMode() == SequentialExecution);
+        JitSpew(JitSpew_IonScripts, "%sompiling script %s:%d (%p) (warmup-counter=%d, level=%s)",
+                (script()->hasIonScript() ? "Rec" : "C"),
                 script()->filename(), script()->lineno(), (void *)script(),
                 (int)script()->getWarmUpCount(), OptimizationLevelString(optimizationInfo().level()));
     }
 #endif
 
     initParameters();
     initLocals();
 
@@ -6689,20 +6687,16 @@ ClassHasResolveHook(CompileCompartment *
         return FunctionHasResolveHook(comp->runtime()->names(), NameToId(name));
 
     return true;
 }
 
 void
 IonBuilder::insertRecompileCheck()
 {
-    // PJS doesn't recompile and doesn't need recompile checks.
-    if (info().executionMode() != SequentialExecution)
-        return;
-
     // No need for recompile checks if this is the highest optimization level.
     OptimizationLevel curLevel = optimizationInfo().level();
     if (js_IonOptimizations.isLastLevel(curLevel))
         return;
 
     // Add recompile check.
 
     // Get the topmost builder. The topmost script will get recompiled when
--- a/js/src/jit/IonCode.h
+++ b/js/src/jit/IonCode.h
@@ -193,21 +193,16 @@ struct IonScript
     // Number of times this script bailed out without invalidation.
     uint32_t numBailouts_;
 
     // Flag set when it is likely that one of our (transitive) call
     // targets is not compiled.  Used in ForkJoin.cpp to decide when
     // we should add call targets to the worklist.
     mozilla::Atomic<bool, mozilla::Relaxed> hasUncompiledCallTarget_;
 
-    // Flag set when this script is used as an entry script to parallel
-    // execution. If this is true, then the parent JSScript must be in its
-    // JitCompartment's parallel entry script set.
-    bool isParallelEntryScript_;
-
     // Flag set if IonScript was compiled with SPS profiling enabled.
     bool hasSPSInstrumentation_;
 
     // Flag for if this script is getting recompiled.
     uint32_t recompiling_;
 
     // Any kind of data needed by the runtime, these can be either cache
     // information or profiling info.
@@ -258,23 +253,16 @@ struct IonScript
 
     // List of patchable backedges which are threaded into the runtime's list.
     uint32_t backedgeList_;
     uint32_t backedgeEntries_;
 
     // Number of references from invalidation records.
     uint32_t invalidationCount_;
 
-    // If this is a parallel script, the number of major GC collections it has
-    // been idle, otherwise 0.
-    //
-    // JSScripts with parallel IonScripts are preserved across GC if the
-    // parallel age is < MAX_PARALLEL_AGE.
-    uint32_t parallelAge_;
-
     // Identifier of the compilation which produced this code.
     types::RecompileInfo recompileInfo_;
 
     // The optimization level this script was compiled in.
     OptimizationLevel optimizationLevel_;
 
     // Number of times we tried to enter this script via OSR but failed due to
     // a LOOPENTRY pc other than osrPc_.
@@ -433,25 +421,16 @@ struct IonScript
         hasUncompiledCallTarget_ = true;
     }
     void clearHasUncompiledCallTarget() {
         hasUncompiledCallTarget_ = false;
     }
     bool hasUncompiledCallTarget() const {
         return hasUncompiledCallTarget_;
     }
-    void setIsParallelEntryScript() {
-        isParallelEntryScript_ = true;
-    }
-    void clearIsParallelEntryScript() {
-        isParallelEntryScript_ = false;
-    }
-    bool isParallelEntryScript() const {
-        return isParallelEntryScript_;
-    }
     void setHasSPSInstrumentation() {
         hasSPSInstrumentation_ = true;
     }
     void clearHasSPSInstrumentation() {
         hasSPSInstrumentation_ = false;
     }
     bool hasSPSInstrumentation() const {
         return hasSPSInstrumentation_;
@@ -585,35 +564,21 @@ struct IonScript
     bool isRecompiling() const {
         return recompiling_;
     }
 
     void clearRecompiling() {
         recompiling_ = false;
     }
 
-    static const uint32_t MAX_PARALLEL_AGE = 5;
-
     enum ShouldIncreaseAge {
         IncreaseAge = true,
         KeepAge = false
     };
 
-    void resetParallelAge() {
-        MOZ_ASSERT(isParallelEntryScript());
-        parallelAge_ = 0;
-    }
-    uint32_t parallelAge() const {
-        return parallelAge_;
-    }
-    uint32_t shouldPreserveParallelCode(ShouldIncreaseAge increaseAge = KeepAge) {
-        MOZ_ASSERT(isParallelEntryScript());
-        return (increaseAge ? ++parallelAge_ : parallelAge_) < MAX_PARALLEL_AGE;
-    }
-
     static void writeBarrierPre(Zone *zone, IonScript *ionScript);
 };
 
 // Execution information for a basic block which may persist after the
 // accompanying IonScript is destroyed, for use during profiling.
 struct IonBlockCounts
 {
   private:
--- a/js/src/jit/IonTypes.h
+++ b/js/src/jit/IonTypes.h
@@ -96,22 +96,16 @@ enum BailoutKind
     // Unbox expects a given type, bails out if it doesn't get it.
     Bailout_NonInt32Input,
     Bailout_NonNumericInput, // unboxing a double works with int32 too
     Bailout_NonBooleanInput,
     Bailout_NonObjectInput,
     Bailout_NonStringInput,
     Bailout_NonSymbolInput,
 
-    // PJS bailout when writing to a non-thread local object.
-    Bailout_GuardThreadExclusive,
-
-    // PJS bailout when encountering MIR unsafe for parallel execution.
-    Bailout_ParallelUnsafe,
-
     // For the initial snapshot when entering a function.
     Bailout_InitialState,
 
     // We hit a |debugger;| statement.
     Bailout_Debugger,
 
     // END Normal bailouts
 
@@ -195,18 +189,16 @@ BailoutKindString(BailoutKind kind)
       case Bailout_NonBooleanInput:
         return "Bailout_NonBooleanInput";
       case Bailout_NonObjectInput:
         return "Bailout_NonObjectInput";
       case Bailout_NonStringInput:
         return "Bailout_NonStringInput";
       case Bailout_NonSymbolInput:
         return "Bailout_NonSymbolInput";
-      case Bailout_GuardThreadExclusive:
-        return "Bailout_GuardThreadExclusive";
       case Bailout_InitialState:
         return "Bailout_InitialState";
       case Bailout_Debugger:
         return "Bailout_Debugger";
 
       // Bailouts caused by invalid assumptions.
       case Bailout_OverflowInvalidate:
         return "Bailout_OverflowInvalidate";
--- a/js/src/jit/JitCompartment.h
+++ b/js/src/jit/JitCompartment.h
@@ -430,23 +430,16 @@ class JitCompartment
     // in JitRuntime. These are weak pointers, but are not declared as
     // ReadBarriered since they are only read from during Ion compilation,
     // which may occur off thread and whose barriers are captured during
     // CodeGenerator::link.
     JitCode *stringConcatStub_;
     JitCode *regExpExecStub_;
     JitCode *regExpTestStub_;
 
-    // Set of JSScripts invoked by ForkJoin (i.e. the entry script). These
-    // scripts are marked if their respective parallel IonScripts' age is less
-    // than a certain amount. See IonScript::parallelAge_.
-    typedef HashSet<PreBarrieredScript, DefaultHasher<PreBarrieredScript>, SystemAllocPolicy>
-        ScriptSet;
-    ScriptSet *activeParallelEntryScripts_;
-
     JitCode *generateStringConcatStub(JSContext *cx);
     JitCode *generateRegExpExecStub(JSContext *cx);
     JitCode *generateRegExpTestStub(JSContext *cx);
 
   public:
     JitCode *getStubCode(uint32_t key) {
         ICStubCodeMap::AddPtr p = stubCodes_->lookupForAdd(key);
         if (p)
@@ -481,19 +474,16 @@ class JitCompartment
         MOZ_ASSERT(baselineSetPropReturnAddr_ == nullptr);
         baselineSetPropReturnAddr_ = addr;
     }
     void *baselineSetPropReturnAddr() {
         MOZ_ASSERT(baselineSetPropReturnAddr_ != nullptr);
         return baselineSetPropReturnAddr_;
     }
 
-    bool notifyOfActiveParallelEntryScript(JSContext *cx, HandleScript script);
-    bool hasRecentParallelActivity() const;
-
     void toggleBarriers(bool enabled);
 
     ExecutableAllocator *createIonAlloc();
 
   public:
     JitCompartment();
     ~JitCompartment();
 
--- a/js/src/jit/MIRGraph.h
+++ b/js/src/jit/MIRGraph.h
@@ -226,18 +226,17 @@ class MBasicBlock : public TempObject, p
     void addPredecessorSameInputsAs(MBasicBlock *pred, MBasicBlock *existingPred);
 
     // Stranger utilities used for inlining.
     bool addPredecessorWithoutPhis(MBasicBlock *pred);
     void inheritSlots(MBasicBlock *parent);
     bool initEntrySlots(TempAllocator &alloc);
 
     // Replaces an edge for a given block with a new block. This is
-    // used for critical edge splitting and also for inserting
-    // bailouts during ParallelSafetyAnalysis.
+    // used for critical edge splitting.
     //
     // Note: If successorWithPhis is set, you must not be replacing it.
     void replacePredecessor(MBasicBlock *old, MBasicBlock *split);
     void replaceSuccessor(size_t pos, MBasicBlock *split);
 
     // Removes `pred` from the predecessor list. If this block defines phis,
     // removes the entry for `pred` and updates the indices of later entries.
     // This may introduce redundant phis if the new block has fewer
--- a/js/src/jit/arm/Simulator-arm.cpp
+++ b/js/src/jit/arm/Simulator-arm.cpp
@@ -368,17 +368,17 @@ class SimulatorRuntime
     };
 
   public:
     typedef HashMap<void *, CachePage *, ICacheHasher, SystemAllocPolicy> ICacheMap;
 
   protected:
     ICacheMap icache_;
 
-    // Synchronize access between main thread and compilation/PJS threads.
+    // Synchronize access between main thread and compilation threads.
     PRLock *lock_;
     mozilla::DebugOnly<PRThread *> lockOwner_;
 
   public:
     SimulatorRuntime()
       : redirection_(nullptr),
         lock_(nullptr),
         lockOwner_(nullptr)
--- a/js/src/jit/mips/Simulator-mips.cpp
+++ b/js/src/jit/mips/Simulator-mips.cpp
@@ -503,17 +503,17 @@ class SimulatorRuntime
     };
 
   public:
     typedef HashMap<void *, CachePage *, ICacheHasher, SystemAllocPolicy> ICacheMap;
 
   protected:
     ICacheMap icache_;
 
-    // Synchronize access between main thread and compilation/PJS threads.
+    // Synchronize access between main thread and compilation threads.
     PRLock *lock_;
     mozilla::DebugOnly<PRThread *> lockOwner_;
 
   public:
     SimulatorRuntime()
       : redirection_(nullptr),
         lock_(nullptr),
         lockOwner_(nullptr) {}
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -2471,19 +2471,16 @@ TypeZone::addPendingRecompile(JSContext 
 
     // Let the script warm up again before attempting another compile.
     if (jit::IsBaselineEnabled(cx))
         script->resetWarmUpCounter();
 
     if (script->hasIonScript())
         addPendingRecompile(cx, script->ionScript()->recompileInfo());
 
-    if (script->hasParallelIonScript())
-        addPendingRecompile(cx, script->parallelIonScript()->recompileInfo());
-
     // When one script is inlined into another the caller listens to state
     // changes on the callee's script, so trigger these to force recompilation
     // of any such callers.
     if (script->functionNonDelazifying() && !script->functionNonDelazifying()->hasLazyType())
         ObjectStateChange(cx, script->functionNonDelazifying()->type(), false);
 }
 
 void
@@ -5021,18 +5018,17 @@ JSScript::maybeSweepTypes(AutoClearTypeI
 
     TypeZone &types = zone()->types;
 
     // Destroy all type information attached to the script if desired. We can
     // only do this if nothing has been compiled for the script, which will be
     // the case unless the script has been compiled since we started sweeping.
     if (types.sweepReleaseTypes &&
         !hasBaselineScript() &&
-        !hasIonScript() &&
-        !hasParallelIonScript())
+        !hasIonScript())
     {
         types_->destroy();
         types_ = nullptr;
 
         // Freeze constraints on stack type sets need to be regenerated the
         // next time the script is analyzed.
         hasFreezeConstraints_ = false;
 
@@ -5044,18 +5040,16 @@ JSScript::maybeSweepTypes(AutoClearTypeI
 
     // Remove constraints and references to dead objects from stack type sets.
     for (unsigned i = 0; i < num; i++)
         typeArray[i].sweep(zone(), *oom);
 
     // Update the recompile indexes in any IonScripts still on the script.
     if (hasIonScript())
         ionScript()->recompileInfoRef().shouldSweep(types);
-    if (hasParallelIonScript())
-        parallelIonScript()->recompileInfoRef().shouldSweep(types);
 }
 
 void
 TypeScript::destroy()
 {
     js_free(this);
 }
 
--- a/js/src/jsinfer.h
+++ b/js/src/jsinfer.h
@@ -115,37 +115,30 @@ class RootedBase<TaggedProto> : public T
     }
 };
 
 class CallObject;
 
 /*
  * Execution Mode Overview
  *
- * JavaScript code can execute either sequentially or in parallel, such as in
- * PJS. Functions which behave identically in either execution mode can take a
- * ThreadSafeContext, and functions which have similar but not identical
- * behavior between execution modes can be templated on the mode. Such
- * functions use a context parameter type from ExecutionModeTraits below
- * indicating whether they are only permitted constrained operations (such as
- * thread safety, and side effects limited to being thread-local), or whether
- * they can have arbitrary side effects.
+ * JavaScript code executes sequentially.  Functions which have
+ * similar but not identical behavior between execution modes can be
+ * templated on the mode. Such functions use a context parameter type
+ * from ExecutionModeTraits below indicating whether they are only
+ * permitted constrained operations (such as thread safety, and side
+ * effects limited to being thread-local), or whether they can have
+ * arbitrary side effects.
  */
 
 enum ExecutionMode {
     /* Normal JavaScript execution. */
     SequentialExecution,
 
     /*
-     * JavaScript code to be executed in parallel worker threads in PJS in a
-     * fork join fashion.
-     */
-    ParallelExecution,
-
-    /*
      * Modes after this point are internal and are not counted in
      * NumExecutionModes below.
      */
 
     /*
      * MIR analysis performed when invoking 'new' on a script, to determine
      * definite properties. Used by the optimizing JIT.
      */
@@ -159,32 +152,30 @@ enum ExecutionMode {
 };
 
 inline const char *
 ExecutionModeString(ExecutionMode mode)
 {
     switch (mode) {
       case SequentialExecution:
         return "SequentialExecution";
-      case ParallelExecution:
-        return "ParallelExecution";
       case DefinitePropertiesAnalysis:
         return "DefinitePropertiesAnalysis";
       case ArgumentsUsageAnalysis:
         return "ArgumentsUsageAnalysis";
       default:
         MOZ_CRASH("Invalid ExecutionMode");
     }
 }
 
 /*
  * Not as part of the enum so we don't get warnings about unhandled enum
  * values.
  */
-static const unsigned NumExecutionModes = ParallelExecution + 1;
+static const unsigned NumExecutionModes = SequentialExecution + 1;
 
 namespace jit {
     struct IonScript;
     class JitAllocPolicy;
     class TempAllocator;
 }
 
 namespace types {
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -836,19 +836,16 @@ class JSScript : public js::gc::TenuredC
     // For callsite clones, which cannot have enclosing scopes, the original
     // function; otherwise the enclosing scope
     js::HeapPtrObject   enclosingScopeOrOriginalFunction_;
 
     /* Information attached by Baseline/Ion for sequential mode execution. */
     js::jit::IonScript *ion;
     js::jit::BaselineScript *baseline;
 
-    /* Information attached by Ion for parallel mode execution */
-    js::jit::IonScript *parallelIon;
-
     /* Information used to re-lazify a lazily-parsed interpreted function. */
     js::LazyScript *lazyScript;
 
     /*
      * Pointer to either baseline->method()->raw() or ion->method()->raw(), or
      * nullptr if there's no Baseline or Ion script.
      */
     uint8_t *baselineOrIonRaw;
@@ -967,16 +964,17 @@ class JSScript : public js::gc::TenuredC
     bool isCachedEval_:1;
 
     // Set for functions defined at the top level within an 'eval' script.
     bool directlyInsideEval_:1;
 
     // 'this', 'arguments' and f.apply() are used. This is likely to be a wrapper.
     bool usesArgumentsApplyAndThis_:1;
 
+    // PJS FIXME
     /* script is attempted to be cloned anew at each callsite. This is
        temporarily needed for ParallelArray selfhosted code until type
        information can be made context sensitive. See discussion in
        bug 826148. */
     bool shouldCloneAtCallsite_:1;
     bool isCallsiteClone_:1; /* is a callsite clone; has a link to the original function */
     bool shouldInline_:1;    /* hint to inline when possible */
 
@@ -1009,16 +1007,23 @@ class JSScript : public js::gc::TenuredC
 
     // Generation for this script's TypeScript. If out of sync with the
     // TypeZone's generation, the TypeScript needs to be swept.
     //
     // This should be a uint32 but is instead a bool so that MSVC packs it
     // correctly.
     bool typesGeneration_:1;
 
+    // Add padding so JSScript is gc::Cell aligned. Make padding protected
+    // instead of private to suppress -Wunused-private-field compiler warnings.
+  protected:
+#if JS_BITS_PER_WORD == 32
+    uint32_t padding;
+#endif
+
     //
     // End of fields.  Start methods.
     //
 
   public:
     static JSScript *Create(js::ExclusiveContext *cx,
                             js::HandleObject enclosingScope, bool savedCallerFun,
                             const JS::ReadOnlyCompileOptions &options, unsigned staticLevel,
@@ -1307,17 +1312,17 @@ class JSScript : public js::gc::TenuredC
     }
 
     void setTypesGeneration(uint32_t generation) {
         MOZ_ASSERT(generation <= 1);
         typesGeneration_ = (bool) generation;
     }
 
     bool hasAnyIonScript() const {
-        return hasIonScript() || hasParallelIonScript();
+        return hasIonScript();
     }
 
     bool hasIonScript() const {
         bool res = ion && ion != ION_DISABLED_SCRIPT && ion != ION_COMPILING_SCRIPT;
         MOZ_ASSERT_IF(res, baseline);
         return res;
     }
     bool canIonCompile() const {
@@ -1367,50 +1372,22 @@ class JSScript : public js::gc::TenuredC
         ion->setPendingBuilderPrivate(builder);
         updateBaselineOrIonRaw(maybecx);
     }
     js::jit::IonBuilder *pendingIonBuilder() {
         MOZ_ASSERT(hasIonScript());
         return ion->pendingBuilder();
     }
 
-    bool hasParallelIonScript() const {
-        return parallelIon && parallelIon != ION_DISABLED_SCRIPT && parallelIon != ION_COMPILING_SCRIPT;
-    }
-
-    bool canParallelIonCompile() const {
-        return parallelIon != ION_DISABLED_SCRIPT;
-    }
-
-    bool isParallelIonCompilingOffThread() const {
-        return parallelIon == ION_COMPILING_SCRIPT;
-    }
-
-    js::jit::IonScript *parallelIonScript() const {
-        MOZ_ASSERT(hasParallelIonScript());
-        return parallelIon;
-    }
-    js::jit::IonScript *maybeParallelIonScript() const {
-        return parallelIon;
-    }
-    void setParallelIonScript(js::jit::IonScript *ionScript) {
-        if (hasParallelIonScript())
-            js::jit::IonScript::writeBarrierPre(zone(), parallelIon);
-        parallelIon = ionScript;
-    }
-
     static size_t offsetOfBaselineScript() {
         return offsetof(JSScript, baseline);
     }
     static size_t offsetOfIonScript() {
         return offsetof(JSScript, ion);
     }
-    static size_t offsetOfParallelIonScript() {
-        return offsetof(JSScript, parallelIon);
-    }
     static size_t offsetOfBaselineOrIonRaw() {
         return offsetof(JSScript, baselineOrIonRaw);
     }
     uint8_t *baselineOrIonRawPointer() const {
         return baselineOrIonRaw;
     }
     static size_t offsetOfBaselineOrIonSkipArgCheck() {
         return offsetof(JSScript, baselineOrIonSkipArgCheck);
--- a/js/src/vm/ForkJoin.cpp
+++ b/js/src/vm/ForkJoin.cpp
@@ -33,16 +33,18 @@
 #include "vm/Interpreter-inl.h"
 
 using namespace js;
 using namespace js::parallel;
 using namespace js::jit;
 
 using mozilla::ThreadLocal;
 
+#if 0
+
 ///////////////////////////////////////////////////////////////////////////
 // Degenerate configurations
 //
 // When IonMonkey is disabled, we simply run the |func| callback
 // sequentially.  We also forego the feedback altogether.
 
 static bool
 ExecuteSequentially(JSContext *cx_, HandleValue funVal, uint16_t *sliceStart,
@@ -79,28 +81,32 @@ ExecuteSequentially(JSContext *cx, Handl
     args[1].setInt32(*sliceStart);
     args[2].setInt32(sliceEnd);
     if (!fig.invoke(cx))
         return false;
     *sliceStart = (uint16_t)(args.rval().toInt32());
     return true;
 }
 
+#endif // 0
+
 ThreadLocal<ForkJoinContext*> ForkJoinContext::tlsForkJoinContext;
 
 /* static */ bool
 ForkJoinContext::initializeTls()
 {
     if (!tlsForkJoinContext.initialized()) {
         if (!tlsForkJoinContext.init())
             return false;
     }
     return true;
 }
 
+#if 0
+
 ///////////////////////////////////////////////////////////////////////////
 // Parallel configurations
 //
 // The remainder of this file is specific to cases where IonMonkey is enabled.
 
 ///////////////////////////////////////////////////////////////////////////
 // Class Declarations and Function Prototypes
 
@@ -2130,8 +2136,10 @@ js::intrinsic_ClearThreadLocalArenas(JSC
 }
 
 static bool
 intrinsic_ClearThreadLocalArenasPar(ForkJoinContext *cx, unsigned argc, Value *vp)
 {
     //cx->allocator()->arenas.wipeDuringParallelExecution(cx->runtime());
     return true;
 }
+
+#endif // 0