merge mozilla-inbound to b2g-inbound a=merge
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 07 Jan 2015 14:09:20 +0100
changeset 222415 395cc3fd41ae81bbe897c25fa32bcd5864032edc
parent 222361 c7ae19c5b2ed3165a44d4a10bea69bbf485d49f7 (current diff)
parent 222414 0776988aacd6201623ce747940fc7edac89e99d9 (diff)
child 222416 206205dd8bd137e25298c261030184bcd058148a
push id10683
push usercbook@mozilla.com
push dateWed, 07 Jan 2015 13:30:50 +0000
treeherderfx-team@3a1103c584cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone37.0a1
merge mozilla-inbound to b2g-inbound a=merge
js/src/gc/ForkJoinNursery-inl.h
js/src/gc/ForkJoinNursery.cpp
js/src/gc/ForkJoinNursery.h
js/src/jit-test/lib/parallelarray-helpers.js
js/src/jit-test/tests/asm.js/testBug978714.js
js/src/jit-test/tests/auto-regress/bug784015.js
js/src/jit-test/tests/collections/Array-build-basic.js
js/src/jit-test/tests/collections/Array-build-surfaces.js
js/src/jit-test/tests/gc/bug-1014972.js
js/src/jit-test/tests/gc/bug-1055034.js
js/src/jit-test/tests/gc/bug-975959.js
js/src/jit-test/tests/gc/bug-992866.js
js/src/jit-test/tests/ion/900683.js
js/src/jit-test/tests/ion/bug905989.js
js/src/jit-test/tests/ion/bug906885.js
js/src/jit-test/tests/ion/bug908867.js
js/src/jit-test/tests/ion/bug911708.js
js/src/jit-test/tests/ion/bug916761.js
js/src/jit-test/tests/ion/bug936361.js
js/src/jit-test/tests/ion/bug938431.js
js/src/jit-test/tests/ion/bug977674.js
js/src/jit-test/tests/parallel/Array-buildPar-in-loop.js
js/src/jit-test/tests/parallel/Array-buildPar-nested.js
js/src/jit-test/tests/parallel/Array-buildPar.js
js/src/jit-test/tests/parallel/Array-filterPar-all.js
js/src/jit-test/tests/parallel/Array-filterPar-every-third-element.js
js/src/jit-test/tests/parallel/Array-filterPar-non-divisible.js
js/src/jit-test/tests/parallel/Array-filterPar-none.js
js/src/jit-test/tests/parallel/Array-filterPar-short.js
js/src/jit-test/tests/parallel/Array-filterPar-truthy.js
js/src/jit-test/tests/parallel/Array-filterPar-very-few.js
js/src/jit-test/tests/parallel/Array-mapPar-add-from-upvar-field.js
js/src/jit-test/tests/parallel/Array-mapPar-assign-to-def-prop.js
js/src/jit-test/tests/parallel/Array-mapPar-factorial.js
js/src/jit-test/tests/parallel/Array-mapPar-fn-args.js
js/src/jit-test/tests/parallel/Array-mapPar-inc.js
js/src/jit-test/tests/parallel/Array-mapPar-nested.js
js/src/jit-test/tests/parallel/Array-mapPar-short.js
js/src/jit-test/tests/parallel/Array-reducePar-bail.js
js/src/jit-test/tests/parallel/Array-reducePar-fn-args.js
js/src/jit-test/tests/parallel/Array-reducePar-length-one.js
js/src/jit-test/tests/parallel/Array-reducePar-mul-short.js
js/src/jit-test/tests/parallel/Array-reducePar-mul.js
js/src/jit-test/tests/parallel/Array-reducePar-nested-sum-each-row.js
js/src/jit-test/tests/parallel/Array-reducePar-sum.js
js/src/jit-test/tests/parallel/Array-scanPar-fn-args.js
js/src/jit-test/tests/parallel/Array-scanPar-one.js
js/src/jit-test/tests/parallel/Array-scanPar-sorted.js
js/src/jit-test/tests/parallel/Array-scanPar-sum.js
js/src/jit-test/tests/parallel/Array-throws.js
js/src/jit-test/tests/parallel/TypedObj-fromPar-outpointer-struct.js
js/src/jit-test/tests/parallel/TypedObj-fromPar-return-scalar.js
js/src/jit-test/tests/parallel/TypedObj-mapPar-outpointer-struct.js
js/src/jit-test/tests/parallel/TypedObj-mapPar-return-scalar.js
js/src/jit-test/tests/parallel/alloc-array-nonwritable.js
js/src/jit-test/tests/parallel/alloc-array.js
js/src/jit-test/tests/parallel/alloc-different-objs.js
js/src/jit-test/tests/parallel/alloc-many-objs.js
js/src/jit-test/tests/parallel/alloc-obj.js
js/src/jit-test/tests/parallel/alloc-too-many-objs.js
js/src/jit-test/tests/parallel/arguments-index.js
js/src/jit-test/tests/parallel/arguments-length.js
js/src/jit-test/tests/parallel/bailout-executed.js
js/src/jit-test/tests/parallel/bailout-never-executed.js
js/src/jit-test/tests/parallel/binary-arith-numbers.js
js/src/jit-test/tests/parallel/bitops-values.js
js/src/jit-test/tests/parallel/bug1009788.js
js/src/jit-test/tests/parallel/bug1014973.js
js/src/jit-test/tests/parallel/bug1022948.js
js/src/jit-test/tests/parallel/bug1024567.js
js/src/jit-test/tests/parallel/bug1024756.js
js/src/jit-test/tests/parallel/bug1029440.js
js/src/jit-test/tests/parallel/bug1032264.js
js/src/jit-test/tests/parallel/bug1033115-2.js
js/src/jit-test/tests/parallel/bug1033115.js
js/src/jit-test/tests/parallel/bug1037657.js
js/src/jit-test/tests/parallel/bug1083681.js
js/src/jit-test/tests/parallel/bug853576.js
js/src/jit-test/tests/parallel/bug909743.js
js/src/jit-test/tests/parallel/bug944975.js
js/src/jit-test/tests/parallel/bug970427.js
js/src/jit-test/tests/parallel/bug971385.js
js/src/jit-test/tests/parallel/bug975636.js
js/src/jit-test/tests/parallel/bug976889.js
js/src/jit-test/tests/parallel/bug977647.js
js/src/jit-test/tests/parallel/bug977853-convert-doubles.js
js/src/jit-test/tests/parallel/bug977900.js
js/src/jit-test/tests/parallel/bug983558.js
js/src/jit-test/tests/parallel/cat.pgm
js/src/jit-test/tests/parallel/closure-allocate-invoke.js
js/src/jit-test/tests/parallel/closure-creation.js
js/src/jit-test/tests/parallel/closure-eta-expand.js
js/src/jit-test/tests/parallel/closure-invoke.js
js/src/jit-test/tests/parallel/closure-nested-branch.js
js/src/jit-test/tests/parallel/closure-nested-compute.js
js/src/jit-test/tests/parallel/closure-nested.js
js/src/jit-test/tests/parallel/compare-strict-poly.js
js/src/jit-test/tests/parallel/compare-strings-eq.js
js/src/jit-test/tests/parallel/compare-strings-ne.js
js/src/jit-test/tests/parallel/compare-values.js
js/src/jit-test/tests/parallel/comprehension-throws.js
js/src/jit-test/tests/parallel/createthis.js
js/src/jit-test/tests/parallel/enumerate-1.js
js/src/jit-test/tests/parallel/gc-timeout.js
js/src/jit-test/tests/parallel/ic-getelement.js
js/src/jit-test/tests/parallel/ic-getproperty.js
js/src/jit-test/tests/parallel/ic-setelement.js
js/src/jit-test/tests/parallel/ic-setproperty.js
js/src/jit-test/tests/parallel/int32-overflow.js
js/src/jit-test/tests/parallel/mandelbrot.js
js/src/jit-test/tests/parallel/math-fcns.js
js/src/jit-test/tests/parallel/parallelarraycompiledout.js
js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-boxed-shared.js
js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-boxed-to.js
js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-boxed.js
js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-nursery-grow.js
js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-string.js
js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-tenured.js
js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-wastrel.js
js/src/jit-test/tests/parallel/pjsgc-raytrace.js
js/src/jit-test/tests/parallel/spew.js
js/src/jit-test/tests/parallel/stack-overflow.js
js/src/jit-test/tests/parallel/strict-equals-1.js
js/src/jit-test/tests/parallel/strings.js
js/src/jit-test/tests/parallel/surfaces-1.js
js/src/jit-test/tests/parallel/surfaces-2.js
js/src/jit-test/tests/parallel/surfaces-3.js
js/src/jit-test/tests/parallel/throw-executed.js
js/src/jit-test/tests/parallel/throw-never-executed.js
js/src/jit-test/tests/parallel/timeout.js
js/src/jit-test/tests/parallel/write-array.js
js/src/jit-test/tests/parallel/write-illegal-array-elt.js
js/src/jit-test/tests/parallel/write-illegal-obj.js
js/src/jit-test/tests/parallel/write-obj.js
js/src/parjs-benchmarks/README.txt
js/src/parjs-benchmarks/SimPJS-test.js
js/src/parjs-benchmarks/cat-convolve-mapPar-wide.js
js/src/parjs-benchmarks/cat-convolve-mapPar.js
js/src/parjs-benchmarks/cat-expected.pgm
js/src/parjs-benchmarks/cat.pgm
js/src/parjs-benchmarks/obsolete/README.txt
js/src/parjs-benchmarks/obsolete/allocator.js
js/src/parjs-benchmarks/obsolete/edges.js
js/src/parjs-benchmarks/obsolete/liquid-resize-par.js
js/src/parjs-benchmarks/obsolete/liquid-resize.js
js/src/parjs-benchmarks/obsolete/mandelbrot.js
js/src/parjs-benchmarks/obsolete/nbody-seeded.js
js/src/parjs-benchmarks/obsolete/rectarray.js
js/src/parjs-benchmarks/obsolete/run.sh
js/src/parjs-benchmarks/obsolete/seedrandom.js
js/src/parjs-benchmarks/obsolete/util.js
js/src/parjs-benchmarks/ray-expected.ppm
js/src/parjs-benchmarks/ray.js
js/src/parjs-benchmarks/unhex.c
--- a/build/autoconf/android.m4
+++ b/build/autoconf/android.m4
@@ -348,16 +348,23 @@ case "$target" in
         if test -d "$tools_directory" -a -f "$tools_directory/aapt"; then
             android_build_tools="$tools_directory"
             break
         fi
     done
     if test -z "$android_build_tools" ; then
         android_build_tools="$android_platform_tools" # SDK Tools < r22
     fi
+    all_android_build_tools=""
+    for suffix in `ls "$android_sdk_root/build-tools" | sed -e "s,android-,999.," | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr -k 5,5nr`; do
+        tools_directory=`echo "$android_sdk_root/build-tools/$suffix" | sed -e "s,999.,android-,"`
+        if test -d "$tools_directory" -a -f "$tools_directory/aapt"; then
+            all_android_build_tools="$all_android_build_tools:$tools_directory"
+        fi
+    done
 
     if test -d "$android_build_tools" -a -f "$android_build_tools/aapt"; then
         AC_MSG_RESULT([$android_build_tools])
     else
         AC_MSG_ERROR([not found. Please check your SDK for the subdirectory of build-tools. With the current configuration, it should be in $android_sdk_root/build_tools])
     fi
 
     ANDROID_SDK="${android_sdk}"
@@ -385,17 +392,17 @@ case "$target" in
     AC_SUBST(ANDROID_COMPAT_LIB)
     if ! test -e $ANDROID_COMPAT_LIB ; then
         AC_MSG_ERROR([You must download the Android v4 support library when targeting Android.  Run the Android SDK tool and install Android Support Library under Extras.  See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_COMPAT_LIB)])
     fi
     AC_MSG_RESULT([$ANDROID_COMPAT_LIB])
 
     dnl Google has a history of moving the Android tools around.  We don't
     dnl care where they are, so let's try to find them anywhere we can.
-    ALL_ANDROID_TOOLS_PATHS="$ANDROID_TOOLS:$ANDROID_BUILD_TOOLS:$ANDROID_PLATFORM_TOOLS"
+    ALL_ANDROID_TOOLS_PATHS="$ANDROID_TOOLS$all_android_build_tools:$ANDROID_PLATFORM_TOOLS"
     MOZ_PATH_PROG(ZIPALIGN, zipalign, :, [$ALL_ANDROID_TOOLS_PATHS])
     MOZ_PATH_PROG(DX, dx, :, [$ALL_ANDROID_TOOLS_PATHS])
     MOZ_PATH_PROG(AAPT, aapt, :, [$ALL_ANDROID_TOOLS_PATHS])
     MOZ_PATH_PROG(AIDL, aidl, :, [$ALL_ANDROID_TOOLS_PATHS])
     MOZ_PATH_PROG(ADB, adb, :, [$ALL_ANDROID_TOOLS_PATHS])
 
     if test -z "$ZIPALIGN" -o "$ZIPALIGN" = ":"; then
       AC_MSG_ERROR([The program zipalign was not found.  Use --with-android-sdk={android-sdk-dir}.])
--- a/dom/animation/test/mochitest.ini
+++ b/dom/animation/test/mochitest.ini
@@ -10,14 +10,15 @@ skip-if = buildapp == 'mulet'
 skip-if = os == "win" || (os == "mac" && os_version == "10.8") # disabled until bug 1112480 lands
 [css-animations/test_animation-player-playstate.html]
 [css-animations/test_animation-player-ready.html]
 [css-animations/test_animation-target.html]
 [css-animations/test_element-get-animation-players.html]
 skip-if = buildapp == 'mulet'
 [css-transitions/test_animation-effect-name.html]
 [css-transitions/test_animation-pausing.html]
+skip-if = os == "win" # bug 1117955, to be restored in bug 1112480
 [css-transitions/test_animation-player-ready.html]
 [css-transitions/test_animation-target.html]
 [css-transitions/test_element-get-animation-players.html]
 skip-if = buildapp == 'mulet'
 [mozilla/test_deferred_start.html]
 skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && toolkit != 'gonk') # bug 1113425
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -1680,22 +1680,22 @@ nsFocusManager::Blur(nsPIDOMWindow* aWin
     SendFocusOrBlurEvent(NS_BLUR_CONTENT, presShell,
                          content->GetComposedDoc(), content, 1, false);
   }
 
   // if we are leaving the document or the window was lowered, make the caret
   // invisible.
   if (aIsLeavingDocument || !mActiveWindow) {
     SetCaretVisible(presShell, false, nullptr);
-    nsRefPtr<SelectionCarets> selectionCarets = presShell->GetSelectionCarets();
-    if (selectionCarets) {
-      selectionCarets->NotifyBlur();
-    }
   }
 
+  nsRefPtr<SelectionCarets> selectionCarets = presShell->GetSelectionCarets();
+  if (selectionCarets) {
+    selectionCarets->NotifyBlur(aIsLeavingDocument || !mActiveWindow);
+  }
 
   // at this point, it is expected that this window will be still be
   // focused, but the focused content will be null, as it was cleared before
   // the event. If this isn't the case, then something else was focused during
   // the blur event above and we should just return. However, if
   // aIsLeavingDocument is set, a new document is desired, so make sure to
   // blur the document and window.
   if (mFocusedWindow != window ||
--- a/dom/html/HTMLAnchorElement.h
+++ b/dom/html/HTMLAnchorElement.h
@@ -76,19 +76,19 @@ public:
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult) MOZ_OVERRIDE;
 
   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
 
   virtual EventStates IntrinsicState() const MOZ_OVERRIDE;
 
-  virtual void OnDNSPrefetchDeferred();
-  virtual void OnDNSPrefetchRequested();
-  virtual bool HasDeferredDNSPrefetchRequest();
+  virtual void OnDNSPrefetchDeferred() MOZ_OVERRIDE;
+  virtual void OnDNSPrefetchRequested() MOZ_OVERRIDE;
+  virtual bool HasDeferredDNSPrefetchRequest() MOZ_OVERRIDE;
 
   // WebIDL API
   void GetHref(nsAString& aValue, ErrorResult& rv)
   {
     GetHTMLURIAttr(nsGkAtoms::href, aValue);
   }
   void SetHref(const nsAString& aValue, mozilla::ErrorResult& rv)
   {
--- a/dom/html/HTMLButtonElement.h
+++ b/dom/html/HTMLButtonElement.h
@@ -35,24 +35,24 @@ public:
   virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
 
   NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLButtonElement, button)
 
   // nsIDOMHTMLButtonElement
   NS_DECL_NSIDOMHTMLBUTTONELEMENT
 
   // overriden nsIFormControl methods
-  NS_IMETHOD_(uint32_t) GetType() const { return mType; }
+  NS_IMETHOD_(uint32_t) GetType() const MOZ_OVERRIDE { return mType; }
   NS_IMETHOD Reset() MOZ_OVERRIDE;
   NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) MOZ_OVERRIDE;
   NS_IMETHOD SaveState() MOZ_OVERRIDE;
   bool RestoreState(nsPresState* aState) MOZ_OVERRIDE;
   virtual bool IsDisabledForEvents(uint32_t aMessage) MOZ_OVERRIDE;
 
-  virtual void FieldSetDisabledChanged(bool aNotify) MOZ_OVERRIDE; 
+  virtual void FieldSetDisabledChanged(bool aNotify) MOZ_OVERRIDE;
 
   // nsIDOMEventTarget
   virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
   virtual nsresult PostHandleEvent(
                      EventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
 
   // nsINode
   virtual nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;
--- a/dom/html/HTMLContentElement.cpp
+++ b/dom/html/HTMLContentElement.cpp
@@ -344,26 +344,20 @@ DistributedContentList::Item(uint32_t aI
   nsIContent* item = Item(aIndex);
   if (!item) {
     return NS_ERROR_FAILURE;
   }
 
   return CallQueryInterface(item, aReturn);
 }
 
-uint32_t
-DistributedContentList::Length() const
-{
-  return mDistributedNodes.Length();
-}
-
 NS_IMETHODIMP
 DistributedContentList::GetLength(uint32_t* aLength)
 {
-  *aLength = Length();
+  *aLength = mDistributedNodes.Length();
   return NS_OK;
 }
 
 int32_t
 DistributedContentList::IndexOf(nsIContent* aContent)
 {
   return mDistributedNodes.IndexOf(aContent);
 }
--- a/dom/html/HTMLContentElement.h
+++ b/dom/html/HTMLContentElement.h
@@ -24,45 +24,45 @@ public:
   NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLContentElement, content)
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLContentElement,
                                            nsGenericHTMLElement)
 
-  virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
 
-  virtual nsIDOMNode* AsDOMNode() { return this; }
+  virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
 
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
-                              bool aCompileEventHandlers);
+                              bool aCompileEventHandlers) MOZ_OVERRIDE;
 
   virtual void UnbindFromTree(bool aDeep = true,
-                              bool aNullParent = true);
+                              bool aNullParent = true) MOZ_OVERRIDE;
 
   /**
    * Returns whether if the selector of this insertion point
    * matches the provided content.
    */
   bool Match(nsIContent* aContent);
   bool IsInsertionPoint() const { return mIsInsertionPoint; }
   nsCOMArray<nsIContent>& MatchedNodes() { return mMatchedNodes; }
   void AppendMatchedNode(nsIContent* aContent);
   void RemoveMatchedNode(nsIContent* aContent);
   void InsertMatchedNode(uint32_t aIndex, nsIContent* aContent);
   void ClearMatchedNodes();
 
   virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                            nsIAtom* aPrefix, const nsAString& aValue,
-                           bool aNotify);
+                           bool aNotify) MOZ_OVERRIDE;
 
   virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
-                             bool aNotify);
+                             bool aNotify) MOZ_OVERRIDE;
 
   // WebIDL methods.
   already_AddRefed<DistributedContentList> GetDistributedNodes();
   void GetSelect(nsAString& aSelect)
   {
     Element::GetAttr(kNameSpaceID_None, nsGkAtoms::select, aSelect);
   }
   void SetSelect(const nsAString& aSelect)
@@ -102,20 +102,19 @@ public:
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(DistributedContentList)
 
   // nsIDOMNodeList
   NS_DECL_NSIDOMNODELIST
 
   // nsINodeList
-  virtual nsIContent* Item(uint32_t aIndex);
-  virtual int32_t IndexOf(nsIContent* aContent);
-  virtual nsINode* GetParentObject() { return mParent; }
-  virtual uint32_t Length() const;
+  virtual nsIContent* Item(uint32_t aIndex) MOZ_OVERRIDE;
+  virtual int32_t IndexOf(nsIContent* aContent) MOZ_OVERRIDE;
+  virtual nsINode* GetParentObject() MOZ_OVERRIDE { return mParent; }
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 protected:
   virtual ~DistributedContentList();
   nsRefPtr<HTMLContentElement> mParent;
   nsCOMArray<nsIContent> mDistributedNodes;
 };
 
 } // namespace dom
--- a/dom/html/HTMLFieldSetElement.h
+++ b/dom/html/HTMLFieldSetElement.h
@@ -88,17 +88,17 @@ public:
   // XPCOM Validity is OK for us
 
   // XPCOM GetValidationMessage is OK for us
 
   // XPCOM CheckValidity is OK for us
 
   // XPCOM SetCustomValidity is OK for us
 
-  virtual EventStates IntrinsicState() const;
+  virtual EventStates IntrinsicState() const MOZ_OVERRIDE;
 
 
   /*
    * This method will update the fieldset's validity.  This method has to be
    * called by fieldset elements whenever their validity state or status regarding
    * constraint validation changes.
    *
    * @note If an element becomes barred from constraint validation, it has to
--- a/dom/html/HTMLFormControlsCollection.h
+++ b/dom/html/HTMLFormControlsCollection.h
@@ -31,17 +31,17 @@ public:
 
   void DropFormReference();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   // nsIDOMHTMLCollection interface
   NS_DECL_NSIDOMHTMLCOLLECTION
 
-  virtual Element* GetElementAt(uint32_t index);
+  virtual Element* GetElementAt(uint32_t index) MOZ_OVERRIDE;
   virtual nsINode* GetParentObject() MOZ_OVERRIDE;
 
   virtual Element*
   GetFirstNamedElement(const nsAString& aName, bool& aFound) MOZ_OVERRIDE;
 
   void
   NamedGetter(const nsAString& aName,
               bool& aFound,
--- a/dom/html/HTMLFormElement.h
+++ b/dom/html/HTMLFormElement.h
@@ -53,17 +53,17 @@ public:
 
   // nsIDOMHTMLFormElement
   NS_DECL_NSIDOMHTMLFORMELEMENT
 
   // nsIWebProgressListener
   NS_DECL_NSIWEBPROGRESSLISTENER
 
   // nsIForm
-  NS_IMETHOD_(nsIFormControl*) GetElementAt(int32_t aIndex) const;
+  NS_IMETHOD_(nsIFormControl*) GetElementAt(int32_t aIndex) const MOZ_OVERRIDE;
   NS_IMETHOD_(uint32_t) GetElementCount() const MOZ_OVERRIDE;
   NS_IMETHOD_(int32_t) IndexOfControl(nsIFormControl* aControl) MOZ_OVERRIDE;
   NS_IMETHOD_(nsIFormControl*) GetDefaultSubmitElement() const MOZ_OVERRIDE;
 
   // nsIRadioGroupContainer
   void SetCurrentRadioButton(const nsAString& aName,
                              HTMLInputElement* aRadio) MOZ_OVERRIDE;
   HTMLInputElement* GetCurrentRadioButton(const nsAString& aName) MOZ_OVERRIDE;
--- a/dom/html/HTMLImageElement.h
+++ b/dom/html/HTMLImageElement.h
@@ -47,17 +47,17 @@ public:
   virtual bool Draggable() const MOZ_OVERRIDE;
 
   // nsIDOMHTMLImageElement
   NS_DECL_NSIDOMHTMLIMAGEELEMENT
 
   NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLImageElement, img)
 
   // override from nsImageLoadingContent
-  CORSMode GetCORSMode();
+  CORSMode GetCORSMode() MOZ_OVERRIDE;
 
   // nsIContent
   virtual bool ParseAttribute(int32_t aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult) MOZ_OVERRIDE;
   virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
                                               int32_t aModType) const MOZ_OVERRIDE;
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -362,17 +362,17 @@ public:
     if (NS_SUCCEEDED(mTopDir->GetDirectoryEntries(getter_AddRefs(entries))) &&
         entries) {
       mDirEnumeratorStack.AppendElement(entries);
       LookupAndCacheNext();
     }
   }
 
   NS_IMETHOD
-  GetNext(nsISupports** aResult)
+  GetNext(nsISupports** aResult) MOZ_OVERRIDE
   {
     MOZ_ASSERT(!NS_IsMainThread(),
                "Walking the directory tree involves I/O, so using this "
                "enumerator can block a thread for a long time!");
 
     if (!mNextFile) {
       return NS_ERROR_FAILURE;
     }
@@ -396,17 +396,17 @@ public:
       fileImpl->SetPath(Substring(path, 0, uint32_t(length)));
     }
     *aResult = domFile.forget().downcast<nsIDOMFile>().take();
     LookupAndCacheNext();
     return NS_OK;
   }
 
   NS_IMETHOD
-  HasMoreElements(bool* aResult)
+  HasMoreElements(bool* aResult) MOZ_OVERRIDE
   {
     *aResult = !!mNextFile;
     return NS_OK;
   }
 
 private:
 
   void
--- a/dom/html/HTMLInputElement.h
+++ b/dom/html/HTMLInputElement.h
@@ -172,18 +172,18 @@ public:
                               bool aNullParent = true) MOZ_OVERRIDE;
 
   virtual void DoneCreatingElement() MOZ_OVERRIDE;
 
   virtual EventStates IntrinsicState() const MOZ_OVERRIDE;
 
   // Element
 private:
-  virtual void AddStates(EventStates aStates);
-  virtual void RemoveStates(EventStates aStates);
+  virtual void AddStates(EventStates aStates) MOZ_OVERRIDE;
+  virtual void RemoveStates(EventStates aStates) MOZ_OVERRIDE;
 
 public:
 
   // nsITextControlElement
   NS_IMETHOD SetValueChanged(bool aValueChanged) MOZ_OVERRIDE;
   NS_IMETHOD_(bool) IsSingleLineTextControl() const MOZ_OVERRIDE;
   NS_IMETHOD_(bool) IsTextArea() const MOZ_OVERRIDE;
   NS_IMETHOD_(bool) IsPlainTextControl() const MOZ_OVERRIDE;
--- a/dom/html/HTMLLinkElement.h
+++ b/dom/html/HTMLLinkElement.h
@@ -153,17 +153,17 @@ protected:
 
   // nsStyleLinkElement
   virtual already_AddRefed<nsIURI> GetStyleSheetURL(bool* aIsInline) MOZ_OVERRIDE;
   virtual void GetStyleSheetInfo(nsAString& aTitle,
                                  nsAString& aType,
                                  nsAString& aMedia,
                                  bool* aIsScoped,
                                  bool* aIsAlternate) MOZ_OVERRIDE;
-  virtual CORSMode GetCORSMode() const;
+  virtual CORSMode GetCORSMode() const MOZ_OVERRIDE;
 protected:
   // nsGenericHTMLElement
   virtual void GetItemValueText(nsAString& text) MOZ_OVERRIDE;
   virtual void SetItemValueText(const nsAString& text) MOZ_OVERRIDE;
   nsRefPtr<nsDOMTokenList > mRelList;
 private:
   nsRefPtr<ImportLoader> mImportLoader;
 };
--- a/dom/html/HTMLMediaElement.h
+++ b/dom/html/HTMLMediaElement.h
@@ -532,17 +532,17 @@ public:
                                          ErrorResult& aRv);
 
   MediaWaitingFor WaitingFor() const;
 
   mozilla::dom::EventHandlerNonNull* GetOnencrypted();
   void SetOnencrypted(mozilla::dom::EventHandlerNonNull* listener);
 
   void DispatchEncrypted(const nsTArray<uint8_t>& aInitData,
-                         const nsAString& aInitDataType);
+                         const nsAString& aInitDataType) MOZ_OVERRIDE;
 
 
   bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE;
 
   // Returns the principal of the "top level" document; the origin displayed
   // in the URL bar of the browser window.
   already_AddRefed<nsIPrincipal> GetTopLevelPrincipal();
 
--- a/dom/html/HTMLOptionsCollection.h
+++ b/dom/html/HTMLOptionsCollection.h
@@ -53,17 +53,17 @@ protected:
 public:
 
   // nsIDOMHTMLOptionsCollection interface
   NS_DECL_NSIDOMHTMLOPTIONSCOLLECTION
 
   // nsIDOMHTMLCollection interface, all its methods are defined in
   // nsIDOMHTMLOptionsCollection
 
-  virtual Element* GetElementAt(uint32_t aIndex);
+  virtual Element* GetElementAt(uint32_t aIndex) MOZ_OVERRIDE;
   virtual nsINode* GetParentObject() MOZ_OVERRIDE;
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(HTMLOptionsCollection,
                                                          nsIHTMLCollection)
 
   // Helpers for HTMLSelectElement
   /**
    * Insert an option
--- a/dom/html/HTMLOutputElement.h
+++ b/dom/html/HTMLOutputElement.h
@@ -23,17 +23,17 @@ public:
 
   explicit HTMLOutputElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
                              FromParser aFromParser = NOT_FROM_PARSER);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIFormControl
-  NS_IMETHOD_(uint32_t) GetType() const { return NS_FORM_OUTPUT; }
+  NS_IMETHOD_(uint32_t) GetType() const MOZ_OVERRIDE { return NS_FORM_OUTPUT; }
   NS_IMETHOD Reset() MOZ_OVERRIDE;
   NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) MOZ_OVERRIDE;
 
   virtual bool IsDisabled() const MOZ_OVERRIDE { return false; }
 
   nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;
 
   bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
--- a/dom/html/HTMLPropertiesCollection.h
+++ b/dom/html/HTMLPropertiesCollection.h
@@ -64,17 +64,17 @@ protected:
   virtual ~HTMLPropertiesCollection();
 
   virtual JSObject* GetWrapperPreserveColorInternal() MOZ_OVERRIDE
   {
     return nsWrapperCache::GetWrapperPreserveColor();
   }
 public:
 
-  virtual Element* GetElementAt(uint32_t aIndex);
+  virtual Element* GetElementAt(uint32_t aIndex) MOZ_OVERRIDE;
 
   void SetDocument(nsIDocument* aDocument);
   nsINode* GetParentObject() MOZ_OVERRIDE;
 
   virtual Element*
   GetFirstNamedElement(const nsAString& aName, bool& aFound) MOZ_OVERRIDE
   {
     // HTMLPropertiesCollection.namedItem and the named getter call the
--- a/dom/html/HTMLScriptElement.h
+++ b/dom/html/HTMLScriptElement.h
@@ -37,17 +37,17 @@ public:
   // nsIDOMHTMLScriptElement
   NS_DECL_NSIDOMHTMLSCRIPTELEMENT
 
   // nsIScriptElement
   virtual void GetScriptType(nsAString& type) MOZ_OVERRIDE;
   virtual void GetScriptText(nsAString& text) MOZ_OVERRIDE;
   virtual void GetScriptCharset(nsAString& charset) MOZ_OVERRIDE;
   virtual void FreezeUriAsyncDefer() MOZ_OVERRIDE;
-  virtual CORSMode GetCORSMode() const;
+  virtual CORSMode GetCORSMode() const MOZ_OVERRIDE;
 
   // nsIContent
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers) MOZ_OVERRIDE;
   virtual bool ParseAttribute(int32_t aNamespaceID,
                               nsIAtom* aAttribute,
                               const nsAString& aValue,
--- a/dom/html/HTMLShadowElement.h
+++ b/dom/html/HTMLShadowElement.h
@@ -28,20 +28,20 @@ public:
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLShadowElement,
                                            nsGenericHTMLElement)
 
   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
 
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
-                              bool aCompileEventHandlers);
+                              bool aCompileEventHandlers) MOZ_OVERRIDE;
 
   virtual void UnbindFromTree(bool aDeep = true,
-                              bool aNullParent = true);
+                              bool aNullParent = true) MOZ_OVERRIDE;
 
   bool IsInsertionPoint() { return mIsInsertionPoint; }
 
   /**
    * Sets the ShadowRoot that will be rendered in place of
    * this shadow insertion point.
    */
   void SetProjectedShadow(ShadowRoot* aProjectedShadow);
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -27,18 +27,18 @@ class TableRowsCollection : public nsIHT
                             public nsWrapperCache
 {
 public:
   explicit TableRowsCollection(HTMLTableElement* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSIDOMHTMLCOLLECTION
 
-  virtual Element* GetElementAt(uint32_t aIndex);
-  virtual nsINode* GetParentObject()
+  virtual Element* GetElementAt(uint32_t aIndex) MOZ_OVERRIDE;
+  virtual nsINode* GetParentObject() MOZ_OVERRIDE
   {
     return mParent;
   }
 
   virtual Element*
   GetFirstNamedElement(const nsAString& aName, bool& aFound) MOZ_OVERRIDE;
   virtual void GetSupportedNames(unsigned aFlags,
                                  nsTArray<nsString>& aNames) MOZ_OVERRIDE;
--- a/dom/html/HTMLVideoElement.h
+++ b/dom/html/HTMLVideoElement.h
@@ -106,18 +106,18 @@ public:
 
   already_AddRefed<VideoPlaybackQuality> GetVideoPlaybackQuality();
 
 protected:
   virtual ~HTMLVideoElement();
 
   virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
 
-  virtual void WakeLockCreate();
-  virtual void WakeLockRelease();
+  virtual void WakeLockCreate() MOZ_OVERRIDE;
+  virtual void WakeLockRelease() MOZ_OVERRIDE;
   void UpdateScreenWakeLock();
 
   nsRefPtr<WakeLock> mScreenWakeLock;
 
 private:
   static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
                                     nsRuleData* aData);
 };
--- a/dom/html/ImageDocument.h
+++ b/dom/html/ImageDocument.h
@@ -74,17 +74,17 @@ public:
   {
     ScrollImageTo(aX, aY, true);
   }
   void ToggleImageSize();
 
 protected:
   virtual ~ImageDocument();
 
-  virtual nsresult CreateSyntheticDocument();
+  virtual nsresult CreateSyntheticDocument() MOZ_OVERRIDE;
 
   nsresult CheckOverflowing(bool changeState);
 
   void UpdateTitleAndCharset();
 
   void ScrollImageTo(int32_t aX, int32_t aY, bool restoreImage);
 
   float GetRatio() {
--- a/dom/html/MediaDocument.h
+++ b/dom/html/MediaDocument.h
@@ -30,17 +30,17 @@ public:
                                      nsILoadGroup*       aLoadGroup,
                                      nsISupports*        aContainer,
                                      nsIStreamListener** aDocListener,
                                      bool                aReset = true,
                                      nsIContentSink*     aSink = nullptr) MOZ_OVERRIDE;
 
   virtual void SetScriptGlobalObject(nsIScriptGlobalObject* aGlobalObject) MOZ_OVERRIDE;
 
-  virtual bool WillIgnoreCharsetOverride()
+  virtual bool WillIgnoreCharsetOverride() MOZ_OVERRIDE
   {
     return true;
   }
 
 protected:
   void BecomeInteractive();
 
   virtual nsresult CreateSyntheticDocument();
--- a/dom/html/PluginDocument.cpp
+++ b/dom/html/PluginDocument.cpp
@@ -32,20 +32,20 @@ public:
   NS_DECL_NSIPLUGINDOCUMENT
 
   virtual nsresult StartDocumentLoad(const char*         aCommand,
                                      nsIChannel*         aChannel,
                                      nsILoadGroup*       aLoadGroup,
                                      nsISupports*        aContainer,
                                      nsIStreamListener** aDocListener,
                                      bool                aReset = true,
-                                     nsIContentSink*     aSink = nullptr);
+                                     nsIContentSink*     aSink = nullptr) MOZ_OVERRIDE;
 
-  virtual void SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObject);
-  virtual bool CanSavePresentation(nsIRequest *aNewRequest);
+  virtual void SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObject) MOZ_OVERRIDE;
+  virtual bool CanSavePresentation(nsIRequest *aNewRequest) MOZ_OVERRIDE;
 
   const nsCString& GetType() const { return mMimeType; }
   Element*         GetPluginContent() { return mPluginContent; }
 
   void StartLayout() { MediaDocument::StartLayout(); }
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(PluginDocument, MediaDocument)
 protected:
--- a/dom/html/UndoManager.cpp
+++ b/dom/html/UndoManager.cpp
@@ -100,18 +100,18 @@ UndoTxn::Merge(nsITransaction* aTransact
 /////////////////////////////////////////////////
 
 /**
  * Transaction to handle an attribute change to a nsIContent.
  */
 class UndoAttrChanged : public UndoTxn {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(UndoAttrChanged)
-  NS_IMETHOD RedoTransaction();
-  NS_IMETHOD UndoTransaction();
+  NS_IMETHOD RedoTransaction() MOZ_OVERRIDE;
+  NS_IMETHOD UndoTransaction() MOZ_OVERRIDE;
   nsresult Init();
   UndoAttrChanged(mozilla::dom::Element* aElement, int32_t aNameSpaceID,
                   nsIAtom* aAttribute, int32_t aModType);
 protected:
   ~UndoAttrChanged() {}
 
   nsresult SaveRedoState();
   nsCOMPtr<nsIContent> mElement;
@@ -211,18 +211,18 @@ struct UndoCharacterChangedData {
 };
 
 /**
  * Transaction to handle a text change to a nsIContent.
  */
 class UndoTextChanged : public UndoTxn {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(UndoTextChanged)
-  NS_IMETHOD RedoTransaction();
-  NS_IMETHOD UndoTransaction();
+  NS_IMETHOD RedoTransaction() MOZ_OVERRIDE;
+  NS_IMETHOD UndoTransaction() MOZ_OVERRIDE;
   UndoTextChanged(nsIContent* aContent,
                   CharacterDataChangeInfo* aChange);
 protected:
   ~UndoTextChanged() {}
 
   void SaveRedoState();
   nsCOMPtr<nsIContent> mContent;
   UndoCharacterChangedData mChange;
@@ -326,18 +326,18 @@ UndoTextChanged::SaveRedoState()
 
 /**
  * Transaction to handle appending content to a nsIContent.
  */
 class UndoContentAppend : public UndoTxn {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(UndoContentAppend)
   nsresult Init(int32_t aFirstIndex);
-  NS_IMETHOD RedoTransaction();
-  NS_IMETHOD UndoTransaction();
+  NS_IMETHOD RedoTransaction() MOZ_OVERRIDE;
+  NS_IMETHOD UndoTransaction() MOZ_OVERRIDE;
   explicit UndoContentAppend(nsIContent* aContent);
 protected:
   ~UndoContentAppend() {}
   nsCOMPtr<nsIContent> mContent;
   nsCOMArray<nsIContent> mChildren;
 };
 
 NS_IMPL_CYCLE_COLLECTION(UndoContentAppend, mContent, mChildren)
@@ -396,18 +396,18 @@ UndoContentAppend::UndoTransaction()
 /////////////////////////////////////////////////
 
 /**
  * Transaction to handle inserting content into a nsIContent.
  */
 class UndoContentInsert : public UndoTxn {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(UndoContentInsert)
-  NS_IMETHOD UndoTransaction();
-  NS_IMETHOD RedoTransaction();
+  NS_IMETHOD UndoTransaction() MOZ_OVERRIDE;
+  NS_IMETHOD RedoTransaction() MOZ_OVERRIDE;
   UndoContentInsert(nsIContent* aContent, nsIContent* aChild,
                     int32_t aInsertIndex);
 protected:
   ~UndoContentInsert() {}
   nsCOMPtr<nsIContent> mContent;
   nsCOMPtr<nsIContent> mChild;
   nsCOMPtr<nsIContent> mNextNode;
 };
@@ -484,18 +484,18 @@ UndoContentInsert::UndoTransaction()
 /////////////////////////////////////////////////
 
 /**
  * Transaction to handle removing content from an nsIContent.
  */
 class UndoContentRemove : public UndoTxn {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(UndoContentRemove)
-  NS_IMETHOD UndoTransaction();
-  NS_IMETHOD RedoTransaction();
+  NS_IMETHOD UndoTransaction() MOZ_OVERRIDE;
+  NS_IMETHOD RedoTransaction() MOZ_OVERRIDE;
   nsresult Init(int32_t aInsertIndex);
   UndoContentRemove(nsIContent* aContent, nsIContent* aChild,
                     int32_t aInsertIndex);
 protected:
   ~UndoContentRemove() {}
   nsCOMPtr<nsIContent> mContent;
   nsCOMPtr<nsIContent> mChild;
   nsCOMPtr<nsIContent> mNextNode;
@@ -732,18 +732,18 @@ UndoMutationObserver::ContentRemoved(nsI
 class FunctionCallTxn : public UndoTxn {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(FunctionCallTxn)
 
   // Flags
   static const uint32_t CALL_ON_REDO = 1;
   static const uint32_t CALL_ON_UNDO = 2;
 
-  NS_IMETHOD RedoTransaction();
-  NS_IMETHOD UndoTransaction();
+  NS_IMETHOD RedoTransaction() MOZ_OVERRIDE;
+  NS_IMETHOD UndoTransaction() MOZ_OVERRIDE;
   FunctionCallTxn(DOMTransaction* aTransaction, uint32_t aFlags);
 protected:
   ~FunctionCallTxn() {}
   /**
    * Call a function member on the transaction object with the
    * specified function name.
    */
   nsRefPtr<DOMTransaction> mTransaction;
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -172,17 +172,17 @@ class nsGenericHTMLElementTearoff : publ
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   explicit nsGenericHTMLElementTearoff(nsGenericHTMLElement* aElement)
     : mElement(aElement)
   {
   }
 
-  NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
+  NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration** aStyle) MOZ_OVERRIDE
   {
     NS_ADDREF(*aStyle = mElement->Style());
     return NS_OK;
   }
 
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsGenericHTMLElementTearoff,
                                            nsIDOMElementCSSInlineStyle)
 
--- a/dom/html/nsGenericHTMLElement.h
+++ b/dom/html/nsGenericHTMLElement.h
@@ -67,26 +67,26 @@ public:
 
   // From Element
   nsresult CopyInnerTo(mozilla::dom::Element* aDest);
 
   void GetTitle(nsString& aTitle)
   {
     GetHTMLAttr(nsGkAtoms::title, aTitle);
   }
-  NS_IMETHODIMP SetTitle(const nsAString& aTitle)
+  NS_IMETHODIMP SetTitle(const nsAString& aTitle) MOZ_OVERRIDE
   {
     SetHTMLAttr(nsGkAtoms::title, aTitle);
     return NS_OK;
   }
   void GetLang(nsString& aLang)
   {
     GetHTMLAttr(nsGkAtoms::lang, aLang);
   }
-  NS_IMETHODIMP SetLang(const nsAString& aLang)
+  NS_IMETHODIMP SetLang(const nsAString& aLang) MOZ_OVERRIDE
   {
     SetHTMLAttr(nsGkAtoms::lang, aLang);
     return NS_OK;
   }
   void GetDir(nsString& aDir)
   {
     GetHTMLEnumAttr(nsGkAtoms::dir, aDir);
   }
@@ -294,17 +294,17 @@ public:
 protected:
   virtual ~nsGenericHTMLElement() {}
 
   // These methods are used to implement element-specific behavior of Get/SetItemValue
   // when an element has @itemprop but no @itemscope.
   virtual void GetItemValueText(nsAString& text);
   virtual void SetItemValueText(const nsAString& text);
 public:
-  virtual already_AddRefed<mozilla::dom::UndoManager> GetUndoManager();
+  virtual already_AddRefed<mozilla::dom::UndoManager> GetUndoManager() MOZ_OVERRIDE;
   virtual bool UndoScope() MOZ_OVERRIDE;
   virtual void SetUndoScope(bool aUndoScope, mozilla::ErrorResult& aError) MOZ_OVERRIDE;
   // Callback for destructor of of dataset to ensure to null out weak pointer.
   nsresult ClearDataset();
 
   /**
    * Get width and height, using given image request if attributes are unset.
    * Pass a reference to the image request, since the method may change the
@@ -1246,17 +1246,17 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   nsINode* GetScopeChainParent() const MOZ_OVERRIDE;
 
   virtual bool IsNodeOfType(uint32_t aFlags) const MOZ_OVERRIDE;
   virtual void SaveSubtreeState() MOZ_OVERRIDE;
 
   // nsIFormControl
-  virtual mozilla::dom::HTMLFieldSetElement* GetFieldSet();
+  virtual mozilla::dom::HTMLFieldSetElement* GetFieldSet() MOZ_OVERRIDE;
   virtual mozilla::dom::Element* GetFormElement() MOZ_OVERRIDE;
   mozilla::dom::HTMLFormElement* GetForm() const
   {
     return mForm;
   }
   virtual void SetForm(nsIDOMHTMLFormElement* aForm) MOZ_OVERRIDE;
   virtual void ClearForm(bool aRemoveFromForm) MOZ_OVERRIDE;
 
--- a/dom/html/nsHTMLContentSink.cpp
+++ b/dom/html/nsHTMLContentSink.cpp
@@ -129,30 +129,30 @@ public:
   nsresult Init(nsIDocument* aDoc, nsIURI* aURI, nsISupports* aContainer,
                 nsIChannel* aChannel);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLContentSink, nsContentSink)
 
   // nsIContentSink
-  NS_IMETHOD WillParse(void);
-  NS_IMETHOD WillBuildModel(nsDTDMode aDTDMode);
-  NS_IMETHOD DidBuildModel(bool aTerminated);
-  NS_IMETHOD WillInterrupt(void);
-  NS_IMETHOD WillResume(void);
-  NS_IMETHOD SetParser(nsParserBase* aParser);
-  virtual void FlushPendingNotifications(mozFlushType aType);
-  NS_IMETHOD SetDocumentCharset(nsACString& aCharset);
-  virtual nsISupports *GetTarget();
-  virtual bool IsScriptExecuting();
+  NS_IMETHOD WillParse(void) MOZ_OVERRIDE;
+  NS_IMETHOD WillBuildModel(nsDTDMode aDTDMode) MOZ_OVERRIDE;
+  NS_IMETHOD DidBuildModel(bool aTerminated) MOZ_OVERRIDE;
+  NS_IMETHOD WillInterrupt(void) MOZ_OVERRIDE;
+  NS_IMETHOD WillResume(void) MOZ_OVERRIDE;
+  NS_IMETHOD SetParser(nsParserBase* aParser) MOZ_OVERRIDE;
+  virtual void FlushPendingNotifications(mozFlushType aType) MOZ_OVERRIDE;
+  NS_IMETHOD SetDocumentCharset(nsACString& aCharset) MOZ_OVERRIDE;
+  virtual nsISupports *GetTarget() MOZ_OVERRIDE;
+  virtual bool IsScriptExecuting() MOZ_OVERRIDE;
 
   // nsIHTMLContentSink
-  NS_IMETHOD OpenContainer(ElementType aNodeType);
-  NS_IMETHOD CloseContainer(ElementType aTag);
+  NS_IMETHOD OpenContainer(ElementType aNodeType) MOZ_OVERRIDE;
+  NS_IMETHOD CloseContainer(ElementType aTag) MOZ_OVERRIDE;
 
 protected:
   virtual ~HTMLContentSink();
 
   nsCOMPtr<nsIHTMLDocument> mHTMLDocument;
 
   // The maximum length of a text run
   int32_t mMaxTextRun;
@@ -170,27 +170,27 @@ protected:
   bool mHaveSeenHead;
 
   // Boolean indicating whether we've notified insertion of our root content
   // yet.  We want to make sure to only do this once.
   bool mNotifiedRootInsertion;
 
   mozilla::dom::NodeInfo* mNodeInfoCache[NS_HTML_TAG_MAX + 1];
 
-  nsresult FlushTags();
+  nsresult FlushTags() MOZ_OVERRIDE;
 
   // Routines for tags that require special handling
   nsresult CloseHTML();
   nsresult OpenBody();
   nsresult CloseBody();
 
   void CloseHeadContext();
 
   // nsContentSink overrides
-  void UpdateChildCounts();
+  void UpdateChildCounts() MOZ_OVERRIDE;
 
   void NotifyInsert(nsIContent* aContent,
                     nsIContent* aChildContent,
                     int32_t aIndexInContainer);
   void NotifyRootInsertion();
 };
 
 class SinkContext
--- a/dom/html/nsHTMLDocument.h
+++ b/dom/html/nsHTMLDocument.h
@@ -73,20 +73,20 @@ public:
   // nsIHTMLDocument
   virtual void SetCompatibilityMode(nsCompatibility aMode) MOZ_OVERRIDE;
 
   virtual bool IsWriting() MOZ_OVERRIDE
   {
     return mWriteLevel != uint32_t(0);
   }
 
-  virtual nsContentList* GetForms();
- 
-  virtual nsContentList* GetFormControls();
- 
+  virtual nsContentList* GetForms() MOZ_OVERRIDE;
+
+  virtual nsContentList* GetFormControls() MOZ_OVERRIDE;
+
   // nsIDOMDocument interface
   using nsDocument::CreateElement;
   using nsDocument::CreateElementNS;
   NS_FORWARD_NSIDOMDOCUMENT(nsDocument::)
 
   // And explicitly import the things from nsDocument that we just shadowed
   using nsDocument::GetImplementation;
   using nsDocument::GetTitle;
@@ -150,17 +150,17 @@ public:
   void EndUpdate(nsUpdateType aUpdateType) MOZ_OVERRIDE;
 
   virtual nsresult SetEditingState(EditingState aState) MOZ_OVERRIDE;
 
   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
 
   virtual void RemovedFromDocShell() MOZ_OVERRIDE;
 
-  virtual mozilla::dom::Element *GetElementById(const nsAString& aElementId)
+  virtual mozilla::dom::Element *GetElementById(const nsAString& aElementId) MOZ_OVERRIDE
   {
     return nsDocument::GetElementById(aElementId);
   }
 
   virtual void DocAddSizeOfExcludingThis(nsWindowSizes* aWindowSizes) const MOZ_OVERRIDE;
   // DocAddSizeOfIncludingThis is inherited from nsIDocument.
 
   virtual bool WillIgnoreCharsetOverride() MOZ_OVERRIDE;
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -209,46 +209,46 @@ public:
 
   nsTextInputSelectionImpl(nsFrameSelection *aSel, nsIPresShell *aShell, nsIContent *aLimiter);
 
   void SetScrollableFrame(nsIScrollableFrame *aScrollableFrame);
   nsFrameSelection* GetConstFrameSelection()
     { return mFrameSelection; }
 
   //NSISELECTIONCONTROLLER INTERFACES
-  NS_IMETHOD SetDisplaySelection(int16_t toggle);
-  NS_IMETHOD GetDisplaySelection(int16_t *_retval);
-  NS_IMETHOD SetSelectionFlags(int16_t aInEnable);
-  NS_IMETHOD GetSelectionFlags(int16_t *aOutEnable);
-  NS_IMETHOD GetSelection(int16_t type, nsISelection **_retval);
-  NS_IMETHOD ScrollSelectionIntoView(int16_t aType, int16_t aRegion, int16_t aFlags);
-  NS_IMETHOD RepaintSelection(int16_t type);
+  NS_IMETHOD SetDisplaySelection(int16_t toggle) MOZ_OVERRIDE;
+  NS_IMETHOD GetDisplaySelection(int16_t* _retval) MOZ_OVERRIDE;
+  NS_IMETHOD SetSelectionFlags(int16_t aInEnable) MOZ_OVERRIDE;
+  NS_IMETHOD GetSelectionFlags(int16_t *aOutEnable) MOZ_OVERRIDE;
+  NS_IMETHOD GetSelection(int16_t type, nsISelection** _retval) MOZ_OVERRIDE;
+  NS_IMETHOD ScrollSelectionIntoView(int16_t aType, int16_t aRegion, int16_t aFlags) MOZ_OVERRIDE;
+  NS_IMETHOD RepaintSelection(int16_t type) MOZ_OVERRIDE;
   NS_IMETHOD RepaintSelection(nsPresContext* aPresContext, SelectionType aSelectionType);
-  NS_IMETHOD SetCaretEnabled(bool enabled);
-  NS_IMETHOD SetCaretReadOnly(bool aReadOnly);
-  NS_IMETHOD GetCaretEnabled(bool *_retval);
-  NS_IMETHOD GetCaretVisible(bool *_retval);
-  NS_IMETHOD SetCaretVisibilityDuringSelection(bool aVisibility);
+  NS_IMETHOD SetCaretEnabled(bool enabled) MOZ_OVERRIDE;
+  NS_IMETHOD SetCaretReadOnly(bool aReadOnly) MOZ_OVERRIDE;
+  NS_IMETHOD GetCaretEnabled(bool* _retval) MOZ_OVERRIDE;
+  NS_IMETHOD GetCaretVisible(bool* _retval) MOZ_OVERRIDE;
+  NS_IMETHOD SetCaretVisibilityDuringSelection(bool aVisibility) MOZ_OVERRIDE;
   NS_IMETHOD PhysicalMove(int16_t aDirection, int16_t aAmount, bool aExtend) MOZ_OVERRIDE;
-  NS_IMETHOD CharacterMove(bool aForward, bool aExtend);
-  NS_IMETHOD CharacterExtendForDelete();
-  NS_IMETHOD CharacterExtendForBackspace();
-  NS_IMETHOD WordMove(bool aForward, bool aExtend);
-  NS_IMETHOD WordExtendForDelete(bool aForward);
-  NS_IMETHOD LineMove(bool aForward, bool aExtend);
-  NS_IMETHOD IntraLineMove(bool aForward, bool aExtend);
-  NS_IMETHOD PageMove(bool aForward, bool aExtend);
-  NS_IMETHOD CompleteScroll(bool aForward);
-  NS_IMETHOD CompleteMove(bool aForward, bool aExtend);
-  NS_IMETHOD ScrollPage(bool aForward);
-  NS_IMETHOD ScrollLine(bool aForward);
-  NS_IMETHOD ScrollCharacter(bool aRight);
-  NS_IMETHOD SelectAll(void);
-  NS_IMETHOD CheckVisibility(nsIDOMNode *node, int16_t startOffset, int16_t EndOffset, bool *_retval);
-  virtual nsresult CheckVisibilityContent(nsIContent* aNode, int16_t aStartOffset, int16_t aEndOffset, bool* aRetval);
+  NS_IMETHOD CharacterMove(bool aForward, bool aExtend) MOZ_OVERRIDE;
+  NS_IMETHOD CharacterExtendForDelete() MOZ_OVERRIDE;
+  NS_IMETHOD CharacterExtendForBackspace() MOZ_OVERRIDE;
+  NS_IMETHOD WordMove(bool aForward, bool aExtend) MOZ_OVERRIDE;
+  NS_IMETHOD WordExtendForDelete(bool aForward) MOZ_OVERRIDE;
+  NS_IMETHOD LineMove(bool aForward, bool aExtend) MOZ_OVERRIDE;
+  NS_IMETHOD IntraLineMove(bool aForward, bool aExtend) MOZ_OVERRIDE;
+  NS_IMETHOD PageMove(bool aForward, bool aExtend) MOZ_OVERRIDE;
+  NS_IMETHOD CompleteScroll(bool aForward) MOZ_OVERRIDE;
+  NS_IMETHOD CompleteMove(bool aForward, bool aExtend) MOZ_OVERRIDE;
+  NS_IMETHOD ScrollPage(bool aForward) MOZ_OVERRIDE;
+  NS_IMETHOD ScrollLine(bool aForward) MOZ_OVERRIDE;
+  NS_IMETHOD ScrollCharacter(bool aRight) MOZ_OVERRIDE;
+  NS_IMETHOD SelectAll(void) MOZ_OVERRIDE;
+  NS_IMETHOD CheckVisibility(nsIDOMNode *node, int16_t startOffset, int16_t EndOffset, bool* _retval) MOZ_OVERRIDE;
+  virtual nsresult CheckVisibilityContent(nsIContent* aNode, int16_t aStartOffset, int16_t aEndOffset, bool* aRetval) MOZ_OVERRIDE;
 
 private:
   nsRefPtr<nsFrameSelection> mFrameSelection;
   nsCOMPtr<nsIContent>       mLimiter;
   nsIScrollableFrame        *mScrollFrame;
   nsWeakPtr mPresShellWeak;
 };
 
--- a/dom/ipc/ContentBridgeChild.h
+++ b/dom/ipc/ContentBridgeChild.h
@@ -29,17 +29,17 @@ public:
 
   virtual bool RecvAsyncMessage(const nsString& aMsg,
                                 const ClonedMessageData& aData,
                                 const InfallibleTArray<jsipc::CpowEntry>& aCpows,
                                 const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
   virtual PBlobChild*
   SendPBlobConstructor(PBlobChild* actor,
-                       const BlobConstructorParams& params);
+                       const BlobConstructorParams& aParams) MOZ_OVERRIDE;
 
   jsipc::JavaScriptShared* GetCPOWManager() MOZ_OVERRIDE;
 
   virtual bool SendPBrowserConstructor(PBrowserChild* aActor,
                                        const TabId& aTabId,
                                        const IPCTabContext& aContext,
                                        const uint32_t& aChromeFlags,
                                        const ContentParentId& aCpID,
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -211,17 +211,17 @@ namespace dom {
 class MemoryReportRequestChild : public PMemoryReportRequestChild,
                                  public nsIRunnable
 {
 public:
     NS_DECL_ISUPPORTS
 
     MemoryReportRequestChild(uint32_t aGeneration, bool aAnonymize,
                              const MaybeFileDesc& aDMDFile);
-    NS_IMETHOD Run();
+    NS_IMETHOD Run() MOZ_OVERRIDE;
 private:
     virtual ~MemoryReportRequestChild();
 
     uint32_t mGeneration;
     bool     mAnonymize;
     FileDescriptor mDMDFile;
 };
 
@@ -801,20 +801,20 @@ class MemoryReportCallback MOZ_FINAL : p
 public:
     NS_DECL_ISUPPORTS
 
     explicit MemoryReportCallback(const nsACString& aProcess)
     : mProcess(aProcess)
     {
     }
 
-    NS_IMETHOD Callback(const nsACString &aProcess, const nsACString &aPath,
+    NS_IMETHOD Callback(const nsACString& aProcess, const nsACString &aPath,
                         int32_t aKind, int32_t aUnits, int64_t aAmount,
-                        const nsACString &aDescription,
-                        nsISupports *aiWrappedReports)
+                        const nsACString& aDescription,
+                        nsISupports* aiWrappedReports) MOZ_OVERRIDE
     {
         MemoryReportsWrapper *wrappedReports =
             static_cast<MemoryReportsWrapper *>(aiWrappedReports);
 
         MemoryReport memreport(mProcess, nsCString(aPath), aKind, aUnits,
                                aAmount, nsCString(aDescription));
         wrappedReports->mReports->AppendElement(memreport);
         return NS_OK;
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -57,19 +57,19 @@ class ContentChild : public PContentChil
     typedef mozilla::dom::ClonedMessageData ClonedMessageData;
     typedef mozilla::ipc::OptionalURIParams OptionalURIParams;
     typedef mozilla::ipc::PFileDescriptorSetChild PFileDescriptorSetChild;
     typedef mozilla::ipc::URIParams URIParams;
 
 public:
     ContentChild();
     virtual ~ContentChild();
-    NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
-    NS_IMETHOD_(MozExternalRefCountType) AddRef(void) { return 1; }
-    NS_IMETHOD_(MozExternalRefCountType) Release(void) { return 1; }
+    NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) MOZ_OVERRIDE;
+    NS_IMETHOD_(MozExternalRefCountType) AddRef(void) MOZ_OVERRIDE { return 1; }
+    NS_IMETHOD_(MozExternalRefCountType) Release(void) MOZ_OVERRIDE { return 1; }
 
     struct AppInfo
     {
         nsCString version;
         nsCString buildID;
         nsCString name;
         nsCString UAName;
         nsCString ID;
@@ -137,24 +137,28 @@ public:
     AllocPBackgroundChild(Transport* aTransport, ProcessId aOtherProcess)
                           MOZ_OVERRIDE;
 
     virtual PBrowserChild* AllocPBrowserChild(const TabId& aTabId,
                                               const IPCTabContext& aContext,
                                               const uint32_t& aChromeFlags,
                                               const ContentParentId& aCpID,
                                               const bool& aIsForApp,
-                                              const bool& aIsForBrowser);
-    virtual bool DeallocPBrowserChild(PBrowserChild*);
+                                              const bool& aIsForBrowser)
+                                              MOZ_OVERRIDE;
+    virtual bool DeallocPBrowserChild(PBrowserChild*) MOZ_OVERRIDE;
 
-    virtual PDeviceStorageRequestChild* AllocPDeviceStorageRequestChild(const DeviceStorageParams&);
-    virtual bool DeallocPDeviceStorageRequestChild(PDeviceStorageRequestChild*);
+    virtual PDeviceStorageRequestChild* AllocPDeviceStorageRequestChild(const DeviceStorageParams&)
+                                                                        MOZ_OVERRIDE;
+    virtual bool DeallocPDeviceStorageRequestChild(PDeviceStorageRequestChild*)
+                                                   MOZ_OVERRIDE;
 
-    virtual PFileSystemRequestChild* AllocPFileSystemRequestChild(const FileSystemParams&);
-    virtual bool DeallocPFileSystemRequestChild(PFileSystemRequestChild*);
+    virtual PFileSystemRequestChild* AllocPFileSystemRequestChild(const FileSystemParams&)
+                                                                  MOZ_OVERRIDE;
+    virtual bool DeallocPFileSystemRequestChild(PFileSystemRequestChild*) MOZ_OVERRIDE;
 
     virtual PBlobChild* AllocPBlobChild(const BlobConstructorParams& aParams)
                                         MOZ_OVERRIDE;
     virtual bool DeallocPBlobChild(PBlobChild* aActor) MOZ_OVERRIDE;
 
     virtual PCrashReporterChild*
     AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id,
                              const uint32_t& processType) MOZ_OVERRIDE;
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -380,17 +380,17 @@ bool ContentParent::sNuwaReady = false;
 class MemoryReportRequestParent : public PMemoryReportRequestParent
 {
 public:
     MemoryReportRequestParent();
     virtual ~MemoryReportRequestParent();
 
     virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
 
-    virtual bool Recv__delete__(const uint32_t& generation, const InfallibleTArray<MemoryReport>& report);
+    virtual bool Recv__delete__(const uint32_t& aGeneration, const InfallibleTArray<MemoryReport>& aReport) MOZ_OVERRIDE;
 private:
     ContentParent* Owner()
     {
         return static_cast<ContentParent*>(Manager());
     }
 };
 
 MemoryReportRequestParent::MemoryReportRequestParent()
@@ -1337,17 +1337,17 @@ public:
         mTimer = do_CreateInstance("@mozilla.org/timer;1");
 
         uint32_t timeoutSec =
             Preferences::GetInt("dom.ipc.systemMessageCPULockTimeoutSec", 30);
         mTimer->InitWithCallback(this, timeoutSec * 1000,
                                  nsITimer::TYPE_ONE_SHOT);
     }
 
-    NS_IMETHOD Notify(nsITimer* aTimer)
+    NS_IMETHOD Notify(nsITimer* aTimer) MOZ_OVERRIDE
     {
         // Careful: ShutDown() may delete |this|.
         ShutDown();
         return NS_OK;
     }
 
 private:
     ~SystemMessageHandledListener() {}
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -497,18 +497,18 @@ private:
                                           MOZ_OVERRIDE;
     virtual bool DeallocPBlobParent(PBlobParent* aActor) MOZ_OVERRIDE;
 
     virtual bool DeallocPCrashReporterParent(PCrashReporterParent* crashreporter) MOZ_OVERRIDE;
 
     virtual bool RecvGetRandomValues(const uint32_t& length,
                                      InfallibleTArray<uint8_t>* randomValues) MOZ_OVERRIDE;
 
-    virtual bool RecvIsSecureURI(const uint32_t& type, const URIParams& uri,
-                                 const uint32_t& flags, bool* isSecureURI);
+    virtual bool RecvIsSecureURI(const uint32_t& aType, const URIParams& aURI,
+                                 const uint32_t& aFlags, bool* aIsSecureURI) MOZ_OVERRIDE;
 
     virtual bool DeallocPHalParent(PHalParent*) MOZ_OVERRIDE;
 
     virtual PMemoryReportRequestParent*
     AllocPMemoryReportRequestParent(const uint32_t& aGeneration,
                                     const bool &aAnonymize,
                                     const bool &aMinimizeMemoryUsage,
                                     const MaybeFileDesc &aDMDFile) MOZ_OVERRIDE;
--- a/dom/ipc/ScreenManagerParent.h
+++ b/dom/ipc/ScreenManagerParent.h
@@ -38,17 +38,17 @@ class ScreenManagerParent : public PScre
                                  const int32_t& aTop,
                                  const int32_t& aWidth,
                                  const int32_t& aHeight,
                                  ScreenDetails* aRetVal,
                                  bool* aSuccess) MOZ_OVERRIDE;
 
   virtual bool RecvScreenForBrowser(PBrowserParent* aBrowser,
                                     ScreenDetails* aRetVal,
-                                    bool* aSuccess);
+                                    bool* aSuccess) MOZ_OVERRIDE;
 
  private:
   bool ExtractScreenDetails(nsIScreen* aScreen, ScreenDetails &aDetails);
   nsCOMPtr<nsIScreenManager> mScreenMgr;
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -75,30 +75,30 @@ public:
   NS_FORWARD_SAFE_NSIMESSAGELISTENERMANAGER(mMessageManager)
   NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager)
   NS_IMETHOD SendSyncMessage(const nsAString& aMessageName,
                              JS::Handle<JS::Value> aObject,
                              JS::Handle<JS::Value> aRemote,
                              nsIPrincipal* aPrincipal,
                              JSContext* aCx,
                              uint8_t aArgc,
-                             JS::MutableHandle<JS::Value> aRetval)
+                             JS::MutableHandle<JS::Value> aRetval) MOZ_OVERRIDE
   {
     return mMessageManager
       ? mMessageManager->SendSyncMessage(aMessageName, aObject, aRemote,
                                          aPrincipal, aCx, aArgc, aRetval)
       : NS_ERROR_NULL_POINTER;
   }
   NS_IMETHOD SendRpcMessage(const nsAString& aMessageName,
                             JS::Handle<JS::Value> aObject,
                             JS::Handle<JS::Value> aRemote,
                             nsIPrincipal* aPrincipal,
                             JSContext* aCx,
                             uint8_t aArgc,
-                            JS::MutableHandle<JS::Value> aRetval)
+                            JS::MutableHandle<JS::Value> aRetval) MOZ_OVERRIDE
   {
     return mMessageManager
       ? mMessageManager->SendRpcMessage(aMessageName, aObject, aRemote,
                                         aPrincipal, aCx, aArgc, aRetval)
       : NS_ERROR_NULL_POINTER;
   }
   NS_IMETHOD GetContent(nsIDOMWindow** aContent) MOZ_OVERRIDE;
   NS_IMETHOD GetDocShell(nsIDocShell** aDocShell) MOZ_OVERRIDE;
@@ -107,19 +107,19 @@ public:
     return mMessageManager ? mMessageManager->Dump(aStr) : NS_OK;
   }
   NS_IMETHOD PrivateNoteIntentionalCrash() MOZ_OVERRIDE;
   NS_IMETHOD Btoa(const nsAString& aBinaryData,
                   nsAString& aAsciiBase64String) MOZ_OVERRIDE;
   NS_IMETHOD Atob(const nsAString& aAsciiString,
                   nsAString& aBinaryData) MOZ_OVERRIDE;
 
-  NS_IMETHOD AddEventListener(const nsAString& aType,
-                              nsIDOMEventListener* aListener,
-                              bool aUseCapture)
+  nsresult AddEventListener(const nsAString& aType,
+                            nsIDOMEventListener* aListener,
+                            bool aUseCapture)
   {
     // By default add listeners only for trusted events!
     return DOMEventTargetHelper::AddEventListener(aType, aListener,
                                                   aUseCapture, false, 2);
   }
   using DOMEventTargetHelper::AddEventListener;
   NS_IMETHOD AddEventListener(const nsAString& aType,
                               nsIDOMEventListener* aListener,
@@ -128,17 +128,17 @@ public:
   {
     return DOMEventTargetHelper::AddEventListener(aType, aListener,
                                                   aUseCapture,
                                                   aWantsUntrusted,
                                                   optional_argc);
   }
 
   nsresult
-  PreHandleEvent(EventChainPreVisitor& aVisitor)
+  PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE
   {
     aVisitor.mForceContentDispatch = true;
     return NS_OK;
   }
 
   virtual JSContext* GetJSContextForEventHandlers() MOZ_OVERRIDE;
   virtual nsIPrincipal* GetPrincipal() MOZ_OVERRIDE;
   virtual JSObject* GetGlobalJSObject() MOZ_OVERRIDE;
@@ -503,17 +503,17 @@ protected:
     virtual ~TabChild();
 
     virtual PRenderFrameChild* AllocPRenderFrameChild() MOZ_OVERRIDE;
     virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) MOZ_OVERRIDE;
     virtual bool RecvDestroy() MOZ_OVERRIDE;
     virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) MOZ_OVERRIDE;
     virtual bool RecvSetIsDocShellActive(const bool& aIsActive) MOZ_OVERRIDE;
 
-    virtual bool RecvRequestNotifyAfterRemotePaint();
+    virtual bool RecvRequestNotifyAfterRemotePaint() MOZ_OVERRIDE;
 
     virtual bool RecvParentActivated(const bool& aActivated) MOZ_OVERRIDE;
 
 #ifdef MOZ_WIDGET_GONK
     void MaybeRequestPreinitCamera();
 #endif
 
 private:
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -2368,48 +2368,48 @@ public:
   FakeChannel(const nsCString& aUri, uint64_t aCallbackId, Element* aElement)
     : mCallbackId(aCallbackId)
     , mElement(aElement)
   {
     NS_NewURI(getter_AddRefs(mUri), aUri);
   }
 
   NS_DECL_ISUPPORTS
-#define NO_IMPL { return NS_ERROR_NOT_IMPLEMENTED; }
+#define NO_IMPL MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
   NS_IMETHOD GetName(nsACString&) NO_IMPL
   NS_IMETHOD IsPending(bool*) NO_IMPL
   NS_IMETHOD GetStatus(nsresult*) NO_IMPL
   NS_IMETHOD Cancel(nsresult) NO_IMPL
   NS_IMETHOD Suspend() NO_IMPL
   NS_IMETHOD Resume() NO_IMPL
   NS_IMETHOD GetLoadGroup(nsILoadGroup**) NO_IMPL
   NS_IMETHOD SetLoadGroup(nsILoadGroup*) NO_IMPL
   NS_IMETHOD SetLoadFlags(nsLoadFlags) NO_IMPL
   NS_IMETHOD GetLoadFlags(nsLoadFlags*) NO_IMPL
   NS_IMETHOD GetOriginalURI(nsIURI**) NO_IMPL
   NS_IMETHOD SetOriginalURI(nsIURI*) NO_IMPL
-  NS_IMETHOD GetURI(nsIURI** aUri)
+  NS_IMETHOD GetURI(nsIURI** aUri) MOZ_OVERRIDE
   {
     NS_IF_ADDREF(mUri);
     *aUri = mUri;
     return NS_OK;
   }
   NS_IMETHOD GetOwner(nsISupports**) NO_IMPL
   NS_IMETHOD SetOwner(nsISupports*) NO_IMPL
-  NS_IMETHOD GetLoadInfo(nsILoadInfo** aLoadInfo)
+  NS_IMETHOD GetLoadInfo(nsILoadInfo** aLoadInfo) MOZ_OVERRIDE
   {
     NS_IF_ADDREF(*aLoadInfo = mLoadInfo);
     return NS_OK;
   }
-  NS_IMETHOD SetLoadInfo(nsILoadInfo* aLoadInfo)
+  NS_IMETHOD SetLoadInfo(nsILoadInfo* aLoadInfo) MOZ_OVERRIDE
   {
     mLoadInfo = aLoadInfo;
     return NS_OK;
   }
-  NS_IMETHOD GetNotificationCallbacks(nsIInterfaceRequestor** aRequestor)
+  NS_IMETHOD GetNotificationCallbacks(nsIInterfaceRequestor** aRequestor) MOZ_OVERRIDE
   {
     NS_ADDREF(*aRequestor = this);
     return NS_OK;
   }
   NS_IMETHOD SetNotificationCallbacks(nsIInterfaceRequestor*) NO_IMPL
   NS_IMETHOD GetSecurityInfo(nsISupports**) NO_IMPL
   NS_IMETHOD GetContentType(nsACString&) NO_IMPL
   NS_IMETHOD SetContentType(const nsACString&) NO_IMPL
@@ -2419,25 +2419,25 @@ public:
   NS_IMETHOD SetContentLength(int64_t) NO_IMPL
   NS_IMETHOD Open(nsIInputStream**) NO_IMPL
   NS_IMETHOD AsyncOpen(nsIStreamListener*, nsISupports*) NO_IMPL
   NS_IMETHOD GetContentDisposition(uint32_t*) NO_IMPL
   NS_IMETHOD SetContentDisposition(uint32_t) NO_IMPL
   NS_IMETHOD GetContentDispositionFilename(nsAString&) NO_IMPL
   NS_IMETHOD SetContentDispositionFilename(const nsAString&) NO_IMPL
   NS_IMETHOD GetContentDispositionHeader(nsACString&) NO_IMPL
-  NS_IMETHOD OnAuthAvailable(nsISupports *aContext, nsIAuthInformation *aAuthInfo);
-  NS_IMETHOD OnAuthCancelled(nsISupports *aContext, bool userCancel);
-  NS_IMETHOD GetInterface(const nsIID & uuid, void **result)
+  NS_IMETHOD OnAuthAvailable(nsISupports *aContext, nsIAuthInformation *aAuthInfo) MOZ_OVERRIDE;
+  NS_IMETHOD OnAuthCancelled(nsISupports *aContext, bool userCancel) MOZ_OVERRIDE;
+  NS_IMETHOD GetInterface(const nsIID & uuid, void **result) MOZ_OVERRIDE
   {
     return QueryInterface(uuid, result);
   }
   NS_IMETHOD GetAssociatedWindow(nsIDOMWindow**) NO_IMPL
   NS_IMETHOD GetTopWindow(nsIDOMWindow**) NO_IMPL
-  NS_IMETHOD GetTopFrameElement(nsIDOMElement** aElement)
+  NS_IMETHOD GetTopFrameElement(nsIDOMElement** aElement) MOZ_OVERRIDE
   {
     nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(mElement);
     elem.forget(aElement);
     return NS_OK;
   }
   NS_IMETHOD GetNestedFrameId(uint64_t*) NO_IMPL
   NS_IMETHOD IsAppOfType(uint32_t, bool*) NO_IMPL
   NS_IMETHOD GetIsContent(bool*) NO_IMPL
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -122,18 +122,18 @@ public:
      * capturer.
      */
     bool TryCapture(const WidgetGUIEvent& aEvent);
 
     void Destroy();
 
     virtual bool RecvMoveFocus(const bool& aForward) MOZ_OVERRIDE;
     virtual bool RecvEvent(const RemoteDOMEvent& aEvent) MOZ_OVERRIDE;
-    virtual bool RecvReplyKeyEvent(const WidgetKeyboardEvent& event);
-    virtual bool RecvDispatchAfterKeyboardEvent(const WidgetKeyboardEvent& event);
+    virtual bool RecvReplyKeyEvent(const WidgetKeyboardEvent& aEvent) MOZ_OVERRIDE;
+    virtual bool RecvDispatchAfterKeyboardEvent(const WidgetKeyboardEvent& aEvent) MOZ_OVERRIDE;
     virtual bool RecvBrowserFrameOpenWindow(PBrowserParent* aOpener,
                                             const nsString& aURL,
                                             const nsString& aName,
                                             const nsString& aFeatures,
                                             bool* aOutWindowOpened) MOZ_OVERRIDE;
     virtual bool AnswerCreateWindow(const uint32_t& aChromeFlags,
                                     const bool& aCalledFromJS,
                                     const bool& aPositionSpecified,
@@ -192,19 +192,19 @@ public:
                                      const int32_t& aFocusChange) MOZ_OVERRIDE;
     virtual bool RecvRequestFocus(const bool& aCanRaise) MOZ_OVERRIDE;
     virtual bool RecvEnableDisableCommands(const nsString& aAction,
                                            const nsTArray<nsCString>& aEnabledCommands,
                                            const nsTArray<nsCString>& aDisabledCommands) MOZ_OVERRIDE;
     virtual bool RecvSetCursor(const uint32_t& aValue, const bool& aForce) MOZ_OVERRIDE;
     virtual bool RecvSetBackgroundColor(const nscolor& aValue) MOZ_OVERRIDE;
     virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus) MOZ_OVERRIDE;
-    virtual bool RecvIsParentWindowMainWidgetVisible(bool* aIsVisible);
-    virtual bool RecvShowTooltip(const uint32_t& aX, const uint32_t& aY, const nsString& aTooltip);
-    virtual bool RecvHideTooltip();
+    virtual bool RecvIsParentWindowMainWidgetVisible(bool* aIsVisible) MOZ_OVERRIDE;
+    virtual bool RecvShowTooltip(const uint32_t& aX, const uint32_t& aY, const nsString& aTooltip) MOZ_OVERRIDE;
+    virtual bool RecvHideTooltip() MOZ_OVERRIDE;
     virtual bool RecvGetDPI(float* aValue) MOZ_OVERRIDE;
     virtual bool RecvGetDefaultScale(double* aValue) MOZ_OVERRIDE;
     virtual bool RecvGetWidgetNativeData(WindowsHandle* aValue) MOZ_OVERRIDE;
     virtual bool RecvZoomToRect(const uint32_t& aPresShellId,
                                 const ViewID& aViewId,
                                 const CSSRect& aRect) MOZ_OVERRIDE;
     virtual bool RecvUpdateZoomConstraints(const uint32_t& aPresShellId,
                                            const ViewID& aViewId,
--- a/dom/media/fmp4/gonk/GonkDecoderModule.cpp
+++ b/dom/media/fmp4/gonk/GonkDecoderModule.cpp
@@ -24,18 +24,16 @@ void
 GonkDecoderModule::Init()
 {
   MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
 }
 
 nsresult
 GonkDecoderModule::Shutdown()
 {
-  MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
-
   return NS_OK;
 }
 
 already_AddRefed<MediaDataDecoder>
 GonkDecoderModule::CreateVideoDecoder(const mp4_demuxer::VideoDecoderConfig& aConfig,
                                      mozilla::layers::LayersBackend aLayersBackend,
                                      mozilla::layers::ImageContainer* aImageContainer,
                                      MediaTaskQueue* aVideoTaskQueue,
--- a/dom/media/gmp/GMPService.cpp
+++ b/dom/media/gmp/GMPService.cpp
@@ -927,18 +927,18 @@ WriteToFile(nsIFile* aPath,
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 static nsresult
 ReadFromFile(nsIFile* aPath,
-             const nsCString& aFileName,
-             nsCString& aOutData,
+             const nsACString& aFileName,
+             nsACString& aOutData,
              int32_t aMaxLength)
 {
   nsCOMPtr<nsIFile> path;
   nsresult rv = aPath->Clone(getter_AddRefs(path));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -965,18 +965,18 @@ ReadFromFile(nsIFile* aPath,
   PR_Close(f);
   if (NS_WARN_IF(len != size)) {
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
-static nsresult
-ReadSalt(nsIFile* aPath, nsCString& aOutData)
+nsresult
+ReadSalt(nsIFile* aPath, nsACString& aOutData)
 {
   return ReadFromFile(aPath, NS_LITERAL_CSTRING("salt"),
                       aOutData, NodeIdSaltLength);
 
 }
 
 NS_IMETHODIMP
 GeckoMediaPluginService::IsPersistentStorageAllowed(const nsACString& aNodeId,
@@ -1136,17 +1136,17 @@ GeckoMediaPluginService::GetNodeId(const
   }
 
   aOutId = salt;
   mPersistentStorageAllowed.Put(salt, true);
 
   return NS_OK;
 }
 
-static bool
+bool
 MatchOrigin(nsIFile* aPath, const nsACString& aOrigin)
 {
   // http://en.wikipedia.org/wiki/Domain_Name_System#Domain_name_syntax
   static const uint32_t MaxDomainLength = 253;
 
   nsresult rv;
   nsCString str;
   rv = ReadFromFile(aPath, NS_LITERAL_CSTRING("origin"), str, MaxDomainLength);
--- a/dom/media/gmp/GMPService.h
+++ b/dom/media/gmp/GMPService.h
@@ -139,12 +139,15 @@ private:
   // non-persistent sessions.
   nsClassHashtable<nsUint32HashKey, nsCString> mTempNodeIds;
 
   // Hashes node id to whether that node id is allowed to store data
   // persistently on disk.
   nsDataHashtable<nsCStringHashKey, bool> mPersistentStorageAllowed;
 };
 
+nsresult ReadSalt(nsIFile* aPath, nsACString& aOutData);
+bool MatchOrigin(nsIFile* aPath, const nsACString& aOrigin);
+
 } // namespace gmp
 } // namespace mozilla
 
 #endif // GMPService_h_
--- a/dom/media/gtest/TestGMPCrossOrigin.cpp
+++ b/dom/media/gtest/TestGMPCrossOrigin.cpp
@@ -115,16 +115,52 @@ GetGMPThread()
 {
   nsRefPtr<GeckoMediaPluginService> service =
     GeckoMediaPluginService::GetGeckoMediaPluginService();
   nsCOMPtr<nsIThread> thread;
   EXPECT_TRUE(NS_SUCCEEDED(service->GetThread(getter_AddRefs(thread))));
   return thread.forget();
 }
 
+template<typename T>
+static nsresult
+EnumerateDir(const nsACString& aDir, T&& aDirIter)
+{
+  nsRefPtr<GeckoMediaPluginService> service =
+    GeckoMediaPluginService::GetGeckoMediaPluginService();
+  MOZ_ASSERT(service);
+
+  // $profileDir/gmp/
+  nsCOMPtr<nsIFile> path;
+  nsresult rv = service->GetStorageDir(getter_AddRefs(path));
+  NS_ENSURE_SUCCESS(rv, rv);
+  // $profileDir/gmp/$aDir/
+  rv = path->AppendNative(aDir);
+  NS_ENSURE_SUCCESS(rv, rv);
+  // Iterate all sub-folders of $profileDir/gmp/$aDir/
+  nsCOMPtr<nsISimpleEnumerator> iter;
+  rv = path->GetDirectoryEntries(getter_AddRefs(iter));
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  bool hasMore = false;
+  while (NS_SUCCEEDED(iter->HasMoreElements(&hasMore)) && hasMore) {
+    nsCOMPtr<nsISupports> supports;
+    rv = iter->GetNext(getter_AddRefs(supports));
+    if (NS_FAILED(rv)) {
+      continue;
+    }
+    nsCOMPtr<nsIFile> entry(do_QueryInterface(supports, &rv));
+    if (NS_FAILED(rv)) {
+      continue;
+    }
+    aDirIter(entry);
+  }
+  return NS_OK;
+}
+
 class GMPShutdownObserver : public nsIRunnable
                           , public nsIObserver {
 public:
   GMPShutdownObserver(nsIRunnable* aShutdownTask,
                       nsIRunnable* Continuation,
                       const nsACString& aNodeId)
     : mShutdownTask(aShutdownTask)
     , mContinuation(Continuation)
@@ -407,16 +443,148 @@ class GMPStorageTest : public GMPDecrypt
     // Send a message to the fake GMP for it to run its own tests internally.
     // It sends us a "test-storage complete" message when its passed, or
     // some other message if its tests fail.
     Expect(NS_LITERAL_CSTRING("test-storage complete"),
            NS_NewRunnableMethod(this, &GMPStorageTest::SetFinished));
     Update(NS_LITERAL_CSTRING("test-storage"));
   }
 
+  /**
+   * 1. Generate storage data for some sites.
+   * 2. Forget about one of the sites.
+   * 3. Check if the storage data for the forgotten site are erased correctly.
+   * 4. Check if the storage data for other sites remain unchanged.
+   */
+  void TestForgetThisSite() {
+    AssertIsOnGMPThread();
+    EXPECT_TRUE(IsGMPStorageIsEmpty());
+
+    // Generate storage data for some site.
+    CreateDecryptor(NS_LITERAL_STRING("example1.com"),
+                    NS_LITERAL_STRING("example2.com"),
+                    false);
+
+    nsCOMPtr<nsIRunnable> r = NS_NewRunnableMethod(
+        this, &GMPStorageTest::TestForgetThisSite_AnotherSite);
+    Expect(NS_LITERAL_CSTRING("test-storage complete"), r);
+    Update(NS_LITERAL_CSTRING("test-storage"));
+  }
+
+  void TestForgetThisSite_AnotherSite() {
+    Shutdown();
+
+    // Generate storage data for another site.
+    CreateDecryptor(NS_LITERAL_STRING("example3.com"),
+                    NS_LITERAL_STRING("example4.com"),
+                    false);
+
+    nsCOMPtr<nsIRunnable> r = NS_NewRunnableMethod(
+        this, &GMPStorageTest::TestForgetThisSite_CollectSiteInfo);
+    Expect(NS_LITERAL_CSTRING("test-storage complete"), r);
+    Update(NS_LITERAL_CSTRING("test-storage"));
+  }
+
+  struct NodeInfo {
+    explicit NodeInfo(const nsACString& aSite) : siteToForget(aSite) {}
+    nsCString siteToForget;
+    nsTArray<nsCString> expectedRemainingNodeIds;
+  };
+
+  class NodeIdCollector {
+  public:
+    explicit NodeIdCollector(NodeInfo* aInfo) : mNodeInfo(aInfo) {}
+    void operator()(nsIFile* aFile) {
+      nsCString salt;
+      nsresult rv = ReadSalt(aFile, salt);
+      ASSERT_TRUE(NS_SUCCEEDED(rv));
+      if (!MatchOrigin(aFile, mNodeInfo->siteToForget)) {
+        mNodeInfo->expectedRemainingNodeIds.AppendElement(salt);
+      }
+    }
+  private:
+    NodeInfo* mNodeInfo;
+  };
+
+  void TestForgetThisSite_CollectSiteInfo() {
+    nsAutoPtr<NodeInfo> siteInfo(
+        new NodeInfo(NS_LITERAL_CSTRING("example1.com")));
+    // Collect nodeIds that are expected to remain for later comparison.
+    EnumerateDir(NS_LITERAL_CSTRING("id"), NodeIdCollector(siteInfo));
+    // Invoke "Forget this site" on the main thread.
+    NS_DispatchToMainThread(NS_NewRunnableMethodWithArg<nsAutoPtr<NodeInfo>>(
+        this, &GMPStorageTest::TestForgetThisSite_Forget, siteInfo));
+  }
+
+  void TestForgetThisSite_Forget(nsAutoPtr<NodeInfo> aSiteInfo) {
+    nsRefPtr<GeckoMediaPluginService> service =
+        GeckoMediaPluginService::GetGeckoMediaPluginService();
+    service->ForgetThisSite(NS_ConvertUTF8toUTF16(aSiteInfo->siteToForget));
+
+    nsCOMPtr<nsIThread> thread;
+    service->GetThread(getter_AddRefs(thread));
+
+    nsCOMPtr<nsIRunnable> r = NS_NewRunnableMethodWithArg<nsAutoPtr<NodeInfo>>(
+        this, &GMPStorageTest::TestForgetThisSite_Verify, aSiteInfo);
+    thread->Dispatch(r, NS_DISPATCH_NORMAL);
+
+    nsCOMPtr<nsIRunnable> f = NS_NewRunnableMethod(
+        this, &GMPStorageTest::SetFinished);
+    thread->Dispatch(f, NS_DISPATCH_NORMAL);
+  }
+
+  class NodeIdVerifier {
+  public:
+    explicit NodeIdVerifier(const NodeInfo* aInfo)
+      : mNodeInfo(aInfo)
+      , mExpectedRemainingNodeIds(aInfo->expectedRemainingNodeIds) {}
+    void operator()(nsIFile* aFile) {
+      nsCString salt;
+      nsresult rv = ReadSalt(aFile, salt);
+      ASSERT_TRUE(NS_SUCCEEDED(rv));
+      // Shouldn't match the origin if we clear correctly.
+      EXPECT_FALSE(MatchOrigin(aFile, mNodeInfo->siteToForget));
+      // Check if remaining nodeIDs are as expected.
+      EXPECT_TRUE(mExpectedRemainingNodeIds.RemoveElement(salt));
+    }
+    ~NodeIdVerifier() {
+      EXPECT_TRUE(mExpectedRemainingNodeIds.IsEmpty());
+    }
+  private:
+    const NodeInfo* mNodeInfo;
+    nsTArray<nsCString> mExpectedRemainingNodeIds;
+  };
+
+  class StorageVerifier {
+  public:
+    explicit StorageVerifier(const NodeInfo* aInfo)
+      : mExpectedRemainingNodeIds(aInfo->expectedRemainingNodeIds) {}
+    void operator()(nsIFile* aFile) {
+      nsCString salt;
+      nsresult rv = aFile->GetNativeLeafName(salt);
+      ASSERT_TRUE(NS_SUCCEEDED(rv));
+      EXPECT_TRUE(mExpectedRemainingNodeIds.RemoveElement(salt));
+    }
+    ~StorageVerifier() {
+      EXPECT_TRUE(mExpectedRemainingNodeIds.IsEmpty());
+    }
+  private:
+    nsTArray<nsCString> mExpectedRemainingNodeIds;
+  };
+
+  void TestForgetThisSite_Verify(nsAutoPtr<NodeInfo> aSiteInfo) {
+    nsresult rv = EnumerateDir(
+        NS_LITERAL_CSTRING("id"), NodeIdVerifier(aSiteInfo));
+    EXPECT_TRUE(NS_SUCCEEDED(rv));
+
+    rv = EnumerateDir(
+        NS_LITERAL_CSTRING("storage"), StorageVerifier(aSiteInfo));
+    EXPECT_TRUE(NS_SUCCEEDED(rv));
+  }
+
   void TestCrossOriginStorage() {
     EXPECT_TRUE(!mDecryptor);
 
     // Open decryptor on one, origin, write a record, and test that that
     // record can't be read on another origin.
     CreateDecryptor(NS_LITERAL_STRING("example3.com"),
                     NS_LITERAL_STRING("example4.com"),
                     false);
@@ -813,16 +981,21 @@ TEST(GeckoMediaPlugins, GMPStorageGetNod
   runner->DoTest(&GMPStorageTest::TestGetNodeId);
 }
 
 TEST(GeckoMediaPlugins, GMPStorageBasic) {
   nsRefPtr<GMPStorageTest> runner = new GMPStorageTest();
   runner->DoTest(&GMPStorageTest::TestBasicStorage);
 }
 
+TEST(GeckoMediaPlugins, GMPStorageForgetThisSite) {
+  nsRefPtr<GMPStorageTest> runner = new GMPStorageTest();
+  runner->DoTest(&GMPStorageTest::TestForgetThisSite);
+}
+
 TEST(GeckoMediaPlugins, GMPStorageCrossOrigin) {
   nsRefPtr<GMPStorageTest> runner = new GMPStorageTest();
   runner->DoTest(&GMPStorageTest::TestCrossOriginStorage);
 }
 
 TEST(GeckoMediaPlugins, GMPStoragePrivateBrowsing) {
   nsRefPtr<GMPStorageTest> runner = new GMPStorageTest();
   runner->DoTest(&GMPStorageTest::TestPBStorage);
--- a/dom/media/test/test_bug448534.html
+++ b/dom/media/test/test_bug448534.html
@@ -23,17 +23,19 @@ function loaded(event) {
   if (v._finished)
     return;
   v.play();
 }
 
 function started(event) {
   var v = event.target;
   info(v.token + ": event=" + event.type);
-  if (v._finished)
+  // For a short file, it could reach the end before 'play' received. We will
+  // skip the test for 'paused' would be true when ended.
+  if (v._finished || v.ended)
     return;
   ok(!v.paused, v.token + ": Video should not be paused while playing");
   v.parentNode.removeChild(v);
   v._played = true;
 }
 
 function stopped(event) {
   var v = event.target;
--- a/extensions/spellcheck/locales/Makefile.in
+++ b/extensions/spellcheck/locales/Makefile.in
@@ -1,12 +1,7 @@
 # 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 $(topsrcdir)/config/rules.mk
-
 DICTIONARY_FILES = $(strip $(wildcard $(LOCALE_SRCDIR)/hunspell/*.dic) $(wildcard $(LOCALE_SRCDIR)/hunspell/*.aff))
-
-ifneq (,$(DICTIONARY_FILES))
-libs::
-	$(INSTALL)  $(DICTIONARY_FILES) $(FINAL_TARGET)/dictionaries
-endif
+DICTIONARY_DEST = $(FINAL_TARGET)/dictionaries
+INSTALL_TARGETS += DICTIONARY
--- a/gfx/thebes/gfxDWriteFontList.cpp
+++ b/gfx/thebes/gfxDWriteFontList.cpp
@@ -891,21 +891,16 @@ gfxDWriteFontList::InitFontList()
                       nullptr, nullptr, nowTime, 256);
         GetDateFormat(LOCALE_INVARIANT, 0, nullptr, nullptr, nowDate, 256);
     }
     upTime = (double) GetTickCount();
     QueryPerformanceFrequency(&frequency);
     QueryPerformanceCounter(&t1);
 
     HRESULT hr;
-    gfxFontCache *fc = gfxFontCache::GetCache();
-    if (fc) {
-        fc->AgeAllGenerations();
-    }
-
     mGDIFontTableAccess = Preferences::GetBool("gfx.font_rendering.directwrite.use_gdi_table_loading", false);
 
     gfxPlatformFontList::InitFontList();
 
     mFontSubstitutes.Clear();
     mNonExistingFonts.Clear();
 
     QueryPerformanceCounter(&t2);
--- a/gfx/thebes/gfxGDIFontList.cpp
+++ b/gfx/thebes/gfxGDIFontList.cpp
@@ -651,19 +651,16 @@ gfxGDIFontList::GetFontSubstitutes()
     }
     return NS_OK;
 }
 
 nsresult
 gfxGDIFontList::InitFontList()
 {
     Telemetry::AutoTimer<Telemetry::GDI_INITFONTLIST_TOTAL> timer;
-    gfxFontCache *fc = gfxFontCache::GetCache();
-    if (fc)
-        fc->AgeAllGenerations();
 
     // reset font lists
     gfxPlatformFontList::InitFontList();
     
     mFontSubstitutes.Clear();
     mNonExistingFonts.Clear();
 
     // iterate over available families
--- a/gfx/thebes/gfxMacPlatformFontList.h
+++ b/gfx/thebes/gfxMacPlatformFontList.h
@@ -88,18 +88,16 @@ public:
     
     virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
                                            uint16_t aWeight,
                                            int16_t aStretch,
                                            bool aItalic,
                                            const uint8_t* aFontData,
                                            uint32_t aLength);
 
-    void ClearPrefFonts() { mPrefFonts.Clear(); }
-
 private:
     friend class gfxPlatformMac;
 
     gfxMacPlatformFontList();
     virtual ~gfxMacPlatformFontList();
 
     // initialize font lists
     virtual nsresult InitFontList();
--- a/gfx/thebes/gfxPlatformFontList.cpp
+++ b/gfx/thebes/gfxPlatformFontList.cpp
@@ -194,16 +194,23 @@ gfxPlatformFontList::~gfxPlatformFontLis
     NS_ASSERTION(gFontListPrefObserver, "There is no font list pref observer");
     Preferences::RemoveObservers(gFontListPrefObserver, kObservedPrefs);
     NS_RELEASE(gFontListPrefObserver);
 }
 
 nsresult
 gfxPlatformFontList::InitFontList()
 {
+    // rebuilding fontlist so clear out font/word caches
+    gfxFontCache *fontCache = gfxFontCache::GetCache();
+    if (fontCache) {
+        fontCache->AgeAllGenerations();
+        fontCache->FlushShapedWordCaches();
+    }
+
     mFontFamilies.Clear();
     mOtherFamilyNames.Clear();
     mOtherFamilyNamesInitialized = false;
     if (mExtraNames) {
         mExtraNames->mFullnames.Clear();
         mExtraNames->mPostscriptNames.Clear();
     }
     mFaceNameListsInitialized = false;
--- a/gfx/thebes/gfxQtPlatform.h
+++ b/gfx/thebes/gfxQtPlatform.h
@@ -67,34 +67,29 @@ public:
 
     /**
      * Check whether format is supported on a platform or not (if unclear,
      * returns true).
      */
     virtual bool IsFontFormatSupported(nsIURI *aFontURI,
                                        uint32_t aFormatFlags) MOZ_OVERRIDE;
 
-    virtual void ClearPrefFonts() { mPrefFonts.Clear(); }
-
     static int32_t GetDPI();
 
     virtual gfxImageFormat GetOffscreenFormat() MOZ_OVERRIDE;
 #ifdef MOZ_X11
     static Display* GetXDisplay(QWindow* aWindow = 0);
     static Screen* GetXScreen(QWindow* aWindow = 0);
 #endif
 
     virtual int GetScreenDepth() const MOZ_OVERRIDE;
 
 protected:
     static gfxFontconfigUtils *sFontconfigUtils;
 
 private:
     virtual void GetPlatformCMSOutputProfile(void *&mem, size_t &size) MOZ_OVERRIDE;
 
-    // TODO: unify this with mPrefFonts (NB: holds families, not fonts) in gfxPlatformFontList
-    nsDataHashtable<nsCStringHashKey, nsTArray<nsRefPtr<gfxFontEntry> > > mPrefFonts;
-
     int mScreenDepth;
 };
 
 #endif /* GFX_PLATFORM_QT_H */
 
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -321,17 +321,16 @@ public:
         return NS_OK;
     }
 };
 
 NS_IMPL_ISUPPORTS(GPUAdapterReporter, nsIMemoryReporter)
 
 gfxWindowsPlatform::gfxWindowsPlatform()
   : mD3D11DeviceInitialized(false)
-  , mPrefFonts(32)
 {
     mUseClearTypeForDownloadableFonts = UNINITIALIZED_VALUE;
     mUseClearTypeAlways = UNINITIALIZED_VALUE;
 
     mUsingGDIFonts = false;
 
     /* 
      * Initialize COM 
@@ -1094,28 +1093,16 @@ gfxWindowsPlatform::GetPlatformCMSOutput
         fprintf(stderr,
                 "ICM profile read from %s successfully\n",
                 NS_ConvertUTF16toUTF8(str).get());
 #endif // DEBUG_tor
 #endif // _WIN32
 }
 
 bool
-gfxWindowsPlatform::GetPrefFontEntries(const nsCString& aKey, nsTArray<nsRefPtr<gfxFontEntry> > *array)
-{
-    return mPrefFonts.Get(aKey, array);
-}
-
-void
-gfxWindowsPlatform::SetPrefFontEntries(const nsCString& aKey, nsTArray<nsRefPtr<gfxFontEntry> >& array)
-{
-    mPrefFonts.Put(aKey, array);
-}
-
-bool
 gfxWindowsPlatform::UseClearTypeForDownloadableFonts()
 {
     if (mUseClearTypeForDownloadableFonts == UNINITIALIZED_VALUE) {
         mUseClearTypeForDownloadableFonts = Preferences::GetBool(GFX_DOWNLOADABLE_FONTS_USE_CLEARTYPE, true);
     }
 
     return mUseClearTypeForDownloadableFonts;
 }
--- a/gfx/thebes/gfxWindowsPlatform.h
+++ b/gfx/thebes/gfxWindowsPlatform.h
@@ -210,21 +210,16 @@ public:
     virtual bool IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags);
 
     virtual bool DidRenderingDeviceReset();
 
     /* Find a FontFamily/FontEntry object that represents a font on your system given a name */
     gfxFontFamily *FindFontFamily(const nsAString& aName);
     gfxFontEntry *FindFontEntry(const nsAString& aName, const gfxFontStyle& aFontStyle);
 
-    bool GetPrefFontEntries(const nsCString& aLangGroup, nsTArray<nsRefPtr<gfxFontEntry> > *array);
-    void SetPrefFontEntries(const nsCString& aLangGroup, nsTArray<nsRefPtr<gfxFontEntry> >& array);
-
-    void ClearPrefFonts() { mPrefFonts.Clear(); }
-
     // ClearType is not always enabled even when available (e.g. Windows XP)
     // if either of these prefs are enabled and apply, use ClearType rendering
     bool UseClearTypeForDownloadableFonts();
     bool UseClearTypeAlways();
 
     static void GetDLLVersion(char16ptr_t aDLLPath, nsAString& aVersion);
 
     // returns ClearType tuning information for each display
@@ -285,17 +280,14 @@ private:
     mozilla::RefPtr<IDXGIAdapter1> mAdapter;
     nsRefPtr<mozilla::layers::DeviceManagerD3D9> mDeviceManager;
     mozilla::RefPtr<ID3D11Device> mD3D11Device;
     mozilla::RefPtr<ID3D11Device> mD3D11ContentDevice;
     bool mD3D11DeviceInitialized;
     mozilla::RefPtr<mozilla::layers::ReadbackManagerD3D11> mD3D11ReadbackManager;
 
     virtual void GetPlatformCMSOutputProfile(void* &mem, size_t &size);
-
-    // TODO: unify this with mPrefFonts (NB: holds families, not fonts) in gfxPlatformFontList
-    nsDataHashtable<nsCStringHashKey, nsTArray<nsRefPtr<gfxFontEntry> > > mPrefFonts;
 };
 
 bool DoesD3D11TextureSharingWork(ID3D11Device *device);
 bool DoesD3D11DeviceWork(ID3D11Device *device);
 
 #endif /* GFX_WINDOWS_PLATFORM_H */
--- a/intl/chardet/nsCyrillicDetector.h
+++ b/intl/chardet/nsCyrillicDetector.h
@@ -87,41 +87,41 @@ class nsCyrXPCOMDetector :
       public nsICharsetDetector
 {
   public:
     // nsISupports interface
     NS_DECL_ISUPPORTS
     nsCyrXPCOMDetector(uint8_t aItems, 
                       const uint8_t ** aCyrillicClass, 
                       const char **aCharsets);
-    NS_IMETHOD Init(nsICharsetDetectionObserver* aObserver);
-    NS_IMETHOD DoIt(const char* aBuf, uint32_t aLen, bool *oDontFeedMe);
-    NS_IMETHOD Done();
+    NS_IMETHOD Init(nsICharsetDetectionObserver* aObserver) MOZ_OVERRIDE;
+    NS_IMETHOD DoIt(const char* aBuf, uint32_t aLen, bool *oDontFeedMe) MOZ_OVERRIDE;
+    NS_IMETHOD Done() MOZ_OVERRIDE;
   protected:
     virtual ~nsCyrXPCOMDetector();
-    virtual void Report(const char* aCharset);
+    virtual void Report(const char* aCharset) MOZ_OVERRIDE;
   private:
     nsCOMPtr<nsICharsetDetectionObserver> mObserver;
 };
 
 class nsCyrXPCOMStringDetector :  
       public nsCyrillicDetector,
       public nsIStringCharsetDetector
 {
   public:
     // nsISupports interface
     NS_DECL_ISUPPORTS
     nsCyrXPCOMStringDetector(uint8_t aItems, 
                       const uint8_t ** aCyrillicClass, 
                       const char **aCharsets);
     NS_IMETHOD DoIt(const char* aBuf, uint32_t aLen, 
-                     const char** oCharset, nsDetectionConfident &oConf);
+                     const char** oCharset, nsDetectionConfident &oConf) MOZ_OVERRIDE;
   protected:
     virtual ~nsCyrXPCOMStringDetector();
-    virtual void Report(const char* aCharset);
+    virtual void Report(const char* aCharset) MOZ_OVERRIDE;
   private:
     nsCOMPtr<nsICharsetDetectionObserver> mObserver;
     const char* mResult;
 };
 
 class nsRUProbDetector : public nsCyrXPCOMDetector
 {
   public:
--- a/intl/locale/mac/nsDateTimeFormatMac.h
+++ b/intl/locale/mac/nsDateTimeFormatMac.h
@@ -17,37 +17,37 @@ class nsDateTimeFormatMac : public nsIDa
 public: 
   NS_DECL_THREADSAFE_ISUPPORTS 
 
   // performs a locale sensitive date formatting operation on the time_t parameter
   NS_IMETHOD FormatTime(nsILocale* locale, 
                         const nsDateFormatSelector  dateFormatSelector, 
                         const nsTimeFormatSelector timeFormatSelector, 
                         const time_t  timetTime, 
-                        nsAString& stringOut); 
+                        nsAString& stringOut) MOZ_OVERRIDE; 
 
   // performs a locale sensitive date formatting operation on the struct tm parameter
   NS_IMETHOD FormatTMTime(nsILocale* locale, 
                           const nsDateFormatSelector  dateFormatSelector, 
                           const nsTimeFormatSelector timeFormatSelector, 
                           const struct tm*  tmTime, 
-                          nsAString& stringOut); 
+                          nsAString& stringOut) MOZ_OVERRIDE; 
   // performs a locale sensitive date formatting operation on the PRTime parameter
   NS_IMETHOD FormatPRTime(nsILocale* locale, 
                           const nsDateFormatSelector  dateFormatSelector, 
                           const nsTimeFormatSelector timeFormatSelector, 
                           const PRTime  prTime, 
-                          nsAString& stringOut);
+                          nsAString& stringOut) MOZ_OVERRIDE;
 
   // performs a locale sensitive date formatting operation on the PRExplodedTime parameter
   NS_IMETHOD FormatPRExplodedTime(nsILocale* locale, 
                                   const nsDateFormatSelector  dateFormatSelector, 
                                   const nsTimeFormatSelector timeFormatSelector, 
                                   const PRExplodedTime*  explodedTime, 
-                                  nsAString& stringOut); 
+                                  nsAString& stringOut) MOZ_OVERRIDE; 
 
   nsDateTimeFormatMac() {}
 
 protected:
   virtual ~nsDateTimeFormatMac() {}
 
 private:
   // init this interface to a specified locale
--- a/intl/locale/nsCollation.h
+++ b/intl/locale/nsCollation.h
@@ -18,17 +18,17 @@ class nsIUnicodeEncoder;
 // 
 class nsCollationFactory MOZ_FINAL : public nsICollationFactory {
 
   ~nsCollationFactory() {}
 
 public: 
   NS_DECL_ISUPPORTS 
 
-  NS_IMETHOD CreateCollation(nsILocale* locale, nsICollation** instancePtr);
+  NS_IMETHOD CreateCollation(nsILocale* locale, nsICollation** instancePtr) MOZ_OVERRIDE;
 
   nsCollationFactory() {}
 };
 
 
 struct nsCollation {
 
 public: 
--- a/intl/locale/nsLanguageAtomService.h
+++ b/intl/locale/nsLanguageAtomService.h
@@ -15,25 +15,25 @@
 
 class nsLanguageAtomService MOZ_FINAL : public nsILanguageAtomService
 {
 public:
   NS_DECL_ISUPPORTS
 
   // nsILanguageAtomService
   virtual nsIAtom*
-    LookupLanguage(const nsACString &aLanguage, nsresult *aError);
+    LookupLanguage(const nsACString &aLanguage, nsresult *aError) MOZ_OVERRIDE;
 
   virtual already_AddRefed<nsIAtom>
-    LookupCharSet(const nsACString& aCharSet);
+    LookupCharSet(const nsACString& aCharSet) MOZ_OVERRIDE;
 
-  virtual nsIAtom* GetLocaleLanguage(nsresult *aError);
+  virtual nsIAtom* GetLocaleLanguage(nsresult *aError) MOZ_OVERRIDE;
 
   virtual nsIAtom* GetLanguageGroup(nsIAtom *aLanguage,
-                                                nsresult *aError);
+                                                nsresult *aError) MOZ_OVERRIDE;
 
   nsLanguageAtomService();
 
 private:
   ~nsLanguageAtomService() { }
 
 protected:
   nsresult InitLangGroupTable();
--- a/intl/locale/nsPlatformCharset.h
+++ b/intl/locale/nsPlatformCharset.h
@@ -11,18 +11,18 @@ class nsPlatformCharset : public nsIPlat
 {
   NS_DECL_ISUPPORTS
 
 public:
 
   nsPlatformCharset();
 
   NS_IMETHOD Init();
-  NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsACString& oResult);
-  NS_IMETHOD GetDefaultCharsetForLocale(const nsAString& localeName, nsACString& oResult);
+  NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsACString& oResult) MOZ_OVERRIDE;
+  NS_IMETHOD GetDefaultCharsetForLocale(const nsAString& localeName, nsACString& oResult) MOZ_OVERRIDE;
 
 private:
   nsCString mCharset;
   nsString mLocale; // remember the locale & charset
 
   nsresult MapToCharset(nsAString& inANSICodePage, nsACString& outCharset);
   nsresult InitGetCharset(nsACString& oString);
   nsresult VerifyCharset(nsCString &aCharset);
--- a/intl/locale/nsScriptableDateFormat.cpp
+++ b/intl/locale/nsScriptableDateFormat.cpp
@@ -21,33 +21,33 @@ class nsScriptableDateFormat : public ns
                             nsDateFormatSelector dateFormatSelector, 
                             nsTimeFormatSelector timeFormatSelector, 
                             int32_t year, 
                             int32_t month, 
                             int32_t day, 
                             int32_t hour, 
                             int32_t minute, 
                             int32_t second, 
-                            char16_t **dateTimeString);
+                            char16_t **dateTimeString) MOZ_OVERRIDE;
 
   NS_IMETHOD FormatDate(const char16_t *locale, 
                         nsDateFormatSelector dateFormatSelector, 
                         int32_t year, 
                         int32_t month, 
                         int32_t day, 
-                        char16_t **dateString)
+                        char16_t **dateString) MOZ_OVERRIDE
                         {return FormatDateTime(locale, dateFormatSelector, kTimeFormatNone, 
                                                year, month, day, 0, 0, 0, dateString);}
 
   NS_IMETHOD FormatTime(const char16_t *locale, 
                         nsTimeFormatSelector timeFormatSelector, 
                         int32_t hour, 
                         int32_t minute, 
                         int32_t second, 
-                        char16_t **timeString)
+                        char16_t **timeString) MOZ_OVERRIDE
                         {return FormatDateTime(locale, kDateFormatNone, timeFormatSelector, 
                                                1999, 1, 1, hour, minute, second, timeString);}
 
   nsScriptableDateFormat() {}
 
 private:
   nsString mStringOut;   
 
--- a/intl/lwbrk/nsJISx4051LineBreaker.h
+++ b/intl/lwbrk/nsJISx4051LineBreaker.h
@@ -13,25 +13,25 @@ class nsJISx4051LineBreaker : public nsI
   NS_DECL_ISUPPORTS
 
 private:
   virtual ~nsJISx4051LineBreaker();
 
 public:
   nsJISx4051LineBreaker();
 
-  int32_t Next( const char16_t* aText, uint32_t aLen, uint32_t aPos);
+  int32_t Next( const char16_t* aText, uint32_t aLen, uint32_t aPos) MOZ_OVERRIDE;
 
-  int32_t Prev( const char16_t* aText, uint32_t aLen, uint32_t aPos);
+  int32_t Prev( const char16_t* aText, uint32_t aLen, uint32_t aPos) MOZ_OVERRIDE;
 
   virtual void GetJISx4051Breaks(const char16_t* aText, uint32_t aLength,
                                  uint8_t aBreakMode,
-                                 uint8_t* aBreakBefore);
+                                 uint8_t* aBreakBefore) MOZ_OVERRIDE;
   virtual void GetJISx4051Breaks(const uint8_t* aText, uint32_t aLength,
                                  uint8_t aBreakMode,
-                                 uint8_t* aBreakBefore);
+                                 uint8_t* aBreakBefore) MOZ_OVERRIDE;
 
 private:
   int32_t WordMove(const char16_t* aText, uint32_t aLen, uint32_t aPos,
                    int8_t aDirection);
 };
 
 #endif  /* nsJISx4051LineBreaker_h__ */
--- a/intl/lwbrk/nsSampleWordBreaker.h
+++ b/intl/lwbrk/nsSampleWordBreaker.h
@@ -22,21 +22,21 @@ typedef enum {
 class nsSampleWordBreaker : public nsIWordBreaker
 {
   NS_DECL_ISUPPORTS
 public:
 
   nsSampleWordBreaker() ;
 
   bool BreakInBetween(const char16_t* aText1 , uint32_t aTextLen1,
-                        const char16_t* aText2 , uint32_t aTextLen2);
+                        const char16_t* aText2 , uint32_t aTextLen2) MOZ_OVERRIDE;
   nsWordRange FindWord(const char16_t* aText1 , uint32_t aTextLen1,
-                       uint32_t aOffset);
+                       uint32_t aOffset) MOZ_OVERRIDE;
 
-  int32_t NextWord(const char16_t* aText, uint32_t aLen, uint32_t aPos);
+  int32_t NextWord(const char16_t* aText, uint32_t aLen, uint32_t aPos) MOZ_OVERRIDE;
 
 protected:
   uint8_t  GetClass(char16_t aChar);
 
   virtual ~nsSampleWordBreaker();
 };
 
 #endif  /* nsSampleWordBreaker_h__ */
--- a/intl/uconv/nsUCSupport.h
+++ b/intl/uconv/nsUCSupport.h
@@ -76,18 +76,18 @@ public:
   /**
    * Class constructor.
    */
   nsBasicDecoderSupport();
 
   //--------------------------------------------------------------------
   // Interface nsIUnicodeDecoder [declaration]
 
-  virtual void SetInputErrorBehavior(int32_t aBehavior);
-  virtual char16_t GetCharacterForUnMapped();
+  virtual void SetInputErrorBehavior(int32_t aBehavior) MOZ_OVERRIDE;
+  virtual char16_t GetCharacterForUnMapped() MOZ_OVERRIDE;
 
 protected:
   int32_t   mErrBehavior;
 
   /**
    * Class destructor.
    */
   virtual ~nsBasicDecoderSupport();
--- a/intl/uconv/nsUnicodeToUTF8.h
+++ b/intl/uconv/nsUnicodeToUTF8.h
@@ -39,26 +39,26 @@ public:
   /**
    * Class constructor.
    */
   nsUnicodeToUTF8() {mHighSurrogate = 0;}
 
   NS_IMETHOD Convert(const char16_t * aSrc, 
                      int32_t * aSrcLength, 
                      char * aDest, 
-                     int32_t * aDestLength);
+                     int32_t * aDestLength) MOZ_OVERRIDE;
 
-  NS_IMETHOD Finish(char * aDest, int32_t * aDestLength);
+  NS_IMETHOD Finish(char * aDest, int32_t * aDestLength) MOZ_OVERRIDE;
 
   NS_IMETHOD GetMaxLength(const char16_t * aSrc, int32_t aSrcLength, 
-      int32_t * aDestLength);
+      int32_t * aDestLength) MOZ_OVERRIDE;
 
-  NS_IMETHOD Reset() {mHighSurrogate = 0; return NS_OK;}
+  NS_IMETHOD Reset() MOZ_OVERRIDE {mHighSurrogate = 0; return NS_OK;}
 
   NS_IMETHOD SetOutputErrorBehavior(int32_t aBehavior, 
-    nsIUnicharEncoder * aEncoder, char16_t aChar) {return NS_OK;}
+    nsIUnicharEncoder * aEncoder, char16_t aChar) MOZ_OVERRIDE {return NS_OK;}
 
 protected:
   char16_t mHighSurrogate;
 
 };
 
 #endif /* nsUnicodeToUTF8_h___ */
--- a/intl/unicharutil/nsCaseConversionImp2.h
+++ b/intl/unicharutil/nsCaseConversionImp2.h
@@ -14,22 +14,22 @@
 class nsCaseConversionImp2 : public nsICaseConversion { 
   NS_DECL_THREADSAFE_ISUPPORTS 
 
 public:
   virtual ~nsCaseConversionImp2() { }
 
   static nsCaseConversionImp2* GetInstance();
 
-  NS_IMETHOD ToUpper(char16_t aChar, char16_t* aReturn);
+  NS_IMETHOD ToUpper(char16_t aChar, char16_t* aReturn) MOZ_OVERRIDE;
 
-  NS_IMETHOD ToLower(char16_t aChar, char16_t* aReturn);
+  NS_IMETHOD ToLower(char16_t aChar, char16_t* aReturn) MOZ_OVERRIDE;
 
-  NS_IMETHOD ToTitle(char16_t aChar, char16_t* aReturn);
+  NS_IMETHOD ToTitle(char16_t aChar, char16_t* aReturn) MOZ_OVERRIDE;
 
-  NS_IMETHOD ToUpper(const char16_t* anArray, char16_t* aReturn, uint32_t aLen);
+  NS_IMETHOD ToUpper(const char16_t* anArray, char16_t* aReturn, uint32_t aLen) MOZ_OVERRIDE;
 
-  NS_IMETHOD ToLower(const char16_t* anArray, char16_t* aReturn, uint32_t aLen);
+  NS_IMETHOD ToLower(const char16_t* anArray, char16_t* aReturn, uint32_t aLen) MOZ_OVERRIDE;
 
-  NS_IMETHOD CaseInsensitiveCompare(const char16_t* aLeft, const char16_t* aRight, uint32_t aLength, int32_t *aResult);
+  NS_IMETHOD CaseInsensitiveCompare(const char16_t* aLeft, const char16_t* aRight, uint32_t aLength, int32_t *aResult) MOZ_OVERRIDE;
 };
 
 #endif
--- a/intl/unicharutil/nsCategoryImp.h
+++ b/intl/unicharutil/nsCategoryImp.h
@@ -11,12 +11,12 @@ class nsCategoryImp : public nsIUGenCate
    NS_DECL_THREADSAFE_ISUPPORTS
    
 public:
    static nsCategoryImp* GetInstance();
     
    /**
     * Give a Unichar, return a nsUGenCategory
     */
-   virtual nsUGenCategory Get(uint32_t aChar);
+   virtual nsUGenCategory Get(uint32_t aChar) MOZ_OVERRIDE;
 };
 
 #endif  /* nsCategoryImp_h__ */
--- a/intl/unicharutil/nsEntityConverter.h
+++ b/intl/unicharutil/nsEntityConverter.h
@@ -34,20 +34,20 @@ public:
 	//
 	// nsISupports
 	//
 	NS_DECL_ISUPPORTS
 
 	//
 	// nsIEntityConverter
 	//
-	NS_IMETHOD ConvertUTF32ToEntity(uint32_t character, uint32_t entityVersion, char **_retval);
-	NS_IMETHOD ConvertToEntity(char16_t character, uint32_t entityVersion, char **_retval);
+	NS_IMETHOD ConvertUTF32ToEntity(uint32_t character, uint32_t entityVersion, char **_retval) MOZ_OVERRIDE;
+	NS_IMETHOD ConvertToEntity(char16_t character, uint32_t entityVersion, char **_retval) MOZ_OVERRIDE;
 
-	NS_IMETHOD ConvertToEntities(const char16_t *inString, uint32_t entityVersion, char16_t **_retval);
+	NS_IMETHOD ConvertToEntities(const char16_t *inString, uint32_t entityVersion, char16_t **_retval) MOZ_OVERRIDE;
 
 protected:
 
   // load a version property file and generate a version list (number/name pair)
   NS_IMETHOD LoadVersionPropertyFile();
 
   // map version number to version string
   const char16_t* GetVersionName(uint32_t versionNumber);
--- a/intl/unicharutil/nsSaveAsCharset.h
+++ b/intl/unicharutil/nsSaveAsCharset.h
@@ -32,21 +32,21 @@ public:
 	//
 	// nsISupports
 	//
 	NS_DECL_ISUPPORTS
 
 	//
 	// nsIEntityConverter
 	//
-  NS_IMETHOD Init(const char *charset, uint32_t attr, uint32_t entityVersion);
+  NS_IMETHOD Init(const char *charset, uint32_t attr, uint32_t entityVersion) MOZ_OVERRIDE;
 
-  NS_IMETHOD Convert(const char16_t *inString, char **_retval);
+  NS_IMETHOD Convert(const char16_t *inString, char **_retval) MOZ_OVERRIDE;
 
-  NS_IMETHODIMP GetCharset(char * *aCharset);
+  NS_IMETHODIMP GetCharset(char * *aCharset) MOZ_OVERRIDE;
 
 protected:
 
   virtual ~nsSaveAsCharset();
 
   NS_IMETHOD DoCharsetConversion(const char16_t *inString, char **outString);
 
   NS_IMETHOD DoConversionFallBack(uint32_t inUCS4, char *outString, int32_t bufferLength);
--- a/intl/unicharutil/nsUnicodeNormalizer.h
+++ b/intl/unicharutil/nsUnicodeNormalizer.h
@@ -15,20 +15,20 @@ nsresult NS_NewUnicodeNormalizer(nsISupp
 
 
 class nsUnicodeNormalizer : public nsIUnicodeNormalizer {
 public:
    nsUnicodeNormalizer();
 
    NS_DECL_ISUPPORTS 
 
-   NS_IMETHOD NormalizeUnicodeNFD( const nsAString& aSrc, nsAString& aDest);
-   NS_IMETHOD NormalizeUnicodeNFC( const nsAString& aSrc, nsAString& aDest);
-   NS_IMETHOD NormalizeUnicodeNFKD( const nsAString& aSrc, nsAString& aDest);
-   NS_IMETHOD NormalizeUnicodeNFKC( const nsAString& aSrc, nsAString& aDest);
+   NS_IMETHOD NormalizeUnicodeNFD( const nsAString& aSrc, nsAString& aDest) MOZ_OVERRIDE;
+   NS_IMETHOD NormalizeUnicodeNFC( const nsAString& aSrc, nsAString& aDest) MOZ_OVERRIDE;
+   NS_IMETHOD NormalizeUnicodeNFKD( const nsAString& aSrc, nsAString& aDest) MOZ_OVERRIDE;
+   NS_IMETHOD NormalizeUnicodeNFKC( const nsAString& aSrc, nsAString& aDest) MOZ_OVERRIDE;
 
    // low-level access to the composition data needed for HarfBuzz callbacks
    static bool Compose(uint32_t a, uint32_t b, uint32_t *ab);
    static bool DecomposeNonRecursively(uint32_t comp, uint32_t *c1, uint32_t *c2);
 
 private:
    virtual ~nsUnicodeNormalizer();
 };
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -1110,22 +1110,18 @@ Parser<ParseHandler>::functionBody(Funct
         return null();
 
     return pn;
 }
 
 /* See comment for use in Parser::functionDef. */
 template <>
 bool
-Parser<FullParseHandler>::makeDefIntoUse(Definition *dn, ParseNode *pn, JSAtom *atom,
-                                         bool *pbodyLevelHoistedUse)
-{
-    // See comment in addFreeVariablesFromLazyFunction.
-    *pbodyLevelHoistedUse = !!dn->dn_uses;
-
+Parser<FullParseHandler>::makeDefIntoUse(Definition *dn, ParseNode *pn, JSAtom *atom)
+{
     /* Turn pn into a definition. */
     pc->updateDecl(atom, pn);
 
     /* Change all uses of dn to be uses of pn. */
     for (ParseNode *pnu = dn->dn_uses; pnu; pnu = pnu->pn_link) {
         MOZ_ASSERT(pnu->isUsed());
         MOZ_ASSERT(!pnu->isDefn());
         pnu->pn_lexdef = (Definition *) pn;
@@ -1360,20 +1356,21 @@ AssociateUsesWithOuterDefinition(ParseNo
  * Beware: this function is called for functions nested in other functions or
  * global scripts but not for functions compiled through the Function
  * constructor or JSAPI. To always execute code when a function has finished
  * parsing, use Parser::functionBody.
  */
 template <>
 bool
 Parser<FullParseHandler>::leaveFunction(ParseNode *fn, ParseContext<FullParseHandler> *outerpc,
-                                        bool bodyLevelHoistedUse, FunctionSyntaxKind kind)
+                                        FunctionSyntaxKind kind)
 {
     outerpc->blockidGen = pc->blockidGen;
 
+    bool bodyLevel = outerpc->atBodyLevel();
     FunctionBox *funbox = fn->pn_funbox;
     MOZ_ASSERT(funbox == pc->sc->asFunctionBox());
 
     /* Propagate unresolved lexical names up to outerpc->lexdeps. */
     if (pc->lexdeps->count()) {
         for (AtomDefnRange r = pc->lexdeps->all(); !r.empty(); r.popFront()) {
             JSAtom *atom = r.front().key();
             Definition *dn = r.front().value().get<FullParseHandler>();
@@ -1433,35 +1430,43 @@ Parser<FullParseHandler>::leaveFunction(
              *
              * The dn == outer_dn case arises with generator expressions
              * (see LegacyCompExprTransplanter::transplant, the PN_CODE/PN_NAME
              * case), and nowhere else, currently.
              */
             if (dn != outer_dn) {
                 if (ParseNode *pnu = dn->dn_uses) {
                     // In ES6, lexical bindings cannot be accessed until
-                    // initialized. If we are parsing a function with a
-                    // hoisted body-level use, all free variables that get
-                    // linked to an outer lexical binding need to be marked as
-                    // needing dead zone checks. e.g.,
+                    // initialized. If we are parsing a body-level function,
+                    // it is hoisted to the top, so we conservatively mark all
+                    // uses linked to an outer lexical binding as needing TDZ
+                    // checks. e.g.,
                     //
                     // function outer() {
-                    //   inner();
+                    //   inner2();
                     //   function inner() { use(x); }
+                    //   function inner2() { inner(); }
                     //   let x;
                     // }
                     //
                     // The use of 'x' inside 'inner' needs to be marked.
                     //
+                    // Note that to not be fully conservative requires a call
+                    // graph analysis of all body-level functions to compute
+                    // the transitive closure of which hoisted body level use
+                    // of which function forces TDZ checks on which uses. This
+                    // is unreasonably difficult to do in a single pass parser
+                    // like ours.
+                    //
                     // Similarly, if we are closing over a lexical binding
                     // from another case in a switch, those uses also need to
                     // be marked as needing dead zone checks.
                     RootedAtom name(context, atom);
                     bool markUsesAsLexical = outer_dn->isLexical() &&
-                                             (bodyLevelHoistedUse ||
+                                             (bodyLevel ||
                                               IsNonDominatingInScopedSwitch(outerpc, name, outer_dn));
                     AssociateUsesWithOuterDefinition(pnu, dn, outer_dn, markUsesAsLexical);
                 }
 
                 outer_dn->pn_dflags |= dn->pn_dflags & ~PND_PLACEHOLDER;
             }
 
             /* Mark the outer dn as escaping. */
@@ -1472,22 +1477,22 @@ Parser<FullParseHandler>::leaveFunction(
     InternalHandle<Bindings*> bindings =
         InternalHandle<Bindings*>::fromMarkedLocation(&funbox->bindings);
     return pc->generateFunctionBindings(context, tokenStream, alloc, bindings);
 }
 
 template <>
 bool
 Parser<SyntaxParseHandler>::leaveFunction(Node fn, ParseContext<SyntaxParseHandler> *outerpc,
-                                          bool bodyLevelHoistedUse, FunctionSyntaxKind kind)
+                                          FunctionSyntaxKind kind)
 {
     outerpc->blockidGen = pc->blockidGen;
 
     FunctionBox *funbox = pc->sc->asFunctionBox();
-    return addFreeVariablesFromLazyFunction(funbox->function(), outerpc, bodyLevelHoistedUse);
+    return addFreeVariablesFromLazyFunction(funbox->function(), outerpc);
 }
 
 /*
  * defineArg is called for both the arguments of a regular function definition
  * and the arguments specified by the Function constructor.
  *
  * The 'disallowDuplicateArgs' bool indicates whether the use of another
  * feature (destructuring or default arguments) disables duplicate arguments.
@@ -1783,22 +1788,20 @@ Parser<ParseHandler>::functionArguments(
 
     return true;
 }
 
 template <>
 bool
 Parser<FullParseHandler>::checkFunctionDefinition(HandlePropertyName funName,
                                                   ParseNode **pn_, FunctionSyntaxKind kind,
-                                                  bool *pbodyProcessed,
-                                                  bool *pbodyLevelHoistedUse)
+                                                  bool *pbodyProcessed)
 {
     ParseNode *&pn = *pn_;
     *pbodyProcessed = false;
-    *pbodyLevelHoistedUse = false;
 
     /* Function statements add a binding to the enclosing scope. */
     bool bodyLevel = pc->atBodyLevel();
 
     if (kind == Statement) {
         /*
          * Handle redeclaration and optimize cases where we can statically bind the
          * function (thereby avoiding JSOP_DEFFUN and dynamic name lookup).
@@ -1838,17 +1841,17 @@ Parser<FullParseHandler>::checkFunctionD
                     // remains a definition. But change the function node pn so
                     // that it knows where the argument is located.
                     pn->setOp(JSOP_GETARG);
                     pn->setDefn(true);
                     pn->pn_cookie = dn->pn_cookie;
                     pn->pn_dflags |= PND_BOUND;
                     dn->markAsAssigned();
                 } else {
-                    if (!makeDefIntoUse(dn, pn, funName, pbodyLevelHoistedUse))
+                    if (!makeDefIntoUse(dn, pn, funName))
                         return false;
                 }
             }
         } else if (bodyLevel) {
             /*
              * If this function was used before it was defined, claim the
              * pre-created definition node for this function that primaryExpr
              * put in pc->lexdeps on first forward reference, and recycle pn.
@@ -1861,18 +1864,16 @@ Parser<FullParseHandler>::checkFunctionD
                 fn->pn_pos.end = pn->pn_pos.end;
 
                 fn->pn_body = nullptr;
                 fn->pn_cookie.makeFree();
 
                 pc->lexdeps->remove(funName);
                 handler.freeTree(pn);
                 pn = fn;
-
-                *pbodyLevelHoistedUse = true;
             }
 
             if (!pc->define(tokenStream, funName, pn, Definition::VAR))
                 return false;
         }
 
         if (bodyLevel) {
             MOZ_ASSERT(pn->functionIsHoisted());
@@ -1931,17 +1932,17 @@ Parser<FullParseHandler>::checkFunctionD
     if (LazyScript *lazyOuter = handler.lazyOuterFunction()) {
         JSFunction *fun = handler.nextLazyInnerFunction();
         MOZ_ASSERT(!fun->isLegacyGenerator());
         FunctionBox *funbox = newFunctionBox(pn, fun, pc, Directives(/* strict = */ false),
                                              fun->generatorKind());
         if (!funbox)
             return false;
 
-        if (!addFreeVariablesFromLazyFunction(fun, pc, *pbodyLevelHoistedUse))
+        if (!addFreeVariablesFromLazyFunction(fun, pc))
             return false;
 
         // The position passed to tokenStream.advance() is an offset of the sort
         // returned by userbuf.offset() and expected by userbuf.rawCharPtrAt(),
         // while LazyScript::{begin,end} offsets are relative to the outermost
         // script source.
         uint32_t userbufBase = lazyOuter->begin() - lazyOuter->column();
         tokenStream.advance(fun->lazyScript()->end() - userbufBase);
@@ -1961,24 +1962,22 @@ PropagateTransitiveParseFlags(const T *i
      outer->setBindingsAccessedDynamically();
    if (inner->hasDebuggerStatement())
      outer->setHasDebuggerStatement();
 }
 
 template <typename ParseHandler>
 bool
 Parser<ParseHandler>::addFreeVariablesFromLazyFunction(JSFunction *fun,
-                                                       ParseContext<ParseHandler> *pc,
-                                                       bool bodyLevelHoistedUse)
-{
-    MOZ_ASSERT_IF(bodyLevelHoistedUse, fun->displayAtom() && pc->atBodyLevel());
-
+                                                       ParseContext<ParseHandler> *pc)
+{
     // Update any definition nodes in this context according to free variables
     // in a lazily parsed inner function.
 
+    bool bodyLevel = pc->atBodyLevel();
     LazyScript *lazy = fun->lazyScript();
     LazyScript::FreeVariable *freeVariables = lazy->freeVariables();
     for (size_t i = 0; i < lazy->numFreeVariables(); i++) {
         JSAtom *atom = freeVariables[i].atom();
 
         // 'arguments' will be implicitly bound within the inner function.
         if (atom == context->names().arguments)
             continue;
@@ -2001,36 +2000,34 @@ Parser<ParseHandler>::addFreeVariablesFr
         // dead zone check.
         //
         // Subtlety: we don't need to check for closing over a non-dominating
         // lexical binding in a switch, as lexical declarations currently
         // disable syntax parsing. So a non-dominating but textually preceding
         // lexical declaration would have aborted syntax parsing, and a
         // textually following declaration would return true for
         // handler.isPlaceholderDefinition(dn) below.
-        if (handler.isPlaceholderDefinition(dn) || bodyLevelHoistedUse)
+        if (handler.isPlaceholderDefinition(dn) || bodyLevel)
             freeVariables[i].setIsHoistedUse();
 
         /* Mark the outer dn as escaping. */
         handler.setFlag(handler.getDefinitionNode(dn), PND_CLOSED);
     }
 
     PropagateTransitiveParseFlags(lazy, pc->sc);
     return true;
 }
 
 template <>
 bool
 Parser<SyntaxParseHandler>::checkFunctionDefinition(HandlePropertyName funName,
                                                     Node *pn, FunctionSyntaxKind kind,
-                                                    bool *pbodyProcessed,
-                                                    bool *pbodyLevelHoistedUse)
+                                                    bool *pbodyProcessed)
 {
     *pbodyProcessed = false;
-    *pbodyLevelHoistedUse = false;
 
     /* Function statements add a binding to the enclosing scope. */
     bool bodyLevel = pc->atBodyLevel();
 
     if (kind == Statement) {
         /*
          * Handle redeclaration and optimize cases where we can statically bind the
          * function (thereby avoiding JSOP_DEFFUN and dynamic name lookup).
@@ -2044,20 +2041,18 @@ Parser<SyntaxParseHandler>::checkFunctio
                 if (!AtomToPrintableString(context, funName, &name) ||
                     !report(ParseError, false, null(), JSMSG_REDECLARED_VAR,
                             Definition::kindString(dn), name.ptr()))
                 {
                     return false;
                 }
             }
         } else if (bodyLevel) {
-            if (pc->lexdeps.lookupDefn<SyntaxParseHandler>(funName)) {
-                *pbodyLevelHoistedUse = true;
+            if (pc->lexdeps.lookupDefn<SyntaxParseHandler>(funName))
                 pc->lexdeps->remove(funName);
-            }
 
             if (!pc->define(tokenStream, funName, *pn, Definition::VAR))
                 return false;
         }
 
         if (!bodyLevel && funName == context->names().arguments)
             pc->sc->setBindingsAccessedDynamically();
     }
@@ -2144,18 +2139,17 @@ Parser<ParseHandler>::functionDef(Handle
     MOZ_ASSERT_IF(kind == Statement, funName);
 
     /* Make a TOK_FUNCTION node. */
     Node pn = handler.newFunctionDefinition();
     if (!pn)
         return null();
 
     bool bodyProcessed;
-    bool bodyLevelHoistedUse;
-    if (!checkFunctionDefinition(funName, &pn, kind, &bodyProcessed, &bodyLevelHoistedUse))
+    if (!checkFunctionDefinition(funName, &pn, kind, &bodyProcessed))
         return null();
 
     if (bodyProcessed)
         return pn;
 
     RootedObject proto(context);
     if (generatorKind == StarGenerator) {
         // If we are off the main thread, the generator meta-objects have
@@ -2176,18 +2170,17 @@ Parser<ParseHandler>::functionDef(Handle
     // of directives.
     Directives directives(pc);
     Directives newDirectives = directives;
 
     TokenStream::Position start(keepAtoms);
     tokenStream.tell(&start);
 
     while (true) {
-        if (functionArgsAndBody(pn, fun, type, kind, generatorKind, directives, &newDirectives,
-                                bodyLevelHoistedUse))
+        if (functionArgsAndBody(pn, fun, type, kind, generatorKind, directives, &newDirectives))
             break;
         if (tokenStream.hadError() || directives == newDirectives)
             return null();
 
         // Assignment must be monotonic to prevent reparsing iloops
         MOZ_ASSERT_IF(directives.strict(), newDirectives.strict());
         MOZ_ASSERT_IF(directives.asmJS(), newDirectives.asmJS());
         directives = newDirectives;
@@ -2293,18 +2286,17 @@ Parser<SyntaxParseHandler>::finishFuncti
 }
 
 template <>
 bool
 Parser<FullParseHandler>::functionArgsAndBody(ParseNode *pn, HandleFunction fun,
                                               FunctionType type, FunctionSyntaxKind kind,
                                               GeneratorKind generatorKind,
                                               Directives inheritedDirectives,
-                                              Directives *newDirectives,
-                                              bool bodyLevelHoistedUse)
+                                              Directives *newDirectives)
 {
     ParseContext<FullParseHandler> *outerpc = pc;
 
     // Create box for fun->object early to protect against last-ditch GC.
     FunctionBox *funbox = newFunctionBox(pn, fun, pc, inheritedDirectives, generatorKind);
     if (!funbox)
         return false;
 
@@ -2346,17 +2338,17 @@ Parser<FullParseHandler>::functionArgsAn
             parser->tokenStream.tell(&position);
             if (!tokenStream.seek(position, parser->tokenStream))
                 return false;
 
             // Update the end position of the parse node.
             pn->pn_pos.end = tokenStream.currentToken().pos.end;
         }
 
-        if (!addFreeVariablesFromLazyFunction(fun, pc, bodyLevelHoistedUse))
+        if (!addFreeVariablesFromLazyFunction(fun, pc))
             return false;
 
         pn->pn_blockid = outerpc->blockid();
         PropagateTransitiveParseFlags(funbox, outerpc->sc);
         return true;
     } while (false);
 
     // Continue doing a full parse for this inner function.
@@ -2364,17 +2356,17 @@ Parser<FullParseHandler>::functionArgsAn
                                          outerpc->staticLevel + 1, outerpc->blockidGen,
                                          /* blockScopeDepth = */ 0);
     if (!funpc.init(tokenStream))
         return false;
 
     if (!functionArgsAndBodyGeneric(pn, fun, type, kind))
         return false;
 
-    if (!leaveFunction(pn, outerpc, bodyLevelHoistedUse, kind))
+    if (!leaveFunction(pn, outerpc, kind))
         return false;
 
     pn->pn_blockid = outerpc->blockid();
 
     /*
      * Fruit of the poisonous tree: if a closure contains a dynamic name access
      * (eval, with, etc), we consider the parent to do the same. The reason is
      * that the deoptimizing effects of dynamic name access apply equally to
@@ -2385,18 +2377,17 @@ Parser<FullParseHandler>::functionArgsAn
 }
 
 template <>
 bool
 Parser<SyntaxParseHandler>::functionArgsAndBody(Node pn, HandleFunction fun,
                                                 FunctionType type, FunctionSyntaxKind kind,
                                                 GeneratorKind generatorKind,
                                                 Directives inheritedDirectives,
-                                                Directives *newDirectives,
-                                                bool bodyLevelHoistedUse)
+                                                Directives *newDirectives)
 {
     ParseContext<SyntaxParseHandler> *outerpc = pc;
 
     // Create box for fun->object early to protect against last-ditch GC.
     FunctionBox *funbox = newFunctionBox(pn, fun, pc, inheritedDirectives, generatorKind);
     if (!funbox)
         return false;
 
@@ -2405,17 +2396,17 @@ Parser<SyntaxParseHandler>::functionArgs
                                            outerpc->staticLevel + 1, outerpc->blockidGen,
                                            /* blockScopeDepth = */ 0);
     if (!funpc.init(tokenStream))
         return false;
 
     if (!functionArgsAndBodyGeneric(pn, fun, type, kind))
         return false;
 
-    if (!leaveFunction(pn, outerpc, bodyLevelHoistedUse, kind))
+    if (!leaveFunction(pn, outerpc, kind))
         return false;
 
     // This is a lazy function inner to another lazy function. Remember the
     // inner function so that if the outer function is eventually parsed we do
     // not need any further parsing or processing of the inner function.
     MOZ_ASSERT(fun->lazyScript());
     return outerpc->innerFunctions.append(fun);
 }
@@ -7121,17 +7112,17 @@ Parser<ParseHandler>::generatorComprehen
 
     // Note that if we ever start syntax-parsing generators, we will also
     // need to propagate the closed-over variable set to the inner
     // lazyscript, as in finishFunctionDefinition.
     handler.setFunctionBody(genfn, body);
 
     PropagateTransitiveParseFlags(genFunbox, outerpc->sc);
 
-    if (!leaveFunction(genfn, outerpc, /* bodyLevelHoistedUse = */ false))
+    if (!leaveFunction(genfn, outerpc))
         return null();
 
     return genfn;
 }
 
 #if JS_HAS_GENERATOR_EXPRS
 
 /*
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -582,18 +582,17 @@ class Parser : private JS::AutoGCRooter,
      */
     bool functionArguments(FunctionSyntaxKind kind, Node *list, Node funcpn, bool *hasRest);
 
     Node functionDef(HandlePropertyName name, FunctionType type, FunctionSyntaxKind kind,
                      GeneratorKind generatorKind);
     bool functionArgsAndBody(Node pn, HandleFunction fun,
                              FunctionType type, FunctionSyntaxKind kind,
                              GeneratorKind generatorKind,
-                             Directives inheritedDirectives, Directives *newDirectives,
-                             bool bodyLevelHoistedUse);
+                             Directives inheritedDirectives, Directives *newDirectives);
 
     Node unaryOpExpr(ParseNodeKind kind, JSOp op, uint32_t begin);
 
     Node condition();
 
     Node generatorComprehensionLambda(GeneratorKind comprehensionKind, unsigned begin,
                                       Node innerStmt);
 
@@ -633,22 +632,21 @@ class Parser : private JS::AutoGCRooter,
         KeyedDestructuringAssignment,
         IncDecAssignment
     };
 
     bool checkAndMarkAsAssignmentLhs(Node pn, AssignmentFlavor flavor);
     bool matchInOrOf(bool *isForInp, bool *isForOfp);
 
     bool checkFunctionArguments();
-    bool makeDefIntoUse(Definition *dn, Node pn, JSAtom *atom, bool *pbodyLevelHoistedUse);
+    bool makeDefIntoUse(Definition *dn, Node pn, JSAtom *atom);
     bool checkFunctionDefinition(HandlePropertyName funName, Node *pn, FunctionSyntaxKind kind,
-                                 bool *pbodyProcessed, bool *pbodyLevelHoistedUse);
+                                 bool *pbodyProcessed);
     bool finishFunctionDefinition(Node pn, FunctionBox *funbox, Node prelude, Node body);
-    bool addFreeVariablesFromLazyFunction(JSFunction *fun, ParseContext<ParseHandler> *pc,
-                                          bool bodyLevelHoistedUse);
+    bool addFreeVariablesFromLazyFunction(JSFunction *fun, ParseContext<ParseHandler> *pc);
 
     bool isValidForStatementLHS(Node pn1, JSVersion version, bool forDecl, bool forEach,
                                 ParseNodeKind headKind);
     bool checkForHeadConstInitializers(Node pn1);
     bool checkAndMarkAsIncOperand(Node kid, TokenKind tt, bool preorder);
     bool checkStrictAssignment(Node lhs);
     bool checkStrictBinding(PropertyName *name, Node pn);
     bool defineArg(Node funcpn, HandlePropertyName name,
@@ -690,17 +688,17 @@ class Parser : private JS::AutoGCRooter,
 
     static Node null() { return ParseHandler::null(); }
 
     bool reportRedeclaration(Node pn, Definition::Kind redeclKind, HandlePropertyName name);
     bool reportBadReturn(Node pn, ParseReportKind kind, unsigned errnum, unsigned anonerrnum);
     DefinitionNode getOrCreateLexicalDependency(ParseContext<ParseHandler> *pc, JSAtom *atom);
 
     bool leaveFunction(Node fn, ParseContext<ParseHandler> *outerpc,
-                       bool bodyLevelHoistedUse, FunctionSyntaxKind kind = Expression);
+                       FunctionSyntaxKind kind = Expression);
 
     TokenPos pos() const { return tokenStream.currentToken().pos; }
 
     bool asmJS(Node list);
 
     void accumulateTelemetry();
 
     friend class LegacyCompExprTransplanter;
deleted file mode 100644
--- a/js/src/gc/ForkJoinNursery-inl.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- 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/. */
-
-#ifndef gc_ForkJoinNursery_inl_h
-#define gc_ForkJoinNursery_inl_h
-
-#ifdef JSGC_FJGENERATIONAL
-
-#include "gc/ForkJoinNursery.h"
-
-#include "jsgc.h"
-
-namespace js {
-namespace gc {
-
-// For the following two predicates we can't check the attributes on
-// the chunk trailer because it's not known whether addr points into a
-// chunk.
-//
-// A couple of optimizations are possible if performance is an issue:
-//
-//  - The loop can be unrolled, and we can arrange for all array entries
-//    to be valid for this purpose so that the bound is constant.
-//  - The per-chunk test can be reduced to testing whether the high bits
-//    of the object pointer and the high bits of the chunk pointer are
-//    the same (and the latter value is essentially space[i]).
-//    Note, experiments with that do not show an improvement yet.
-//  - Taken together, those optimizations yield code that is one LOAD,
-//    one XOR, and one AND for each chunk, with the result being true
-//    iff the resulting value is zero.
-//  - We can have multiple versions of the predicates, and those that
-//    take known-good GCThing types can go directly to the attributes;
-//    it may be possible to ensure that more calls use GCThing types.
-//    Note, this requires the worker ID to be part of the chunk
-//    attribute bit vector.
-//
-// Performance may not be an issue as there may be few survivors of a
-// collection in the ForkJoinNursery and few objects will be tested.
-// If so then the bulk of the calls may come from the code that scans
-// the roots.  Behavior will be workload-dependent however.
-
-MOZ_ALWAYS_INLINE bool
-ForkJoinNursery::isInsideNewspace(const void *addr)
-{
-    uintptr_t p = reinterpret_cast<uintptr_t>(addr);
-    for (unsigned i = 0 ; i <= currentChunk_ ; i++) {
-        if (p >= newspace[i]->start() && p < newspace[i]->end())
-            return true;
-    }
-    return false;
-}
-
-MOZ_ALWAYS_INLINE bool
-ForkJoinNursery::isInsideFromspace(const void *addr)
-{
-    uintptr_t p = reinterpret_cast<uintptr_t>(addr);
-    for (unsigned i = 0 ; i < numFromspaceChunks_ ; i++) {
-        if (p >= fromspace[i]->start() && p < fromspace[i]->end())
-            return true;
-    }
-    return false;
-}
-
-MOZ_ALWAYS_INLINE bool
-ForkJoinNursery::isForwarded(Cell *cell)
-{
-    MOZ_ASSERT(isInsideFromspace(cell));
-    const RelocationOverlay *overlay = RelocationOverlay::fromCell(cell);
-    return overlay->isForwarded();
-}
-
-template <typename T>
-MOZ_ALWAYS_INLINE bool
-ForkJoinNursery::getForwardedPointer(T **ref)
-{
-    MOZ_ASSERT(ref);
-    MOZ_ASSERT(isInsideFromspace(*ref));
-    const RelocationOverlay *overlay = RelocationOverlay::fromCell(*ref);
-    if (!overlay->isForwarded())
-        return false;
-    // This static_cast from Cell* restricts T to valid (GC thing) types.
-    *ref = static_cast<T *>(overlay->forwardingAddress());
-    return true;
-}
-
-} // namespace gc
-} // namespace js
-
-#endif // JSGC_FJGENERATIONAL
-
-#endif // gc_ForkJoinNursery_inl_h
deleted file mode 100644
--- a/js/src/gc/ForkJoinNursery.cpp
+++ /dev/null
@@ -1,932 +0,0 @@
-/* -*- 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/. */
-
-#ifdef JSGC_FJGENERATIONAL
-
-#include "gc/ForkJoinNursery-inl.h"
-
-#include "mozilla/IntegerPrintfMacros.h"
-
-#include "prmjtime.h"
-
-#include "gc/Heap.h"
-#include "jit/JitFrames.h"
-#include "jit/RematerializedFrame.h"
-#include "vm/ArrayObject.h"
-#include "vm/ForkJoin.h"
-
-#include "jsgcinlines.h"
-#include "gc/Nursery-inl.h"
-#include "vm/NativeObject-inl.h"
-
-// The ForkJoinNursery provides an object nursery for movable object
-// types for one ForkJoin worker thread.  There is a one-to-one
-// correspondence between ForkJoinNursery and ForkJoinContext.
-//
-// For a general overview of how the ForkJoinNursery fits into the
-// overall PJS system, see the comment block in vm/ForkJoin.h.
-//
-//
-// Invariants on the ForkJoinNursery:
-//
-// Let "the tenured area" from the point of view of one
-// ForkJoinNursery comprise the global tenured area and the nursery's
-// owning worker's private tenured area.  Then:
-//
-// - There can be pointers from the tenured area into a ForkJoinNursery,
-//   and from the ForkJoinNursery into the tenured area
-//
-// - There *cannot* be a pointer from one ForkJoinNursery into
-//   another, or from one private tenured area into another, or from a
-//   ForkJoinNursery into another worker's private tenured are or vice
-//   versa, or from any ForkJoinNursery or private tenured area into
-//   the normal Nursery.
-//
-// For those invariants to hold the normal Nursery must be empty before
-// a ForkJoin section.
-//
-//
-// General description:
-//
-// The nursery maintains a space into which small, movable objects
-// are allocated.  Other objects are allocated directly in the private
-// tenured area for the worker.
-//
-// If an allocation request can't be satisfied because the nursery is
-// full then a /minor collection/ is triggered without bailouts.  This
-// collection copies nursery-allocated objects reachable from the
-// worker's roots into a fresh space.  Then the old space is
-// discarded.
-//
-// Nurseries are maintained in 1MB chunks.  If the live data in a
-// nursery after a collection exceeds some set fraction (currently
-// 1/3) then the nursery is grown, independently of other nurseries.
-//
-// There is an upper limit on the number of chunks in a nursery.  If
-// the live data in a nursery after a collection exceeds the set
-// fraction and the nursery can't grow, then the next collection will
-// be an /evacuating collection/.
-//
-// An evacuating collection copies nursery-allocated objects reachable
-// from the worker's roots into the worker's private tenured area.
-//
-// If an allocation request in the tenured area - whether the request
-// comes from the mutator or from the garbage collector during
-// evacuation - can't be satisified because the tenured area is full,
-// then the worker bails out and triggers a full collection in the
-// ForkJoin worker's zone.  This is expected to happen very rarely in
-// practice.
-//
-// The roots for a collection in the ForkJoinNursery are: the frames
-// of the execution stack, any registered roots on the execution
-// stack, any objects in the private tenured area, and the ForkJoin
-// result object in the common tenured area.
-//
-// The entire private tenured area is considered to be rooted in order
-// not to have to run write barriers during the ForkJoin section.
-// During a minor or evacuating collection in a worker the GC will
-// step through the worker's tenured area, examining each object for
-// pointers into the nursery.
-//
-// The ForkJoinNursery contains its own object tracing machinery for
-// most of the types that can be allocated in the nursery.  But it
-// does not handle all types, and there are two places where the code
-// in ForkJoinNursery loses control of the tracing:
-//
-// - When calling clasp->trace() in traceObject()
-// - When calling MarkForkJoinStack() in forwardFromStack()
-//
-// In both cases:
-//
-// - We pass a ForkJoinNurseryCollectionTracer object with a callback
-//   to ForkJoinNursery::MinorGCCallback
-//
-// - We should only ever end up in MarkInternal() in Marking.cpp, in
-//   the case in that code that calls back to trc->callback.  We
-//   should /never/ end up in functions that trigger use of the mark
-//   stack internal to the general GC's marker.
-//
-// - Any function along the path to MarkInternal() that asks about
-//   whether something is in the nursery or is tenured /must/ be aware
-//   that there can be multiple nursery and tenured areas; assertions
-//   get this wrong a lot of the time and must be fixed when they do.
-//   In practice, such code either must have a case for each nursery
-//   kind or must use the IsInsideNursery(Cell*) method, which looks
-//   only at the chunk tag.
-//
-//
-// Terminological note:
-//
-// - While the mutator is running it is allocating in what's known as
-//   the nursery's "newspace".  The mutator may also allocate directly
-//   in the tenured space, but the tenured space is not part of the
-//   newspace.
-//
-// - While the gc is running, the previous "newspace" has been renamed
-//   as the gc's "fromspace", and the space that objects are copied
-//   into is known as the "tospace".  The tospace may be a nursery
-//   space (during a minor collection), or it may be a tenured space
-//   (during an evacuation collection), but it's always one or the
-//   other, never a combination.  After gc the fromspace is always
-//   discarded.
-//
-// - If the gc copies objects into a nursery tospace then this tospace
-//   becomes known as the "newspace" following gc.  Otherwise, a new
-//   newspace won't be needed (if the parallel section is finished) or
-//   can be created empty (if the gc just needed to evacuate).
-//
-
-namespace js {
-namespace gc {
-
-ForkJoinNursery::ForkJoinNursery(ForkJoinContext *cx, ForkJoinGCShared *shared, Allocator *tenured)
-  : cx_(cx)
-  , tenured_(tenured)
-  , shared_(shared)
-  , evacuationZone_(nullptr)
-  , currentStart_(0)
-  , currentEnd_(0)
-  , position_(0)
-  , currentChunk_(0)
-  , numActiveChunks_(0)
-  , numFromspaceChunks_(0)
-  , mustEvacuate_(false)
-  , isEvacuating_(false)
-  , movedSize_(0)
-  , head_(nullptr)
-  , tail_(&head_)
-  , hugeSlotsNew(0)
-  , hugeSlotsFrom(1)
-{
-    for ( size_t i=0 ; i < MaxNurseryChunks ; i++ ) {
-        newspace[i] = nullptr;
-        fromspace[i] = nullptr;
-    }
-}
-
-ForkJoinNursery::~ForkJoinNursery()
-{
-    for ( size_t i=0 ; i < numActiveChunks_ ; i++ ) {
-        if (newspace[i])
-            shared_->freeNurseryChunk(newspace[i]);
-    }
-}
-
-bool
-ForkJoinNursery::initialize()
-{
-    if (!hugeSlots[hugeSlotsNew].init() || !hugeSlots[hugeSlotsFrom].init())
-        return false;
-    if (!initNewspace())
-        return false;
-    return true;
-}
-
-void
-ForkJoinNursery::minorGC()
-{
-    if (mustEvacuate_) {
-        mustEvacuate_ = false;
-        pjsCollection(Evacuate|Recreate);
-    } else {
-        pjsCollection(Collect|Recreate);
-    }
-}
-
-void
-ForkJoinNursery::evacuatingGC()
-{
-    pjsCollection(Evacuate);
-}
-
-#define TIME_START(name) int64_t timstampStart_##name = PRMJ_Now()
-#define TIME_END(name) int64_t timstampEnd_##name = PRMJ_Now()
-#define TIME_TOTAL(name) (timstampEnd_##name - timstampStart_##name)
-
-void
-ForkJoinNursery::pjsCollection(int op)
-{
-    MOZ_ASSERT((op & Collect) != (op & Evacuate));
-
-    bool evacuate = op & Evacuate;
-    bool recreate = op & Recreate;
-
-    MOZ_ASSERT(!isEvacuating_);
-    MOZ_ASSERT(!evacuationZone_);
-    MOZ_ASSERT(!head_);
-    MOZ_ASSERT(tail_ == &head_);
-
-    JSRuntime *const rt = shared_->runtime();
-    const unsigned currentNumActiveChunks_ = numActiveChunks_;
-    const char *msg = "";
-
-    MOZ_ASSERT(!rt->needsIncrementalBarrier());
-
-    TIME_START(pjsCollection);
-
-    rt->gc.incFJMinorCollecting();
-    if (evacuate) {
-        isEvacuating_ = true;
-        evacuationZone_ = shared_->zone();
-    }
-
-    flip();
-    if (recreate) {
-        if (!initNewspace())
-            CrashAtUnhandlableOOM("Cannot expand PJS nursery during GC");
-        // newspace must be at least as large as fromSpace
-        numActiveChunks_ = currentNumActiveChunks_;
-    }
-    ForkJoinNurseryCollectionTracer trc(rt, this);
-    forwardFromRoots(&trc);
-    collectToFixedPoint(&trc);
-    jit::UpdateJitActivationsForMinorGC<ForkJoinNursery>(TlsPerThreadData.get(), &trc);
-    freeFromspace();
-
-    size_t live = movedSize_;
-    computeNurserySizeAfterGC(live, &msg);
-
-    sweepHugeSlots();
-    MOZ_ASSERT(hugeSlots[hugeSlotsFrom].empty());
-    MOZ_ASSERT_IF(isEvacuating_, hugeSlots[hugeSlotsNew].empty());
-
-    isEvacuating_ = false;
-    evacuationZone_ = nullptr;
-    head_ = nullptr;
-    tail_ = &head_;
-    movedSize_ = 0;
-
-    rt->gc.decFJMinorCollecting();
-
-    TIME_END(pjsCollection);
-
-    // Note, the spew is awk-friendly, non-underlined words serve as markers:
-    //   FJGC _tag_ us _value_ copied _value_ size _value_ _message-word_ ...
-    shared_->spewGC("FJGC %s us %5" PRId64 "  copied %7" PRIu64 "  size %" PRIu64 "  %s",
-                    (evacuate ? "evacuate " : "collect  "),
-                    TIME_TOTAL(pjsCollection),
-                    (uint64_t)live,
-                    (uint64_t)numActiveChunks_*1024*1024,
-                    msg);
-}
-
-#undef TIME_START
-#undef TIME_END
-#undef TIME_TOTAL
-
-void
-ForkJoinNursery::computeNurserySizeAfterGC(size_t live, const char **msg)
-{
-    // Grow the nursery if it is too full.  Do not bother to shrink it - lazy
-    // chunk allocation means that a too-large nursery will not really be a problem,
-    // the entire nursery will be deallocated soon anyway.
-    if (live * NurseryLoadFactor > numActiveChunks_ * ForkJoinNurseryChunk::UsableSize) {
-        if (numActiveChunks_ < MaxNurseryChunks) {
-            while (numActiveChunks_ < MaxNurseryChunks &&
-                   live * NurseryLoadFactor > numActiveChunks_ * ForkJoinNurseryChunk::UsableSize)
-            {
-                ++numActiveChunks_;
-            }
-        } else {
-            // Evacuation will tend to drive us toward the cliff of a bailout GC, which
-            // is not good, probably worse than working within the thread at a higher load
-            // than desirable.
-            //
-            // Thus it's possible to be more sophisticated than this:
-            //
-            // - evacuate only after several minor GCs in a row exceeded the set load
-            // - evacuate only if significantly less space than required is available, eg,
-            //   if only 1/2 the required free space is available
-            *msg = "  Overfull, will evacuate next";
-            mustEvacuate_ = true;
-        }
-    }
-}
-
-void
-ForkJoinNursery::flip()
-{
-    size_t i;
-    for (i=0; i < numActiveChunks_; i++) {
-        if (!newspace[i])
-            break;
-        fromspace[i] = newspace[i];
-        newspace[i] = nullptr;
-        fromspace[i]->trailer.location = gc::ChunkLocationBitPJSFromspace;
-    }
-    numFromspaceChunks_ = i;
-    numActiveChunks_ = 0;
-
-    int tmp = hugeSlotsNew;
-    hugeSlotsNew = hugeSlotsFrom;
-    hugeSlotsFrom = tmp;
-
-    MOZ_ASSERT(hugeSlots[hugeSlotsNew].empty());
-}
-
-void
-ForkJoinNursery::freeFromspace()
-{
-    for (size_t i=0; i < numFromspaceChunks_; i++) {
-        shared_->freeNurseryChunk(fromspace[i]);
-        fromspace[i] = nullptr;
-    }
-    numFromspaceChunks_ = 0;
-}
-
-bool
-ForkJoinNursery::initNewspace()
-{
-    MOZ_ASSERT(newspace[0] == nullptr);
-    MOZ_ASSERT(numActiveChunks_ == 0);
-
-    numActiveChunks_ = 1;
-    return setCurrentChunk(0);
-}
-
-MOZ_ALWAYS_INLINE bool
-ForkJoinNursery::shouldMoveObject(void **thingp)
-{
-    // Note that thingp must really be a T** where T is some GCThing,
-    // ie, something that lives in a chunk (or nullptr).  This should
-    // be the case because the MinorGCCallback is only called on exact
-    // roots on the stack or slots within in tenured objects and not
-    // on slot/element arrays that can be malloc'd; they are forwarded
-    // using the forwardBufferPointer() mechanism.
-    //
-    // The main reason for that restriction is so that we can call a
-    // method here that can check the chunk trailer for the cell (a
-    // future optimization).
-    Cell **cellp = reinterpret_cast<Cell **>(thingp);
-    return isInsideFromspace(*cellp) && !getForwardedPointer(cellp);
-}
-
-/* static */ void
-ForkJoinNursery::MinorGCCallback(JSTracer *trcArg, void **thingp, JSGCTraceKind traceKind)
-{
-    // traceKind can be all sorts of things, when we're marking from stack roots
-    ForkJoinNursery *nursery = static_cast<ForkJoinNurseryCollectionTracer *>(trcArg)->nursery_;
-    if (nursery->shouldMoveObject(thingp)) {
-        // When other types of objects become nursery-allocable then the static_cast
-        // to JSObject * will no longer be valid.
-        MOZ_ASSERT(traceKind == JSTRACE_OBJECT);
-        *thingp = nursery->moveObjectToTospace(static_cast<JSObject *>(*thingp));
-    }
-}
-
-void
-ForkJoinNursery::forwardFromRoots(ForkJoinNurseryCollectionTracer *trc)
-{
-    // There should be no other roots as a result of effect-freedom.
-    forwardFromUpdatable(trc);
-    forwardFromStack(trc);
-    forwardFromTenured(trc);
-    forwardFromRematerializedFrames(trc);
-}
-
-void
-ForkJoinNursery::forwardFromUpdatable(ForkJoinNurseryCollectionTracer *trc)
-{
-    JSObject *obj = shared_->updatable();
-    if (obj)
-        traceObject(trc, obj);
-}
-
-void
-ForkJoinNursery::forwardFromStack(ForkJoinNurseryCollectionTracer *trc)
-{
-    MarkForkJoinStack(trc);
-}
-
-void
-ForkJoinNursery::forwardFromTenured(ForkJoinNurseryCollectionTracer *trc)
-{
-    JSObject *objs[ArenaCellCount];
-    ArenaLists &lists = tenured_->arenas;
-    for (size_t k=0; k < FINALIZE_LIMIT; k++) {
-        AllocKind kind = (AllocKind)k;
-        if (!IsFJNurseryAllocable(kind))
-            continue;
-
-        // When non-JSObject types become nursery-allocable the assumptions in the
-        // loops below will no longer hold; other types than JSObject must be
-        // handled.
-        MOZ_ASSERT(kind <= FINALIZE_OBJECT_LAST);
-
-        // Clear the free list that we're currently allocating out of.
-        lists.purge(kind);
-
-        // Since we only purge once, there must not currently be any partially
-        // full arenas left to allocate out of, or we would break out early.
-        MOZ_ASSERT(!lists.getArenaAfterCursor(kind));
-
-        ArenaIter ai;
-        ai.init(const_cast<Allocator *>(tenured_), kind);
-        for (; !ai.done(); ai.next()) {
-            if (isEvacuating_ && lists.arenaIsInUse(ai.get(), kind))
-                break;
-            // Use ArenaCellIterUnderFinalize, not ...UnderGC, because that side-steps
-            // some assertions in the latter that are wrong for PJS collection.
-            size_t numObjs = 0;
-            for (ArenaCellIterUnderFinalize i(ai.get()); !i.done(); i.next())
-                objs[numObjs++] = i.get<JSObject>();
-            for (size_t i=0; i < numObjs; i++)
-                traceObject(trc, objs[i]);
-        }
-    }
-}
-
-void
-ForkJoinNursery::forwardFromRematerializedFrames(ForkJoinNurseryCollectionTracer *trc)
-{
-    if (cx_->bailoutRecord->hasFrames())
-        jit::RematerializedFrame::MarkInVector(trc, cx_->bailoutRecord->frames());
-}
-
-/*static*/ void
-ForkJoinNursery::forwardBufferPointer(JSTracer *trc, HeapSlot **pSlotsElems)
-{
-    ForkJoinNursery *nursery = static_cast<ForkJoinNurseryCollectionTracer *>(trc)->nursery_;
-    HeapSlot *old = *pSlotsElems;
-
-    if (!nursery->isInsideFromspace(old))
-        return;
-
-    // If the elements buffer is zero length, the "first" item could be inside
-    // of the next object or past the end of the allocable area.  However,
-    // since we always store the runtime as the last word in a nursery chunk,
-    // isInsideFromspace will still be true, even if this zero-size allocation
-    // abuts the end of the allocable area. Thus, it is always safe to read the
-    // first word of |old| here.
-    *pSlotsElems = *reinterpret_cast<HeapSlot **>(old);
-    MOZ_ASSERT(!nursery->isInsideFromspace(*pSlotsElems));
-}
-
-void
-ForkJoinNursery::collectToFixedPoint(ForkJoinNurseryCollectionTracer *trc)
-{
-    for (RelocationOverlay *p = head_; p; p = p->next())
-        traceObject(trc, static_cast<JSObject *>(p->forwardingAddress()));
-}
-
-inline bool
-ForkJoinNursery::setCurrentChunk(int index)
-{
-    MOZ_ASSERT((size_t)index < numActiveChunks_);
-    MOZ_ASSERT(!newspace[index]);
-
-    currentChunk_ = index;
-    ForkJoinNurseryChunk *c = shared_->allocateNurseryChunk();
-    if (!c)
-        return false;
-    c->trailer.runtime = shared_->runtime();
-    c->trailer.location = gc::ChunkLocationBitPJSNewspace;
-    c->trailer.storeBuffer = nullptr;
-    currentStart_ = c->start();
-    currentEnd_ = c->end();
-    position_ = currentStart_;
-    newspace[index] = c;
-    return true;
-}
-
-void *
-ForkJoinNursery::allocate(size_t size)
-{
-    MOZ_ASSERT(position_ >= currentStart_);
-
-    if (currentEnd_ - position_ < size) {
-        if (currentChunk_ + 1 == numActiveChunks_)
-            return nullptr;
-        // Failure to allocate on growth is treated the same as exhaustion
-        // of the nursery.  If this happens during normal execution then
-        // we'll trigger a minor collection.  That collection will likely
-        // fail to obtain a block for the new tospace, and we'll go OOM
-        // immediately; that's expected and acceptable.  If we do continue
-        // to run (because some other thread or process has freed the memory)
-        // then so much the better.
-        if (!setCurrentChunk(currentChunk_ + 1))
-            return nullptr;
-    }
-
-    void *thing = reinterpret_cast<void *>(position_);
-    position_ += size;
-
-    JS_POISON(thing, JS_ALLOCATED_NURSERY_PATTERN, size);
-    return thing;
-}
-
-JSObject *
-ForkJoinNursery::allocateObject(size_t baseSize, size_t numDynamic, bool& tooLarge)
-{
-    // Ensure there's enough space to replace the contents with a RelocationOverlay.
-    MOZ_ASSERT(baseSize >= sizeof(js::gc::RelocationOverlay));
-
-    // Too-large slot arrays cannot be accomodated.
-    if (numDynamic > MaxNurserySlots) {
-        tooLarge = true;
-        return nullptr;
-    }
-
-    // Allocate slots contiguously after the object.
-    size_t totalSize = baseSize + sizeof(HeapSlot) * numDynamic;
-    JSObject *obj = static_cast<JSObject *>(allocate(totalSize));
-    if (!obj) {
-        tooLarge = false;
-        return nullptr;
-    }
-    obj->setInitialSlotsMaybeNonNative(numDynamic
-                                       ? reinterpret_cast<HeapSlot *>(size_t(obj) + baseSize)
-                                       : nullptr);
-    return obj;
-}
-
-HeapSlot *
-ForkJoinNursery::allocateSlots(JSObject *obj, uint32_t nslots)
-{
-    MOZ_ASSERT(obj);
-    MOZ_ASSERT(nslots > 0);
-
-    if (nslots & mozilla::tl::MulOverflowMask<sizeof(HeapSlot)>::value)
-        return nullptr;
-
-    if (!isInsideNewspace(obj))
-        return obj->zone()->pod_malloc<HeapSlot>(nslots);
-
-    if (nslots > MaxNurserySlots)
-        return allocateHugeSlots(obj, nslots);
-
-    size_t size = nslots * sizeof(HeapSlot);
-    HeapSlot *slots = static_cast<HeapSlot *>(allocate(size));
-    if (slots)
-        return slots;
-
-    return allocateHugeSlots(obj, nslots);
-}
-
-HeapSlot *
-ForkJoinNursery::reallocateSlots(JSObject *obj, HeapSlot *oldSlots,
-                                 uint32_t oldCount, uint32_t newCount)
-{
-    if (newCount & mozilla::tl::MulOverflowMask<sizeof(HeapSlot)>::value)
-        return nullptr;
-
-    if (!isInsideNewspace(obj)) {
-        MOZ_ASSERT_IF(oldSlots, !isInsideNewspace(oldSlots));
-        return obj->zone()->pod_realloc<HeapSlot>(oldSlots, oldCount, newCount);
-    }
-
-    if (!isInsideNewspace(oldSlots))
-        return reallocateHugeSlots(obj, oldSlots, oldCount, newCount);
-
-    // No-op if we're shrinking, we can't make use of the freed portion.
-    if (newCount < oldCount)
-        return oldSlots;
-
-    HeapSlot *newSlots = allocateSlots(obj, newCount);
-    if (!newSlots)
-        return nullptr;
-
-    size_t oldSize = oldCount * sizeof(HeapSlot);
-    js_memcpy(newSlots, oldSlots, oldSize);
-    return newSlots;
-}
-
-ObjectElements *
-ForkJoinNursery::allocateElements(JSObject *obj, uint32_t nelems)
-{
-    MOZ_ASSERT(nelems >= ObjectElements::VALUES_PER_HEADER);
-    return reinterpret_cast<ObjectElements *>(allocateSlots(obj, nelems));
-}
-
-ObjectElements *
-ForkJoinNursery::reallocateElements(JSObject *obj, ObjectElements *oldHeader,
-                                    uint32_t oldCount, uint32_t newCount)
-{
-    HeapSlot *slots = reallocateSlots(obj, reinterpret_cast<HeapSlot *>(oldHeader),
-                                      oldCount, newCount);
-    return reinterpret_cast<ObjectElements *>(slots);
-}
-
-void
-ForkJoinNursery::freeSlots(HeapSlot *slots)
-{
-    if (!isInsideNewspace(slots)) {
-        hugeSlots[hugeSlotsNew].remove(slots);
-        js_free(slots);
-    }
-}
-
-HeapSlot *
-ForkJoinNursery::allocateHugeSlots(JSObject *obj, size_t nslots)
-{
-    if (nslots & mozilla::tl::MulOverflowMask<sizeof(HeapSlot)>::value)
-        return nullptr;
-
-    HeapSlot *slots = obj->zone()->pod_malloc<HeapSlot>(nslots);
-    if (!slots)
-        return slots;
-
-    // If this put fails, we will only leak the slots.
-    (void)hugeSlots[hugeSlotsNew].put(slots);
-    return slots;
-}
-
-HeapSlot *
-ForkJoinNursery::reallocateHugeSlots(JSObject *obj, HeapSlot *oldSlots,
-                                     uint32_t oldCount, uint32_t newCount)
-{
-    HeapSlot *newSlots = obj->zone()->pod_realloc<HeapSlot>(oldSlots, oldCount, newCount);
-    if (!newSlots)
-        return newSlots;
-
-    if (oldSlots != newSlots) {
-        hugeSlots[hugeSlotsNew].remove(oldSlots);
-        // If this put fails, we will only leak the slots.
-        (void)hugeSlots[hugeSlotsNew].put(newSlots);
-    }
-    return newSlots;
-}
-
-void
-ForkJoinNursery::sweepHugeSlots()
-{
-    for (HugeSlotsSet::Range r = hugeSlots[hugeSlotsFrom].all(); !r.empty(); r.popFront())
-        js_free(r.front());
-    hugeSlots[hugeSlotsFrom].clear();
-}
-
-MOZ_ALWAYS_INLINE void
-ForkJoinNursery::traceObject(ForkJoinNurseryCollectionTracer *trc, JSObject *obj)
-{
-    const Class *clasp = obj->getClass();
-    if (clasp->trace)
-        clasp->trace(trc, obj);
-
-    if (!obj->isNative())
-        return;
-    NativeObject *nobj = &obj->as<NativeObject>();
-
-    if (!nobj->hasEmptyElements())
-        markSlots(nobj->getDenseElements(), nobj->getDenseInitializedLength());
-
-    HeapSlot *fixedStart, *fixedEnd, *dynStart, *dynEnd;
-    nobj->getSlotRange(0, nobj->slotSpan(), &fixedStart, &fixedEnd, &dynStart, &dynEnd);
-    markSlots(fixedStart, fixedEnd);
-    markSlots(dynStart, dynEnd);
-}
-
-MOZ_ALWAYS_INLINE void
-ForkJoinNursery::markSlots(HeapSlot *vp, uint32_t nslots)
-{
-    markSlots(vp, vp + nslots);
-}
-
-MOZ_ALWAYS_INLINE void
-ForkJoinNursery::markSlots(HeapSlot *vp, HeapSlot *end)
-{
-    for (; vp != end; ++vp)
-        markSlot(vp);
-}
-
-MOZ_ALWAYS_INLINE void
-ForkJoinNursery::markSlot(HeapSlot *slotp)
-{
-    if (!slotp->isObject())
-        return;
-
-    JSObject *obj = &slotp->toObject();
-    if (!isInsideFromspace(obj))
-        return;
-
-    if (getForwardedPointer(&obj)) {
-        slotp->unsafeGet()->setObject(*obj);
-        return;
-    }
-
-    JSObject *moved = static_cast<JSObject *>(moveObjectToTospace(obj));
-    slotp->unsafeGet()->setObject(*moved);
-}
-
-AllocKind
-ForkJoinNursery::getObjectAllocKind(JSObject *obj)
-{
-    if (obj->is<ArrayObject>()) {
-        ArrayObject *aobj = &obj->as<ArrayObject>();
-        MOZ_ASSERT(aobj->numFixedSlots() == 0);
-
-        // Use minimal size object if we are just going to copy the pointer.
-        if (!isInsideFromspace((void *)aobj->getElementsHeader()))
-            return FINALIZE_OBJECT0_BACKGROUND;
-
-        size_t nelements = aobj->getDenseCapacity();
-        return GetBackgroundAllocKind(GetGCArrayKind(nelements));
-    }
-
-    if (obj->is<JSFunction>())
-        return obj->as<JSFunction>().getAllocKind();
-
-    // Don't handle other objects with special allocation requirements.
-    MOZ_ASSERT(!obj->is<TypedArrayObject>());
-    MOZ_ASSERT(obj->isNative());
-
-    AllocKind kind = GetGCObjectFixedSlotsKind(obj->as<NativeObject>().numFixedSlots());
-    MOZ_ASSERT(!IsBackgroundFinalized(kind));
-    MOZ_ASSERT(CanBeFinalizedInBackground(kind, obj->getClass()));
-    return GetBackgroundAllocKind(kind);
-}
-
-// Nursery allocation will never fail during GC - apart from true OOM - since
-// newspace is at least as large as fromspace, ergo a nullptr return from the
-// allocator means true OOM, which we catch and signal here.
-void *
-ForkJoinNursery::allocateInTospaceInfallible(size_t thingSize)
-{
-    void *p = allocate(thingSize);
-    if (!p)
-        CrashAtUnhandlableOOM("Cannot expand PJS nursery during GC");
-    return p;
-}
-
-void *
-ForkJoinNursery::allocateInTospace(gc::AllocKind thingKind)
-{
-    size_t thingSize = Arena::thingSize(thingKind);
-    if (isEvacuating_) {
-        void *t = tenured_->arenas.allocateFromFreeList(thingKind, thingSize);
-        if (t)
-            return t;
-        tenured_->arenas.checkEmptyFreeList(thingKind);
-        // This call may return NULL but should do so only if memory
-        // is truly exhausted.  However, allocateFromArena() can fail
-        // either because memory is exhausted or if the allocation
-        // budget is used up.  There is a guard in
-        // Chunk::allocateArena() against the latter case.
-        return tenured_->arenas.allocateFromArena(evacuationZone_, thingKind);
-    }
-    return allocateInTospaceInfallible(thingSize);
-}
-
-template <typename T>
-T *
-ForkJoinNursery::allocateInTospace(size_t nelem)
-{
-    if (isEvacuating_)
-        return evacuationZone_->pod_malloc<T>(nelem);
-    return static_cast<T *>(allocateInTospaceInfallible(nelem * sizeof(T)));
-}
-
-MOZ_ALWAYS_INLINE void
-ForkJoinNursery::insertIntoFixupList(RelocationOverlay *entry)
-{
-    *tail_ = entry;
-    tail_ = &entry->next_;
-    *tail_ = nullptr;
-}
-
-void *
-ForkJoinNursery::moveObjectToTospace(JSObject *src)
-{
-    AllocKind dstKind = getObjectAllocKind(src);
-    JSObject *dst = static_cast<JSObject *>(allocateInTospace(dstKind));
-    if (!dst)
-        CrashAtUnhandlableOOM("Failed to allocate object while moving object.");
-
-    movedSize_ += copyObjectToTospace(dst, src, dstKind);
-
-    RelocationOverlay *overlay = RelocationOverlay::fromCell(src);
-    overlay->forwardTo(dst);
-    insertIntoFixupList(overlay);
-
-    return static_cast<void *>(dst);
-}
-
-size_t
-ForkJoinNursery::copyObjectToTospace(JSObject *dst, JSObject *src, AllocKind dstKind)
-{
-    size_t srcSize = Arena::thingSize(dstKind);
-    size_t movedSize = srcSize;
-
-    // Arrays do not necessarily have the same AllocKind between src and dst.
-    // We deal with this by copying elements manually, possibly re-inlining
-    // them if there is adequate room inline in dst.
-    if (src->is<ArrayObject>())
-        srcSize = movedSize = sizeof(NativeObject);
-
-    js_memcpy(dst, src, srcSize);
-    if (src->isNative()) {
-        NativeObject *ndst = &dst->as<NativeObject>(), *nsrc = &src->as<NativeObject>();
-        movedSize += copySlotsToTospace(ndst, nsrc, dstKind);
-        movedSize += copyElementsToTospace(ndst, nsrc, dstKind);
-    }
-
-    // The shape's list head may point into the old object.
-    if (&src->shape_ == dst->shape_->listp) {
-        MOZ_ASSERT(cx_->isThreadLocal(dst->shape_.get()));
-        dst->shape_->listp = &dst->shape_;
-    }
-
-    return movedSize;
-}
-
-size_t
-ForkJoinNursery::copySlotsToTospace(NativeObject *dst, NativeObject *src, AllocKind dstKind)
-{
-    // Fixed slots have already been copied over.
-    if (!src->hasDynamicSlots())
-        return 0;
-
-    if (!isInsideFromspace(src->slots_)) {
-        hugeSlots[hugeSlotsFrom].remove(src->slots_);
-        if (!isEvacuating_)
-            hugeSlots[hugeSlotsNew].put(src->slots_);
-        return 0;
-    }
-
-    size_t count = src->numDynamicSlots();
-    dst->slots_ = allocateInTospace<HeapSlot>(count);
-    if (!dst->slots_)
-        CrashAtUnhandlableOOM("Failed to allocate slots while moving object.");
-    js_memcpy(dst->slots_, src->slots_, count * sizeof(HeapSlot));
-    setSlotsForwardingPointer(src->slots_, dst->slots_, count);
-    return count * sizeof(HeapSlot);
-}
-
-size_t
-ForkJoinNursery::copyElementsToTospace(NativeObject *dst, NativeObject *src, AllocKind dstKind)
-{
-    if (src->hasEmptyElements() || src->denseElementsAreCopyOnWrite())
-        return 0;
-
-    ObjectElements *srcHeader = src->getElementsHeader();
-    ObjectElements *dstHeader;
-
-    // TODO Bug 874151: Prefer to put element data inline if we have space.
-    // (Note, not a correctness issue.)
-    if (!isInsideFromspace(srcHeader)) {
-        MOZ_ASSERT(src->elements_ == dst->elements_);
-        hugeSlots[hugeSlotsFrom].remove(reinterpret_cast<HeapSlot*>(srcHeader));
-        if (!isEvacuating_)
-            hugeSlots[hugeSlotsNew].put(reinterpret_cast<HeapSlot*>(srcHeader));
-        return 0;
-    }
-
-    size_t nslots = ObjectElements::VALUES_PER_HEADER + srcHeader->capacity;
-
-    // Unlike other objects, Arrays can have fixed elements.
-    if (src->is<ArrayObject>() && nslots <= GetGCKindSlots(dstKind)) {
-        dst->as<ArrayObject>().setFixedElements();
-        dstHeader = dst->as<ArrayObject>().getElementsHeader();
-        js_memcpy(dstHeader, srcHeader, nslots * sizeof(HeapSlot));
-        setElementsForwardingPointer(srcHeader, dstHeader, nslots);
-        return nslots * sizeof(HeapSlot);
-    }
-
-    MOZ_ASSERT(nslots >= 2);
-    dstHeader = reinterpret_cast<ObjectElements *>(allocateInTospace<HeapSlot>(nslots));
-    if (!dstHeader)
-        CrashAtUnhandlableOOM("Failed to allocate elements while moving object.");
-    js_memcpy(dstHeader, srcHeader, nslots * sizeof(HeapSlot));
-    setElementsForwardingPointer(srcHeader, dstHeader, nslots);
-    dst->elements_ = dstHeader->elements();
-    return nslots * sizeof(HeapSlot);
-}
-
-void
-ForkJoinNursery::setSlotsForwardingPointer(HeapSlot *oldSlots, HeapSlot *newSlots, uint32_t nslots)
-{
-    MOZ_ASSERT(nslots > 0);
-    MOZ_ASSERT(isInsideFromspace(oldSlots));
-    MOZ_ASSERT(!isInsideFromspace(newSlots));
-    *reinterpret_cast<HeapSlot **>(oldSlots) = newSlots;
-}
-
-void
-ForkJoinNursery::setElementsForwardingPointer(ObjectElements *oldHeader, ObjectElements *newHeader,
-                                             uint32_t nelems)
-{
-    // If the JIT has hoisted a zero length pointer, then we do not need to
-    // relocate it because reads and writes to/from this pointer are invalid.
-    if (nelems - ObjectElements::VALUES_PER_HEADER < 1)
-        return;
-    MOZ_ASSERT(isInsideFromspace(oldHeader));
-    MOZ_ASSERT(!isInsideFromspace(newHeader));
-    *reinterpret_cast<HeapSlot **>(oldHeader->elements()) = newHeader->elements();
-}
-
-ForkJoinNurseryCollectionTracer::ForkJoinNurseryCollectionTracer(JSRuntime *rt,
-                                                                 ForkJoinNursery *nursery)
-  : JSTracer(rt, ForkJoinNursery::MinorGCCallback, TraceWeakMapKeysValues)
-  , nursery_(nursery)
-{
-    MOZ_ASSERT(rt);
-    MOZ_ASSERT(nursery);
-}
-
-} // namespace gc
-} // namespace js
-
-#endif /* JSGC_FJGENERATIONAL */
deleted file mode 100644
--- a/js/src/gc/ForkJoinNursery.h
+++ /dev/null
@@ -1,297 +0,0 @@
-/* -*- 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/. */
-
-#ifndef gc_ForkJoinNursery_h
-#define gc_ForkJoinNursery_h
-
-#ifdef JSGC_FJGENERATIONAL
-
-#include "jsalloc.h"
-#include "jspubtd.h"
-
-#include "gc/Heap.h"
-#include "gc/Memory.h"
-#include "gc/Nursery.h"
-
-#include "js/HashTable.h"
-#include "js/TracingAPI.h"
-
-namespace js {
-class ObjectElements;
-class HeapSlot;
-class ForkJoinShared;
-}
-
-namespace js {
-namespace gc {
-
-class ForkJoinGCShared;
-class ForkJoinNursery;
-class ForkJoinNurseryCollectionTracer;
-class RelocationOverlay;
-
-// This tracer comes into play when a class has a tracer function, but
-// is otherwise unused and has no other functionality.
-//
-// It could look like this could be merged into ForkJoinNursery by
-// making the latter derive from JSTracer; I've decided to keep them
-// separate for now, since it allows for multiple instantiations of
-// this class with different parameters, for different purposes.  That
-// may change.
-
-class ForkJoinNurseryCollectionTracer : public JSTracer
-{
-    friend class ForkJoinNursery;
-
-  public:
-    ForkJoinNurseryCollectionTracer(JSRuntime *rt, ForkJoinNursery *nursery);
-
-  private:
-    ForkJoinNursery *const nursery_;
-};
-
-// The layout for a chunk used by the ForkJoinNursery.
-
-struct ForkJoinNurseryChunk
-{
-    // The amount of space in the mapped nursery available to allocations
-    static const size_t UsableSize = ChunkSize - sizeof(ChunkTrailer);
-
-    char data[UsableSize];
-    ChunkTrailer trailer;
-    uintptr_t start() { return uintptr_t(&data); }
-    uintptr_t end() { return uintptr_t(&trailer); }
-};
-
-// A GC adapter to ForkJoinShared, which is a complex class hidden
-// inside ForkJoin.cpp.
-
-class ForkJoinGCShared
-{
-  public:
-    explicit ForkJoinGCShared(ForkJoinShared *shared) : shared_(shared) {}
-
-    JSRuntime *runtime();
-    JS::Zone *zone();
-
-    // The updatable object (the ForkJoin result array), or nullptr.
-    JSObject *updatable();
-
-    // allocateNurseryChunk() returns nullptr on oom.
-    ForkJoinNurseryChunk *allocateNurseryChunk();
-
-    // p must have been obtained through allocateNurseryChunk.
-    void freeNurseryChunk(ForkJoinNurseryChunk *p);
-
-    // GC statistics output.
-    void spewGC(const char *fmt, ...);
-
-  private:
-    ForkJoinShared *const shared_;
-};
-
-// There is one ForkJoinNursery per ForkJoin worker.
-//
-// See the comment in ForkJoinNursery.cpp about how it works.
-
-class ForkJoinNursery
-{
-    friend class ForkJoinNurseryCollectionTracer;
-    friend class RelocationOverlay;
-
-    static_assert(sizeof(ForkJoinNurseryChunk) == ChunkSize,
-                  "ForkJoinNursery chunk size must match Chunk size.");
-  public:
-    ForkJoinNursery(ForkJoinContext *cx, ForkJoinGCShared *shared, Allocator *tenured);
-    ~ForkJoinNursery();
-
-    // Attempt to allocate initial storage, returns false on failure
-    bool initialize();
-
-    // Perform a collection within the nursery, and if that for some reason
-    // cannot be done then perform an evacuating collection.
-    void minorGC();
-
-    // Evacuate the live data from the nursery into the tenured area;
-    // do not recreate the nursery.
-    void evacuatingGC();
-
-    // Allocate an object with a number of dynamic slots.  Returns an
-    // object, or nullptr in one of two circumstances:
-    //
-    //  - The nursery was full, the collector must be run, and the
-    //    allocation must be retried.  tooLarge is set to 'false'.
-    //  - The number of dynamic slots requested is too large and
-    //    the object should be allocated in the tenured area.
-    //    tooLarge is set to 'true'.
-    //
-    // This method will never run the garbage collector.
-    JSObject *allocateObject(size_t size, size_t numDynamic, bool& tooLarge);
-
-    // Allocate and reallocate slot and element arrays for existing
-    // objects.  These will create or maintain the arrays within the
-    // nursery if possible and appropriate, and otherwise will fall
-    // back to allocating in the tenured area.  They will return
-    // nullptr only if memory is exhausted.  If the reallocate methods
-    // return nullptr then the old array is still live.
-    //
-    // These methods will never run the garbage collector.
-    HeapSlot *allocateSlots(JSObject *obj, uint32_t nslots);
-    HeapSlot *reallocateSlots(JSObject *obj, HeapSlot *oldSlots,
-                              uint32_t oldCount, uint32_t newCount);
-    ObjectElements *allocateElements(JSObject *obj, uint32_t nelems);
-    ObjectElements *reallocateElements(JSObject *obj, ObjectElements *oldHeader,
-                                       uint32_t oldCount, uint32_t newCount);
-
-    // Free a slots array.
-    void freeSlots(HeapSlot *slots);
-
-    // The method embedded in a ForkJoinNurseryCollectionTracer
-    static void MinorGCCallback(JSTracer *trcArg, void **thingp, JSGCTraceKind kind);
-
-    // A method called from the JIT frame updater
-    static void forwardBufferPointer(JSTracer *trc, HeapSlot **pSlotsElems);
-
-    // Return true iff obj is inside the current newspace.
-    MOZ_ALWAYS_INLINE bool isInsideNewspace(const void *obj);
-
-    // Return true iff collection is ongoing and obj is inside the current fromspace.
-    MOZ_ALWAYS_INLINE bool isInsideFromspace(const void *obj);
-
-    MOZ_ALWAYS_INLINE bool isForwarded(Cell *cell);
-
-    template <typename T>
-    MOZ_ALWAYS_INLINE bool getForwardedPointer(T **ref);
-
-    static size_t offsetOfPosition() {
-        return offsetof(ForkJoinNursery, position_);
-    }
-
-    static size_t offsetOfCurrentEnd() {
-        return offsetof(ForkJoinNursery, currentEnd_);
-    }
-
-  private:
-    // The largest slot arrays that will be allocated in the nursery.
-    // On the one hand we want this limit to be large, to avoid
-    // managing many hugeSlots.  On the other hand, slot arrays have
-    // to be copied during GC and will induce some external
-    // fragmentation in the nursery at chunk boundaries.
-    static const size_t MaxNurserySlots = 2048;
-
-    // The fixed limit on the per-worker nursery, in chunks.
-    //
-    // For production runs, 16 may be good - programs that need it,
-    // really need it, and as allocation is lazy programs that don't
-    // need it won't suck up a lot of resources.
-    //
-    // For debugging runs, 1 or 2 may sometimes be good, because it
-    // will more easily provoke bugs in the evacuation paths.
-    static const size_t MaxNurseryChunks = 16;
-
-    // The inverse load factor in the per-worker nursery.  Grow the nursery
-    // or schedule an evacuation if more than 1/NurseryLoadFactor of the
-    // current nursery size is live after minor GC.
-    static const int NurseryLoadFactor = 3;
-
-    // Allocate an object in the nursery's newspace.  Return nullptr
-    // when allocation fails (ie the object can't fit in the current
-    // chunk and the number of chunks it at its maximum).
-    void *allocate(size_t size);
-
-    // Allocate an external slot array and register it with this nursery.
-    HeapSlot *allocateHugeSlots(JSObject *obj, size_t nslots);
-
-    // Reallocate an external slot array, unregister the old array and
-    // register the new array.  If the allocation fails then leave
-    // everything unchanged.
-    HeapSlot *reallocateHugeSlots(JSObject *obj, HeapSlot *oldSlots,
-                                  uint32_t oldCount, uint32_t newCount);
-
-    // Walk the list of registered slot arrays and free them all.
-    void sweepHugeSlots();
-
-    // Set the position/end pointers to correspond to the numbered
-    // chunk.  Returns false if the chunk could not be allocated, either
-    // because we're OOM or because the nursery capacity is exhausted.
-    bool setCurrentChunk(int index);
-
-    enum PJSCollectionOp {
-        Evacuate = 1,
-        Collect = 2,
-        Recreate = 4
-    };
-
-    // Misc GC internals.
-    void pjsCollection(int op /* A combination of PJSCollectionOp bits */);
-    bool initNewspace();
-    void flip();
-    void forwardFromRoots(ForkJoinNurseryCollectionTracer *trc);
-    void forwardFromUpdatable(ForkJoinNurseryCollectionTracer *trc);
-    void forwardFromStack(ForkJoinNurseryCollectionTracer *trc);
-    void forwardFromTenured(ForkJoinNurseryCollectionTracer *trc);
-    void forwardFromRematerializedFrames(ForkJoinNurseryCollectionTracer *trc);
-    void collectToFixedPoint(ForkJoinNurseryCollectionTracer *trc);
-    void freeFromspace();
-    void computeNurserySizeAfterGC(size_t live, const char **msg);
-
-    AllocKind getObjectAllocKind(JSObject *src);
-    void *allocateInTospaceInfallible(size_t thingSize);
-    void *allocateInTospace(AllocKind thingKind);
-    template <typename T> T *allocateInTospace(size_t nelem);
-    MOZ_ALWAYS_INLINE bool shouldMoveObject(void **thingp);
-    void *moveObjectToTospace(JSObject *src);
-    size_t copyObjectToTospace(JSObject *dst, JSObject *src, gc::AllocKind dstKind);
-    size_t copyElementsToTospace(NativeObject *dst, NativeObject *src, gc::AllocKind dstKind);
-    size_t copySlotsToTospace(NativeObject *dst, NativeObject *src, gc::AllocKind dstKind);
-    MOZ_ALWAYS_INLINE void insertIntoFixupList(RelocationOverlay *entry);
-
-    void setSlotsForwardingPointer(HeapSlot *oldSlots, HeapSlot *newSlots, uint32_t nslots);
-    void setElementsForwardingPointer(ObjectElements *oldHeader, ObjectElements *newHeader,
-                                      uint32_t nelems);
-
-    MOZ_ALWAYS_INLINE void traceObject(ForkJoinNurseryCollectionTracer *trc, JSObject *obj);
-    MOZ_ALWAYS_INLINE void markSlots(HeapSlot *vp, uint32_t nslots);
-    MOZ_ALWAYS_INLINE void markSlots(HeapSlot *vp, HeapSlot *end);
-    MOZ_ALWAYS_INLINE void markSlot(HeapSlot *slotp);
-
-    ForkJoinContext *const cx_;      // The context that owns this nursery
-    Allocator *const tenured_;       // Private tenured area
-    ForkJoinGCShared *const shared_; // Common to all nurseries belonging to a ForkJoin instance
-    JS::Zone *evacuationZone_;       // During evacuating GC this is non-NULL: the Zone we
-                                     // allocate into
-
-    uintptr_t currentStart_;         // Start of current area in newspace
-    uintptr_t currentEnd_;           // End of current area in newspace (last byte + 1)
-    uintptr_t position_;             // Next free byte in current newspace chunk
-    unsigned currentChunk_;          // Index of current / highest numbered chunk in newspace
-    unsigned numActiveChunks_;       // Number of active chunks in newspace, not all may be allocated
-    unsigned numFromspaceChunks_;    // Number of active chunks in fromspace, all are allocated
-    bool mustEvacuate_;              // Set to true after GC when the /next/ minor GC must evacuate
-
-    bool isEvacuating_;              // Set to true when the current minor GC is evacuating
-    size_t movedSize_;               // Bytes copied during the current minor GC
-    RelocationOverlay *head_;        // First node of relocation list
-    RelocationOverlay **tail_;       // Pointer to 'next_' field of last node of relocation list
-
-    typedef HashSet<HeapSlot *, PointerHasher<HeapSlot *, 3>, SystemAllocPolicy> HugeSlotsSet;
-
-    HugeSlotsSet hugeSlots[2];       // Hash sets for huge slots
-
-    int hugeSlotsNew;                // Huge slot arrays in the newspace (index in hugeSlots)
-    int hugeSlotsFrom;               // Huge slot arrays in the fromspace (index in hugeSlots)
-
-    ForkJoinNurseryChunk *newspace[MaxNurseryChunks];  // All allocation happens here
-    ForkJoinNurseryChunk *fromspace[MaxNurseryChunks]; // Meaningful during GC: the previous newspace
-};
-
-} // namespace gc
-} // namespace js
-
-#endif // JSGC_FJGENERATIONAL
-
-#endif // gc_ForkJoinNursery_h
--- a/js/src/gc/GCInternals.h
+++ b/js/src/gc/GCInternals.h
@@ -14,23 +14,16 @@
 #include "vm/Runtime.h"
 
 namespace js {
 namespace gc {
 
 void
 MarkPersistentRootedChains(JSTracer *trc);
 
-#ifdef JSGC_FJGENERATIONAL
-class ForkJoinNurseryCollectionTracer;
-
-void
-MarkForkJoinStack(ForkJoinNurseryCollectionTracer *trc);
-#endif
-
 class AutoCopyFreeListToArenas
 {
     JSRuntime *runtime;
     ZoneSelector selector;
 
   public:
     AutoCopyFreeListToArenas(JSRuntime *rt, ZoneSelector selector);
     ~AutoCopyFreeListToArenas();
--- a/js/src/gc/GCRuntime.h
+++ b/js/src/gc/GCRuntime.h
@@ -296,25 +296,16 @@ class GCRuntime
     bool isHeapMinorCollecting() { return heapState == js::MinorCollecting; }
     bool isHeapCollecting() { return isHeapMajorCollecting() || isHeapMinorCollecting(); }
 #ifdef JSGC_COMPACTING
     bool isHeapCompacting() { return isHeapMajorCollecting() && state() == COMPACT; }
 #else
     bool isHeapCompacting() { return false; }
 #endif
 
-    // Performance note: if isFJMinorCollecting turns out to be slow because
-    // reading the counter is slow then we may be able to augment the counter
-    // with a volatile flag that is set iff the counter is greater than
-    // zero. (It will require some care to make sure the two variables stay in
-    // sync.)
-    bool isFJMinorCollecting() { return fjCollectionCounter > 0; }
-    void incFJMinorCollecting() { fjCollectionCounter++; }
-    void decFJMinorCollecting() { fjCollectionCounter--; }
-
     bool triggerGC(JS::gcreason::Reason reason);
     void maybeAllocTriggerZoneGC(Zone *zone, const AutoLockGC &lock);
     bool triggerZoneGC(Zone *zone, JS::gcreason::Reason reason);
     bool maybeGC(Zone *zone);
     void maybePeriodicFullGC();
     void minorGC(JS::gcreason::Reason reason) {
         gcstats::AutoPhase ap(stats, gcstats::PHASE_MINOR_GC);
         minorGCImpl(reason, nullptr);
@@ -843,26 +834,16 @@ class GCRuntime
      */
     unsigned objectsMarkedInDeadZones;
 
     bool poked;
 
     mozilla::Atomic<js::HeapState> heapState;
 
     /*
-     * ForkJoin workers enter and leave GC independently; this counter
-     * tracks the number that are currently in GC.
-     *
-     * Technically this should be #ifdef JSGC_FJGENERATIONAL but that
-     * affects the observed size of JSRuntime in problematic ways, see
-     * note in vm/ThreadPool.h.
-     */
-    mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire> fjCollectionCounter;
-
-    /*
      * These options control the zealousness of the GC. The fundamental values
      * are nextScheduled and gcDebugCompartmentGC. At every allocation,
      * nextScheduled is decremented. When it reaches zero, we do either a full
      * or a compartmental GC, based on debugCompartmentGC.
      *
      * At this point, if zeal_ is one of the types that trigger periodic
      * collection, then nextScheduled is reset to the value of zealFrequency.
      * Otherwise, no additional GCs take place.
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -159,26 +159,16 @@ CheckMarkedThing(JSTracer *trc, T **thin
 
     T *thing = *thingp;
     MOZ_ASSERT(*thingp);
 
 #ifdef JSGC_COMPACTING
     thing = MaybeForwarded(thing);
 #endif
 
-# ifdef JSGC_FJGENERATIONAL
-    /*
-     * The code below (runtimeFromMainThread(), etc) makes assumptions
-     * not valid for the ForkJoin worker threads during ForkJoin GGC,
-     * so just bail.
-     */
-    if (ForkJoinContext::current())
-        return;
-# endif
-
     /* This function uses data that's not available in the nursery. */
     if (IsInsideNursery(thing))
         return;
 
 #ifdef JSGC_COMPACTING
     MOZ_ASSERT_IF(!MovingTracer::IsMovingTracer(trc) && !Nursery::IsMinorCollectionTracer(trc),
                   !IsForwarded(*thingp));
 #endif
@@ -271,26 +261,16 @@ SetMaybeAliveFlag(JSScript *thing)
 template<typename T>
 static void
 MarkInternal(JSTracer *trc, T **thingp)
 {
     CheckMarkedThing(trc, thingp);
     T *thing = *thingp;
 
     if (!trc->callback) {
-#ifdef JSGC_FJGENERATIONAL
-        /*
-         * This case should never be reached from PJS collections as
-         * those should all be using a ForkJoinNurseryCollectionTracer
-         * that carries a callback.
-         */
-        MOZ_ASSERT(!ForkJoinContext::current());
-        MOZ_ASSERT(!trc->runtime()->isFJMinorCollecting());
-#endif
-
         /*
          * We may mark a Nursery thing outside the context of the
          * MinorCollectionTracer because of a pre-barrier. The pre-barrier is
          * not needed in this case because we perform a minor collection before
          * each incremental slice.
          */
         if (IsInsideNursery(thing))
             return;
@@ -442,32 +422,20 @@ IsMarked(T **thingp)
 
 template <typename T>
 static bool
 IsMarkedFromAnyThread(T **thingp)
 {
     MOZ_ASSERT(thingp);
     MOZ_ASSERT(*thingp);
     JSRuntime* rt = (*thingp)->runtimeFromAnyThread();
-#ifdef JSGC_FJGENERATIONAL
-    // Must precede the case for GGC because IsInsideNursery()
-    // will also be true for the ForkJoinNursery.
-    if (rt->isFJMinorCollecting()) {
-        ForkJoinContext *ctx = ForkJoinContext::current();
-        ForkJoinNursery &nursery = ctx->nursery();
-        if (nursery.isInsideFromspace(*thingp))
-            return nursery.getForwardedPointer(thingp);
-    }
-    else
-#endif
-    {
-        if (IsInsideNursery(*thingp)) {
-            Nursery &nursery = rt->gc.nursery;
-            return nursery.getForwardedPointer(thingp);
-        }
+
+    if (IsInsideNursery(*thingp)) {
+        Nursery &nursery = rt->gc.nursery;
+        return nursery.getForwardedPointer(thingp);
     }
 
     Zone *zone = (*thingp)->asTenured().zoneFromAnyThread();
     if (!zone->isCollectingFromAnyThread() || zone->isGCFinished())
         return true;
 #ifdef JSGC_COMPACTING
     if (zone->isGCCompacting() && IsForwarded(*thingp))
         *thingp = Forwarded(*thingp);
@@ -493,33 +461,22 @@ IsAboutToBeFinalizedFromAnyThread(T **th
 
     T *thing = *thingp;
     JSRuntime *rt = thing->runtimeFromAnyThread();
 
     /* Permanent atoms are never finalized by non-owning runtimes. */
     if (ThingIsPermanentAtom(thing) && !TlsPerThreadData.get()->associatedWith(rt))
         return false;
 
-#ifdef JSGC_FJGENERATIONAL
-    if (rt->isFJMinorCollecting()) {
-        ForkJoinContext *ctx = ForkJoinContext::current();
-        ForkJoinNursery &nursery = ctx->nursery();
-        if (nursery.isInsideFromspace(thing))
+    Nursery &nursery = rt->gc.nursery;
+    MOZ_ASSERT_IF(!rt->isHeapMinorCollecting(), !IsInsideNursery(thing));
+    if (rt->isHeapMinorCollecting()) {
+        if (IsInsideNursery(thing))
             return !nursery.getForwardedPointer(thingp);
-    }
-    else
-#endif
-    {
-        Nursery &nursery = rt->gc.nursery;
-        MOZ_ASSERT_IF(!rt->isHeapMinorCollecting(), !IsInsideNursery(thing));
-        if (rt->isHeapMinorCollecting()) {
-            if (IsInsideNursery(thing))
-                return !nursery.getForwardedPointer(thingp);
-            return false;
-        }
+        return false;
     }
 
     Zone *zone = thing->asTenured().zoneFromAnyThread();
     if (zone->isGCSweeping()) {
         if (thing->asTenured().arenaHeader()->allocatedDuringIncremental)
             return false;
         return !thing->asTenured().isMarked();
     }
@@ -536,26 +493,16 @@ IsAboutToBeFinalizedFromAnyThread(T **th
 template <typename T>
 T *
 UpdateIfRelocated(JSRuntime *rt, T **thingp)
 {
     MOZ_ASSERT(thingp);
     if (!*thingp)
         return nullptr;
 
-#ifdef JSGC_FJGENERATIONAL
-    if (rt->isFJMinorCollecting()) {
-        ForkJoinContext *ctx = ForkJoinContext::current();
-        ForkJoinNursery &nursery = ctx->nursery();
-        if (nursery.isInsideFromspace(*thingp))
-            nursery.getForwardedPointer(thingp);
-        return *thingp;
-    }
-#endif
-
     if (rt->isHeapMinorCollecting() && IsInsideNursery(*thingp)) {
         rt->gc.nursery.getForwardedPointer(thingp);
         return *thingp;
     }
 
 #ifdef JSGC_COMPACTING
     Zone *zone = (*thingp)->zone();
     if (zone->isGCCompacting() && IsForwarded(*thingp))
--- a/js/src/gc/Memory.cpp
+++ b/js/src/gc/Memory.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 "gc/Memory.h"
 
+#include "mozilla/Atomics.h"
 #include "mozilla/TaggedAnonymousMemory.h"
 
 #include "js/HeapAPI.h"
 #include "vm/Runtime.h"
 
 #if defined(XP_WIN)
 
 #include "jswin.h"
@@ -40,28 +41,26 @@ namespace gc {
 // running process matches the compiled arena size.
 static size_t pageSize = 0;
 
 // The OS allocation granularity may not match the page size.
 static size_t allocGranularity = 0;
 
 #if defined(XP_UNIX)
 // The addresses handed out by mmap may grow up or down.
-static int growthDirection = 0;
+static mozilla::Atomic<int, mozilla::Relaxed> growthDirection(0);
 #endif
 
-// The maximum number of unalignable chunks to temporarily keep alive in
-// the last ditch allocation pass. OOM crash reports generally show <= 7
-// unaligned chunks available (bug 1005844 comment #16).
-static const int MaxLastDitchAttempts = 8;
+// Data from OOM crashes shows there may be up to 24 chunksized but unusable
+// chunks available in low memory situations. These chunks may all need to be
+// used up before we gain access to remaining *alignable* chunksized regions,
+// so we use a generous limit of 32 unusable chunks to ensure we reach them.
+static const int MaxLastDitchAttempts = 32;
 
-static void GetNewChunk(void **aAddress, void **aRetainedAddr, size_t *aRetainedSize, size_t size,
-                        size_t alignment);
-static bool GetNewChunkInner(void **aAddress, void **aRetainedAddr, size_t *aRetainedSize,
-                             size_t size, size_t alignment, bool addrsGrowDown);
+static void GetNewChunk(void **aAddress, void **aRetainedAddr, size_t size, size_t alignment);
 static void *MapAlignedPagesSlow(size_t size, size_t alignment);
 static void *MapAlignedPagesLastDitch(size_t size, size_t alignment);
 
 size_t
 SystemPageSize()
 {
     return pageSize;
 }
@@ -129,20 +128,19 @@ MapAlignedPages(size_t size, size_t alig
     /* Special case: If we want allocation alignment, no further work is needed. */
     if (alignment == allocGranularity)
         return p;
 
     if (OffsetFromAligned(p, alignment) == 0)
         return p;
 
     void *retainedAddr;
-    size_t retainedSize;
-    GetNewChunk(&p, &retainedAddr, &retainedSize, size, alignment);
+    GetNewChunk(&p, &retainedAddr, size, alignment);
     if (retainedAddr)
-        UnmapPages(retainedAddr, retainedSize);
+        UnmapPages(retainedAddr, size);
     if (p) {
         if (OffsetFromAligned(p, alignment) == 0)
             return p;
         UnmapPages(p, size);
     }
 
     p = MapAlignedPagesSlow(size, alignment);
     if (!p)
@@ -181,79 +179,73 @@ MapAlignedPagesSlow(size_t size, size_t 
 
         /* Failure here indicates a race with another thread, so try again. */
     } while (!p);
 
     return p;
 }
 
 /*
- * Even though there aren't any |size + alignment - pageSize| byte chunks left,
- * the allocator may still be able to give us |size| byte chunks that are
- * either already aligned, or *can* be aligned by allocating in the nearest
- * aligned location. Since we can't tell the allocator to give us a different
- * address each time, we temporarily hold onto the unaligned part of each chunk
- * until the allocator gives us a chunk that either is, or can be aligned.
+ * In a low memory or high fragmentation situation, alignable chunks of the
+ * desired size may still be available, even if there are no more contiguous
+ * free chunks that meet the |size + alignment - pageSize| requirement of
+ * MapAlignedPagesSlow. In this case, try harder to find an alignable chunk
+ * by temporarily holding onto the unaligned parts of each chunk until the
+ * allocator gives us a chunk that either is, or can be aligned.
  */
 static void *
 MapAlignedPagesLastDitch(size_t size, size_t alignment)
 {
-    void *p = nullptr;
     void *tempMaps[MaxLastDitchAttempts];
     int attempt = 0;
+    void *p = MapMemory(size, MEM_COMMIT | MEM_RESERVE);
+    if (OffsetFromAligned(p, alignment) == 0)
+        return p;
     for (; attempt < MaxLastDitchAttempts; ++attempt) {
-        size_t retainedSize;
-        GetNewChunk(&p, tempMaps + attempt, &retainedSize, size, alignment);
+        GetNewChunk(&p, tempMaps + attempt, size, alignment);
         if (OffsetFromAligned(p, alignment) == 0) {
             if (tempMaps[attempt])
-                UnmapPages(tempMaps[attempt], retainedSize);
+                UnmapPages(tempMaps[attempt], size);
             break;
         }
-        if (!tempMaps[attempt]) {
-            /* GetNewChunk failed, but we can still try the simpler method. */
-            tempMaps[attempt] = p;
-            p = nullptr;
-        }
+        if (!tempMaps[attempt])
+            break; /* Bail if GetNewChunk failed. */
     }
     if (OffsetFromAligned(p, alignment)) {
         UnmapPages(p, size);
         p = nullptr;
     }
     while (--attempt >= 0)
-        UnmapPages(tempMaps[attempt], 0);
+        UnmapPages(tempMaps[attempt], size);
     return p;
 }
 
 /*
  * On Windows, map and unmap calls must be matched, so we deallocate the
  * unaligned chunk, then reallocate the unaligned part to block off the
  * old address and force the allocator to give us a new one.
  */
 static void
-GetNewChunk(void **aAddress, void **aRetainedAddr, size_t *aRetainedSize, size_t size,
-            size_t alignment)
+GetNewChunk(void **aAddress, void **aRetainedAddr, size_t size, size_t alignment)
 {
     void *address = *aAddress;
     void *retainedAddr = nullptr;
-    size_t retainedSize = 0;
     do {
-        if (!address)
-            address = MapMemory(size, MEM_COMMIT | MEM_RESERVE);
+        size_t retainedSize;
         size_t offset = OffsetFromAligned(address, alignment);
         if (!offset)
             break;
         UnmapPages(address, size);
         retainedSize = alignment - offset;
         retainedAddr = MapMemoryAt(address, retainedSize, MEM_RESERVE);
         address = MapMemory(size, MEM_COMMIT | MEM_RESERVE);
         /* If retainedAddr is null here, we raced with another thread. */
     } while (!retainedAddr);
     *aAddress = address;
     *aRetainedAddr = retainedAddr;
-    *aRetainedSize = retainedSize;
 }
 
 void
 UnmapPages(void *p, size_t size)
 {
     MOZ_ALWAYS_TRUE(VirtualFree(p, 0, MEM_RELEASE));
 }
 
@@ -374,20 +366,18 @@ DeallocateMappedContent(void *p, size_t 
     // Not implemented.
 }
 
 #elif defined(XP_UNIX)
 
 void
 InitMemorySubsystem()
 {
-    if (pageSize == 0) {
+    if (pageSize == 0)
         pageSize = allocGranularity = size_t(sysconf(_SC_PAGESIZE));
-        growthDirection = 0;
-    }
 }
 
 static inline void *
 MapMemoryAt(void *desired, size_t length, int prot = PROT_READ | PROT_WRITE,
             int flags = MAP_PRIVATE | MAP_ANON, int fd = -1, off_t offset = 0)
 {
 #if defined(__ia64__)
     MOZ_ASSERT(0xffff800000000000ULL & (uintptr_t(desired) + length - 1) == 0);
@@ -460,20 +450,19 @@ MapAlignedPages(size_t size, size_t alig
     /* Special case: If we want page alignment, no further work is needed. */
     if (alignment == allocGranularity)
         return p;
 
     if (OffsetFromAligned(p, alignment) == 0)
         return p;
 
     void *retainedAddr;
-    size_t retainedSize;
-    GetNewChunk(&p, &retainedAddr, &retainedSize, size, alignment);
+    GetNewChunk(&p, &retainedAddr, size, alignment);
     if (retainedAddr)
-        UnmapPages(retainedAddr, retainedSize);
+        UnmapPages(retainedAddr, size);
     if (p) {
         if (OffsetFromAligned(p, alignment) == 0)
             return p;
         UnmapPages(p, size);
     }
 
     p = MapAlignedPagesSlow(size, alignment);
     if (!p)
@@ -509,148 +498,103 @@ MapAlignedPagesSlow(size_t size, size_t 
         UnmapPages(region, uintptr_t(front) - uintptr_t(region));
     if (end != regionEnd)
         UnmapPages(end, uintptr_t(regionEnd) - uintptr_t(end));
 
     return front;
 }
 
 /*
- * Even though there aren't any |size + alignment - pageSize| byte chunks left,
- * the allocator may still be able to give us |size| byte chunks that are
- * either already aligned, or *can* be aligned by allocating in the nearest
- * aligned location. Since we can't tell the allocator to give us a different
- * address each time, we temporarily hold onto the unaligned part of each chunk
- * until the allocator gives us a chunk that either is, or can be aligned.
+ * In a low memory or high fragmentation situation, alignable chunks of the
+ * desired size may still be available, even if there are no more contiguous
+ * free chunks that meet the |size + alignment - pageSize| requirement of
+ * MapAlignedPagesSlow. In this case, try harder to find an alignable chunk
+ * by temporarily holding onto the unaligned parts of each chunk until the
+ * allocator gives us a chunk that either is, or can be aligned.
  */
 static void *
 MapAlignedPagesLastDitch(size_t size, size_t alignment)
 {
-    void *p = nullptr;
     void *tempMaps[MaxLastDitchAttempts];
-    size_t tempSizes[MaxLastDitchAttempts];
     int attempt = 0;
+    void *p = MapMemory(size);
+    if (OffsetFromAligned(p, alignment) == 0)
+        return p;
     for (; attempt < MaxLastDitchAttempts; ++attempt) {
-        GetNewChunk(&p, tempMaps + attempt, tempSizes + attempt, size, alignment);
+        GetNewChunk(&p, tempMaps + attempt, size, alignment);
         if (OffsetFromAligned(p, alignment) == 0) {
             if (tempMaps[attempt])
-                UnmapPages(tempMaps[attempt], tempSizes[attempt]);
+                UnmapPages(tempMaps[attempt], size);
             break;
         }
-        if (!tempMaps[attempt]) {
-            /* GetNewChunk failed, but we can still try the simpler method. */
-            tempMaps[attempt] = p;
-            tempSizes[attempt] = size;
-            p = nullptr;
-        }
+        if (!tempMaps[attempt])
+            break; /* Bail if GetNewChunk failed. */
     }
     if (OffsetFromAligned(p, alignment)) {
         UnmapPages(p, size);
         p = nullptr;
     }
     while (--attempt >= 0)
-        UnmapPages(tempMaps[attempt], tempSizes[attempt]);
+        UnmapPages(tempMaps[attempt], size);
     return p;
 }
 
 /*
  * mmap calls don't have to be matched with calls to munmap, so we can unmap
  * just the pages we don't need. However, as we don't know a priori if addresses
  * are handed out in increasing or decreasing order, we have to try both
  * directions (depending on the environment, one will always fail).
  */
 static void
-GetNewChunk(void **aAddress, void **aRetainedAddr, size_t *aRetainedSize, size_t size,
-            size_t alignment)
+GetNewChunk(void **aAddress, void **aRetainedAddr, size_t size, size_t alignment)
 {
     void *address = *aAddress;
     void *retainedAddr = nullptr;
-    size_t retainedSize = 0;
-    do {
-        bool addrsGrowDown = growthDirection <= 0;
+    bool addrsGrowDown = growthDirection <= 0;
+    int i = 0;
+    for (; i < 2; ++i) {
         /* Try the direction indicated by growthDirection. */
-        if (GetNewChunkInner(&address, &retainedAddr, &retainedSize, size,
-                             alignment, addrsGrowDown)) {
-            break;
+        if (addrsGrowDown) {
+            size_t offset = OffsetFromAligned(address, alignment);
+            void *head = (void *)((uintptr_t)address - offset);
+            void *tail = (void *)((uintptr_t)head + size);
+            if (MapMemoryAt(head, offset)) {
+                UnmapPages(tail, offset);
+                if (growthDirection >= -8)
+                    --growthDirection;
+                address = head;
+                break;
+            }
+        } else {
+            size_t offset = alignment - OffsetFromAligned(address, alignment);
+            void *head = (void *)((uintptr_t)address + offset);
+            void *tail = (void *)((uintptr_t)address + size);
+            if (MapMemoryAt(tail, offset)) {
+                UnmapPages(address, offset);
+                if (growthDirection <= 8)
+                    ++growthDirection;
+                address = head;
+                break;
+            }
         }
-        /* If that failed, try the opposite direction. */
-        if (GetNewChunkInner(&address, &retainedAddr, &retainedSize, size,
-                             alignment, !addrsGrowDown)) {
+        /* If we're confident in the growth direction, don't try the other. */
+        if (growthDirection < -8 || growthDirection > 8)
             break;
-        }
-        /* If retainedAddr is non-null here, we raced with another thread. */
-    } while (retainedAddr);
+        /* If that failed, try the opposite direction. */
+        addrsGrowDown = !addrsGrowDown;
+    }
+    /* If our current chunk cannot be aligned, see if the next one is aligned. */
+    if (OffsetFromAligned(address, alignment)) {
+        retainedAddr = address;
+        address = MapMemory(size);
+    }
     *aAddress = address;
     *aRetainedAddr = retainedAddr;
-    *aRetainedSize = retainedSize;
 }
 
-#define SET_OUT_PARAMS_AND_RETURN(address_, retainedAddr_, retainedSize_, toReturn_)\
-    do {                                                                            \
-        *aAddress = address_; *aRetainedAddr = retainedAddr_;                       \
-        *aRetainedSize = retainedSize_; return toReturn_;                           \
-    } while(false)
-
-static bool
-GetNewChunkInner(void **aAddress, void **aRetainedAddr, size_t *aRetainedSize, size_t size,
-                 size_t alignment, bool addrsGrowDown)
-{
-    void *initial = *aAddress;
-    if (!initial)
-        initial = MapMemory(size);
-    if (OffsetFromAligned(initial, alignment) == 0)
-        SET_OUT_PARAMS_AND_RETURN(initial, nullptr, 0, true);
-    /* Set the parameters based on whether addresses grow up or down. */
-    size_t offset;
-    void *discardedAddr;
-    void *retainedAddr;
-    int delta;
-    if (addrsGrowDown) {
-        offset = OffsetFromAligned(initial, alignment);
-        discardedAddr = initial;
-        retainedAddr = (void *)(uintptr_t(initial) + size - offset);
-        delta = -1;
-    } else {
-        offset = alignment - OffsetFromAligned(initial, alignment);
-        discardedAddr = (void*)(uintptr_t(initial) + offset);
-        retainedAddr = initial;
-        delta = 1;
-    }
-    /* Keep only the |offset| unaligned bytes. */
-    UnmapPages(discardedAddr, size - offset);
-    void *address = MapMemory(size);
-    if (!address) {
-        /* Map the rest of the original chunk again in case we can recover. */
-        address = MapMemoryAt(initial, size - offset);
-        if (!address)
-            UnmapPages(retainedAddr, offset);
-        SET_OUT_PARAMS_AND_RETURN(address, nullptr, 0, false);
-    }
-    if ((addrsGrowDown && address < retainedAddr) || (!addrsGrowDown && address > retainedAddr)) {
-        growthDirection += delta;
-        SET_OUT_PARAMS_AND_RETURN(address, retainedAddr, offset, true);
-    }
-    /* If we didn't choose the right direction, reduce its score. */
-    growthDirection -= delta;
-    /* Accept an aligned address if growthDirection didn't just flip. */
-    if (OffsetFromAligned(address, alignment) == 0 && growthDirection + delta != 0)
-        SET_OUT_PARAMS_AND_RETURN(address, retainedAddr, offset, true);
-    UnmapPages(address, size);
-    /* Map the original chunk again since we chose the wrong direction. */
-    address = MapMemoryAt(initial, size - offset);
-    if (!address) {
-        /* Return non-null retainedAddr to indicate thread-related failure. */
-        UnmapPages(retainedAddr, offset);
-        SET_OUT_PARAMS_AND_RETURN(nullptr, retainedAddr, 0, false);
-    }
-    SET_OUT_PARAMS_AND_RETURN(address, nullptr, 0, false);
-}
-
-#undef SET_OUT_PARAMS_AND_RETURN
-
 void
 UnmapPages(void *p, size_t size)
 {
     if (munmap(p, size))
         MOZ_ASSERT(errno == ENOMEM);
 }
 
 bool
--- a/js/src/gc/Nursery-inl.h
+++ b/js/src/gc/Nursery-inl.h
@@ -23,15 +23,9 @@ js::Nursery::getForwardedPointer(T **ref
     const gc::RelocationOverlay *overlay = reinterpret_cast<const gc::RelocationOverlay *>(*ref);
     if (!overlay->isForwarded())
         return false;
     /* This static cast from Cell* restricts T to valid (GC thing) types. */
     *ref = static_cast<T *>(overlay->forwardingAddress());
     return true;
 }
 
-inline void
-js::Nursery::forwardBufferPointer(JSTracer* trc, HeapSlot **pSlotElems)
-{
-    trc->runtime()->gc.nursery.forwardBufferPointer(pSlotElems);
-}
-
 #endif /* gc_Nursery_inl_h */
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -820,17 +820,17 @@ js::Nursery::collect(JSRuntime *rt, JS::
     for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
         if (c->innerViews.needsSweepAfterMinorGC())
             c->innerViews.sweepAfterMinorGC(rt);
     }
     TIME_END(sweepArrayBufferViewList);
 
     // Update any slot or element pointers whose destination has been tenured.
     TIME_START(updateJitActivations);
-    js::jit::UpdateJitActivationsForMinorGC<Nursery>(&rt->mainThread, &trc);
+    js::jit::UpdateJitActivationsForMinorGC(&rt->mainThread, &trc);
     forwardedBuffers.finish();
     TIME_END(updateJitActivations);
 
     // Resize the nursery.
     TIME_START(resize);
     double promotionRate = trc.tenuredSize / double(allocationEnd() - start());
     if (promotionRate > 0.05)
         growAllocableSpace();
--- a/js/src/gc/Nursery.h
+++ b/js/src/gc/Nursery.h
@@ -31,17 +31,16 @@ class ObjectElements;
 class NativeObject;
 class HeapSlot;
 void SetGCZeal(JSRuntime *, uint8_t, uint32_t);
 
 namespace gc {
 struct Cell;
 class Collector;
 class MinorCollectionTracer;
-class ForkJoinNursery;
 } /* namespace gc */
 
 namespace types {
 struct TypeObject;
 }
 
 namespace jit {
 class CodeGenerator;
@@ -130,18 +129,16 @@ class Nursery
      * returns false and leaves |*ref| unset.
      */
     template <typename T>
     MOZ_ALWAYS_INLINE bool getForwardedPointer(T **ref);
 
     /* Forward a slots/elements pointer stored in an Ion frame. */
     void forwardBufferPointer(HeapSlot **pSlotsElems);
 
-    static void forwardBufferPointer(JSTracer* trc, HeapSlot **pSlotsElems);
-
     void maybeSetForwardingPointer(JSTracer *trc, void *oldData, void *newData, bool direct) {
         if (IsMinorCollectionTracer(trc) && isInside(oldData))
             setForwardingPointer(oldData, newData, direct);
     }
 
     size_t sizeOfHeapCommitted() const {
         return numActiveChunks_ * gc::ChunkSize;
     }
--- a/js/src/gc/RootMarking.cpp
+++ b/js/src/gc/RootMarking.cpp
@@ -13,17 +13,16 @@
 #include "jscntxt.h"
 #include "jsgc.h"
 #include "jsprf.h"
 #include "jstypes.h"
 #include "jswatchpoint.h"
 
 #include "builtin/MapObject.h"
 #include "frontend/BytecodeCompiler.h"
-#include "gc/ForkJoinNursery.h"
 #include "gc/GCInternals.h"
 #include "gc/Marking.h"
 #include "jit/MacroAssembler.h"
 #include "js/HashTable.h"
 #include "vm/Debugger.h"
 #include "vm/JSONParser.h"
 #include "vm/PropDesc.h"
 
@@ -115,24 +114,16 @@ MarkExactStackRootsAcrossTypes(T context
     MarkExactStackRootList<Value, MarkValueRoot>(trc, context, "exact-value");
     MarkExactStackRootList<types::Type, MarkTypeRoot>(trc, context, "types::Type");
     MarkExactStackRootList<Bindings, MarkBindingsRoot>(trc, context, "Bindings");
     MarkExactStackRootList<JSPropertyDescriptor, MarkPropertyDescriptorRoot>(
         trc, context, "JSPropertyDescriptor");
     MarkExactStackRootList<PropDesc, MarkPropDescRoot>(trc, context, "PropDesc");
 }
 
-#ifdef JSGC_FJGENERATIONAL
-static void
-MarkExactStackRoots(ThreadSafeContext* cx, JSTracer *trc)
-{
-    MarkExactStackRootsAcrossTypes<ThreadSafeContext*>(cx, trc);
-}
-#endif
-
 static void
 MarkExactStackRoots(JSRuntime* rt, JSTracer *trc)
 {
     for (ContextIter cx(rt); !cx.done(); cx.next())
         MarkExactStackRootsAcrossTypes<ThreadSafeContext*>(cx.get(), trc);
     MarkExactStackRootsAcrossTypes<PerThreadData*>(&rt->mainThread, trc);
 }
 
@@ -414,37 +405,16 @@ js::gc::MarkPersistentRootedChains(JSTra
 
     // Mark the PersistentRooted chains of types that are never null.
     PersistentRootedMarker<jsid>::markChain<MarkIdRoot>(trc, rt->idPersistentRooteds,
                                                         "PersistentRooted<jsid>");
     PersistentRootedMarker<Value>::markChain<MarkValueRoot>(trc, rt->valuePersistentRooteds,
                                                             "PersistentRooted<Value>");
 }
 
-#ifdef JSGC_FJGENERATIONAL
-void
-js::gc::MarkForkJoinStack(ForkJoinNurseryCollectionTracer *trc)
-{
-    ForkJoinContext *cx = ForkJoinContext::current();
-    PerThreadData *ptd = cx->perThreadData;
-
-    AutoGCRooter::traceAllInContext(cx, trc);
-    MarkExactStackRoots(cx, trc);
-    jit::MarkJitActivations(ptd, trc);
-
-#ifdef DEBUG
-    // There should be only JIT activations on the stack
-    for (ActivationIterator iter(ptd); !iter.done(); ++iter) {
-        Activation *act = iter.activation();
-        MOZ_ASSERT(act->isJit());
-    }
-#endif
-}
-#endif  // JSGC_FJGENERATIONAL
-
 void
 js::gc::GCRuntime::markRuntime(JSTracer *trc,
                                TraceOrMarkRuntime traceOrMark,
                                TraceRootsOrUsedSaved rootsSource)
 {
     gcstats::AutoPhase ap(stats, gcstats::PHASE_MARK_ROOTS);
 
     MOZ_ASSERT(trc->callback != GCMarker::GrayCallback);
deleted file mode 100644
--- a/js/src/jit-test/lib/parallelarray-helpers.js
+++ /dev/null
@@ -1,223 +0,0 @@
-/* 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/. */
-
-// Explanation of minItemsTestingThreshold:
-//
-// If the volume of input items in a test is small, then all of them
-// may be processed during warmup alone, and the parallel-invocation
-// will trivially succeed even if we are intentionally trying to
-// detect a failure.
-//
-// The maximum number of items processed by sequential warmups for
-// ArrayBuildPar is:
-//      maxSeqItems = maxBailouts * numSlices * CHUNK_SIZE
-//
-// For maxBailouts = 3, maxSeqItems == 3 * 8 * 32 == 768
-// For maxBailouts = 5, maxSeqItems == 5 * 8 * 32 == 1280
-//
-// Our test code does not have access to the values of these constants
-// (maxBailouts, numSlices, CHUNK_SIZE).  Therefore, the value of
-// minItemsTestingThreshold should be kept in sync with some value
-// greater than maxSeqItems as calculated above.
-//
-// This is still imperfect since it assumes numSlices <= 8, but
-// numSlices is machine-dependent.
-// (TODO: consider exposing numSlices via builtin/TestingFunctions.cpp)
-
-var minItemsTestingThreshold = 1024;
-
-// The standard sequence of modes to test.
-// First mode compiles for parallel exec.
-// Second mode checks that parallel exec does not bail.
-// Final mode tests the sequential fallback path.
-var MODE_STRINGS = ["compile", "par", "seq"];
-var MODES = MODE_STRINGS.map(s => ({mode: s}));
-
-var INVALIDATE_MODE_STRINGS = ["seq", "compile", "par", "seq"];
-var INVALIDATE_MODES = INVALIDATE_MODE_STRINGS.map(s => ({mode: s}));
-
-function build(n, f) {
-  var result = [];
-  for (var i = 0; i < n; i++)
-    result.push(f(i));
-  return result;
-}
-
-function range(n, m) {
-  // Returns an array with [n..m] (include on n, exclusive on m)
-
-  var result = [];
-  for (var i = n; i < m; i++)
-    result.push(i);
-  return result;
-}
-
-function seq_scan(array, f) {
-  // Simple sequential version of scan() that operates over an array
-
-  var result = [];
-  result[0] = array[0];
-  for (var i = 1; i < array.length; i++) {
-    result[i] = f(result[i-1], array[i]);
-  }
-  return result;
-}
-
-function assertAlmostEq(v1, v2) {
-  if (v1 === v2)
-    return true;
-  // + and other fp ops can vary somewhat when run in parallel!
-  assertEq(typeof v1, "number");
-  assertEq(typeof v2, "number");
-  var diff = Math.abs(v1 - v2);
-  var percent = diff / v1 * 100.0;
-  print("v1 = " + v1);
-  print("v2 = " + v2);
-  print("% diff = " + percent);
-  assertEq(percent < 1e-10, true); // off by an less than 1e-10%...good enough.
-}
-
-function assertStructuralEq(e1, e2) {
-    if (e1 instanceof Array && e2 instanceof Array) {
-      assertEqArray(e1, e2);
-    } else if (e1 instanceof Object && e2 instanceof Object) {
-      assertEq(e1.__proto__, e2.__proto__);
-      for (prop in e1) {
-        if (e1.hasOwnProperty(prop)) {
-          assertEq(e2.hasOwnProperty(prop), true);
-          assertStructuralEq(e1[prop], e2[prop]);
-        }
-      }
-    } else {
-      assertEq(e1, e2);
-    }
-}
-
-function assertEqArray(a, b) {
-    assertEq(a.length, b.length);
-    for (var i = 0, l = a.length; i < l; i++) {
-      try {
-        assertStructuralEq(a[i], b[i]);
-      } catch (e) {
-        print("...in index", i, "of", l);
-        throw e;
-      }
-    }
-}
-
-// Checks that whenever we execute this in parallel mode,
-// it bails out. `opFunction` should be a closure that takes a
-// mode parameter and performs some parallel array operation.
-// This closure will be invoked repeatedly.
-//
-// Here is an example of the expected usage:
-//
-//    assertParallelExecWillBail(function(m) {
-//        Array.buildPar(..., m)
-//    });
-//
-// where the `Array.buildPar(...)` is a stand-in
-// for some parallel array operation.
-function assertParallelExecWillBail(opFunction) {
-  opFunction({mode:"compile"}); // get the script compiled
-  opFunction({mode:"bailout"}); // check that it bails when executed
-}
-
-// Checks that when we execute this in parallel mode,
-// some bailouts will occur but we will recover and
-// return to parallel execution mode. `opFunction` is a closure
-// that expects a mode, just as in `assertParallelExecWillBail`.
-function assertParallelExecWillRecover(opFunction) {
-  opFunction({mode:"compile"}); // get the script compiled
-  opFunction({mode:"recover"}); // check that it bails when executed
-}
-
-// Checks that we will (eventually) be able to compile and exection
-// `opFunction` in parallel mode. Invokes `cmpFunction` with the
-// result.  For some tests, it takes many compile rounds to reach a TI
-// fixed point. So this function will repeatedly attempt to invoke
-// `opFunction` with `compile` and then `par` mode until getting a
-// successful `par` run.  After enough tries, of course, we give up
-// and declare a test failure.
-function assertParallelExecSucceeds(opFunction, cmpFunction) {
-  var failures = 0;
-  while (true) {
-    print("Attempting compile #", failures);
-    var result = opFunction({mode:"compile"});
-    cmpFunction(result);
-
-    try {
-      print("Attempting parallel run #", failures);
-      var result = opFunction({mode:"par"});
-      cmpFunction(result);
-      break;
-    } catch (e) {
-      failures++;
-      if (failures > 5) {
-        throw e; // doesn't seem to be reaching a fixed point!
-      } else {
-        print(e);
-      }
-    }
-  }
-
-  print("Attempting sequential run");
-  var result = opFunction({mode:"seq"});
-  cmpFunction(result);
-}
-
-// Compares an Array constructed in parallel against one constructed
-// sequentially. `func` should be the closure to provide as argument. For
-// example:
-//
-//    assertArraySeqParResultsEq([1, 2, 3], "map", i => i + 1)
-//
-// would check that `[1, 2, 3].map(i => i+1)` and `[1, 2, 3].mapPar(i => i+1)`
-// yield the same result.
-//
-// Based on `assertParallelExecSucceeds`
-function assertArraySeqParResultsEq(arr, op, func, cmpFunc) {
-  if (!cmpFunc)
-    cmpFunc = assertStructuralEq;
-  var expected = arr[op].apply(arr, [func]);
-  assertParallelExecSucceeds(
-    function (m) { return arr[op + "Par"].apply(arr, [func, m]); },
-    function (r) { cmpFunc(expected, r); });
-}
-
-// Similar to `compareAgainstArray`, but for the `scan` method which
-// does not appear on array.
-function testArrayScanPar(jsarray, func, cmpFunction) {
-  if (!cmpFunction)
-    cmpFunction = assertStructuralEq;
-  var expected = seq_scan(jsarray, func);
-
-  // Unfortunately, it sometimes happens that running 'par' twice in a
-  // row causes bailouts and other unfortunate things!
-
-  assertParallelExecSucceeds(
-    function(m) {
-      print(m.mode + " " + m.expect);
-      var p = jsarray.scanPar(func, m);
-      return p;
-    },
-    function(r) {
-      cmpFunction(expected, r);
-    });
-}
-
-// Checks that `opFunction`, when run with each of the modes
-// in `modes`, returns the same value each time.
-function assertParallelModesCommute(modes, opFunction) {
-  var expected = undefined;
-  var acc = opFunction(modes[0]);
-  assertParallelExecSucceeds(
-    opFunction,
-    function(r) {
-      if (expected === undefined)
-        expected = r;
-      else
-        assertStructuralEq(expected, r);
-    });
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/asm.js/testBug978714.js
+++ /dev/null
@@ -1,9 +0,0 @@
-if (!getBuildConfiguration().parallelJS)
-    quit();
-
-var y = Array.buildPar(9, function() {});
-Array.prototype.every.call(y, (function() {
-    "use asm";
-    function f() {}
-    return f
-}))
deleted file mode 100644
--- a/js/src/jit-test/tests/auto-regress/bug784015.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// |jit-test| error:Error
-
-// Binary: cache/js-dbg-64-c676b554c7bb-linux
-// Flags:
-//
-
-if (getBuildConfiguration().parallelJS) {
-  var p = new ParallelArray([1,25e8 ,3,4]);
-  var pp = p.partition(.34 );
-} else {
-  throw new Error();
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/collections/Array-build-basic.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// Array.build basics
-
-if (getBuildConfiguration().parallelJS) {
-  load(libdir + "asserts.js");
-  load(libdir + "eqArrayHelper.js");
-
-  function myBuild(l, f) {
-    var a = [];
-    for (var i = 0; i < l; i++)
-      a.push(f(i));
-    return a;
-  }
-
-  // Test that build returns an identical, but new array.
-  var a1 = [];
-  for (var i = 0; i < 100; i++)
-    a1[i] = Math.random();
-  var a2 = Array.build(a1.length, (i) => a1[i]);
-
-  assertEq(a1 === a2, false);
-  assertEqArray(a2, a1);
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/collections/Array-build-surfaces.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// Check superficial features of Array.build.
-
-if (getBuildConfiguration().parallelJS) {
-  load(libdir + "asserts.js");
-
-  var desc = Object.getOwnPropertyDescriptor(Array, "build");
-  assertEq(desc.configurable, true);
-  assertEq(desc.enumerable, false);
-  assertEq(desc.writable, true);
-  assertEq(Array.build.length, 2);
-  assertThrowsInstanceOf(() => new Array.build(), TypeError);  // not a constructor
-
-  // Must pass a function to second argument.
-  for (let v of [undefined, null, false, "cow"])
-    assertThrowsInstanceOf(() => Array.build(1, v), TypeError);
-
-  // The first argument must be a legal length.
-  assertThrowsInstanceOf(() => Array.build(-1, function() {}), RangeError);
-
-  // When the this-value passed in is not a constructor, the result is an array.
-  for (let v of [undefined, null, false, "cow"])
-    assertEq(Array.isArray(Array.build.call(v, 1, function() {})), true);
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/gc/bug-1014972.js
+++ /dev/null
@@ -1,14 +0,0 @@
-if (getBuildConfiguration().parallelJS) {
-    Function("\
-        Array.buildPar(6947, (function() {\
-            return {\
-                a: new Function,\
-                b1: function() {},\
-                b2: function() {},\
-                b3: function() {},\
-                b4: function() {}\
-            }\
-        }));\
-        selectforgc(new Object);\
-    ")()
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/gc/bug-1055034.js
+++ /dev/null
@@ -1,14 +0,0 @@
-function range(n, m) {
-  var result = [];
-  for (var i = n; i < m; i++)
-    result.push(i);
-  return result;
-}
-function run(arr, func) {
-  var expected = arr["map"].apply(arr, [func]);
-  function f(m) { return arr["mapPar"].apply(arr, [func, m]); }
-    f({mode:"compile"});
-    f({mode:"seq"});
- }
-if (getBuildConfiguration().parallelJS)
-  run(range(0, 1024), function (i) { var a = []; a.length = i; });
deleted file mode 100644
--- a/js/src/jit-test/tests/gc/bug-975959.js
+++ /dev/null
@@ -1,20 +0,0 @@
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-try {
-    y = z = [];
-    y[1] = x
-    for (var e, x = [];; d) {}
-} catch (e) {}
-try {
-    Object.defineProperty(this, "y", {
-        get: function() {
-            z.filterPar(function() {})
-        }
-    })(1 instanceof 2)
-} catch (e) {}
-y
-verifyprebarriers()
-y
-verifyprebarriers()
-y
deleted file mode 100644
--- a/js/src/jit-test/tests/gc/bug-992866.js
+++ /dev/null
@@ -1,15 +0,0 @@
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-test([0], "map", function (... Object)  {
-  var x = [];
-  for (var i = 0; i < 10; i++) {
-      x[i] = {};
-  }
-});
-
-function test(arr, op, func) {
-  for (var i = 0; i < 1000; i++) {
-    arr[op + "Par"].apply(arr, [func, undefined]);
-  }
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/900683.js
+++ /dev/null
@@ -1,37 +0,0 @@
-if (typeof ParallelArray === "undefined")
-  quit();
-
-ParallelArray(11701, function() {
-    return /x/
-}).reduce(function(a) {
-    if (a % 9) {
-        for (var y = 0; y; ++y) {}
-        return []
-    }
-})
-
-function foo() {
-  return "foo";
-}
-
-function test() {
-var a = [1, 2, 3];
-var s = '';
-for (var x of a)
-  for (var i of 'y')
-    s += '' + foo()
-} test();
-
-ignoreComments = [];
-
-function bug909276() {
-var actual = '';
-for (var next of ignoreComments) {
-  actual += a;
-  for (var b in x) {
-    actual += b.eval("args = [-0, NaN, -1/0]; this.f(-0, NaN, -1/0);");
-  }
-}
-var y = Iterator([1,2,3], true);
-for (var c in y) {}
-} bug909276();
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug905989.js
+++ /dev/null
@@ -1,13 +0,0 @@
-if (typeof ParallelArray === "undefined")
-  quit();
-
-function TestCase(n, d, e, a) {};
-function reportCompare() {
-  new TestCase();
-}
-reportCompare();
-TestCase = ParallelArray;
-try {
-  reportCompare();
-} catch(exc1) {}
-reportCompare();
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug906885.js
+++ /dev/null
@@ -1,8 +0,0 @@
-if (typeof ParallelArray === "undefined")
-  quit();
-
-ParallelArray([57], function() {
-    return (Math.max(2207764374, (function() {
-        return 1
-    })()))
-})
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug908867.js
+++ /dev/null
@@ -1,42 +0,0 @@
-if (typeof ParallelArray === "undefined")
-  quit();
-
-x = ParallelArray()
-y = x.shape
-Object.defineProperty(this, "z", {
-    get: function() {
-        return x.flatten()
-    }
-})
-Object.defineProperty(y, 5, {
-    value: this
-});
-y[8] = z
-valueOf = (function() {
-    function f() {
-        (.9 % 1) > f
-    }
-    return f
-})(this, {})
-x.shape.join()
-
-
-assertArraySeqParResultsEq(range(0, 1024), "filter", function(e, i) { return (i % (1.1)) != 0; });
-function range(n, m) {
-  var result = [];
-  for (var i = n; i < m; i++)
-    result.push(i);
-  return result;
-}
-function assertArraySeqParResultsEq(arr, op, func) {
-  arr[op].apply(arr, [func]);
-}
-
-
-function foo(v) {
-  if (v < -200) return 0;
-  if (v > 200) return 0;
-  return v % 1;
-}
-assertEq(foo(0.9), 0.9);
-assertEq(foo(0.9), 0.9);
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug911708.js
+++ /dev/null
@@ -1,11 +0,0 @@
-if (typeof ParallelArray === "undefined")
-  quit();
-
-function x() {
-    yield x
-}
-new(x)
-ParallelArray([7247], function() {
-    --x
-    eval("")
-})
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug916761.js
+++ /dev/null
@@ -1,11 +0,0 @@
-if (typeof ParallelArray === "undefined")
-    quit();
-
-function toString(r) {
-    var result = "";
-    for (var i = 0; i < 5; i++)
-	result += r.get(i);
-    return result;
-}
-Array.prototype[2] = 'y';
-assertEq(toString(new ParallelArray(['x', 'x'])), "xxyundefinedundefined");
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug936361.js
+++ /dev/null
@@ -1,5 +0,0 @@
-if (typeof ParallelArray === "undefined")
-  quit();
-
-x = ParallelArray([1942], function() {})
-x + watch.call(x, "length", (function() {}));
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug938431.js
+++ /dev/null
@@ -1,9 +0,0 @@
-if (typeof ParallelArray === "undefined")
-  quit();
-
-function x() {}
-ParallelArray(3385, function(y) {
-    Object.defineProperty([], 8, {
-        e: (y ? x : Math.fround(1))
-    })
-})
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug977674.js
+++ /dev/null
@@ -1,41 +0,0 @@
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-function testReduce() {
-  function sum(a, b) {
-    var r = a + b;
-  }
-  var array = build(8 * 0X0aaec , function() { return 1; });
-  var parResult = array.reducePar(sum);
-}
-for (var ix = 0; ix < 3; ++ix) {
-  testReduce();
-}
-function build(n, f) {
-  var result = [];
-  for (var i = 0; i < n; i++)
-    result.push(f(i));
-  return result;
-}
-function seq_scan(array, f) {
-  for (var i = 1; i < array.length; i++) {
-  }
-}
-function assertAlmostEq(v1, v2) {
-    if (e1 instanceof Array && e2 instanceof Array) {
-      for (prop in e1) {
-        if (e1.hasOwnProperty(prop)) {        }
-      }
-    }
-}
-function assertEqArray(a, b) {
-    for (var i = 0, l = a.length; i < l; i++) {
-      try {      } catch (e) {      }
-    }
-}
-function assertParallelExecWillRecover(opFunction) {
-assertParallelExecSucceeds(
-    function(m) {},
-    function(r) {}
-);
-}
--- a/js/src/jit-test/tests/ion/inlining/TypedObject-TypeDescrIsArrayType-unknown.js
+++ b/js/src/jit-test/tests/ion/inlining/TypedObject-TypeDescrIsArrayType-unknown.js
@@ -30,19 +30,26 @@ if (!this.TypedObject) {
 
 var T = TypedObject;
 var AT = new T.ArrayType(T.int32, 100);
 
 function check(v) {
     return v.map(x => x+1);
 }
 
+function Array_build(n, f) {
+  var a = new Array(n);
+  for ( var i=0 ; i < n ; i++ )
+    a[i] = f(i);
+  return a;
+}
+
 function test() {
     var w1 = AT.build(x => x+1);
-    var w2 = Array.build(100, x => x+1);
+    var w2 = Array_build(100, x => x+1);
     w2.map = w1.map;
     var a = [ w1, w2 ];
     for ( var i=0 ; i < 2000 ; i++ )
 	try { a[i%2] = check(a[i%2]); } catch (e) { assertEq( i%2, 1 ); }
     return a[0];
 }
 
 var w = test();
--- a/js/src/jit-test/tests/ion/testFloat32.js
+++ b/js/src/jit-test/tests/ion/testFloat32.js
@@ -22,21 +22,16 @@
         for (var i = 0; i < v.length; ++i)
         v[i] = i;
     var t = (false  );
     for (var i = 0; i < i .length; ++i)
         t += v[i];
     })();
     //
     (function() {
-        if (typeof ParallelArray !== "undefined")
-        ParallelArray([1606], Math.fround)
-    })();
-    //
-    (function() {
         x = y = {};
         z = new Float32Array(6)
         for (c in this) {
             Array.prototype.unshift.call(x, new ArrayBuffer())
         }
         Array.prototype.sort.call(x, (function (j) {
             y.s = z[2]
         }))
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-buildPar-in-loop.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// |jit-test| slow;
-
-load(libdir + "parallelarray-helpers.js")
-
-function buildComprehension() {
-  var pa1 = Array.buildPar(256, function (idx) { return idx; });
-  for (var i = 0; i < 20000; i++) {
-    print(i);
-    buildAndCompare();
-  }
-
-  function buildAndCompare() {
-    // this will be ion-generated:
-    var pa2 = Array.buildPar(256, function (idx) { return idx; });
-    assertStructuralEq(pa1, pa2);
-  }
-}
-
-if (getBuildConfiguration().parallelJS)
-  buildComprehension();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-buildPar-nested.js
+++ /dev/null
@@ -1,17 +0,0 @@
-load(libdir + "parallelarray-helpers.js")
-
-function test() {
-  var pa1 = Array.buildPar(256, function (x) {
-    return Array.buildPar(256, function(y) { return x*1000 + y; });
-  });
-
-  for (var x = 0; x < 256; x++) {
-    var pax = pa1[x];
-    for (var y = 0; y < 256; y++) {
-      assertEq(pax[y], x * 1000 + y);
-    }
-  }
-}
-
-if (getBuildConfiguration().parallelJS)
-  test();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-buildPar.js
+++ /dev/null
@@ -1,11 +0,0 @@
-load(libdir + "parallelarray-helpers.js")
-
-function buildComprehension() {
-  // 1D comprehension
-  var p = Array.buildPar(10, function (idx) { return idx; });
-  var a = [0,1,2,3,4,5,6,7,8,9];
-  assertEqArray(p, a);
-}
-
-if (getBuildConfiguration().parallelJS)
-  buildComprehension();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-filterPar-all.js
+++ /dev/null
@@ -1,3 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(range(0, 1024), "filter", function() { return true; });
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-filterPar-every-third-element.js
+++ /dev/null
@@ -1,6 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(range(0, 1024), "filter", function(e, i) {
-    return (i % 3) != 0;
-  });
-
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-filterPar-non-divisible.js
+++ /dev/null
@@ -1,7 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-// since we divide things into chunks of 32, and filter uses some
-// bitsets, test that all that logic works fine if the number of items
-// is not evenly divisible by 32:
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(range(0, 617), "filter", function(i) { return (i % 2) == 0; });
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-filterPar-none.js
+++ /dev/null
@@ -1,3 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(range(0, 1024), "filter", function() { return false; });
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-filterPar-short.js
+++ /dev/null
@@ -1,3 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(range(0, 4), "filter", function(i) { return i % 2; });
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-filterPar-truthy.js
+++ /dev/null
@@ -1,19 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testFilterMisc() {
-  function truthy(e, i, c) {
-    switch (i % 6) {
-      case 0: return 1;
-      case 1: return "";
-      case 2: return {};
-      case 3: return [];
-      case 4: return false;
-      case 5: return true;
-    }
-  }
-
-  assertArraySeqParResultsEq(range(0, 1024), "filter", truthy);
-}
-
-if (getBuildConfiguration().parallelJS)
-  testFilterMisc();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-filterPar-very-few.js
+++ /dev/null
@@ -1,3 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(range(0, 1024), "filter", function(i) { return i <= 1 || i >= 1022; });
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-mapPar-add-from-upvar-field.js
+++ /dev/null
@@ -1,13 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-var SIZE = 4096;
-
-function testMap() {
-  var q = {f: 22};
-  assertArraySeqParResultsEq(range(0, SIZE), "map", function(e) {
-    return e + q.f;
-  });
-}
-
-if (getBuildConfiguration().parallelJS)
-  testMap();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-mapPar-assign-to-def-prop.js
+++ /dev/null
@@ -1,10 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function wrapInObject(v) {
-    var obj = {f: 2};
-    obj.f += v;
-    return obj;
-}
-
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(range(0, 64), "map", wrapInObject);
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-mapPar-factorial.js
+++ /dev/null
@@ -1,10 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function factorial(n) {
-  if (n == 0)
-    return 1;
-  return n * factorial(n - 1);
-}
-
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(range(0, 64), "map", factorial);
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-mapPar-fn-args.js
+++ /dev/null
@@ -1,19 +0,0 @@
-function testMap() {
-  // Test map elemental fun args
-  var p = [1,2,3,4];
-  var m = p.mapPar(function(e) {
-    assertEq(e >= 1 && e <= 4, true);
-  });
-  var m = p.mapPar(function(e,i) {
-    assertEq(e >= 1 && e <= 4, true);
-    assertEq(i >= 0 && i < 4, true);
-  });
-  var m = p.mapPar(function(e,i,c) {
-    assertEq(e >= 1 && e <= 4, true);
-    assertEq(i >= 0 && i < 4, true);
-    assertEq(c, p);
-  });
-}
-
-if (getBuildConfiguration().parallelJS)
-  testMap();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-mapPar-inc.js
+++ /dev/null
@@ -1,4 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(range(0, 512), "map", function(e) { return e+1; });
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-mapPar-nested.js
+++ /dev/null
@@ -1,21 +0,0 @@
-load(libdir + "parallelarray-helpers.js")
-
-function test() {
-  var pa0 = range(0, 256);
-
-  var pa1;
-  for (var i in MODES)
-    pa1 = Array.buildPar(256, function (x) {
-      return pa0.mapPar(function(y) { return x * 1000 + y; });
-    }, MODES[i]);
-
-  for (var x = 0; x < 256; x++) {
-    var pax = pa1[x];
-    for (var y = 0; y < 256; y++) {
-      assertEq(pax[y], x * 1000 + y);
-    }
-  }
-}
-
-if (getBuildConfiguration().parallelJS)
-  test();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-mapPar-short.js
+++ /dev/null
@@ -1,12 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function test() {
-  // Test what happens if the length of the array is very short (i.e.,
-  // less than the number of cores).  There used to be a bug in this
-  // case that led to crashes or other undefined behavior.
-  var makeadd1 = function (v) { return [v]; }
-  assertArraySeqParResultsEq(range(1, 3), "map", makeadd1);
-}
-
-if (getBuildConfiguration().parallelJS)
-  test();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-reducePar-bail.js
+++ /dev/null
@@ -1,32 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-// Tests that reduce saves its intermediate state correctly by
-// inducing a bailout in the middle of the reduction.  This test may
-// fail to test what it is intended to test if the wrong number of
-// worker threads etc are present.  It reproduced an existing bug when
-// used with 8 worker threads.
-
-function testReduce() {
-  var aCounter = 0;
-  function sum(a, b) {
-    var r = a + b;
-    if (r == 234) // occurs once per slice
-      aCounter++;
-    return r;
-  }
-
-  // We use a big array, to make sure that the test runs with 64 slices.
-  var array = build(8 * 4096, function() { return 1; });
-  var seqResult = array.reduce(sum);
-  var seqCounter = aCounter;
-
-  aCounter = 0;
-  var parResult = array.reducePar(sum);
-  var parCounter = aCounter;
-
-  assertEq(true, parCounter >= seqCounter);
-  assertStructuralEq(parResult, seqResult);
-}
-
-if (getBuildConfiguration().parallelJS)
-  testReduce();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-reducePar-fn-args.js
+++ /dev/null
@@ -1,16 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testReduce() {
-  // Test reduce elemental fun args
-  var N = 64;
-  var p = range(1, N+1);
-  var r = p.reducePar(function (a, b) {
-    assertEq(a >= 1 && a <= N, true);
-    assertEq(b >= 1 && b <= N, true);
-    return a;
-  });
-  assertEq(r >= 1 && r <= N, true);
-}
-
-if (getBuildConfiguration().parallelJS)
-  testReduce();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-reducePar-length-one.js
+++ /dev/null
@@ -1,10 +0,0 @@
-function testReduceOne() {
-    // Note: parallel execution with only 1 element will generally
-    // bailout, so don't use assertParallelArrayModesEq() here.
-    var p = [1];
-    var r = p.reducePar(function (v, p) { return v*p; });
-    assertEq(r, 1);
-}
-
-if (getBuildConfiguration().parallelJS)
-  testReduceOne();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-reducePar-mul-short.js
+++ /dev/null
@@ -1,16 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testReduce() {
-  // This test is interesting because during warmup v*p remains an
-  // integer but this ceases to be true once real execution proceeds.
-  // By the end, it will just be some double value.
-
-  function mul(v, p) { return v*p; }
-
-  // Ensure that the array only contains values between 1 and 4.
-  var array = range(1, 513).map(function(v) { return (v % 4) + 1; });
-  assertArraySeqParResultsEq(array, "reduce", mul, assertAlmostEq);
-}
-
-if (getBuildConfiguration().parallelJS)
-  testReduce();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-reducePar-mul.js
+++ /dev/null
@@ -1,15 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testReduce() {
-  // This test is interesting because during warmup v*p remains an
-  // integer but this ceases to be true once real execution proceeds.
-  // By the end, it will just be infinity. Note that this is a case
-  // where the non-commutative of floating point becomes relevant,
-  // so we must use assertAlmostEq.
-  function mul(v, p) { return v*p; }
-  var array = range(1, 513);
-  assertArraySeqParResultsEq(array, "reduce", mul, assertAlmostEq);
-}
-
-if (getBuildConfiguration().parallelJS)
-  testReduce();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-reducePar-nested-sum-each-row.js
+++ /dev/null
@@ -1,23 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function test() {
-  var array1 = range(0, 512);
-  var array2 = Array.build(512, function(i) {
-    return i*1000000 + array1.reduce(sum);
-  });
-
-  assertParallelExecSucceeds(
-    function (m) {
-      return  Array.buildPar(512, function(i) {
-        return i*1000000 + array1.reducePar(sum);
-      });
-    },
-    function (r) {
-      assertStructuralEq(array2, r);
-    });
-
-  function sum(a, b) { return a+b; }
-}
-
-if (getBuildConfiguration().parallelJS)
-  test();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-reducePar-sum.js
+++ /dev/null
@@ -1,9 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testReduce() {
-  function sum(v, p) { return v+p; }
-  assertArraySeqParResultsEq(range(1, 513), "reduce", sum);
-}
-
-if (getBuildConfiguration().parallelJS)
-  testReduce();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-scanPar-fn-args.js
+++ /dev/null
@@ -1,12 +0,0 @@
-function testScan() {
-  // Test reduce elemental fun args
-  var p = [1,2,3,4];
-  var r = p.scanPar(function (a, b) {
-    assertEq(a >= 1 && a <= 4, true);
-    assertEq(b >= 1 && b <= 4, true);
-    return a;
-  });
-}
-
-if (getBuildConfiguration().parallelJS)
-  testScan();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-scanPar-one.js
+++ /dev/null
@@ -1,10 +0,0 @@
-function testScanOne() {
-  function f(v, p) { throw "This should never be called."; }
-  var p = [1];
-  var s = p.scanPar(f);
-  assertEq(s[0], 1);
-  assertEq(s[0], p.reducePar(f));
-}
-
-if (getBuildConfiguration().parallelJS)
-  testScanOne();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-scanPar-sorted.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// |jit-test| slow;
-
-load(libdir + "parallelarray-helpers.js");
-
-function mergeSorted(l1, l2) {
-  var result = [];
-  var i1 = 0, i2 = 0, j = 0;
-  while (i1 < l1.length && i2 < l2.length) {
-    if (l1[i1] < l2[i2])
-      result[j++] = l1[i1++];
-    else
-      result[j++] = l2[i2++];
-  }
-  while (i1 < l1.length) {
-    result[j++] = l1[i1++];
-  }
-  while (i2 < l2.length) {
-    result[j++] = l2[i2++];
-  }
-  return result;
-}
-
-function test() {
-  var elts = [];
-  var ints = range(1, 5), c = 0;
-
-  // Using 2048 as the length of elts induces bailouts due to GC.
-  // This exposed various bugs.
-  for (var i = 0; i < 2048; i++)
-    elts[i] = ints;
-
-  var scanned1 = seq_scan(elts, mergeSorted);
-  var scanned2 = elts.scanPar(mergeSorted);
-  assertStructuralEq(scanned1, scanned2);
-}
-
-if (getBuildConfiguration().parallelJS)
-  test();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-scanPar-sum.js
+++ /dev/null
@@ -1,4 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-function sum(a, b) { return a+b; }
-if (getBuildConfiguration().parallelJS)
-  testArrayScanPar(range(1, 1024), sum);
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/Array-throws.js
+++ /dev/null
@@ -1,54 +0,0 @@
-load(libdir + "asserts.js");
-
-function testArrayThrows() {
-  // Test kernel not being callable.
-  var a = [1,2,3,4,5,6,7,8];
-  for (var [opName, args] in ["mapPar", [{}],
-                              "filterPar", [{}],
-                              "reducePar", [{}],
-                              "scanPar", [{}]])
-  {
-    assertThrowsInstanceOf(function () { a[opName].apply(a, args); }, TypeError);
-  }
-
-  assertThrowsInstanceOf(function () {
-    a.scatterPar(a, 0, {});
-  }, TypeError);
-
-  assertThrowsInstanceOf(function () {
-    Array.buildPar(1024, {});
-  }, TypeError);
-
-  // Test bad lengths.
-  assertThrowsInstanceOf(function () {
-    Array.buildPar(0xffffffff + 1, function () {});
-  }, RangeError);
-
-  assertThrowsInstanceOf(function () {
-    a.scatterPar(a, 0, function () {}, 0xffffffff + 1);
-  }, RangeError);
-
-  // Test empty reduction.
-  for (var opName in ["reducePar", "scanPar"]) {
-    assertThrowsInstanceOf(function () {
-      var a = [];
-      a[opName](function (v, p) { return v * p; });
-    }, TypeError);
-  }
-
-  // Test scatter:
-  //  - no conflict function.
-  //  - out of bounds
-  var p = [1,2,3,4,5];
-
-  assertThrowsInstanceOf(function () {
-    p.scatterPar([0,1,0,3,4]);
-  }, Error);
-
-  assertThrowsInstanceOf(function () {
-    p.scatterPar([0,1,0,3,11]);
-  }, Error);
-}
-
-if (getBuildConfiguration().parallelJS)
-  testArrayThrows();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/TypedObj-fromPar-outpointer-struct.js
+++ /dev/null
@@ -1,36 +0,0 @@
-// Test basic fromPar parallel execution using an out
-// pointer to generate a struct return.
-
-if (!getBuildConfiguration().parallelJS)
-  quit();
-
-load(libdir + "parallelarray-helpers.js")
-
-var { ArrayType, StructType, uint32 } = TypedObject;
-
-function test() {
-  var L = minItemsTestingThreshold;
-
-  var Matrix = uint32.array(L, 2);
-  var matrix = new Matrix();
-  for (var i = 0; i < L; i++)
-    matrix[i][0] = i;
-
-  var Point = new StructType({x: uint32, y: uint32});
-  var Points = Point.array(L);
-
-  assertParallelExecSucceeds(
-    // FIXME Bug 983692 -- no where to pass `m` to
-    function(m) Points.fromPar(matrix, function(p, i, c, out) { out.y = p[0]; }),
-    function(points) {
-      for (var i = 0; i < L; i++) {
-        assertEq(matrix[i][0], i);
-        assertEq(matrix[i][1], 0);
-        assertEq(points[i].x, 0);
-        assertEq(points[i].y, i);
-      }
-    });
-}
-
-test();
-
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/TypedObj-fromPar-return-scalar.js
+++ /dev/null
@@ -1,27 +0,0 @@
-// Test basic fromPar parallel execution using a scalar return value.
-
-if (!getBuildConfiguration().parallelJS)
-  quit();
-
-load(libdir + "parallelarray-helpers.js")
-
-var { uint8, uint32 } = TypedObject;
-
-function test() {
-  var L = minItemsTestingThreshold;
-  var Uints = uint32.array(L);
-  var Uint8s = uint8.array(L);
-
-  var uint32s = new Uints();
-
-  assertParallelExecSucceeds(
-    // FIXME Bug 983692 -- no where to pass `m` to
-    function(m) Uint8s.fromPar(uint32s, function(e) e + 1),
-    function(uint8s) {
-      for (var i = 0; i < L; i++)
-        assertEq((uint32s[i] + 1) & 0xFF, uint8s[i]);
-    });
-}
-
-test();
-
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/TypedObj-mapPar-outpointer-struct.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Test basic mapPar parallel execution using an out
-// pointer to generate a struct return.
-
-if (!this.hasOwnProperty("TypedObject"))
-  quit();
-
-load(libdir + "parallelarray-helpers.js")
-
-var { ArrayType, StructType, uint32 } = TypedObject;
-
-function test() {
-  var L = minItemsTestingThreshold;
-  var Point = new StructType({x: uint32, y: uint32});
-  var Points = Point.array(L);
-  var points = new Points();
-  for (var i = 0; i < L; i++)
-    points[i].x = i;
-
-  assertParallelExecSucceeds(
-    // FIXME Bug 983692 -- no where to pass `m` to
-    function(m) points.mapPar(function(p, i, c, out) { out.y = p.x; }),
-    function(points2) {
-      for (var i = 0; i < L; i++) {
-        assertEq(points[i].x, i);
-        assertEq(points[i].y, 0);
-        assertEq(points2[i].x, 0);
-        assertEq(points2[i].y, i);
-      }
-    });
-}
-
-test();
-
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/TypedObj-mapPar-return-scalar.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// Test basic mapPar parallel execution.
-
-if (!this.hasOwnProperty("TypedObject"))
-  quit();
-
-load(libdir + "parallelarray-helpers.js")
-
-var { ArrayType, StructType, uint32 } = TypedObject;
-
-function test() {
-  var L = minItemsTestingThreshold;
-  var Uints = uint32.array(L);
-  var uints1 = new Uints();
-  assertParallelExecSucceeds(
-    // FIXME Bug 983692 -- no where to pass `m` to
-    function(m) uints1.mapPar(function(e) e + 1),
-    function(uints2) {
-      for (var i = 0; i < L; i++)
-        assertEq(uints1[i] + 1, uints2[i]);
-    });
-}
-
-test();
-
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/alloc-array-nonwritable.js
+++ /dev/null
@@ -1,40 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function buildSimple()
-{
-  var subarr = [];
-  for (var i = 0; i < 100; i++)
-    subarr[i] = 3;
-  subarr[100] = 0;
-
-  var expected = [];
-  for (var i = 0; i < 256; i++)
-    expected[i] = subarr;
-
-  var pa = Array.buildPar(256, function(_) {
-    var arrs = [];
-    for (var i = 0; i < 100; i++)
-      arrs[i] = [0, 1, 2, 3, 4, 5, 6];
-
-    arrs[100] =
-      Object.defineProperty([0, 1, 2, 3, 4, 5, 6, 7],
-                            "length",
-                            { writable: false, value: 7 });
-
-    for (var i = 0; i < 101; i++)
-      arrs[i][7] = 7;
-
-    var x = [];
-    for (var i = 0; i < 101; i++) {
-      var a = arrs[i];
-      x[i] = +(a.length === 8) + 2 * +("7" in a);
-    }
-
-    return x;
-  });
-
-  assertEqArray(pa, expected);
-}
-
-if (getBuildConfiguration().parallelJS)
-  buildSimple();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/alloc-array.js
+++ /dev/null
@@ -1,33 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function buildSimple() {
-
-    assertParallelModesCommute(["seq", "par"], function(m) {
-        return Array.buildPar(256, function(i) {
-            return [i, i+1, i+2, i+3];
-        }, m);
-    });
-
-    assertParallelModesCommute(["seq", "par"], function(m) {
-        return Array.buildPar(256, function(i) {
-            var x = [];
-            for (var i = 0; i < 4; i++) {
-                x[i] = i;
-            }
-            return x;
-        }, m);
-    });
-
-    assertParallelModesCommute(["seq", "par"], function(m) {
-        return Array.buildPar(256, function(i) {
-            var x = [];
-            for (var i = 0; i < 99; i++) {
-                x[i] = i;
-            }
-            return x;
-        }, m);
-    });
-}
-
-if (getBuildConfiguration().parallelJS)
-  buildSimple();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/alloc-different-objs.js
+++ /dev/null
@@ -1,22 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testMap() {
-  assertArraySeqParResultsEq(range(0, 64), "map", function (v) {
-    var x = [];
-    var N = 2;
-    for (var i = 0; i < 10; i++) {
-      if ((i % N) == 0) {
-        x[i] = {f1: v};
-      } else if ((i % N) == 1) {
-        x[i] = {f1: v, f2: v, f3: v,
-                f4: v, f5: v, f6: v,
-                f7: v, f8: v, f9: v};
-      }
-    }
-    return x;
-  });
-}
-
-if (getBuildConfiguration().parallelJS)
-  testMap();
-
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/alloc-many-objs.js
+++ /dev/null
@@ -1,24 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testMap() {
-  // At least on my machine, this test is successful, whereas
-  // `alloc-too-many-objs.js` fails to run in parallel because of
-  // issues around GC.
-
-  var nums = range(0, 10);
-
-  assertParallelModesCommute(["seq", "par"], function(m) {
-    print(m.mode+" "+m.expect);
-    nums.mapPar(function (v) {
-      var x = [];
-      for (var i = 0; i < 20000; i++) {
-        x[i] = {from: v};
-      }
-      return x;
-    }, m)
-  });
-}
-
-if (getBuildConfiguration().parallelJS)
-  testMap();
-
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/alloc-obj.js
+++ /dev/null
@@ -1,12 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function buildSimple() {
-    assertParallelModesCommute(["seq", "par"], function(m) {
-        return Array.buildPar(256, function(i) {
-            return { x: i, y: i + 1, z: i + 2 };
-        }, m);
-    });
-}
-
-if (getBuildConfiguration().parallelJS)
-  buildSimple();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/alloc-too-many-objs.js
+++ /dev/null
@@ -1,37 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testMap() {
-
-  // Note: This is the same kernel function as `alloc-many-objs`, but
-  // with a larger bound.  This often fails par. exec. because it
-  // triggers GC at inconvenient times.  But let's just test that it
-  // doesn't crash or something!
-
-  var ints = range(0, 100000);
-
-  // The disqual occurs because each time we try to run we wind up
-  // bailing due to running out of memory or requesting a GC.
-  assertParallelExecWillBail(function (m) {
-    ints.mapPar(kernel, m);
-  });
-
-  function kernel(v) {
-    var x = [];
-
-    if (inParallelSection()) {
-      // don't bother to stress test the non-parallel paths!
-      for (var i = 0; i < 50; i++) {
-        x[i] = [];
-        for (var j = 0; j < 1024; j++) {
-          x[i][j] = j;
-        }
-      }
-    }
-
-    return x;
-  }
-}
-
-if (getBuildConfiguration().parallelJS)
-  testMap();
-
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/arguments-index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-if (getBuildConfiguration().parallelJS) {
-  assertParallelExecSucceeds(
-    function (m) {
-      return Array.buildPar(minItemsTestingThreshold,
-                            function (i) { return arguments[0]; },
-                            m);
-    },
-    function (r) {
-      assertStructuralEq(Array.build(minItemsTestingThreshold,
-                                     function (i) { return arguments[0]; }),
-                         r);
-    });
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/arguments-length.js
+++ /dev/null
@@ -1,15 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-if (getBuildConfiguration().parallelJS) {
-  assertParallelExecSucceeds(
-    function (m) {
-      return Array.buildPar(minItemsTestingThreshold,
-                            function (i) { return arguments.length; },
-                            m);
-    },
-    function (r) {
-      assertStructuralEq(Array.build(minItemsTestingThreshold,
-                                     function (i) { return arguments.length }),
-                         r);
-    });
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bailout-executed.js
+++ /dev/null
@@ -1,23 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function makeObject(e, i, c) {
-  var v = {element: e, index: i, collection: c};
-
-  if (e == 0) // note: happens once
-    delete v.index;
-
-  return v;
-}
-
-function test() {
-  var array = range(0, 768);
-  var array1 = array.map(makeObject);
-
-  assertParallelExecWillRecover(function (m) {
-    var pa = array.mapPar(makeObject, m);
-    assertStructuralEq(pa, array1);
-  });
-}
-
-if (getBuildConfiguration().parallelJS)
-  test();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bailout-never-executed.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// |jit-test| slow;
-// ^^ This test is slow when --no-ion is used, specifically,
-//    as part of TBPL.
-
-load(libdir + "parallelarray-helpers.js");
-
-function makeObject(e, i, c) {
-  var v = {element: e, index: i, collection: c};
-
-  if (e == 512) // note: never happens
-    delete v.i;
-
-  return v;
-}
-
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(range(0, 512), "map", makeObject);
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/binary-arith-numbers.js
+++ /dev/null
@@ -1,30 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-// Test that we are able to add numbers even if the typesets are not
-// "clean" because we have previously added strings and numbers.  This
-// should cause fallible unboxing to occur.
-
-function theTest() {
-  var mixedArray = [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.1,
-                    "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"];
-
-  function op(e, i) {
-    return mixedArray[e % mixedArray.length] + i;
-  }
-
-  // run op once where it has to add doubles and strings,
-  // just to pullute the typesets:
-  var jsarray0 = range(0, 1024);
-  jsarray0.map(op);
-
-  // this version will never actually touch the strings:
-  assertArraySeqParResultsEq(range(0, 1024), "map", function (i) { return i % 10; });
-
-  // but if we try against the original we get bailouts:
-  assertParallelExecWillBail(function (mode) {
-    jsarray0.mapPar(op, mode);
-  });
-}
-
-if (getBuildConfiguration().parallelJS)
-  theTest();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bitops-values.js
+++ /dev/null
@@ -1,84 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-// The following tests test 2 paths in Ion. The 'ValueToInt32' paths test
-// LValueToInt32, and the 'V' paths test the slow value-taking VM functions
-// corresponding to the bit ops.
-//
-// At the time of writing the 'V' paths are triggered when any of the operands
-// to the bit ops may be an object, thus the always-false branch which assign
-// {} to one of the operands.
-
-var len = minItemsTestingThreshold;
-var vals = [true, false, undefined, "1"];
-
-function testBitNotValueToInt32() {
-  assertArraySeqParResultsEq(range(0, len), "map", function (i) {
-    return [~vals[0], ~vals[1], ~vals[2], ~vals[3]];
-  });
-}
-
-function testBitNotV() {
-  assertArraySeqParResultsEq(range(0, len), "map", function (i) {
-    var a, b, c, d;
-    if (i < 0) {
-      a = {};
-      b = {};
-      c = {};
-      d = {};
-    } else {
-      a = vals[0];
-      b = vals[1];
-      c = vals[2];
-      d = vals[3];
-    }
-    return [~a, ~b, ~c, ~d];
-  });
-}
-
-function testBitBinOpsValueToInt32() {
-  for (var n = 0; n < vals.length; n++) {
-    for (var m = n; m < vals.length; m++) {
-      assertArraySeqParResultsEq(range(0, len), "map", function (i) {
-        var a = vals[n];
-        var b = vals[m];
-
-        return [a & b,
-                a | b,
-                a ^ b,
-                a << b,
-                a >> b];
-      });
-    }
-  }
-}
-
-function testBitBinOpsV() {
-  for (var n = 0; n < vals.length; n++) {
-    for (var m = n; m < vals.length; m++) {
-      assertArraySeqParResultsEq(range(0, len), "map", function (i) {
-        var a, b;
-
-        if (i < 0) {
-          a = {};
-          b = {};
-        } else {
-          a = vals[n];
-          b = vals[m];
-        }
-
-        return [a & b,
-                a | b,
-                a ^ b,
-                a << b,
-                a >> b];
-      });
-    }
-  }
-}
-
-if (getBuildConfiguration().parallelJS) {
-  testBitNotValueToInt32();
-  testBitNotV();
-  testBitBinOpsValueToInt32();
-  testBitBinOpsV();
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug1009788.js
+++ /dev/null
@@ -1,7 +0,0 @@
-if (getBuildConfiguration().parallelJS) {
-    for (var a = 0; a < 2000; a++) {
-        Array.buildPar(500, (function() {
-            return {}
-        }))
-    }
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug1014973.js
+++ /dev/null
@@ -1,5 +0,0 @@
-if (getBuildConfiguration().parallelJS) {
-    Array.buildPar(6763, function() {
-        return Math.fround(Math.round(Math.fround(-0)));
-    });
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug1022948.js
+++ /dev/null
@@ -1,12 +0,0 @@
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-var a = Array.buildPar(999, function() {
-    return (Math.asin(Math.tanh(1)))
-});
-var count = 0;
-for (let e of a) {
-  count++;
-  print(count);
-  assertEq(e, a[0])
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug1024567.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Stale assertion in initDenseElementsUnbarriered, but it's a useful test anyhow.
-
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-var sum=0;
-for ( var i=0 ; i < 1000 ; i++ ) {
-    sum += ([0].mapPar(function (...xs) { return xs.length; }))[0];
-}
-assertEq(sum, 3000);		// Function is invoked with value, index, self
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug1024756.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Failure to track frame size properly in code generation for NewDenseArray and rest arguments.
-
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-var x =
-(function() {
-    return Array.buildPar(15891, function() {
-        return [].map(function() {})
-    })
-})();
-assertEq(x.length, 15891);
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug1029440.js
+++ /dev/null
@@ -1,7 +0,0 @@
-if (getBuildConfiguration().parallelJS) {
-  Array.buildPar(3, function() {})
-  gczeal(10, 3)
-  Array.buildPar(9, function() {
-      Array.prototype.unshift.call([], undefined)
-  })
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug1032264.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// |jit-test| error: 503
-
-if (getBuildConfiguration().parallelJS) {
-  Array.buildPar(16427, function(x) {
-      if (x % 633 == 503) {
-          throw x;
-      }
-  });
-} else {
-  throw 503;
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug1033115-2.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// Failed to pass the subreductions as an assignment root to Array.prototype.reducePar,
-// fuzzing test case discovered separately.
-
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-x = [];
-y = x.mapPar(function() {});
-Object.defineProperty(y, 3, {
-    get: (function( ... $8)  {
-        try {
-            new Int8Array(y);
-            x.reducePar(function() function q() 1);
-        } catch (e) {}
-    })
-});
-var x = [1,2,3];
-function rsh() {
- return y.toSource() >> 2.0;
-}
-rsh();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug1033115.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// Failed to pass the subreductions as an assignment root to Array.prototype.reducePar,
-// fuzzing test case.
-
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-x = []
-x[8] = ((function() {})());
-for each(let a in [0, 0]) {
-    x.reducePar(function() {
-        return [0];
-    });
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug1037657.js
+++ /dev/null
@@ -1,5 +0,0 @@
-if (getBuildConfiguration().parallelJS && typeof Symbol === "function") {
-  x = Array.buildPar(7, Symbol);
-  Array.prototype.push.call(x, 2);
-  x.mapPar(function(){}, 1)
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug1083681.js
+++ /dev/null
@@ -1,8 +0,0 @@
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-function f() {
-    Function() * (function() {})()
-}
-Array.buildPar(1, f)
-
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug853576.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// |jit-test| error: Error;
-
-var len = 2;
-function add1(x) { return x+1; }
-var p = new ParallelArray(len, add1);
-var idx = [0,0].concat(build(len-4, add1)).concat([len-3,len-3]);
-var revidx = idx.reverse();
-var r = p.scatter(revidx, 0, function (x,y) { return x+y; }, len-2, {});
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug909743.js
+++ /dev/null
@@ -1,21 +0,0 @@
-if (getBuildConfiguration().parallelJS) {
-  function assertParallelExecSucceeds(opFunction) {
-    for (var i = 0; i < 100; ++i) {
-      opFunction({mode:"compile"});
-    }
-  }
-  function assertArraySeqParResultsEq(arr, op, func) {
-    assertParallelExecSucceeds(
-      function (m) { 
-        return arr[op + "Par"].apply(arr, [func, m]); 
-      }
-    );
-  }
-  function range(n, m) {
-    var result = [];
-    for (var i = n; i < m; i++)
-      result.push(i);
-    return result;
-  }
-  assertArraySeqParResultsEq(range(0, 512), "map", function(e) { return e+'x'; });
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug944975.js
+++ /dev/null
@@ -1,17 +0,0 @@
-if (getBuildConfiguration().parallelJS) {
-  var map_toSource_called = false;
-  var mapPar_toSource_called = false;
-
-  Array.prototype.mapPar.toSource = function() {
-    mapPar_toSource_called = true;
-  };
-
-  Array.prototype.map.toSource = function() {
-    map_toSource_called = true;
-  };
-
-  try { new Array.prototype.mapPar; } catch (e) {}
-  try { new Array.prototype.map; } catch (e) {}
-
-  assertEq(map_toSource_called, mapPar_toSource_called);
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug970427.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// XXXshu: I tried wrapping the entire test in an |if (pjs)|, but the timing
-// is fragile and it no longer reproduced the bug, thus getting this value at
-// the beginning.
-var pjs = getBuildConfiguration().parallelJS;
-function f(a, b) {
-  var o = a;
-  gczeal(2);
-}
-f(3, 4);
-var len = 5000;
-var iters = 100;
-for (var i = 0; i < iters; i++) {
-  var par = pjs ? Array.buildPar(len, fill) : true;
-}
-function fill(i) { return 10/i; }
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug971385.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// |jit-test| slow;
-load(libdir + "asserts.js");
-
-function f() {
-    Array.buildPar(6, function() {});
-    f();
-}
-
-if (getBuildConfiguration().parallelJS)
-  assertThrowsInstanceOf(f, InternalError);
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug975636.js
+++ /dev/null
@@ -1,7 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-if (getBuildConfiguration().parallelJS) {
-  function f(x) { return [] << 0; }
-  var a = Array.buildPar(9, f);
-  var b = Array.build(9, f);
-  assertEqArray(a, b);
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug976889.js
+++ /dev/null
@@ -1,6 +0,0 @@
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-Array.buildPar(5, function() {
-    return [].t = encodeURI
-})
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug977647.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Check for mapPar() applied to an empty array.
-// Public domain.
-
-if (!this.hasOwnProperty("TypedObject"))
-  quit();
-
-var { ArrayType, StructType, uint32 } = TypedObject;
-var Point = new StructType({x: uint32, y: uint32});
-var Points = Point.array(0);
-var points = new Points();
-points.mapPar(function() {});
-
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug977853-convert-doubles.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// Bug 977853 -- Pared down version of script exhibiting negative
-// interaction with convert to doubles optimization. See bug for gory
-// details.
-
-if (!getBuildConfiguration().parallelJS)
-  quit();
-
-load(libdir + "parallelarray-helpers.js")
-
-var numIters = 5;
-var golden_output;
-
-function PJS_div4(v, s)
-{
-  return [ v[0]/s, v[1]/s, v[2]/s, v[3]/s ];
-}
-
-function PJS_normalized(v)
-{
-  var d = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-  d = d > 0.0 ? d : 1.0;
-  var result = [ v[0]/d, v[1]/d, v[2]/d, 1.0 ];
-  return result;
-}
-
-// This is the elemental function passed to mapPar
-function PJS_displace(p)
-{
-  var position = [p[0], p[1], p[2], 1.0];
-  var normal = position;
-  var roughness = 0.025 / 0.35;
-  normal = PJS_normalized(PJS_div4(normal, roughness));
-  return null;
-}
-var NUM_VERTEX_COMPONENTS = 3;
-var initPos, nVertices;
-var userData = {
-  nVertices : 25, //2880,
-  initPos : [],
-};
-function setup() {
-  for(var k = 0; k < NUM_VERTEX_COMPONENTS*userData.nVertices; k++) {
-    userData.initPos[k] = k/1000;
-  }
-  nVertices	= userData.nVertices;
-  initPos		= new Array(nVertices);
-  for(var i=0, j=0; i<nVertices; i++, j+=NUM_VERTEX_COMPONENTS) {
-	initPos[i] = [userData.initPos[j],
-				  userData.initPos[j+1],
-				  userData.initPos[j+2]];
-  }
-}
-function SimulatePJS() {
-  var curPosAndNor;
-
-  // Measure Parallel Execution
-  assertParallelExecSucceeds(
-    function(m) { return initPos.mapPar(PJS_displace, m); },
-    function() { });
-}
-var start_time, elapsed_parallel = 0, elapsed_sequential = 0;
-setup();
-SimulatePJS();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug977900.js
+++ /dev/null
@@ -1,5 +0,0 @@
-if (!getBuildConfiguration().parallelJS)
-    quit();
-
-function chooseMax(a, b) { return a>b?a:b;};
-var a = [1,2].scatterPar([0,0], -1, chooseMax);
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/bug983558.js
+++ /dev/null
@@ -1,15 +0,0 @@
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-x = [];
-Array.prototype.push.call(x, 2);
-y = x.mapPar(function() {});
-Object.defineProperty(y, 3, {
-    get: (function() {
-        try {
-            new Int8Array(y);
-            x.reducePar(function() {});
-        } catch (e) { print(e); }
-    })
-});
-y + '';
deleted file mode 100644
index e9aafcebebd75f8526ead74450866f4ea6a6d207..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/closure-allocate-invoke.js
+++ /dev/null
@@ -1,37 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testClosureCreationAndInvocation() {
-  var a = range(1, 65);
-  function makeaddv(v) {
-    var u = v - 1;
-    var t = v - 2;
-    var s = v - 3;
-    var r = v - 4;
-    var q = v - 5;
-    var p = v - 6;
-    var o = v - 7;
-    var n = v - 8;
-    var m = v - 9;
-    var l = v - 10;
-    var k = v - 11;
-    var j = v - 12;
-    var i = v - 13;
-    var h = v - 14;
-    var g = v - 15;
-    var f = v - 16;
-    var e = v - 17;
-    var d = v - 18;
-    var c = v - 19;
-    var b = v - 20;
-    var a = v - 21;
-    return function (x) { return [x,v,u,t,v,s,r,q,
-                                  p,o,m,n,l,k,j,i,
-                                  h,g,f,e,d,c,b,a]; };
-  };
-  var m = a.mapPar(makeaddv);
-  print(m[20](1)[2]);
-  assertEq(m[20](1)[2], 20);
-}
-
-if (getBuildConfiguration().parallelJS)
-  testClosureCreationAndInvocation();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/closure-creation.js
+++ /dev/null
@@ -1,13 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testClosureCreation() {
-  var a = range(0, 64);
-  var makeadd1 = function (v) { return function (x) { return x+1; }; };
-  for (var i in MODES) {
-    var m = a.mapPar(makeadd1, MODES[i]);
-    assertEq(m[1](2), 3); // (\x.x+1) 2 == 3
-  }
-}
-
-if (getBuildConfiguration().parallelJS)
-  testClosureCreation();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/closure-eta-expand.js
+++ /dev/null
@@ -1,14 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testClosureCreationAndInvocation() {
-  var a = range(1, 65);
-  function etaadd1(v) { return (function (x) { return x+1; })(v); };
-  // eta-expansion is (or at least can be) treated as call with unknown target
-  for (var i in MODES) {
-    var m = a.mapPar(etaadd1, MODES[i]);
-    assertEq(m[1], 3); // (\x.x+1) 2 == 3
-  }
-}
-
-if (getBuildConfiguration().parallelJS)
-  testClosureCreationAndInvocation();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/closure-invoke.js
+++ /dev/null
@@ -1,14 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testClosureCreationAndInvocation() {
-  var a = range(1, 65);
-  function makeaddv(v) { return function (x) { return x+v; }; };
-  for (var i in MODES) {
-    var m = a.mapPar(makeaddv, MODES[i]);
-    assertEq(m[1](1), 3); // (\x.x+v){v=2} 1 == 3
-    assertEq(m[2](2), 5); // (\x.x+v){v=3} 2 == 5
-  }
-}
-
-if (getBuildConfiguration().parallelJS)
-  testClosureCreationAndInvocation();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/closure-nested-branch.js
+++ /dev/null
@@ -1,40 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testClosureCreationAndInvocation() {
-  var a = range(0, 64);
-  function makeaddv(v) {
-    var l = 10;
-    var k = 11;
-    var j = 12;
-    var i = 13;
-    var h = 14;
-    var g = 15;
-    var f = 16;
-    var e = 17;
-    var d = 18;
-    var c = 19;
-    var b = 20;
-    var a = 21;
-    return ((v % 2 == 0)
-            ? function (x) { return a; }
-            : function (x) {
-              switch (x) {
-              case 0: return a; case 1: return b;
-              case 2: return c; case 3: return d;
-              case 4: return e; case 5: return f;
-              case 6: return g; case 7: return h;
-              case 8: return i; case 9: return j;
-              case 10: return k; case 11: return l;
-              }
-            });
-  }
-  var m;
-  for (var i in MODES) m = a.mapPar(makeaddv, MODES[i]);
-  assertEq(m[21](1), 20); // v == 21; x == 1 ==> inner function returns b == 20
-
-  var n = a.mapPar(function (v) { return function (x) { return v; }});
-  assertEq(n[21](1), 21); // v == 21
-}
-
-if (getBuildConfiguration().parallelJS)
-  testClosureCreationAndInvocation();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/closure-nested-compute.js
+++ /dev/null
@@ -1,36 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testClosureCreationAndInvocation() {
-  var a = range(0, 64);
-  function makeaddv(v) {
-    var l = 10;
-    var k = 11;
-    var j = 12;
-    var i = 13;
-    var h = 14;
-    var g = 15;
-    var f = 16;
-    var e = 17;
-    var d = 18;
-    var c = 19;
-    var b = 20;
-    var a = 21;
-    return function (x) {
-      switch (x) {
-      case 0: return a; case 1: return b;
-      case 2: return c; case 3: return d;
-      case 4: return e; case 5: return f;
-      case 6: return g; case 7: return h;
-      case 8: return i; case 9: return j;
-      case 10: return k; case 11: return l;
-      }
-    };
-  };
-  for (var i in MODES) {
-    var m = a.mapPar(makeaddv, MODES[i]);
-    assertEq(m[21](1), 20); // v == 21; x == 1 ==> inner function returns b == 20
-  }
-}
-
-if (getBuildConfiguration().parallelJS)
-  testClosureCreationAndInvocation();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/closure-nested.js
+++ /dev/null
@@ -1,48 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testClosureCreationAndInvocation() {
-  var a = range(0, 64);
-  function makeaddv(v) {
-    var u = v - 1;
-    var t = v - 2;
-    var s = v - 3;
-    var r = v - 4;
-    var q = v - 5;
-    var p = v - 6;
-    var o = v - 7;
-    var n = v - 8;
-    var m = v - 9;
-    var l = v - 10;
-    var k = v - 11;
-    var j = v - 12;
-    var i = v - 13;
-    var h = v - 14;
-    var g = v - 15;
-    var f = v - 16;
-    var e = v - 17;
-    var d = v - 18;
-    var c = v - 19;
-    var b = v - 20;
-    var a = v - 21;
-    return function (x) {
-      switch (x) {
-      case 0: return a; case 1: return b;
-      case 2: return c; case 3: return d;
-      case 4: return e; case 5: return f;
-      case 6: return g; case 7: return h;
-      case 8: return i; case 9: return j;
-      case 10: return k; case 11: return l;
-      case 12: return m; case 13: return n;
-      case 14: return o; case 15: return p;
-      case 16: return q; case 17: return r;
-      case 18: return s; case 19: return t;
-      case 20: return u;
-      }
-    };
-  };
-  var m = a.mapPar(makeaddv);
-  assertEq(m[21](1), 1); // v == 21; x == 1 ==> inner function returns b == 1
-}
-
-if (getBuildConfiguration().parallelJS)
-  testClosureCreationAndInvocation();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/compare-strict-poly.js
+++ /dev/null
@@ -1,6 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-if (getBuildConfiguration().parallelJS) {
-  assertArraySeqParResultsEq(range(0, 8), "map", function(e) { return [] === 0.1 });
-  assertArraySeqParResultsEq(range(0, 8), "map", function(e) { return [] !== 0.1 });
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/compare-strings-eq.js
+++ /dev/null
@@ -1,7 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(["a", "b", "c", "d", "e", "f", "g", "h",
-                              "i", "j", "k", "l", "m", "n", "o", "p",
-                              "q", "r", "s", "t", "u", "v", "w", "x",
-                              "y", "z"], "map", function(e) { return e == "u" || e == "x"; });
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/compare-strings-ne.js
+++ /dev/null
@@ -1,7 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-if (getBuildConfiguration().parallelJS)
-  assertArraySeqParResultsEq(["a", "b", "c", "d", "e", "f", "g", "h",
-                              "i", "j", "k", "l", "m", "n", "o", "p",
-                              "q", "r", "s", "t", "u", "v", "w", "x",
-                              "y", "z"], "map", function(e) { return e != "u" && e != "x"; });
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/compare-values.js
+++ /dev/null
@@ -1,44 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-// Test that we are able to compare numbers even if the typesets are
-// not "clean" because we have previously added strings and numbers.
-// Also test that we distinguish between bools/numbers etc for strict
-// equality but not loose equality.
-
-function theTest() {
-  var ints = range(0, 1024);
-  var doubles = ints.map(v => v + 0.1);
-  var bools = ints.map(v => (v % 2) == 0);
-  var strings = ints.map(v => String(v));
-
-  function looselyCompareToDoubles(e, i) {
-    return doubles[i] == e;
-  }
-  print("doubles");
-  assertArraySeqParResultsEq(doubles, "map", looselyCompareToDoubles);
-  print("bools");
-  assertArraySeqParResultsEq(bools, "map", looselyCompareToDoubles);
-  // ion bails out when converting a string to a double right now,
-  // so par exec cannot proceed
-  print("strings");
-  assertParallelExecWillBail(function (mode) {
-    strings.mapPar(looselyCompareToDoubles, mode)
-  });
-  print("ints");
-  assertArraySeqParResultsEq(ints, "map", looselyCompareToDoubles);
-
-  function strictlyCompareToDoubles(e, i) {
-    return doubles[i] === e;
-  }
-  print("doubles, strict");
-  assertArraySeqParResultsEq(doubles, "map", strictlyCompareToDoubles);
-  print("bools, strict");
-  assertArraySeqParResultsEq(bools, "map", strictlyCompareToDoubles);
-  print("strings, strict");
-  assertArraySeqParResultsEq(strings, "map", strictlyCompareToDoubles);
-  print("ints, strict");
-  assertArraySeqParResultsEq(ints, "map", strictlyCompareToDoubles);
-}
-
-if (getBuildConfiguration().parallelJS)
-  theTest();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/comprehension-throws.js
+++ /dev/null
@@ -1,27 +0,0 @@
-load(libdir + "asserts.js");
-
-function buildComprehension() {
-  // Throws if elemental fun not callable
-  assertThrowsInstanceOf(function () {
-    var p = new ParallelArray([2,2], undefined);
-  }, TypeError);
-  assertThrowsInstanceOf(function () {
-    var p = new ParallelArray(2, /x/);
-  }, TypeError);
-  assertThrowsInstanceOf(function () {
-    var p = new ParallelArray(/x/, /x/);
-  }, TypeError);
-  assertThrowsInstanceOf(function () {
-    new ParallelArray([0xffffffff + 1], function() { return 0; });
-  }, RangeError);
-  assertThrowsInstanceOf(function () {
-    new ParallelArray(0xffffffff + 1, function() { return 0; });
-  }, RangeError);
-  assertThrowsInstanceOf(function () {
-    new ParallelArray([0xfffff, 0xffff], function() { return 0; });
-  }, RangeError);
-}
-
-// FIXME(bug 844887) throw correct exception
-// if (getBuildConfiguration().parallelJS)
-//   buildComprehension();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/createthis.js
+++ /dev/null
@@ -1,19 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function FooStatic(i) {
-  this.i = i;
-}
-
-function testCreateThisWithTemplate() {
-  assertArraySeqParResultsEq(
-    range(0, minItemsTestingThreshold),
-    "map",
-    function (i) {
-      var o = new FooStatic(i);
-      return o.i;
-    });
-}
-
-if (getBuildConfiguration().parallelJS) {
-  testCreateThisWithTemplate();
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/enumerate-1.js
+++ /dev/null
@@ -1,9 +0,0 @@
-function testEnumerate() {
-  var p = new ParallelArray([1,2,3,4,5]);
-  for (var i in p)
-    assertEq(i >= 0 && i < p.length, true);
-}
-
-// FIXME(bug 844882) self-hosted object not array-like, exposes internal properties
-// if (getBuildConfiguration().parallelJS)
-//   testEnumerate();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/gc-timeout.js
+++ /dev/null
@@ -1,27 +0,0 @@
-// |jit-test| exitstatus: 6;
-
-// One sneaky way to run GC during a parallel section is to invoke the
-// gc() function during the parallel timeout!
-
-load(libdir + "parallelarray-helpers.js");
-
-function iterate(x) {
-  while (x == 2046) {
-    // for exactly one index, this infinitely loops!
-    // this ensures that the warmup doesn't loop.
-  }
-  return 22;
-}
-
-function timeoutfunc() {
-  print("Timed out, invoking the GC");
-  gc();
-  return false;
-}
-
-timeout(1, timeoutfunc);
-
-if (getBuildConfiguration().parallelJS)
-  Array.buildPar(2048, iterate);
-else
-  while(true);
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/ic-getelement.js
+++ /dev/null
@@ -1,64 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function f(a) {
-  assertArraySeqParResultsEq(
-    range(0, minItemsTestingThreshold),
-    "map",
-    function(i) { return a[i]; });
-}
-
-function g(a, x) {
-  assertArraySeqParResultsEq(
-    range(0, minItemsTestingThreshold),
-    "map",
-    function(i) { return a[x]; });
-}
-
-function testICDenseElement() {
-  var a1 = [];
-  var a2 = [];
-  var a3 = [];
-  var a4 = [];
-  var len = minItemsTestingThreshold;
-  for (var i = 0; i < len; i++) {
-    a1[i] = Math.random() * 100 | 0;
-    a2[i] = Math.random() * 100 | 0;
-    a3[i] = Math.random() * 100 | 0;
-    a4[i] = Math.random() * 100 | 0;
-  }
-  f(a1); f({}); f(a2); f(a3); f(a4); f(a3); f(a1);
-}
-
-function testICTypedArrayElement() {
-  var specs = [Int8Array,
-               Uint8Array,
-               Int16Array,
-               Uint16Array,
-               Int32Array,
-               Uint32Array,
-               Float32Array,
-               Float64Array,
-               Uint8ClampedArray];
-  var len = minItemsTestingThreshold;
-  f({});
-  for (var i = 0; i < specs.length; i++) {
-    var ta = new specs[i](len);
-    for (var j = 0; j < len; j++)
-      ta[j] = Math.random() * 100;
-    f(ta);
-  }
-}
-
-function testICSlotElement() {
-  var o1 = { foo: 0 };
-  var o2 = { foo: 0, bar: '' };
-  var o3 = { foo: 0, bar: '', baz: function () { } };
-  var o4 = { foo: { } };
-  g(o1, "foo"); g(o2, "foo"); g(o3, "foo"); g(o2, "foo"); g(o1, "foo"); g(o4, "foo");
-}
-
-if (getBuildConfiguration().parallelJS) {
-  testICDenseElement();
-  testICTypedArrayElement();
-  testICSlotElement();
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/ic-getproperty.js
+++ /dev/null
@@ -1,75 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function testICProto() {
-  function C() {}
-  C.prototype.foo = "foo";
-  var c = new C;
-  assertArraySeqParResultsEq(
-    range(0, minItemsTestingThreshold),
-    "map",
-    function() { return c.foo; });
-}
-
-function f(o) {
-  assertArraySeqParResultsEq(
-    range(0, minItemsTestingThreshold),
-    "map",
-    function() { return o.foo; });
-}
-
-function g(o) {
-  assertArraySeqParResultsEq(
-    range(0, minItemsTestingThreshold),
-    "map",
-    function() { return o.length; });
-}
-
-function testICMultiple() {
-  var o1 = { foo: 0 };
-  var o2 = { foo: 0, bar: '' };
-  var o3 = { foo: 0, bar: '', baz: function () { } };
-  var o4 = { foo: { } };
-  f(o1); f(o2); f(o3); f(o2); f(o1); f(o4);
-}
-
-function testICSameShapeDifferentProto() {
-  function A () { this.bar = 1; }
-  A.prototype.foo = "a";
-  A.prototype.a = true;
-  var x = new A;
-  function B () { this.bar = 2; }
-  B.prototype.foo = "b";
-  A.prototype.b = true;
-  var y = new B;
-
-  f(x);
-  f(y);
-}
-
-function testICArrayLength() {
-  var o1 = { length: 42 };
-  var o2 = [1,2,3,4];
-  g(o1); g(o2);
-}
-
-function testICTypedArrayLength() {
-  var o1 = { length: 42 };
-  var o2 = new Int8Array(128);
-  var o3 = new Uint8Array(128);
-  var o4 = new Uint8ClampedArray(128);
-  var o5 = new Int16Array(128);
-  var o6 = new Uint16Array(128);
-  var o7 = new Int32Array(128);
-  var o8 = new Uint32Array(128);
-  var o9 = new Float32Array(128);
-  var o0 = new Float64Array(128);
-  g(o1); g(o2); g(o3); g(o4); g(o5); g(o6); g(o7); g(o8); g(o9); g(o0);
-}
-
-if (getBuildConfiguration().parallelJS) {
-  testICProto();
-  testICMultiple();
-  testICSameShapeDifferentProto();
-  testICArrayLength();
-  testICTypedArrayLength();
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/ic-setelement.js
+++ /dev/null
@@ -1,134 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function set(a, n) {
-  // Padding to prevent inlining.
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  for (var i = 0; i < n; i++)
-    a[i] = i;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-}
-set({}, 256);
-function Foo() { }
-set(new Foo, 256);
-
-function testSetDense() {
-  assertArraySeqParResultsEq(
-    range(0, minItemsTestingThreshold),
-    "map",
-    function (i) {
-      var a1 = [];
-      // Defines .foo
-      set(a1, 32);
-      return a1[i];
-    });
-}
-
-if (getBuildConfiguration().parallelJS) {
-  testSetDense();
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/ic-setproperty.js
+++ /dev/null
@@ -1,111 +0,0 @@
-load(libdir + "parallelarray-helpers.js");
-
-function set(o, v) {
-  // Padding to prevent inlining.
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  o.foo = v;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-  var foo = 0;
-}
-set({ foo: 0 }, 42);
-
-function testSetPropertySlot() {
-  assertArraySeqParResultsEq(
-    range(0, minItemsTestingThreshold),
-    "map",
-    function (i) {
-      var o1 = {};
-      var o2 = {};
-      var o3 = {};
-      var o4 = {};
-      // Defines .foo
-      set(o1, i + 1);
-      set(o2, i + 2);
-      set(o3, i + 3);
-      set(o4, i + 4);
-      // Sets .foo
-      set(o1, i + 5);
-      set(o2, i + 6);
-      set(o3, i + 7);
-      set(o4, i + 8);
-      return o1.foo + o2.foo + o3.foo + o4.foo;
-    });
-}
-
-function testSetArrayLength() {
-  assertArraySeqParResultsEq(
-    range(0, minItemsTestingThreshold),
-    "map",
-    function (i) {
-      var a = [];
-      a.length = i;
-      return a.length;
-    });
-}
-
-if (getBuildConfiguration().parallelJS) {
-  testSetPropertySlot();
-  testSetArrayLength();
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/int32-overflow.js
+++ /dev/null
@@ -1,10 +0,0 @@
-function testMap() {
-  // Test overflow
-  var p = [1 << 30];
-  var m = p.mapPar(function(x) { return x * 4; });
-  assertEq(m[0], (1 << 30) * 4);
-}
-
-if (getBuildConfiguration().parallelJS)
-  testMap();
-
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/mandelbrot.js
+++ /dev/null
@@ -1,53 +0,0 @@
-// Adapted from
-//
-// https://github.com/RiverTrail/RiverTrail/blob/master/examples/mandelbrot/mandelbrot.js
-//
-// which in turn is adapted from a WebCL implementation available at
-//
-// http://www.ibiblio.org/e-notes/webcl/mandelbrot.html
-
-load(libdir + "parallelarray-helpers.js");
-
-var nc = 30, maxCol = nc*3;
-
-// this is the actual mandelbrot computation, ported to JavaScript
-// from the WebCL / OpenCL example at
-// http://www.ibiblio.org/e-notes/webcl/mandelbrot.html
-function computeSetByRow(x, y) {
-  var Cr = (x - 256) / scale + 0.407476;
-  var Ci = (y - 256) / scale + 0.234204;
-  var I = 0, R = 0, I2 = 0, R2 = 0;
-  var n = 0;
-  while ((R2+I2 < 2.0) && (n < 512)) {
-    I = (R+R)*I+Ci;
-    R = R2-I2+Cr;
-    R2 = R*R;
-    I2 = I*I;
-    n++;
-  }
-  return n;
-}
-
-function computeSequentially() {
-  result = [];
-  for (var r = 0; r < rows; r++) {
-    for (var c = 0; c < cols; c++) {
-      result.push(computeSetByRow(r, c));
-    }
-  }
-  return result;
-}
-
-var scale = 10000*300;
-var rows = 4;
-var cols = 4;
-
-// check that we get correct result
-if (getBuildConfiguration().parallelJS) {
-  var expected = computeSequentially();
-  assertParallelExecSucceeds(
-    function (m) Array.buildPar(rows * cols, function (xy) {
-      return computeSetByRow((xy/cols)|0,(xy%cols))
-    }, m),
-    function (r) assertStructuralEq(expected, r));
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/math-fcns.js
+++ /dev/null
@@ -1,82 +0,0 @@
-// |jit-test| slow;
-load(libdir + "parallelarray-helpers.js");
-
-// The MathCache has 4096 entries, so ensure we overwrite at least one
-// entry by using > 4096 distinct inputs.
-
-var len = 5000;
-var iters = 100;
-
-// The problem we are trying to expose (Bugzilla 901000) is
-// a data-race on the MathCache; such a bug is inherently
-// non-deterministic.  On a 4 core Mac laptop:
-//
-// len == 10000 iters==1  replicates the problem on 2/10 runs,
-// len == 10000 iters==2  replicates the problem on 3/10 runs,
-// len == 10000 iters==5  replicates the problem on 6/10 runs,
-// len == 10000 iters==10 replicates the problem on 9/10 runs.
-//
-// len == 5000  iters==1  replicates the problem on 1/10 runs,
-// len == 5000  iters==2  replicates the problem on 4/10 runs,
-// len == 5000  iters==5  replicates the problem on 5/10 runs,
-// len == 5000  iters==10 replicates the problem on 9/10 runs.
-//
-// len == 2000  iters==1  replicates the problem on 0/10 runs,
-// len == 2000  iters==2  replicates the problem on 0/10 runs,
-// len == 2000  iters==5  replicates the problem on 0/10 runs,
-// len == 2000  iters==10 replicates the problem on 3/10 runs
-
-function check(fill) {
-  var seq = Array.build(len, fill);
-  for (var i = 0; i < iters; i++) {
-    var par = Array.buildPar(len, fill);
-    assertStructuralEq(par, seq);
-  }
-}
-
-function checkAbs(a)   { check(function (i) { return Math.abs(a[i]);   }); }
-function checkAcos(a)  { check(function (i) { return Math.acos(a[i]);  }); }
-function checkAsin(a)  { check(function (i) { return Math.asin(a[i]);  }); }
-function checkAtan(a)  { check(function (i) { return Math.atan(a[i]);  }); }
-function checkAtan2(a) { check(function (i) { return Math.atan2(a[i]); }); }
-function checkCeil(a)  { check(function (i) { return Math.ceil(a[i]);  }); }
-function checkCos(a)   { check(function (i) { return Math.cos(a[i]);   }); }
-function checkExp(a)   { check(function (i) { return Math.exp(a[i]);   }); }
-function checkFloor(a) { check(function (i) { return Math.floor(a[i]); }); }
-function checkLog(a)   { check(function (i) { return Math.log(a[i]);   }); }
-function checkRound(a) { check(function (i) { return Math.round(a[i]); }); }
-function checkSin(a)   { check(function (i) { return Math.sin(a[i]);   }); }
-function checkSqrt(a)  { check(function (i) { return Math.sqrt(a[i]);  }); }
-function checkTan(a)   { check(function (i) { return Math.tan(a[i]);   }); }
-
-function callVariousUnaryMathFunctions() {
-  // We might want to consider making this test adopt seedrandom.js
-  // and call Math.seedrandom("seed") here ...
-  // function fill(i) { return (2*Math.random())-1; }
-  // function fill(i) { return (20*Math.random())-10; }
-  //
-  // ... but its easiest to just drop the pseudo-random input entirely.
-  function fill(i) { return 10/i; }
-  var input = Array.build(len, fill);
-
-  checkAbs(input);    //print("abs");
-  checkAcos(input);   //print("acos");
-  checkAsin(input);   //print("asin");
-  checkAtan(input);   //print("atan");
-
-  checkAtan2(input);  //print("atan2");
-  checkCeil(input);   //print("ceil");
-  checkCos(input);    //print("cos");
-  checkExp(input);    //print("exp");
-
-  checkFloor(input);  //print("floor");
-  checkLog(input);    //print("log");
-  checkRound(input);  //print("round");
-  checkSin(input);    //print("sin");
-
-  checkSqrt(input);   //print("sqrt");
-  checkTan(input);    //print("tan");
-}
-
-if (getBuildConfiguration().parallelJS)
-  callVariousUnaryMathFunctions();
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/parallelarraycompiledout.js
+++ /dev/null
@@ -1,2 +0,0 @@
-if (!getBuildConfiguration().parallelJS)
-  assertEq(typeof ParallelArray, "undefined");
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-boxed-shared.js
+++ /dev/null
@@ -1,195 +0,0 @@
-// |jit-test| slow;
-//
-// PJS GC test: simple convolution that delivers its results as boxed
-// object values, these objects will need to be evacuated from the PJS
-// nurseries at the end of the parallel section or we'll crash or get
-// the wrong results.
-//
-// The boxed results take the form of a small diamond-shaped data
-// structure; when we traverse it in serial later to generate results
-// we check that the sharing was maintained by the collector.
-//
-// 2014-05-12 / lhansen@mozilla.com
-//
-// For testing purposes, just run it standalone in the directory with
-// cat.pgm, or from the jit_test.py harness.
-//
-// To check the output, grab parjs-benchmarks/unhex.c, set "benchmark"
-// below to false, then run like this:
-//
-//  js pjsgc-cat-convolve-mapPar-boxed-shared.js | ./unhex > out.pgm
-//
-// and compare out.pgm to parjs-benchmarks/cat-expected.pgm.
-
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-// NOTE: This test must use Array and Object, not TypedObject array
-// and struct, because there are currently primitives on TypedObject
-// array involving references that cause the PJS engine to bail out.
-
-const benchmark = true;
-const iterations = benchmark && scriptArgs[0] == "many" ? 100 : 1;
-const input = scriptdir + "cat.pgm";
-
-const { loc, bytes, height, width, maxval } = readPgm(input);
-if (maxval > 255)
-    throw "Bad maxval: " + maxval;
-
-var indices = new Array(width-2);
-
-var r = time(
-    function () {
-	var r;
-	for ( var i=0 ; i < iterations ; i++ ) {
-	    r = null;
-	    r = edgeDetect1(bytes, indices, loc, height, width);
-	}
-	return r;
-    });
-
-if (benchmark)
-    print(r.time);
-else {
-    // r.result is an Array of TypedObject arrays representing rows 1..height-2 but
-    // with the first and last columns missing.   Slam it into an output array and
-    // copy over the original bits for the borders.
-    var out = copyAndZeroPgm(bytes, loc);
-    for ( var h=1 ; h < height-1 ; h++ )
-	for ( var w=1 ; w < width-1 ; w++ ) {
-	    var box = r.result[h-1][w-1];
-	    box.l.o.touched++;
-	    assertEq(box.r.o.touched, 1);
-	    var val = box.l.o.value;
-	    out[loc+(h*width)+w] = val;
-	}
-    // ...
-    putstr(encode(out));
-}
-
-quit();
-
-// http://blancosilva.wordpress.com/teaching/mathematical-imaging/edge-detection-the-convolution-approach/
-// Faler's approach
-
-function edgeDetect1(input, indices, loc, height, width) {
-    function c1(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1  0  1)
-	// (-1  0  1)
-	// (-1  0  1)
-	return 0 - xmm - xzm - xpm + xmp + xzp + xpp;
-    }
-    function c2(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 1  1  1)
-	// ( 0  0  0)
-	// (-1 -1 -1)
-	return xmm + xmz + xmp - xpm - xpz - xpp;
-    }
-    function c3(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1 -1 -1)
-	// (-1  8 -1)
-	// (-1 -1 -1)
-	return 0 - xmm - xzm - xpm - xmz + 8*xzz - xpz - xmp - xzp - xpp;
-    }
-    function c4(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 0  1  0)
-	// (-1  0  1)
-	// ( 0 -1  0)
-	return xmz - xzm + xzp - xpz;
-    }
-    function max2(a,b) { return a > b ? a : b }
-    function max4(a,b,c,d) { return max2(max2(a,b),max2(c,d)); }
-    function max5(a,b,c,d,e) { return max2(max4(a,b,c,d),e); }
-    var result = [];
-    for ( var h=1 ; h < height-1 ; h++ ) {
-	// Map across the prototypical array, ignoring the input value but
-	// using the index
-	result.push(indices.mapPar(
-	    function (_, idx) {
-		var w = idx+1;
-		var xmm=input[loc+(h-1)*width+(w-1)];
-		var xzm=input[loc+h*width+(w-1)];
-		var xpm=input[loc+(h+1)*width+(w-1)];
-		var xmz=input[loc+(h-1)*width+w];
-		var xzz=input[loc+h*width+w];
-		var xpz=input[loc+(h+1)*width+w];
-		var xmp=input[loc+(h-1)*width+(w+1)];
-		var xzp=input[loc+h*width+(w+1)];
-		var xpp=input[loc+(h+1)*width+(w+1)];
-		// Math.max not supported in parallel sections (bug 979859)
-		var sum=max5(0,
-			     c1(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c2(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c3(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c4(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp));
-		// Box it, the box will require evacuation at the end of the parallel section
-		var o = {value: sum, touched: 0};
-		var l = {o: o};
-		var r = {o: o};
-		return {l: l, r: r};
-	    }));
-    }
-    return result;
-}
-
-// Benchmarking
-
-function time(thunk) {
-    var then = Date.now();
-    var r = thunk();
-    var now = Date.now();
-    return { time:now - then, result:r};
-}
-
-// PGM input and output
-
-function readPgm(filename) {
-    var bytes = snarf(filename, "binary"); // Uint8Array
-    var loc = 0;
-    var { loc, word } = getAscii(bytes, loc, true);
-    if (word != "P5")
-	throw "Bad magic: " + word;
-    var { loc, word } = getAscii(bytes, loc);
-    var width = parseInt(word);
-    var { loc, word } = getAscii(bytes, loc);
-    var height = parseInt(word);
-    var { loc, word } = getAscii(bytes, loc);
-    var maxval = parseInt(word);
-    loc++;
-    return { bytes: bytes, loc: loc, width: width, height: height, maxval: maxval };
-}
-
-function copyAndZeroPgm(bytes, loc) {
-    var out = new Uint8Array(bytes.length);
-    for ( var i=0 ; i < loc ; i++ )
-	out[i] = bytes[i];
-    return out;
-}
-
-function getAscii(bytes, loc, here) {
-    if (!here)
-	loc = skipWhite(bytes, loc);
-    var s = "";
-    while (loc < bytes.length && bytes[loc] > 32)
-	s += String.fromCharCode(bytes[loc++]);
-    return { loc: loc, word: s };
-}
-
-function skipWhite(bytes, loc) {
-    while (loc < bytes.length && bytes[loc] <= 32)
-	loc++;
-    return loc;
-}
-
-function encode(xs) {
-    function hex(n) {
-	return "0123456789abcdef".charAt(n);
-    }
-    var out = "";
-    for ( var i=0, limit=xs.length ; i < limit ; i++ ) {
-	var c = xs[i];
-	out += hex((c >> 4) & 15);
-	out += hex(c & 15);
-    }
-    return out;
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-boxed-to.js
+++ /dev/null
@@ -1,184 +0,0 @@
-// |jit-test| slow;
-//
-// PJS GC test: simple convolution that delivers its results as boxed
-// TypedObject values, these objects will need to be evacuated from the PJS
-// nurseries at the end of the parallel section or we'll crash or get
-// the wrong results.
-//
-// 2014-05-13 / lhansen@mozilla.com
-//
-// For testing purposes, just run it standalone in the directory with
-// cat.pgm, or from the jit_test.py harness.
-//
-// To check the output, grab parjs-benchmarks/unhex.c, set "benchmark"
-// below to false, then run like this:
-//
-//  js pjsgc-cat-convolve-mapPar-boxed-to.js | ./unhex > out.pgm
-//
-// and compare out.pgm to parjs-benchmarks/cat-expected.pgm.
-
-if (!getBuildConfiguration().parallelJS || !this.TypedObject)
-  quit(0);
-
-// NOTE: This test must use Array, not TypedObject array, because there
-// are currently primitives on TypedObject array involving references
-// that cause the PJS engine to bail out.
-
-const benchmark = true;
-const iterations = benchmark && scriptArgs[0] == "many" ? 100 : 1;
-const input = scriptdir + "cat.pgm";
-
-const { loc, bytes, height, width, maxval } = readPgm(input);
-if (maxval > 255)
-    throw "Bad maxval: " + maxval;
-
-var OT = new TypedObject.StructType({value: TypedObject.uint32});
-var indices = new Array(width-2);
-
-var r = time(
-    function () {
-	var r;
-	for ( var i=0 ; i < iterations ; i++ ) {
-	    r = null;
-	    r = edgeDetect1(bytes, indices, loc, height, width);
-	}
-	return r;
-    });
-
-if (benchmark)
-    print(r.time);
-else {
-    // r.result is an Array of TypedObject arrays representing rows 1..height-2 but
-    // with the first and last columns missing.   Slam it into an output array and
-    // copy over the original bits for the borders.
-    var out = copyAndZeroPgm(bytes, loc);
-    for ( var h=1 ; h < height-1 ; h++ )
-	for ( var w=1 ; w < width-1 ; w++ )
-	    out[loc+(h*width)+w] = r.result[h-1][w-1].value;
-    // ...
-    putstr(encode(out));
-}
-
-quit();
-
-// http://blancosilva.wordpress.com/teaching/mathematical-imaging/edge-detection-the-convolution-approach/
-// Faler's approach
-
-function edgeDetect1(input, indices, loc, height, width) {
-    function c1(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1  0  1)
-	// (-1  0  1)
-	// (-1  0  1)
-	return 0 - xmm - xzm - xpm + xmp + xzp + xpp;
-    }
-    function c2(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 1  1  1)
-	// ( 0  0  0)
-	// (-1 -1 -1)
-	return xmm + xmz + xmp - xpm - xpz - xpp;
-    }
-    function c3(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1 -1 -1)
-	// (-1  8 -1)
-	// (-1 -1 -1)
-	return 0 - xmm - xzm - xpm - xmz + 8*xzz - xpz - xmp - xzp - xpp;
-    }
-    function c4(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 0  1  0)
-	// (-1  0  1)
-	// ( 0 -1  0)
-	return xmz - xzm + xzp - xpz;
-    }
-    function max2(a,b) { return a > b ? a : b }
-    function max4(a,b,c,d) { return max2(max2(a,b),max2(c,d)); }
-    function max5(a,b,c,d,e) { return max2(max4(a,b,c,d),e); }
-    var result = [];
-    for ( var h=1 ; h < height-1 ; h++ ) {
-	// Map across the prototypical array, ignoring the input value but
-	// using the index
-	result.push(indices.mapPar(
-	    function (_, idx) {
-		var w = idx+1;
-		var xmm=input[loc+(h-1)*width+(w-1)];
-		var xzm=input[loc+h*width+(w-1)];
-		var xpm=input[loc+(h+1)*width+(w-1)];
-		var xmz=input[loc+(h-1)*width+w];
-		var xzz=input[loc+h*width+w];
-		var xpz=input[loc+(h+1)*width+w];
-		var xmp=input[loc+(h-1)*width+(w+1)];
-		var xzp=input[loc+h*width+(w+1)];
-		var xpp=input[loc+(h+1)*width+(w+1)];
-		// Math.max not supported in parallel sections (bug 979859)
-		var sum=max5(0,
-			     c1(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c2(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c3(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c4(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp));
-		// Box it, the box will require evacuation at the end of the parallel section
-		return new OT({value: sum});
-	    }));
-    }
-    return result;
-}
-
-// Benchmarking
-
-function time(thunk) {
-    var then = Date.now();
-    var r = thunk();
-    var now = Date.now();
-    return { time:now - then, result:r};
-}
-
-// PGM input and output
-
-function readPgm(filename) {
-    var bytes = snarf(filename, "binary"); // Uint8Array
-    var loc = 0;
-    var { loc, word } = getAscii(bytes, loc, true);
-    if (word != "P5")
-	throw "Bad magic: " + word;
-    var { loc, word } = getAscii(bytes, loc);
-    var width = parseInt(word);
-    var { loc, word } = getAscii(bytes, loc);
-    var height = parseInt(word);
-    var { loc, word } = getAscii(bytes, loc);
-    var maxval = parseInt(word);
-    loc++;
-    return { bytes: bytes, loc: loc, width: width, height: height, maxval: maxval };
-}
-
-function copyAndZeroPgm(bytes, loc) {
-    var out = new Uint8Array(bytes.length);
-    for ( var i=0 ; i < loc ; i++ )
-	out[i] = bytes[i];
-    return out;
-}
-
-function getAscii(bytes, loc, here) {
-    if (!here)
-	loc = skipWhite(bytes, loc);
-    var s = "";
-    while (loc < bytes.length && bytes[loc] > 32)
-	s += String.fromCharCode(bytes[loc++]);
-    return { loc: loc, word: s };
-}
-
-function skipWhite(bytes, loc) {
-    while (loc < bytes.length && bytes[loc] <= 32)
-	loc++;
-    return loc;
-}
-
-function encode(xs) {
-    function hex(n) {
-	return "0123456789abcdef".charAt(n);
-    }
-    var out = "";
-    for ( var i=0, limit=xs.length ; i < limit ; i++ ) {
-	var c = xs[i];
-	out += hex((c >> 4) & 15);
-	out += hex(c & 15);
-    }
-    return out;
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-boxed.js
+++ /dev/null
@@ -1,183 +0,0 @@
-// |jit-test| slow;
-//
-// PJS GC test: simple convolution that delivers its results as boxed
-// object values, these objects will need to be evacuated from the PJS
-// nurseries at the end of the parallel section or we'll crash or get
-// the wrong results.
-//
-// 2014-04-24 / lhansen@mozilla.com
-//
-// For testing purposes, just run it standalone in the directory with
-// cat.pgm, or from the jit_test.py harness.
-//
-// To check the output, grab parjs-benchmarks/unhex.c, set "benchmark"
-// below to false, then run like this:
-//
-//  js pjsgc-cat-convolve-mapPar-boxed.js | ./unhex > out.pgm
-//
-// and compare out.pgm to parjs-benchmarks/cat-expected.pgm.
-
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-// NOTE: This test must use Array and Object, not TypedObject array
-// and struct, because there are currently primitives on TypedObject
-// array involving references that cause the PJS engine to bail out.
-
-const benchmark = true;
-const iterations = benchmark && scriptArgs[0] == "many" ? 100 : 1;
-const input = scriptdir + "cat.pgm";
-
-const { loc, bytes, height, width, maxval } = readPgm(input);
-if (maxval > 255)
-    throw "Bad maxval: " + maxval;
-
-var indices = new Array(width-2);
-
-var r = time(
-    function () {
-	var r;
-	for ( var i=0 ; i < iterations ; i++ ) {
-	    r = null;
-	    r = edgeDetect1(bytes, indices, loc, height, width);
-	}
-	return r;
-    });
-
-if (benchmark)
-    print(r.time);
-else {
-    // r.result is an Array of TypedObject arrays representing rows 1..height-2 but
-    // with the first and last columns missing.   Slam it into an output array and
-    // copy over the original bits for the borders.
-    var out = copyAndZeroPgm(bytes, loc);
-    for ( var h=1 ; h < height-1 ; h++ )
-	for ( var w=1 ; w < width-1 ; w++ )
-	    out[loc+(h*width)+w] = r.result[h-1][w-1].value;
-    // ...
-    putstr(encode(out));
-}
-
-quit();
-
-// http://blancosilva.wordpress.com/teaching/mathematical-imaging/edge-detection-the-convolution-approach/
-// Faler's approach
-
-function edgeDetect1(input, indices, loc, height, width) {
-    function c1(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1  0  1)
-	// (-1  0  1)
-	// (-1  0  1)
-	return 0 - xmm - xzm - xpm + xmp + xzp + xpp;
-    }
-    function c2(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 1  1  1)
-	// ( 0  0  0)
-	// (-1 -1 -1)
-	return xmm + xmz + xmp - xpm - xpz - xpp;
-    }
-    function c3(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1 -1 -1)
-	// (-1  8 -1)
-	// (-1 -1 -1)
-	return 0 - xmm - xzm - xpm - xmz + 8*xzz - xpz - xmp - xzp - xpp;
-    }
-    function c4(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 0  1  0)
-	// (-1  0  1)
-	// ( 0 -1  0)
-	return xmz - xzm + xzp - xpz;
-    }
-    function max2(a,b) { return a > b ? a : b }
-    function max4(a,b,c,d) { return max2(max2(a,b),max2(c,d)); }
-    function max5(a,b,c,d,e) { return max2(max4(a,b,c,d),e); }
-    var result = [];
-    for ( var h=1 ; h < height-1 ; h++ ) {
-	// Map across the prototypical array, ignoring the input value but
-	// using the index
-	result.push(indices.mapPar(
-	    function (_, idx) {
-		var w = idx+1;
-		var xmm=input[loc+(h-1)*width+(w-1)];
-		var xzm=input[loc+h*width+(w-1)];
-		var xpm=input[loc+(h+1)*width+(w-1)];
-		var xmz=input[loc+(h-1)*width+w];
-		var xzz=input[loc+h*width+w];
-		var xpz=input[loc+(h+1)*width+w];
-		var xmp=input[loc+(h-1)*width+(w+1)];
-		var xzp=input[loc+h*width+(w+1)];
-		var xpp=input[loc+(h+1)*width+(w+1)];
-		// Math.max not supported in parallel sections (bug 979859)
-		var sum=max5(0,
-			     c1(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c2(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c3(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c4(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp));
-		// Box it, the box will require evacuation at the end of the parallel section
-		return {value: sum};
-	    }));
-    }
-    return result;
-}
-
-// Benchmarking
-
-function time(thunk) {
-    var then = Date.now();
-    var r = thunk();
-    var now = Date.now();
-    return { time:now - then, result:r};
-}
-
-// PGM input and output
-
-function readPgm(filename) {
-    var bytes = snarf(filename, "binary"); // Uint8Array
-    var loc = 0;
-    var { loc, word } = getAscii(bytes, loc, true);
-    if (word != "P5")
-	throw "Bad magic: " + word;
-    var { loc, word } = getAscii(bytes, loc);
-    var width = parseInt(word);
-    var { loc, word } = getAscii(bytes, loc);
-    var height = parseInt(word);
-    var { loc, word } = getAscii(bytes, loc);
-    var maxval = parseInt(word);
-    loc++;
-    return { bytes: bytes, loc: loc, width: width, height: height, maxval: maxval };
-}
-
-function copyAndZeroPgm(bytes, loc) {
-    var out = new Uint8Array(bytes.length);
-    for ( var i=0 ; i < loc ; i++ )
-	out[i] = bytes[i];
-    return out;
-}
-
-function getAscii(bytes, loc, here) {
-    if (!here)
-	loc = skipWhite(bytes, loc);
-    var s = "";
-    while (loc < bytes.length && bytes[loc] > 32)
-	s += String.fromCharCode(bytes[loc++]);
-    return { loc: loc, word: s };
-}
-
-function skipWhite(bytes, loc) {
-    while (loc < bytes.length && bytes[loc] <= 32)
-	loc++;
-    return loc;
-}
-
-function encode(xs) {
-    function hex(n) {
-	return "0123456789abcdef".charAt(n);
-    }
-    var out = "";
-    for ( var i=0, limit=xs.length ; i < limit ; i++ ) {
-	var c = xs[i];
-	out += hex((c >> 4) & 15);
-	out += hex(c & 15);
-    }
-    return out;
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-nursery-grow.js
+++ /dev/null
@@ -1,208 +0,0 @@
-// |jit-test| slow;
-//
-// PJS GC test: simple convolution that allocates enough temporary but
-// non-evacuated objects per element to kick off a garbage collection
-// that causes the nursery to grow at least once, and that uses the
-// objects in such a way that a GC bug will lead to a crash or wrong
-// result.  The nursery is grown if the live data after GC exceeds a
-// fraction of the nursery size.  Assume now that the fraction is
-// somewhere between 1/3 and 1/2, ergo we want to have a temporary
-// data structure of over 0.5MB to be sure to trigger at least one
-// nursery expansion (per worker).
-//
-// 2014-04-25 / lhansen@mozilla.com
-//
-// For testing purposes, just run it standalone in the directory with
-// cat.pgm, or from the jit_test.py harness.
-//
-// To check the output, grab parjs-benchmarks/unhex.c, set "benchmark"
-// below to false, then run like this:
-//
-//  js pjsgc-cat-convolve-mapPar-nursery-grow.js | ./unhex > out.pgm
-//
-// and compare out.pgm to parjs-benchmarks/cat-expected.pgm.
-
-if (!getBuildConfiguration().parallelJS || !this.TypedObject)
-  quit(0);
-
-const benchmark = true;
-const iterations = benchmark && scriptArgs[0] == "many" ? 100 : 1;
-const input = scriptdir + "cat.pgm";
-
-const T = TypedObject;
-const IX = new T.ArrayType(T.uint32);
-
-const { loc, bytes, height, width, maxval } = readPgm(input);
-if (maxval > 255)
-    throw "Bad maxval: " + maxval;
-
-// Actual work: Convolving the image
-var indices = IX.buildPar(width-2, x => x+1) // [1,2,...,width-2]
-
-// This bootstraps the workers but makes little difference in practice
-var warmup = edgeDetect1(bytes, indices, loc, height, width);
-
-var r = time(
-    function () {
-	var r;
-	for ( var i=0 ; i < iterations ; i++ ) {
-	    r = null;
-	    r = edgeDetect1(bytes, indices, loc, height, width);
-	}
-	return r;
-    });
-
-if (benchmark)
-    print(r.time);
-else {
-    // r.result is an Array of TypedObject arrays representing rows 1..height-2 but
-    // with the first and last columns missing.   Slam it into an output array and
-    // copy over the original bits for the borders.
-    var out = copyAndZeroPgm(bytes, loc);
-    for ( var h=1 ; h < height-1 ; h++ )
-	for ( var w=1 ; w < width-1 ; w++ )
-	    out[loc+(h*width)+w] = r.result[h-1][w-1];
-    // ...
-    putstr(encode(out));
-}
-
-quit();
-
-// http://blancosilva.wordpress.com/teaching/mathematical-imaging/edge-detection-the-convolution-approach/
-// Faler's approach
-
-function edgeDetect1(input, indices, loc, height, width) {
-    function c1(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1  0  1)
-	// (-1  0  1)
-	// (-1  0  1)
-	return 0 - xmm - xzm - xpm + xmp + xzp + xpp;
-    }
-    function c2(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 1  1  1)
-	// ( 0  0  0)
-	// (-1 -1 -1)
-	return xmm + xmz + xmp - xpm - xpz - xpp;
-    }
-    function c3(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1 -1 -1)
-	// (-1  8 -1)
-	// (-1 -1 -1)
-	return 0 - xmm - xzm - xpm - xmz + 8*xzz - xpz - xmp - xzp - xpp;
-    }
-    function c4(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 0  1  0)
-	// (-1  0  1)
-	// ( 0 -1  0)
-	return xmz - xzm + xzp - xpz;
-    }
-    function max2(a,b) { return a > b ? a : b }
-    function max4(a,b,c,d) { return max2(max2(a,b),max2(c,d)); }
-    function max5(a,b,c,d,e) { return max2(max4(a,b,c,d),e); }
-    var result = [];
-    for ( var h=1 ; h < height-1 ; h++ ) {
-	result.push(indices.mapPar(
-	    function (w) {
-		var xmm=input[loc+(h-1)*width+(w-1)];
-		var xzm=input[loc+h*width+(w-1)];
-		var xpm=input[loc+(h+1)*width+(w-1)];
-		var xmz=input[loc+(h-1)*width+w];
-		var xzz=input[loc+h*width+w];
-		var xpz=input[loc+(h+1)*width+w];
-		var xmp=input[loc+(h-1)*width+(w+1)];
-		var xzp=input[loc+h*width+(w+1)];
-		var xpp=input[loc+(h+1)*width+(w+1)];
-		// Math.max not supported in parallel sections (bug 979859)
-		var sum=max5(0,
-			     c1(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c2(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c3(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c4(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp));
-		// Hide the result deep in a list, GC will kick in occasionally
-		function wabbit(n) {
-		    if (n == 0)
-			return { value: sum, left: null, right: null };
-		    return { value: 0, left: wabbit(n-1), right: wabbit(n-1) };
-		}
-		// depth n yields 2^(n+1) - 1 nodes
-		// one node is perhaps 80 bytes on 32-bit
-		// solve:     2^(n+1) * 80 >= 512*1024
-		//        <=> n+1 * lg 2 + lg 80 >= lg 512 + lg 1024
-                //        <=> n >= (lg 512 + lg 1024 - lg 80) - 1
-		//        <=> n >= 19 - 6 - 1
-		//        <=> n >= 12
-		if ((w % 100) == 0) {
-		    var q = wabbit(13);
-		    // Pick the leftmost value in that list
-		    while (q.left != null)
-			q = q.left;
-		    return q.value;
-		}
-		else
-		    return sum;
-	    }));
-    }
-    return result;
-}
-
-// Benchmarking
-
-function time(thunk) {
-    var then = Date.now();
-    var r = thunk();
-    var now = Date.now();
-    return { time:now - then, result:r};
-}
-
-// PGM input and output
-
-function readPgm(filename) {
-    var bytes = snarf(filename, "binary"); // Uint8Array
-    var loc = 0;
-    var { loc, word } = getAscii(bytes, loc, true);
-    if (word != "P5")
-	throw "Bad magic: " + word;
-    var { loc, word } = getAscii(bytes, loc);
-    var width = parseInt(word);
-    var { loc, word } = getAscii(bytes, loc);
-    var height = parseInt(word);
-    var { loc, word } = getAscii(bytes, loc);
-    var maxval = parseInt(word);
-    loc++;
-    return { bytes: bytes, loc: loc, width: width, height: height, maxval: maxval };
-}
-
-function copyAndZeroPgm(bytes, loc) {
-    var out = new Uint8Array(bytes.length);
-    for ( var i=0 ; i < loc ; i++ )
-	out[i] = bytes[i];
-    return out;
-}
-
-function getAscii(bytes, loc, here) {
-    if (!here)
-	loc = skipWhite(bytes, loc);
-    var s = "";
-    while (loc < bytes.length && bytes[loc] > 32)
-	s += String.fromCharCode(bytes[loc++]);
-    return { loc: loc, word: s };
-}
-
-function skipWhite(bytes, loc) {
-    while (loc < bytes.length && bytes[loc] <= 32)
-	loc++;
-    return loc;
-}
-
-function encode(xs) {
-    function hex(n) {
-	return "0123456789abcdef".charAt(n);
-    }
-    var out = "";
-    for ( var i=0, limit=xs.length ; i < limit ; i++ ) {
-	var c = xs[i];
-	out += hex((c >> 4) & 15);
-	out += hex(c & 15);
-    }
-    return out;
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-string.js
+++ /dev/null
@@ -1,182 +0,0 @@
-// |jit-test| slow;
-//
-// PJS GC test: simple convolution that delivers its results as string
-// values.  Strings are allocated within the tenured area and there
-// should be no promotion from the parallel nurseries.  This basically
-// just tests that string allocation works.
-//
-// 2014-04-25 / lhansen@mozilla.com
-//
-// For testing purposes, just run it standalone in the directory with
-// cat.pgm, or from the jit_test.py harness.
-//
-// To check the output, grab parjs-benchmarks/unhex.c, set "benchmark"
-// below to false, then run like this:
-//
-//  js pjsgc-cat-convolve-mapPar-string.js | ./unhex > out.pgm
-//
-// and compare out.pgm to parjs-benchmarks/cat-expected.pgm.
-
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-// NOTE: This test must use Array, not TypedObject array, because
-// there are currently primitives on TypedObject array involving
-// references that cause the PJS engine to bail out.
-
-const benchmark = true;
-const iterations = benchmark && scriptArgs[0] == "many" ? 100 : 1;
-const input = scriptdir + "cat.pgm";
-
-const { loc, bytes, height, width, maxval } = readPgm(input);
-if (maxval > 255)
-    throw "Bad maxval: " + maxval;
-
-var indices = new Array(width-2);
-
-var r = time(
-    function () {
-	var r;
-	for ( var i=0 ; i < iterations ; i++ ) {
-	    r = null;
-	    r = edgeDetect1(bytes, indices, loc, height, width);
-	}
-	return r;
-    });
-
-if (benchmark)
-    print(r.time);
-else {
-    // r.result is an Array of TypedObject arrays representing rows 1..height-2 but
-    // with the first and last columns missing.   Slam it into an output array and
-    // copy over the original bits for the borders.
-    var out = copyAndZeroPgm(bytes, loc);
-    for ( var h=1 ; h < height-1 ; h++ )
-	for ( var w=1 ; w < width-1 ; w++ )
-	    out[loc+(h*width)+w] = parseInt(r.result[h-1][w-1]);
-    // ...
-    putstr(encode(out));
-}
-
-quit();
-
-// http://blancosilva.wordpress.com/teaching/mathematical-imaging/edge-detection-the-convolution-approach/
-// Faler's approach
-
-function edgeDetect1(input, indices, loc, height, width) {
-    function c1(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1  0  1)
-	// (-1  0  1)
-	// (-1  0  1)
-	return 0 - xmm - xzm - xpm + xmp + xzp + xpp;
-    }
-    function c2(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 1  1  1)
-	// ( 0  0  0)
-	// (-1 -1 -1)
-	return xmm + xmz + xmp - xpm - xpz - xpp;
-    }
-    function c3(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1 -1 -1)
-	// (-1  8 -1)
-	// (-1 -1 -1)
-	return 0 - xmm - xzm - xpm - xmz + 8*xzz - xpz - xmp - xzp - xpp;
-    }
-    function c4(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 0  1  0)
-	// (-1  0  1)
-	// ( 0 -1  0)
-	return xmz - xzm + xzp - xpz;
-    }
-    function max2(a,b) { return a > b ? a : b }
-    function max4(a,b,c,d) { return max2(max2(a,b),max2(c,d)); }
-    function max5(a,b,c,d,e) { return max2(max4(a,b,c,d),e); }
-    var result = [];
-    for ( var h=1 ; h < height-1 ; h++ ) {
-	// Map across the prototypical array, ignoring the input value but
-	// using the index
-	result.push(indices.mapPar(
-	    function (_, idx) {
-		var w = idx+1;
-		var xmm=input[loc+(h-1)*width+(w-1)];
-		var xzm=input[loc+h*width+(w-1)];
-		var xpm=input[loc+(h+1)*width+(w-1)];
-		var xmz=input[loc+(h-1)*width+w];
-		var xzz=input[loc+h*width+w];
-		var xpz=input[loc+(h+1)*width+w];
-		var xmp=input[loc+(h-1)*width+(w+1)];
-		var xzp=input[loc+h*width+(w+1)];
-		var xpp=input[loc+(h+1)*width+(w+1)];
-		// Math.max not supported in parallel sections (bug 979859)
-		var sum=max5(0,
-			     c1(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c2(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c3(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp),
-			     c4(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp));
-		return "" + sum; // String(sum) causes bailouts
-	    }));
-    }
-    return result;
-}
-
-// Benchmarking
-
-function time(thunk) {
-    var then = Date.now();
-    var r = thunk();
-    var now = Date.now();
-    return { time:now - then, result:r};
-}
-
-// PGM input and output
-
-function readPgm(filename) {
-    var bytes = snarf(filename, "binary"); // Uint8Array
-    var loc = 0;
-    var { loc, word } = getAscii(bytes, loc, true);
-    if (word != "P5")
-	throw "Bad magic: " + word;
-    var { loc, word } = getAscii(bytes, loc);
-    var width = parseInt(word);
-    var { loc, word } = getAscii(bytes, loc);
-    var height = parseInt(word);
-    var { loc, word } = getAscii(bytes, loc);
-    var maxval = parseInt(word);
-    loc++;
-    return { bytes: bytes, loc: loc, width: width, height: height, maxval: maxval };
-}
-
-function copyAndZeroPgm(bytes, loc) {
-    var out = new Uint8Array(bytes.length);
-    for ( var i=0 ; i < loc ; i++ )
-	out[i] = bytes[i];
-    return out;
-}
-
-function getAscii(bytes, loc, here) {
-    if (!here)
-	loc = skipWhite(bytes, loc);
-    var s = "";
-    while (loc < bytes.length && bytes[loc] > 32)
-	s += String.fromCharCode(bytes[loc++]);
-    return { loc: loc, word: s };
-}
-
-function skipWhite(bytes, loc) {
-    while (loc < bytes.length && bytes[loc] <= 32)
-	loc++;
-    return loc;
-}
-
-function encode(xs) {
-    function hex(n) {
-	return "0123456789abcdef".charAt(n);
-    }
-    var out = "";
-    for ( var i=0, limit=xs.length ; i < limit ; i++ ) {
-	var c = xs[i];
-	out += hex((c >> 4) & 15);
-	out += hex(c & 15);
-    }
-    return out;
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/parallel/pjsgc-cat-convolve-mapPar-tenured.js
+++ /dev/null
@@ -1,189 +0,0 @@
-// |jit-test| slow;
-//
-// PJS GC test: simple convolution that delivers its results as boxed
-// object values, within objects that are allocated directly in the
-// tenured area (functions) by means of a pointer to another object
-// that is allocated in the nursery.  The latter objects will need
-// to be evacuated from the PJS nurseries at the end of the parallel
-// section or we'll crash or get the wrong results, but for that to
-// work the root scanning of the tenured area must work.
-//
-// 2014-04-25 / lhansen@mozilla.com
-//
-// For testing purposes, just run it standalone in the directory with
-// cat.pgm, or from the jit_test.py harness.
-//
-// To check the output, grab parjs-benchmarks/unhex.c, set "benchmark"
-// below to false, then run like this:
-//
-//  js pjsgc-cat-convolve-mapPar-tenured.js | ./unhex > out.pgm
-//
-// and compare out.pgm to parjs-benchmarks/cat-expected.pgm.
-
-if (!getBuildConfiguration().parallelJS)
-  quit(0);
-
-// NOTE: This test must use Array and Object, not TypedObject array
-// and struct, because there are currently primitives on TypedObject
-// array involving references that cause the PJS engine to bail out.
-
-const benchmark = true;
-const iterations = benchmark && scriptArgs[0] == "many" ? 100 : 1;
-const input = scriptdir + "cat.pgm";
-
-const { loc, bytes, height, width, maxval } = readPgm(input);
-if (maxval > 255)
-    throw "Bad maxval: " + maxval;
-
-var indices = new Array(width-2);
-
-var r = time(
-    function () {
-	var r;
-	for ( var i=0 ; i < iterations ; i++ ) {
-	    r = null;
-	    r = edgeDetect1(bytes, indices, loc, height, width);
-	}
-	return r;
-    });
-
-if (benchmark)
-    print(r.time);
-else {
-    // r.result is an Array of TypedObject arrays representing rows 1..height-2 but
-    // with the first and last columns missing.   Slam it into an output array and
-    // copy over the original bits for the borders.
-    var out = copyAndZeroPgm(bytes, loc);
-    for ( var h=1 ; h < height-1 ; h++ )
-	for ( var w=1 ; w < width-1 ; w++ )
-	    out[loc+(h*width)+w] = (r.result[h-1][w-1])().value;
-    // ...
-    putstr(encode(out));
-}
-
-quit();
-
-// http://blancosilva.wordpress.com/teaching/mathematical-imaging/edge-detection-the-convolution-approach/
-// Faler's approach
-
-function edgeDetect1(input, indices, loc, height, width) {
-    function c1(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1  0  1)
-	// (-1  0  1)
-	// (-1  0  1)
-	return 0 - xmm - xzm - xpm + xmp + xzp + xpp;
-    }
-    function c2(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 1  1  1)
-	// ( 0  0  0)
-	// (-1 -1 -1)
-	return xmm + xmz + xmp - xpm - xpz - xpp;
-    }
-    function c3(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// (-1 -1 -1)
-	// (-1  8 -1)
-	// (-1 -1 -1)
-	return 0 - xmm - xzm - xpm - xmz + 8*xzz - xpz - xmp - xzp - xpp;
-    }
-    function c4(xmm,xzm,xpm,xmz,xzz,xpz,xmp,xzp,xpp) {
-	// ( 0  1  0)
-	// (-1  0  1)
-	// ( 0 -1  0)
-	return xmz - xzm + xzp - xpz;
-    }
-    function max2(a,b) { return a > b ? a : b }
-    function max4(a,b,c,d) { return max2(max2(a,b),max2(c,d)); }
-    function max5(a,b,c,d,e) { return max2(max4(a,b,c,d),e); }
-    var result = [];
-    for ( var h=1 ; h < height-1 ; h++ ) {
-	// Map across the prototypical array, ignoring the input value but
-	// using the index
-	result.push(indices.mapPar(
-	    function (_, idx) {
-		var w = idx+1;
-		var xmm=input[loc+(h-1)*width+(w-1)];
-		var xzm=input[loc+h*width+(w-1)];
-		var xpm=input[loc+(h+1)*width+(w-1)];
-		var xmz=input[loc+(h-1)*width+w];
-		var xzz=input[loc+h*width+w];
-		var xpz=input[loc+(h+1)*width+w];
-		var xmp=input[loc+(h-1)*width+(w+1)];
-		var xzp=input[loc+h*width+(w+1)];
-		var xpp=input[loc+(h+1)*width+(w+1)];
-		// Math.max not supported in parallel sections (bug 979859)
-		var sum=max5(0,
-			     c