Merge autoland to mozilla-central. a=merge
authorOana Pop Rus <opoprus@mozilla.com>
Wed, 13 Mar 2019 11:56:51 +0200
changeset 521685 588208caeaf8
parent 521674 9067457d7dcf (current diff)
parent 521656 bd3b527094a9 (diff)
child 521686 aecc70710359
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge autoland to mozilla-central. a=merge
js/src/frontend/BinSource-macros.h
js/src/frontend/BinSource.webidl_
js/src/frontend/BinSource.yaml
js/src/frontend/BinSourceRuntimeSupport.cpp
js/src/frontend/BinSourceRuntimeSupport.h
js/src/frontend/BinToken.cpp
js/src/frontend/BinToken.h
js/src/frontend/BinTokenReaderBase.cpp
js/src/frontend/BinTokenReaderBase.h
js/src/frontend/BinTokenReaderMultipart.cpp
js/src/frontend/BinTokenReaderMultipart.h
js/src/frontend/binsource/Cargo.toml
js/src/frontend/binsource/README.md
js/src/frontend/binsource/build.sh
js/src/frontend/binsource/moz.build
js/src/frontend/binsource/src/main.rs
js/src/frontend/binsource/src/refgraph.rs
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,17 +4,17 @@
 # Their transitive dependencies and dev-dependencies are included automatically
 # and do not need to be listed here. Their external dependencies are vendored
 # into `third_party/rust` by `mach vendor rust`.
 members = [
   "js/src",
   "js/src/rust",
   "js/src/wasm/cranelift",
   "js/rust",
-  "js/src/frontend/binsource", # Code generator.
+  "js/src/frontend/binast", # Code generator.
   "testing/geckodriver",
   "toolkit/crashreporter/rust",
   "toolkit/library/gtest/rust",
   "toolkit/library/rust/",
 ]
 
 # Excluded crates may be built as dependencies, but won't be considered members
 # of the workspace and their dev-dependencies won't be included.
--- a/browser/components/migration/moz.build
+++ b/browser/components/migration/moz.build
@@ -20,16 +20,20 @@ EXTRA_JS_MODULES += [
     'ChromeMigrationUtils.jsm',
     'ChromeProfileMigrator.jsm',
     'FirefoxProfileMigrator.jsm',
     'MigrationUtils.jsm',
     'ProfileMigrator.jsm',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
+    if CONFIG['ENABLE_TESTS']:
+        DIRS += [
+            'tests/unit/insertIEHistory',
+        ]
     SOURCES += [
         'nsIEHistoryEnumerator.cpp',
     ]
     EXTRA_JS_MODULES += [
         '360seProfileMigrator.jsm',
         'EdgeProfileMigrator.jsm',
         'ESEDBReader.jsm',
         'IEProfileMigrator.jsm',
--- a/browser/components/migration/nsIEHistoryEnumerator.cpp
+++ b/browser/components/migration/nsIEHistoryEnumerator.cpp
@@ -88,16 +88,30 @@ nsIEHistoryEnumerator::HasMoreElements(b
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsIEHistoryEnumerator::GetNext(nsISupports** _retval) {
   *_retval = nullptr;
 
-  if (!mCachedNextEntry) return NS_ERROR_FAILURE;
+  EnsureInitialized();
+  MOZ_ASSERT(mURLEnumerator,
+             "Should have instanced an IE History URLEnumerator");
+  if (!mURLEnumerator) return NS_OK;
+
+  if (!mCachedNextEntry) {
+    bool hasMore = false;
+    nsresult rv = this->HasMoreElements(&hasMore);
+    if (NS_FAILED(rv)) {
+      return rv;
+    }
+    if (!hasMore) {
+      return NS_ERROR_FAILURE;
+    }
+  }
 
   NS_ADDREF(*_retval = mCachedNextEntry);
   // Release the cached entry, so it can't be returned twice.
   mCachedNextEntry = nullptr;
 
   return NS_OK;
 }
new file mode 100644
--- /dev/null
+++ b/browser/components/migration/tests/unit/insertIEHistory/InsertIEHistory.cpp
@@ -0,0 +1,35 @@
+/* Any copyright is dedicated to the Public Domain.
+ * https://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Insert URLs into Internet Explorer (IE) history so we can test importing
+ * them.
+ *
+ * See API docs at https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms774949(v%3dvs.85)
+ */
+
+#include <urlhist.h> // IUrlHistoryStg
+#include <shlguid.h> // SID_SUrlHistory
+
+int main(int argc, char** argv) {
+  HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+  if (FAILED(hr)) {
+    CoUninitialize();
+    return -1;
+  }
+  IUrlHistoryStg* ieHist;
+
+  hr = ::CoCreateInstance(CLSID_CUrlHistory, nullptr, CLSCTX_INPROC_SERVER,
+                          IID_IUrlHistoryStg, reinterpret_cast<void**>(&ieHist));
+  if (FAILED(hr)) return -2;
+
+  hr = ieHist->AddUrl(L"http://www.mozilla.org/1", L"Mozilla HTTP Test", 0);
+  if (FAILED(hr)) return -3;
+
+  hr = ieHist->AddUrl(L"https://www.mozilla.org/2", L"Mozilla HTTPS Test 🦊", 0);
+  if (FAILED(hr)) return -4;
+
+  CoUninitialize();
+
+  return 0;
+}
new file mode 100644
--- /dev/null
+++ b/browser/components/migration/tests/unit/insertIEHistory/moz.build
@@ -0,0 +1,18 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+FINAL_TARGET = '_tests/xpcshell/browser/components/migration/tests/unit'
+
+Program('InsertIEHistory')
+OS_LIBS += [
+    'ole32',
+]
+SOURCES += [
+    'InsertIEHistory.cpp',
+]
+
+NO_PGO = True
+DisableStlWrapping()
new file mode 100644
--- /dev/null
+++ b/browser/components/migration/tests/unit/test_IE_history.js
@@ -0,0 +1,50 @@
+"use strict";
+
+// These match what we add to IE via InsertIEHistory.exe.
+const TEST_ENTRIES = [
+{
+  url: "http://www.mozilla.org/1",
+  title: "Mozilla HTTP Test",
+},
+{
+  url: "https://www.mozilla.org/2",
+  // Test character encoding with a fox emoji:
+  title: "Mozilla HTTPS Test 🦊",
+},
+];
+
+function insertIEHistory() {
+  let file = do_get_file("InsertIEHistory.exe", false);
+  let process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
+  process.init(file);
+
+  let args = [];
+  process.run(true, args, args.length);
+
+  Assert.ok(!process.isRunning, "Should be done running");
+  Assert.equal(process.exitValue, 0, "Check exit code");
+}
+
+add_task(async function setup() {
+  await PlacesUtils.history.clear();
+
+  insertIEHistory();
+
+  registerCleanupFunction(async () => {
+    await PlacesUtils.history.clear();
+  });
+});
+
+add_task(async function test_IE_history() {
+  let migrator = await MigrationUtils.getMigrator("ie");
+  Assert.ok(await migrator.isSourceAvailable(), "Source is available");
+
+  await promiseMigration(migrator, MigrationUtils.resourceTypes.HISTORY);
+
+  for (let {url, title} of TEST_ENTRIES) {
+    let entry = await PlacesUtils.history.fetch(url, {includeVisits: true});
+    Assert.equal(entry.url, url, "Should have the correct URL");
+    Assert.equal(entry.title, title, "Should have the correct title");
+    Assert.ok(entry.visits.length > 0, "Should have some visits");
+  }
+});
--- a/browser/components/migration/tests/unit/xpcshell.ini
+++ b/browser/components/migration/tests/unit/xpcshell.ini
@@ -19,13 +19,15 @@ skip-if = os != "win"
 [test_ChromeMigrationUtils_path.js]
 [test_Edge_db_migration.js]
 skip-if = os != "win"
 [test_fx_telemetry.js]
 [test_IE_bookmarks.js]
 skip-if = !(os == "win" && bits == 64) # bug 1392396
 [test_IE_cookies.js]
 skip-if = os != "win" || (os == "win" && bits == 64 && processor == "x86_64") # bug 1522818
+[test_IE_history.js]
+skip-if = os != "win"
 [test_IE7_passwords.js]
 skip-if = os != "win"
 [test_MigrationUtils_timedRetry.js]
 [test_Safari_bookmarks.js]
 skip-if = os != "mac"
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -403,16 +403,17 @@ These should match what Safari and other
 <!ENTITY deleteCmd.accesskey        "D">
 <!ENTITY selectAllCmd.label         "Select All">
 <!ENTITY selectAllCmd.key         "A">
 <!ENTITY selectAllCmd.accesskey       "A">
 <!ENTITY preferencesCmd2.label       "Options">
 <!ENTITY preferencesCmd2.accesskey     "O">
 <!ENTITY preferencesCmdUnix.label       "Preferences">
 <!ENTITY preferencesCmdUnix.accesskey     "n">
+<!ENTITY logins.label                           "Logins and Passwords">
 
 <!ENTITY clearRecentHistory.label               "Clear Recent History…">
 
 <!ENTITY privateBrowsingCmd.commandkey          "P">
 
 <!ENTITY viewMenu.label         "View">
 <!ENTITY viewMenu.accesskey       "V">
 <!ENTITY viewToolbarsMenu.label       "Toolbars">
--- a/build/clang-plugin/CanRunScriptChecker.cpp
+++ b/build/clang-plugin/CanRunScriptChecker.cpp
@@ -37,16 +37,19 @@ void CanRunScriptChecker::registerMatche
               callExpr(allOf(
                 hasAnyArgument(StackSmartPtr),
                 argumentCountIs(1)
               ))
             )
           ),
           // and which is not a parameter of the parent function,
           unless(declRefExpr(to(parmVarDecl()))),
+          // and which is not a default arg with value nullptr, since those are
+          // always safe.
+          unless(cxxDefaultArgExpr(isNullDefaultArg())),
           // and which is not a MOZ_KnownLive wrapped value.
           unless(
             anyOf(
               MozKnownLiveCall,
               // MOZ_KnownLive applied to a RefPtr or nsCOMPtr just returns that
               // same RefPtr/nsCOMPtr type which causes us to have a conversion
               // operator applied after the MOZ_KnownLive.
               cxxMemberCallExpr(on(allOf(hasType(isSmartPtrToRefCounted()),
--- a/build/clang-plugin/CustomMatchers.h
+++ b/build/clang-plugin/CustomMatchers.h
@@ -284,16 +284,23 @@ AST_MATCHER(CXXMethodDecl, isNonVirtual)
   return Decl && !Decl->isVirtual();
 }
 
 AST_MATCHER(FunctionDecl, isMozMustReturnFromCaller) {
   const FunctionDecl *Decl = Node.getCanonicalDecl();
   return Decl && hasCustomAttribute<moz_must_return_from_caller>(Decl);
 }
 
+/// This matcher will select default args which have nullptr as the value.
+AST_MATCHER(CXXDefaultArgExpr, isNullDefaultArg) {
+  const Expr *Expr = Node.getExpr();
+  return Expr && Expr->isNullPointerConstant(Finder->getASTContext(),
+                                             Expr::NPC_NeverValueDependent);
+}
+
 #if CLANG_VERSION_FULL < 309
 /// DISCLAIMER: This is a copy/paste from the Clang source code starting from
 /// Clang 3.9, so that this matcher is supported in lower versions.
 ///
 /// \brief Matches declaration of the function the statement belongs to
 ///
 /// Given:
 /// \code
--- a/build/clang-plugin/tests/TestCanRunScript.cpp
+++ b/build/clang-plugin/tests/TestCanRunScript.cpp
@@ -80,16 +80,20 @@ MOZ_CAN_RUN_SCRIPT void test2_parent6() 
 }
 
 MOZ_CAN_RUN_SCRIPT void test2_parent7() {
   RefCountedBase* t = new RefCountedBase;
   t->method_test(); // expected-error {{arguments must all be strong refs or parent parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument)}}
   t->method_test2(); // expected-error {{arguments must all be strong refs or parent parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument)}}
 }
 
+MOZ_CAN_RUN_SCRIPT void test2_parent8() {
+  test2(nullptr);
+}
+
 MOZ_CAN_RUN_SCRIPT void test3(int* param) {}
 
 MOZ_CAN_RUN_SCRIPT void test3_parent() {
   test3(new int);
 }
 
 struct RefCountedChild : public RefCountedBase {
   virtual void method_test3() override; // expected-note {{overridden function declared here}} expected-note {{overridden function declared here}}
@@ -197,16 +201,50 @@ MOZ_CAN_RUN_SCRIPT void test_maybe() {
 
 MOZ_CAN_RUN_SCRIPT void test_maybe_2() {
   // FIXME(bz): This should not generate an error!
   mozilla::Maybe<RefPtr<RefCountedBase>> safe;
   safe.emplace(new RefCountedBase);
   (*safe)->method_test(); // expected-error {{arguments must all be strong refs or parent parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument)}}
 }
 
+MOZ_CAN_RUN_SCRIPT void test_defaults_helper_1(RefCountedBase* arg = nullptr) {
+}
+
+MOZ_CAN_RUN_SCRIPT void test_defaults_1() {
+  test_defaults_helper_1();
+}
+
+MOZ_CAN_RUN_SCRIPT void test_defaults_2() {
+  RefCountedBase* t = new RefCountedBase;
+  test_defaults_helper_1(t); // expected-error {{arguments must all be strong refs or parent parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument)}}
+}
+
+MOZ_CAN_RUN_SCRIPT void test_defaults_3() {
+  RefPtr<RefCountedBase> t = new RefCountedBase;
+  test_defaults_helper_1(t);
+}
+
+MOZ_CAN_RUN_SCRIPT void test_defaults_helper_2(RefCountedBase* arg = new RefCountedBase()) {
+}
+
+MOZ_CAN_RUN_SCRIPT void test_defaults_4() {
+  test_defaults_helper_2(); // expected-error {{arguments must all be strong refs or parent parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument)}}
+}
+
+MOZ_CAN_RUN_SCRIPT void test_defaults_5() {
+  RefCountedBase* t = new RefCountedBase;
+  test_defaults_helper_2(t); // expected-error {{arguments must all be strong refs or parent parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument)}}
+}
+
+MOZ_CAN_RUN_SCRIPT void test_defaults_6() {
+  RefPtr<RefCountedBase> t = new RefCountedBase;
+  test_defaults_helper_2(t);
+}
+
 struct DisallowMemberArgs {
   RefPtr<RefCountedBase> mRefCounted;
   MOZ_CAN_RUN_SCRIPT void foo() {
     mRefCounted->method_test(); // expected-error {{arguments must all be strong refs or parent parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument)}}
   }
   MOZ_CAN_RUN_SCRIPT void bar() {
     test2(mRefCounted); // expected-error {{arguments must all be strong refs or parent parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument)}}
   }
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -4088,23 +4088,16 @@ nsresult nsContentUtils::DispatchEvent(D
   nsresult rv = EventDispatcher::DispatchDOMEvent(target, &aEvent, nullptr,
                                                   nullptr, &status);
   if (aDefaultAction) {
     *aDefaultAction = (status != nsEventStatus_eConsumeNoDefault);
   }
   return rv;
 }
 
-// static
-nsresult nsContentUtils::DispatchInputEvent(Element* aEventTargetElement) {
-  RefPtr<TextEditor> textEditor;  // See bug 1506439
-  return DispatchInputEvent(aEventTargetElement, EditorInputType::eUnknown,
-                            textEditor, InputEventOptions());
-}
-
 nsContentUtils::InputEventOptions::InputEventOptions(
     DataTransfer* aDataTransfer)
     : mDataTransfer(aDataTransfer) {
   MOZ_ASSERT(mDataTransfer);
   MOZ_ASSERT(mDataTransfer->IsReadOnly());
 }
 
 // static
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -1421,17 +1421,20 @@ class nsContentUtils {
    * @param aTextEditor         Optional.  If this is called by editor,
    *                            editor should set this.  Otherwise, leave
    *                            nullptr.
    * @param aOptions            Optional.  If aEditorInputType value requires
    *                            some additional data, they should be properly
    *                            set with this argument.
    */
   MOZ_CAN_RUN_SCRIPT
-  static nsresult DispatchInputEvent(Element* aEventTarget);
+  static nsresult DispatchInputEvent(Element* aEventTarget) {
+    return DispatchInputEvent(aEventTarget, mozilla::EditorInputType::eUnknown,
+                              nullptr, InputEventOptions());
+  }
   struct MOZ_STACK_CLASS InputEventOptions final {
     InputEventOptions() = default;
     explicit InputEventOptions(const nsAString& aData)
         : mData(aData), mDataTransfer(nullptr) {}
     explicit InputEventOptions(mozilla::dom::DataTransfer* aDataTransfer);
 
     nsString mData;
     mozilla::dom::DataTransfer* mDataTransfer;
--- a/dom/html/HTMLVideoElement.cpp
+++ b/dom/html/HTMLVideoElement.cpp
@@ -46,16 +46,17 @@ nsGenericHTMLElement* NS_NewHTMLVideoEle
   element->Init();
   return element;
 }
 
 namespace mozilla {
 namespace dom {
 
 static bool sVideoStatsEnabled;
+static bool sCloneElementVisuallyTesting;
 
 nsresult HTMLVideoElement::Clone(mozilla::dom::NodeInfo* aNodeInfo,
                                  nsINode** aResult) const {
   *aResult = nullptr;
   RefPtr<mozilla::dom::NodeInfo> ni(aNodeInfo);
   HTMLVideoElement* it = new HTMLVideoElement(ni.forget());
   it->Init();
   nsCOMPtr<nsINode> kungFuDeathGrip = it;
@@ -129,17 +130,18 @@ nsresult HTMLVideoElement::GetVideoSize(
     }
   }
   return NS_OK;
 }
 
 void HTMLVideoElement::Invalidate(bool aImageSizeChanged,
                                   Maybe<nsIntSize>& aNewIntrinsicSize,
                                   bool aForceInvalidate) {
-  HTMLMediaElement::Invalidate(aImageSizeChanged, aNewIntrinsicSize, aForceInvalidate);
+  HTMLMediaElement::Invalidate(aImageSizeChanged, aNewIntrinsicSize,
+                               aForceInvalidate);
   if (mVisualCloneTarget) {
     VideoFrameContainer* container =
         mVisualCloneTarget->GetVideoFrameContainer();
     if (container) {
       container->Invalidate();
     }
   }
 }
@@ -379,49 +381,53 @@ void HTMLVideoElement::ReleaseVideoWakeL
     rv.SuppressException();
     mScreenWakeLock = nullptr;
     return;
   }
 }
 
 bool HTMLVideoElement::SetVisualCloneTarget(
     HTMLVideoElement* aVisualCloneTarget) {
-  MOZ_DIAGNOSTIC_ASSERT(!aVisualCloneTarget || !aVisualCloneTarget->mUnboundFromTree,
-                        "Can't set the clone target to a disconnected video "
-                        "element.");
+  MOZ_DIAGNOSTIC_ASSERT(
+      !aVisualCloneTarget || !aVisualCloneTarget->mUnboundFromTree,
+      "Can't set the clone target to a disconnected video "
+      "element.");
   MOZ_DIAGNOSTIC_ASSERT(!mVisualCloneSource,
                         "Can't clone a video element that is already a clone.");
   if (!aVisualCloneTarget ||
       (!aVisualCloneTarget->mUnboundFromTree && !mVisualCloneSource)) {
     mVisualCloneTarget = aVisualCloneTarget;
     return true;
   }
   return false;
 }
 
 bool HTMLVideoElement::SetVisualCloneSource(
     HTMLVideoElement* aVisualCloneSource) {
-  MOZ_DIAGNOSTIC_ASSERT(!aVisualCloneSource || !aVisualCloneSource->mUnboundFromTree,
-                        "Can't set the clone source to a disconnected video "
-                        "element.");
+  MOZ_DIAGNOSTIC_ASSERT(
+      !aVisualCloneSource || !aVisualCloneSource->mUnboundFromTree,
+      "Can't set the clone source to a disconnected video "
+      "element.");
   MOZ_DIAGNOSTIC_ASSERT(!mVisualCloneTarget,
                         "Can't clone a video element that is already a "
                         "clone.");
   if (!aVisualCloneSource ||
       (!aVisualCloneSource->mUnboundFromTree && !mVisualCloneTarget)) {
     mVisualCloneSource = aVisualCloneSource;
     return true;
   }
   return false;
 }
 
 /* static */
 void HTMLVideoElement::InitStatics() {
   Preferences::AddBoolVarCache(&sVideoStatsEnabled,
                                "media.video_stats.enabled");
+  Preferences::AddBoolVarCache(&sCloneElementVisuallyTesting,
+                               "media.cloneElementVisually.testing");
 }
 
 /* static */
 bool HTMLVideoElement::IsVideoStatsEnabled() { return sVideoStatsEnabled; }
 
 double HTMLVideoElement::TotalPlayTime() const {
   double total = 0.0;
 
@@ -476,19 +482,29 @@ void HTMLVideoElement::CloneElementVisua
   if (!aTargetVideo.SetVisualCloneSource(this)) {
     mVisualCloneTarget = nullptr;
     rv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   aTargetVideo.SetMediaInfo(mMediaInfo);
 
+  if (IsInComposedDoc() && !sCloneElementVisuallyTesting) {
+    NotifyUAWidgetSetupOrChange();
+  }
+
   MaybeBeginCloningVisually();
 }
 
+void HTMLVideoElement::StopCloningElementVisually() {
+  if (mVisualCloneTarget) {
+    EndCloningVisually();
+  }
+}
+
 void HTMLVideoElement::MaybeBeginCloningVisually() {
   if (!mVisualCloneTarget) {
     return;
   }
 
   if (mDecoder) {
     MediaDecoderStateMachine* mdsm = mDecoder->GetStateMachine();
     VideoFrameContainer* container =
@@ -521,12 +537,16 @@ void HTMLVideoElement::EndCloningVisuall
     if (container && mVisualCloneTarget->mSelectedVideoStreamTrack) {
       mVisualCloneTarget->mSelectedVideoStreamTrack->RemoveVideoOutput(
           container);
     }
   }
 
   Unused << mVisualCloneTarget->SetVisualCloneSource(nullptr);
   Unused << SetVisualCloneTarget(nullptr);
+
+  if (IsInComposedDoc() && !sCloneElementVisuallyTesting) {
+    NotifyUAWidgetSetupOrChange();
+  }
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/html/HTMLVideoElement.h
+++ b/dom/html/HTMLVideoElement.h
@@ -134,16 +134,20 @@ class HTMLVideoElement final : public HT
   }
 
   bool MozIsOrientationLocked() const { return mIsOrientationLocked; }
 
   void SetMozIsOrientationLocked(bool aLock) { mIsOrientationLocked = aLock; }
 
   void CloneElementVisually(HTMLVideoElement& aTarget, ErrorResult& rv);
 
+  void StopCloningElementVisually();
+
+  bool IsCloningElementVisually() const { return !!mVisualCloneTarget; }
+
  protected:
   virtual ~HTMLVideoElement();
 
   virtual JSObject* WrapNode(JSContext* aCx,
                              JS::Handle<JSObject*> aGivenProto) override;
 
   /**
    * We create video wakelock when the video is playing and release it when
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -2433,19 +2433,18 @@ bool nsTextEditorState::SetValue(const n
       // If this is called as part of user input, we need to dispatch "input"
       // event with "insertReplacementText" since web apps may want to know
       // the user operation which changes editor value with a built-in function
       // like autocomplete, password manager, session restore, etc.
       if (aFlags & eSetValue_BySetUserInput) {
         nsCOMPtr<Element> element = do_QueryInterface(textControlElement);
         MOZ_ASSERT(element);
         MOZ_ASSERT(!newValue.IsVoid());
-        RefPtr<TextEditor> textEditor;  // See bug 1506439
         DebugOnly<nsresult> rvIgnored = nsContentUtils::DispatchInputEvent(
-            element, EditorInputType::eInsertReplacementText, textEditor,
+            element, EditorInputType::eInsertReplacementText, nullptr,
             nsContentUtils::InputEventOptions(newValue));
         NS_WARNING_ASSERTION(NS_SUCCEEDED(rvIgnored),
                              "Failed to dispatch input event");
       }
     } else {
       // Even if our value is not actually changing, apparently we need to mark
       // our SelectionProperties dirty to make accessibility tests happy.
       // Probably because they depend on the SetSelectionRange() call we make on
--- a/dom/media/test/cloneElementVisually_helpers.js
+++ b/dom/media/test/cloneElementVisually_helpers.js
@@ -8,16 +8,17 @@ const LONG_VIDEO = "http://mochi.test:88
  */
 async function setup() {
   await SpecialPowers.pushPrefEnv({
     set: [
       [ "media.test.video-suspend", true ],
       [ "media.suspend-bkgnd-video.enabled", true ],
       [ "media.suspend-bkgnd-video.delay-ms", 500 ],
       [ "media.dormant-on-pause-timeout-ms", 0 ],
+      [ "media.cloneElementVisually.testing", true ],
     ],
   });
 
   let originalVideo = document.getElementById("original");
   await setVideoSrc(originalVideo, TEST_VIDEO_1);
 }
 
 /**
--- a/dom/webidl/HTMLVideoElement.webidl
+++ b/dom/webidl/HTMLVideoElement.webidl
@@ -54,15 +54,25 @@ partial interface HTMLVideoElement {
   [Pref="media.videocontrols.lock-video-orientation", Func="IsChromeOrXBLOrUAWidget"]
     attribute boolean mozIsOrientationLocked;
 
   // Clones the frames playing in this <video> to the target. Cloning
   // when either node is removed from their DOM trees. Throws if one or
   // both <video> elements are not attached to a DOM tree.
   [Throws, Func="IsChromeOrXBLOrUAWidget"]
     void cloneElementVisually(HTMLVideoElement target);
+
+  // Stops a <video> from cloning visually. Does nothing if the <video>
+  // wasn't cloning in the first place.
+  [Func="IsChromeOrXBLOrUAWidget"]
+    void stopCloningElementVisually();
+
+  // Returns true if the <video> is being cloned visually to another
+  // <video> element (see cloneElementVisually).
+  [Func="IsChromeOrXBLOrUAWidget"]
+    readonly attribute boolean isCloningElementVisually;
 };
 
 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement
 partial interface HTMLVideoElement {
   [Func="mozilla::dom::MediaSource::Enabled", NewObject]
   VideoPlaybackQuality getVideoPlaybackQuality();
 };
--- a/editor/libeditor/TextEditorDataTransfer.cpp
+++ b/editor/libeditor/TextEditorDataTransfer.cpp
@@ -283,18 +283,17 @@ nsresult TextEditor::OnDrop(DragEvent* a
     }
     droppedAt = SelectionRefPtr()->FocusRef();
     if (NS_WARN_IF(!droppedAt.IsSet())) {
       return NS_ERROR_FAILURE;
     }
 
     // Let's fire "input" event for the deletion now.
     if (mDispatchInputEvent) {
-      RefPtr<DataTransfer> dataTransfer;  // Required due to bug 1506439
-      FireInputEvent(EditAction::eDeleteByDrag, VoidString(), dataTransfer);
+      FireInputEvent(EditAction::eDeleteByDrag, VoidString(), nullptr);
       if (NS_WARN_IF(Destroyed())) {
         return NS_OK;
       }
     }
 
     // XXX Now, Selection may be changed by input event listeners.  If so,
     //     should we update |droppedAt|?
   }
--- a/gfx/gl/GLContextProviderCGL.mm
+++ b/gfx/gl/GLContextProviderCGL.mm
@@ -161,20 +161,22 @@ static NSOpenGLContext* CreateWithFormat
   NSOpenGLContext* context = [[NSOpenGLContext alloc] initWithFormat:format shareContext:nullptr];
 
   [format release];
 
   return context;
 }
 
 already_AddRefed<GLContext> GLContextProviderCGL::CreateForCompositorWidget(
-    CompositorWidget* aCompositorWidget, bool aForceAccelerated) {
-  return CreateForWindow(aCompositorWidget->RealWidget(),
-                         aCompositorWidget->GetCompositorOptions().UseWebRender(),
-                         aForceAccelerated);
+    CompositorWidget* aCompositorWidget, bool aWebRender, bool aForceAccelerated) {
+  if (!aCompositorWidget) {
+    MOZ_ASSERT(false);
+    return nullptr;
+  }
+  return CreateForWindow(aCompositorWidget->RealWidget(), aWebRender, aForceAccelerated);
 }
 
 already_AddRefed<GLContext> GLContextProviderCGL::CreateForWindow(nsIWidget* aWidget,
                                                                   bool aWebRender,
                                                                   bool aForceAccelerated) {
   if (!sCGLLibrary.EnsureInitialized()) {
     return nullptr;
   }
--- a/gfx/gl/GLContextProviderEAGL.mm
+++ b/gfx/gl/GLContextProviderEAGL.mm
@@ -161,20 +161,22 @@ static already_AddRefed<GLContext> Creat
     glContext = nullptr;
     return nullptr;
   }
 
   return glContext.forget();
 }
 
 already_AddRefed<GLContext> GLContextProviderEAGL::CreateForCompositorWidget(
-    CompositorWidget* aCompositorWidget, bool aForceAccelerated) {
-  return CreateForWindow(aCompositorWidget->RealWidget(),
-                         aCompositorWidget->GetCompositorOptions().UseWebRender(),
-                         aForceAccelerated);
+    CompositorWidget* aCompositorWidget, bool aWebRender, bool aForceAccelerated) {
+  if (!aCompositorWidget) {
+    MOZ_ASSERT(false);
+    return nullptr;
+  }
+  return CreateForWindow(aCompositorWidget->RealWidget(), aWebRender, aForceAccelerated);
 }
 
 already_AddRefed<GLContext> GLContextProviderEAGL::CreateForWindow(nsIWidget* aWidget,
                                                                    bool aWebRender,
                                                                    bool aForceAccelerated) {
   RefPtr<GLContext> glContext =
       CreateEAGLContext(CreateContextFlags::NONE, false, GetGlobalContextEAGL());
   if (!glContext) {
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -863,21 +863,23 @@ already_AddRefed<GLContext> GLContextPro
                        (EGLSurface)aSurface, (EGLContext)aContext);
   gl->SetIsDoubleBuffered(true);
   gl->mOwnsContext = false;
 
   return gl.forget();
 }
 
 already_AddRefed<GLContext> GLContextProviderEGL::CreateForCompositorWidget(
-    CompositorWidget* aCompositorWidget, bool aForceAccelerated) {
-  MOZ_ASSERT(aCompositorWidget);
-  return GLContextEGLFactory::Create(
-      GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aCompositorWidget),
-      aCompositorWidget->GetCompositorOptions().UseWebRender());
+    CompositorWidget* aCompositorWidget, bool aWebRender,
+    bool aForceAccelerated) {
+  EGLNativeWindowType window = nullptr;
+  if (aCompositorWidget) {
+    window = GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aCompositorWidget);
+  }
+  return GLContextEGLFactory::Create(window, aWebRender);
 }
 
 already_AddRefed<GLContext> GLContextProviderEGL::CreateForWindow(
     nsIWidget* aWidget, bool aWebRender, bool aForceAccelerated) {
   MOZ_ASSERT(aWidget);
   return GLContextEGLFactory::Create(
       GET_NATIVE_WINDOW_FROM_REAL_WIDGET(aWidget), aWebRender);
 }
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -740,23 +740,27 @@ already_AddRefed<GLContext> CreateForWid
     flags = CreateContextFlags::REQUIRE_COMPAT_PROFILE;
   }
   return GLContextGLX::CreateGLContext(flags, SurfaceCaps::Any(), false,
                                        aXDisplay, aXWindow, config, false,
                                        nullptr);
 }
 
 already_AddRefed<GLContext> GLContextProviderGLX::CreateForCompositorWidget(
-    CompositorWidget* aCompositorWidget, bool aForceAccelerated) {
+    CompositorWidget* aCompositorWidget, bool aWebRender,
+    bool aForceAccelerated) {
+  if (!aCompositorWidget) {
+    MOZ_ASSERT(false);
+    return nullptr;
+  }
   GtkCompositorWidget* compWidget = aCompositorWidget->AsX11();
   MOZ_ASSERT(compWidget);
 
   return CreateForWidget(compWidget->XDisplay(), compWidget->XWindow(),
-                         compWidget->GetCompositorOptions().UseWebRender(),
-                         aForceAccelerated);
+                         aWebRender, aForceAccelerated);
 }
 
 already_AddRefed<GLContext> GLContextProviderGLX::CreateForWindow(
     nsIWidget* aWidget, bool aWebRender, bool aForceAccelerated) {
   Display* display =
       (Display*)aWidget->GetNativeData(NS_NATIVE_COMPOSITOR_DISPLAY);
   Window window = GET_NATIVE_WINDOW(aWidget);
 
--- a/gfx/gl/GLContextProviderImpl.h
+++ b/gfx/gl/GLContextProviderImpl.h
@@ -35,17 +35,17 @@ class GL_CONTEXT_PROVIDER_NAME {
    * a GL layer manager.
    *
    * @param aCompositorWidget Widget whose surface to create a context for
    * @param aForceAccelerated true if only accelerated contexts are allowed
    *
    * @return Context to use for the window
    */
   static already_AddRefed<GLContext> CreateForCompositorWidget(
-      mozilla::widget::CompositorWidget* aCompositorWidget,
+      mozilla::widget::CompositorWidget* aCompositorWidget, bool aWebRender,
       bool aForceAccelerated);
 
   /**
    * Create a context that renders to the surface of the widget that is
    * passed in.  The context is always created with an RGB pixel format,
    * with no alpha, depth or stencil.  If any of those features are needed,
    * either use a framebuffer, or use CreateOffscreen.
    *
--- a/gfx/gl/GLContextProviderNull.cpp
+++ b/gfx/gl/GLContextProviderNull.cpp
@@ -6,17 +6,18 @@
 #include "GLContextProvider.h"
 
 namespace mozilla {
 namespace gl {
 
 using namespace mozilla::widget;
 
 already_AddRefed<GLContext> GLContextProviderNull::CreateForCompositorWidget(
-    CompositorWidget* aCompositorWidget, bool aForceAccelerated) {
+    CompositorWidget* aCompositorWidget, bool aWebRender,
+    bool aForceAccelerated) {
   return nullptr;
 }
 
 already_AddRefed<GLContext> GLContextProviderNull::CreateForWindow(
     nsIWidget* aWidget, bool aWebRender, bool aForceAccelerated) {
   return nullptr;
 }
 
--- a/gfx/gl/GLContextProviderWGL.cpp
+++ b/gfx/gl/GLContextProviderWGL.cpp
@@ -447,21 +447,24 @@ static RefPtr<GLContext> CreateForWidget
   cleanupDc.release();
   gl->mIsDoubleBuffered = true;
   if (!gl->Init()) return nullptr;
 
   return gl;
 }
 
 already_AddRefed<GLContext> GLContextProviderWGL::CreateForCompositorWidget(
-    CompositorWidget* aCompositorWidget, bool aForceAccelerated) {
-  return CreateForWidget(
-             aCompositorWidget->AsWindows()->GetHwnd(),
-             aCompositorWidget->GetCompositorOptions().UseWebRender(),
-             aForceAccelerated)
+    CompositorWidget* aCompositorWidget, bool aWebRender,
+    bool aForceAccelerated) {
+  if (!aCompositorWidget) {
+    MOZ_ASSERT(false);
+    return nullptr;
+  }
+  return CreateForWidget(aCompositorWidget->AsWindows()->GetHwnd(), aWebRender,
+                         aForceAccelerated)
       .forget();
 }
 
 already_AddRefed<GLContext> GLContextProviderWGL::CreateForWindow(
     nsIWidget* aWidget, bool aWebRender, bool aForceAccelerated) {
   return CreateForWidget((HWND)aWidget->GetNativeData(NS_NATIVE_WINDOW),
                          aWebRender, aForceAccelerated)
       .forget();
--- a/gfx/gl/GLContextProviderWayland.cpp
+++ b/gfx/gl/GLContextProviderWayland.cpp
@@ -24,23 +24,24 @@ already_AddRefed<GLContext> GLContextPro
   if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
     return sGLContextProviderGLX.CreateWrappingExisting(aContext, aSurface);
   } else {
     return sGLContextProviderEGL.CreateWrappingExisting(aContext, aSurface);
   }
 }
 
 already_AddRefed<GLContext> GLContextProviderWayland::CreateForCompositorWidget(
-    CompositorWidget* aCompositorWidget, bool aForceAccelerated) {
+    CompositorWidget* aCompositorWidget, bool aWebRender,
+    bool aForceAccelerated) {
   if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
-    return sGLContextProviderGLX.CreateForCompositorWidget(aCompositorWidget,
-                                                           aForceAccelerated);
+    return sGLContextProviderGLX.CreateForCompositorWidget(
+        aCompositorWidget, aWebRender, aForceAccelerated);
   } else {
-    return sGLContextProviderEGL.CreateForCompositorWidget(aCompositorWidget,
-                                                           aForceAccelerated);
+    return sGLContextProviderEGL.CreateForCompositorWidget(
+        aCompositorWidget, aWebRender, aForceAccelerated);
   }
 }
 
 already_AddRefed<GLContext> GLContextProviderWayland::CreateForWindow(
     nsIWidget* aWidget, bool aWebRender, bool aForceAccelerated) {
   if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
     return sGLContextProviderGLX.CreateForWindow(aWidget, aWebRender,
                                                  aForceAccelerated);
--- a/gfx/layers/d3d11/CompositorD3D11.cpp
+++ b/gfx/layers/d3d11/CompositorD3D11.cpp
@@ -1247,17 +1247,17 @@ void CompositorD3D11::EndFrame() {
     }
   } else {
     mDiagnostics->Cancel();
   }
 
   // Block until the previous frame's work has been completed.
   if (mQuery) {
     BOOL result;
-    WaitForGPUQuery(mDevice, mContext, mQuery, &result);
+    WaitForFrameGPUQuery(mDevice, mContext, mQuery, &result);
   }
   // Store the query for this frame so we can flush it next time.
   mQuery = query;
 
   Compositor::EndFrame();
 
   mCurrentRT = nullptr;
 }
--- a/gfx/layers/d3d11/HelpersD3D11.h
+++ b/gfx/layers/d3d11/HelpersD3D11.h
@@ -3,16 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_gfx_layers_d3d11_HelpersD3D11_h
 #define mozilla_gfx_layers_d3d11_HelpersD3D11_h
 
 #include <d3d11.h>
+#include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 
 namespace mozilla {
 namespace layers {
 
 template <typename T>
 static inline bool WaitForGPUQuery(ID3D11Device* aDevice,
                                    ID3D11DeviceContext* aContext,
@@ -25,12 +26,31 @@ static inline bool WaitForGPUQuery(ID3D1
     if (TimeStamp::Now() - start > TimeDuration::FromSeconds(2)) {
       return false;
     }
     Sleep(0);
   }
   return true;
 }
 
+static inline bool WaitForFrameGPUQuery(ID3D11Device* aDevice,
+                                        ID3D11DeviceContext* aContext,
+                                        ID3D11Query* aQuery, BOOL* aOut) {
+  TimeStamp start = TimeStamp::Now();
+  bool success = true;
+  while (aContext->GetData(aQuery, aOut, sizeof(*aOut), 0) != S_OK) {
+    if (aDevice->GetDeviceRemovedReason() != S_OK) {
+      return false;
+    }
+    if (TimeStamp::Now() - start > TimeDuration::FromSeconds(2)) {
+      success = false;
+      break;
+    }
+    Sleep(0);
+  }
+  Telemetry::AccumulateTimeDelta(Telemetry::GPU_WAIT_TIME_MS, start);
+  return success;
+}
+
 }  // namespace layers
 }  // namespace mozilla
 
 #endif  // mozilla_gfx_layers_d3d11_HelpersD3D11_h
--- a/gfx/layers/d3d11/MLGDeviceD3D11.cpp
+++ b/gfx/layers/d3d11/MLGDeviceD3D11.cpp
@@ -1781,17 +1781,17 @@ void MLGDeviceD3D11::InsertPresentWaitQu
   }
 
   mCtx->End(mNextWaitForPresentQuery);
 }
 
 void MLGDeviceD3D11::WaitForPreviousPresentQuery() {
   if (mWaitForPresentQuery) {
     BOOL result;
-    WaitForGPUQuery(mDevice, mCtx, mWaitForPresentQuery, &result);
+    WaitForFrameGPUQuery(mDevice, mCtx, mWaitForPresentQuery, &result);
   }
   mWaitForPresentQuery = mNextWaitForPresentQuery.forget();
 }
 
 void MLGDeviceD3D11::Flush() { mCtx->Flush(); }
 
 void MLGDeviceD3D11::EndFrame() {
   // On our Windows 8 x64 machines, we have observed a driver bug related to
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -222,18 +222,18 @@ already_AddRefed<mozilla::gl::GLContext>
   if (widgetOpenGLContext) {
     GLContext* alreadyRefed = reinterpret_cast<GLContext*>(widgetOpenGLContext);
     return already_AddRefed<GLContext>(alreadyRefed);
   }
 
 #ifdef XP_WIN
   if (gfxEnv::LayersPreferEGL()) {
     printf_stderr("Trying GL layers...\n");
-    context =
-        gl::GLContextProviderEGL::CreateForCompositorWidget(mWidget, false);
+    context = gl::GLContextProviderEGL::CreateForCompositorWidget(
+        mWidget, /* aWebRender */ false, /* aForceAccelerated */ false);
   }
 #endif
 
   // Allow to create offscreen GL context for main Layer Manager
   if (!context && gfxEnv::LayersPreferOffscreen()) {
     SurfaceCaps caps = SurfaceCaps::ForRGB();
     caps.preserve = false;
     caps.bpp16 = gfxVars::OffscreenFormat() == SurfaceFormat::R5G6B5_UINT16;
@@ -241,17 +241,19 @@ already_AddRefed<mozilla::gl::GLContext>
     nsCString discardFailureId;
     context = GLContextProvider::CreateOffscreen(
         mSurfaceSize, caps, CreateContextFlags::REQUIRE_COMPAT_PROFILE,
         &discardFailureId);
   }
 
   if (!context) {
     context = gl::GLContextProvider::CreateForCompositorWidget(
-        mWidget, gfxVars::RequiresAcceleratedGLContextForCompositorOGL());
+        mWidget,
+        /* aWebRender */ false,
+        gfxVars::RequiresAcceleratedGLContextForCompositorOGL());
   }
 
   if (!context) {
     NS_WARNING("Failed to create CompositorOGL context");
   }
 
   return context.forget();
 }
--- a/gfx/webrender_bindings/RenderCompositorANGLE.cpp
+++ b/gfx/webrender_bindings/RenderCompositorANGLE.cpp
@@ -505,17 +505,17 @@ void RenderCompositorANGLE::InsertPresen
 }
 
 void RenderCompositorANGLE::WaitForPreviousPresentQuery() {
   size_t waitLatency = mUseTripleBuffering ? 3 : 2;
 
   while (mWaitForPresentQueries.size() >= waitLatency) {
     RefPtr<ID3D11Query>& query = mWaitForPresentQueries.front();
     BOOL result;
-    layers::WaitForGPUQuery(mDevice, mCtx, query, &result);
+    layers::WaitForFrameGPUQuery(mDevice, mCtx, query, &result);
 
     // Recycle query for later use.
     mRecycledQuery = query;
     mWaitForPresentQueries.pop();
   }
 }
 
 }  // namespace wr
--- a/gfx/webrender_bindings/RenderCompositorEGL.cpp
+++ b/gfx/webrender_bindings/RenderCompositorEGL.cpp
@@ -22,38 +22,30 @@ namespace wr {
 /* static */
 UniquePtr<RenderCompositor> RenderCompositorEGL::Create(
     RefPtr<widget::CompositorWidget> aWidget) {
   if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
     return nullptr;
   }
 
   RefPtr<gl::GLContext> gl;
-  gl = CreateGLContext(aWidget);
+  gl = CreateGLContext();
   if (!gl) {
     return nullptr;
   }
   return MakeUnique<RenderCompositorEGL>(gl, aWidget);
 }
 
 /* static */ already_AddRefed<gl::GLContext>
-RenderCompositorEGL::CreateGLContext(RefPtr<widget::CompositorWidget> aWidget) {
-  nsCString discardFailureId;
-
+RenderCompositorEGL::CreateGLContext() {
   // Create GLContext with dummy EGLSurface.
   RefPtr<gl::GLContext> gl =
-      // XXX headless context did not work.
-      gl::GLContextProviderEGL::CreateForCompositorWidget(aWidget, true);
-  if (!gl) {
-    gfxCriticalNote << "Failed GL context creation for WebRender: "
-                    << gfx::hexa(gl.get());
-    return nullptr;
-  }
-
-  if (!gl->MakeCurrent()) {
+      gl::GLContextProviderEGL::CreateForCompositorWidget(
+          nullptr, /* aWebRender */ true, /* aForceAccelerated */ true);
+  if (!gl || !gl->MakeCurrent()) {
     gfxCriticalNote << "Failed GL context creation for WebRender: "
                     << gfx::hexa(gl.get());
     return nullptr;
   }
 
   return gl.forget();
 }
 
--- a/gfx/webrender_bindings/RenderCompositorEGL.h
+++ b/gfx/webrender_bindings/RenderCompositorEGL.h
@@ -33,18 +33,17 @@ class RenderCompositorEGL : public Rende
 
   bool MakeCurrent() override;
 
   bool UseANGLE() const override { return false; }
 
   LayoutDeviceIntSize GetBufferSize() override;
 
  protected:
-  static already_AddRefed<gl::GLContext> CreateGLContext(
-      RefPtr<widget::CompositorWidget> aWidget);
+  static already_AddRefed<gl::GLContext> CreateGLContext();
   EGLSurface CreateEGLSurface();
 
   void DestroyEGLSurface();
 
   const RefPtr<gl::GLContext> mGL;
   EGLSurface mEGLSurface;
 };
 
--- a/gfx/webrender_bindings/RenderCompositorOGL.cpp
+++ b/gfx/webrender_bindings/RenderCompositorOGL.cpp
@@ -12,17 +12,18 @@
 
 namespace mozilla {
 namespace wr {
 
 /* static */
 UniquePtr<RenderCompositor> RenderCompositorOGL::Create(
     RefPtr<widget::CompositorWidget>&& aWidget) {
   RefPtr<gl::GLContext> gl;
-  gl = gl::GLContextProvider::CreateForCompositorWidget(aWidget, true);
+  gl = gl::GLContextProvider::CreateForCompositorWidget(
+      aWidget, /* aWebRender */ true, /* aForceAccelerated */ true);
   if (!gl || !gl->MakeCurrent()) {
     gfxCriticalNote << "Failed GL context creation for WebRender: "
                     << gfx::hexa(gl.get());
     return nullptr;
   }
   return MakeUnique<RenderCompositorOGL>(std::move(gl), std::move(aWidget));
 }
 
rename from js/src/frontend/BinSource-macros.h
rename to js/src/frontend/BinAST-macros.h
--- a/js/src/frontend/BinSource-macros.h
+++ b/js/src/frontend/BinAST-macros.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * 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 frontend_BinSource_macros_h
-#define frontend_BinSource_macros_h
+#ifndef frontend_BinAST_macros_h
+#define frontend_BinAST_macros_h
 
 #include "vm/JSContext.h"
 
 // Evaluate an expression EXPR, checking that the result is not falsy.
 //
 // Throw `cx->alreadyReportedError()` if it returns 0/nullptr.
 #define BINJS_TRY(EXPR)                            \
   do {                                             \
@@ -54,9 +54,9 @@
 // In case of success, unwrap and assign the result to a new variable VAR.
 //
 // In case of error, propagate the error.
 #define BINJS_MOZ_TRY_DECL(VAR, EXPR)                            \
   auto _##VAR = EXPR;                                            \
   if (_##VAR.isErr()) return ::mozilla::Err(_##VAR.unwrapErr()); \
   auto VAR = _##VAR.unwrap();
 
-#endif  // frontend_BinSource_macros_h
+#endif  // frontend_BinAST_macros_h
rename from js/src/frontend/BinSource.webidl_
rename to js/src/frontend/BinAST.webidl_
rename from js/src/frontend/BinSource.yaml
rename to js/src/frontend/BinAST.yaml
--- a/js/src/frontend/BinSource.yaml
+++ b/js/src/frontend/BinAST.yaml
@@ -22,29 +22,29 @@ cpp:
   header: |
     /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
      * vim: set ts=8 sts=2 et sw=2 tw=80:
      * 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/. */
 
     // To generate this file, see the documentation in
-    // js/src/frontend/binsource/README.md.
+    // js/src/frontend/binast/README.md.
 
     #include "frontend/BinASTParser.h"
 
     #include "mozilla/ArrayUtils.h"
     #include "mozilla/Casting.h"
     #include "mozilla/Maybe.h"
     #include "mozilla/Move.h"
     #include "mozilla/PodOperations.h"
     #include "mozilla/Vector.h"
 
-    #include "frontend/BinSource-macros.h"
-    #include "frontend/BinTokenReaderMultipart.h"
+    #include "frontend/BinAST-macros.h"
+    #include "frontend/BinASTTokenReaderMultipart.h"
     #include "frontend/FullParseHandler.h"
     #include "frontend/ParseNode.h"
     #include "frontend/Parser.h"
     #include "frontend/SharedContext.h"
 
     #include "vm/RegExpObject.h"
 
     #include "frontend/ParseContext-inl.h"
@@ -59,43 +59,43 @@ cpp:
       return Tok::equals(left, right);
     }
 
   footer: |
 
     // Force class instantiation.
     // This ensures that the symbols are built, without having to export all our
     // code (and its baggage of #include and macros) in the header.
-    template class BinASTParser<BinTokenReaderMultipart>;
+    template class BinASTParser<BinASTTokenReaderMultipart>;
 
     } // namespace frontend
     } // namespace js
 
 hpp:
   # Rules for generating BinASTParser.h
   class:
     header: |
       /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
        * vim: set ts=8 sts=2 et sw=2 tw=80:
        * 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/. */
 
       // To generate this file, see the documentation in
-      // js/src/frontend/binsource/README.md.
+      // js/src/frontend/binast/README.md.
 
       #ifndef frontend_BinASTParser_h
       #define frontend_BinASTParser_h
 
       #include "mozilla/Maybe.h"
 
       #include "frontend/BCEParserHandle.h"
       #include "frontend/BinASTParserPerTokenizer.h"
-      #include "frontend/BinToken.h"
-      #include "frontend/BinTokenReaderMultipart.h"
+      #include "frontend/BinASTToken.h"
+      #include "frontend/BinASTTokenReaderMultipart.h"
       #include "frontend/FullParseHandler.h"
       #include "frontend/ParseContext.h"
       #include "frontend/ParseNode.h"
       #include "frontend/SharedContext.h"
 
       #include "js/CompileOptions.h"
       #include "js/GCHashTable.h"
       #include "js/GCVector.h"
@@ -106,17 +106,17 @@ hpp:
 
       template<typename Tok>
       class BinASTParser : public BinASTParserPerTokenizer<Tok> {
        public:
         using Base = BinASTParserPerTokenizer<Tok>;
 
         using Tokenizer = Tok;
 
-        using BinFields = typename Tokenizer::BinFields;
+        using BinASTFields = typename Tokenizer::BinASTFields;
         using AutoList = typename Tokenizer::AutoList;
         using AutoTaggedTuple = typename Tokenizer::AutoTaggedTuple;
         using Chars = typename Tokenizer::Chars;
 
        public:
         // Auto-generated types.
         using AssertedDeclaredKind = binast::AssertedDeclaredKind;
         using BinaryOperator = binast::BinaryOperator;
@@ -188,48 +188,48 @@ hpp:
         using Base::prependDirectivesToBody;
 
         using Base::forceStrictIfNecessary;
 
        public:
     footer: |
       };
 
-      extern template class BinASTParser<BinTokenReaderMultipart>;
+      extern template class BinASTParser<BinASTTokenReaderMultipart>;
 
       } // namespace frontend
       } // namespace js
 
       #endif // frontend_BinASTParser_h
 
   enums:
     header: |
       /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
        * vim: set ts=8 sts=2 et sw=2 tw=80:
        * 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/. */
 
       // To generate this file, see the documentation in
-      // js/src/frontend/binsource/README.md.
+      // js/src/frontend/binast/README.md.
 
       #ifndef frontend_BinASTEnum_h
       #define frontend_BinASTEnum_h
 
       namespace js {
       namespace frontend {
       namespace binast {
     footer: |
       } // namespace binast
       } // namespace frontend
       } // namespace js
 
       #endif // frontend_BinASTEnum_h
 
-  # Rules for generating BinToken.h
+  # Rules for generating BinASTToken.h
   tokens:
     kind:
       doc: |
         /**
          * The different kinds of Binary AST nodes, as per the specifications of
          * Binary AST.
          *
          * These kinds match roughly with the `ParseNodeKind` used internally.
@@ -282,31 +282,31 @@ hpp:
       /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
        * vim: set ts=8 sts=2 et sw=2 tw=80:
        * 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/. */
 
 
       // To generate this file, see the documentation in
-      // js/src/frontend/binsource/README.md.
+      // js/src/frontend/binast/README.md.
 
-      #ifndef frontend_BinToken_h
-      #define frontend_BinToken_h
+      #ifndef frontend_BinASTToken_h
+      #define frontend_BinASTToken_h
 
       #include <stddef.h>
 
       /**
        * Definition of Binary AST tokens.
        *
        * In the Binary AST world, an AST is composed of nodes, where a node is
        * defined by:
-       * - a Kind (see `BinKind`);
+       * - a Kind (see `BinASTKind`);
        * - a list of fields, where each field is:
-       *    - a Name (see `BinField`);
+       *    - a Name (see `BinASTField`);
        *    - a Value, which may be either a node or a primitive value.
        *
        * The mapping between Kind and list of fields is determined entirely by
        * the grammar of Binary AST. The mapping between (Kind, Name) and the
        * structure of Value is also determined entirely by the grammar of
        * Binary AST.
        *
        * As per the specifications of Binary AST, kinds may be added as the
@@ -320,34 +320,34 @@ hpp:
        * unknown Kinds or Names.
        */
 
       namespace js {
       namespace frontend {
     footer: |
 
       /**
-       * Return a string describing a `BinKind`.
+       * Return a string describing a `BinASTKind`.
        */
-      const char* describeBinKind(const BinKind& kind);
+      const char* describeBinASTKind(const BinASTKind& kind);
 
       /**
-       * Return a string describing a `BinField`.
+       * Return a string describing a `BinASTField`.
        */
-      const char* describeBinField(const BinField& kind);
+      const char* describeBinASTField(const BinASTField& kind);
 
       /**
-       * Return a string describing a `BinVariant`.
+       * Return a string describing a `BinASTVariant`.
        */
-      const char* describeBinVariant(const BinVariant& kind);
+      const char* describeBinASTVariant(const BinASTVariant& kind);
 
       } // namespace frontend
       } // namespace js
 
-      #endif // frontend_BinToken_h
+      #endif // frontend_BinASTToken_h
 
 Arguments:
   init: |
     BINJS_TRY_DECL(result, handler_.newList(ParseNodeKind::Arguments,
                                             tokenizer_->pos(start)));
   append:
     handler_.addList(/* list = */ result, /* kid = */ item);
 
@@ -916,17 +916,17 @@ EagerFunctionExpression:
           syntax,
           (syntax != FunctionSyntaxKind::Setter &&
            syntax != FunctionSyntaxKind::Getter) ? name : nullptr));
 
         forceStrictIfNecessary(funbox, directives);
 
         // Push a new ParseContext. It will be used to parse `scope`, the arguments,
         // the function.
-        BinParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
+        BinASTParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
         BINJS_TRY(funpc.init());
         pc_->functionScope().useAsVarScope(pc_);
         MOZ_ASSERT(pc_->isFunctionBox());
 
         ParseContext::Scope lexicalScope(cx_, pc_, usedNames_);
         BINJS_TRY(lexicalScope.init(pc_));
         ListNode* params;
         ListNode* body;
@@ -1610,17 +1610,17 @@ VariableDeclarator:
       } else {
         result = bindingNameNode;
       }
     } else {
       // `var pattern = bar`
       if (!init) {
         // Here, `init` is required.
         return raiseMissingField("VariableDeclarator (with non-trivial pattern)",
-                                 BinField::Init);
+                                 BinASTField::Init);
       }
 
       MOZ_CRASH("Unimplemented: AssertedScope check for BindingPattern variable declaration");
       BINJS_TRY_VAR(result,
                     handler_.newAssignment(ParseNodeKind::AssignExpr, binding,
                                            init));
     }
 
--- a/js/src/frontend/BinASTEnum.h
+++ b/js/src/frontend/BinASTEnum.h
@@ -2,17 +2,17 @@
 // please DO NOT EDIT BY HAND.
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * 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/. */
 
 // To generate this file, see the documentation in
-// js/src/frontend/binsource/README.md.
+// js/src/frontend/binast/README.md.
 
 #ifndef frontend_BinASTEnum_h
 #define frontend_BinASTEnum_h
 
 namespace js {
 namespace frontend {
 namespace binast {
 
--- a/js/src/frontend/BinASTParser.cpp
+++ b/js/src/frontend/BinASTParser.cpp
@@ -2,29 +2,29 @@
 // please DO NOT EDIT BY HAND.
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * 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/. */
 
 // To generate this file, see the documentation in
-// js/src/frontend/binsource/README.md.
+// js/src/frontend/binast/README.md.
 
 #include "frontend/BinASTParser.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Casting.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/Move.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/Vector.h"
 
-#include "frontend/BinSource-macros.h"
-#include "frontend/BinTokenReaderMultipart.h"
+#include "frontend/BinAST-macros.h"
+#include "frontend/BinASTTokenReaderMultipart.h"
 #include "frontend/FullParseHandler.h"
 #include "frontend/ParseNode.h"
 #include "frontend/Parser.h"
 #include "frontend/SharedContext.h"
 
 #include "vm/RegExpObject.h"
 
 #include "frontend/ParseContext-inl.h"
@@ -45,48 +45,48 @@ bool operator==(const typename Tok::Char
 AssertedMaybePositionalParameterName ::= AssertedParameterName
     AssertedPositionalParameterName
     AssertedRestParameterName
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedMaybePositionalParameterName(
     AssertedScopeKind scopeKind,
     MutableHandle<GCVector<JSAtom*>> positionalParams) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result,
                      parseSumAssertedMaybePositionalParameterName(
                          start, kind, fields, scopeKind, positionalParams));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseSumAssertedMaybePositionalParameterName(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     AssertedScopeKind scopeKind,
     MutableHandle<GCVector<JSAtom*>> positionalParams) {
   Ok result;
   switch (kind) {
-    case BinKind::AssertedParameterName:
+    case BinASTKind::AssertedParameterName:
       return raiseError(
           "FIXME: Not implemented yet in this preview release "
           "(AssertedParameterName)");
-    case BinKind::AssertedPositionalParameterName:
+    case BinASTKind::AssertedPositionalParameterName:
       MOZ_TRY_VAR(result,
                   parseInterfaceAssertedPositionalParameterName(
                       start, kind, fields, scopeKind, positionalParams));
       break;
-    case BinKind::AssertedRestParameterName:
+    case BinASTKind::AssertedRestParameterName:
       return raiseError(
           "FIXME: Not implemented yet in this preview release "
           "(AssertedRestParameterName)");
     default:
       return raiseInvalidKind("AssertedMaybePositionalParameterName", kind);
   }
   return result;
 }
@@ -95,92 +95,92 @@ JS::Result<Ok> BinASTParser<Tok>::parseS
 AssignmentTarget ::= ArrayAssignmentTarget
     AssignmentTargetIdentifier
     ComputedMemberAssignmentTarget
     ObjectAssignmentTarget
     StaticMemberAssignmentTarget
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseAssignmentTarget() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumAssignmentTarget(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayAssignmentTarget:
+    case BinASTKind::ArrayAssignmentTarget:
       MOZ_TRY_VAR(result,
                   parseInterfaceArrayAssignmentTarget(start, kind, fields));
       break;
-    case BinKind::AssignmentTargetIdentifier:
+    case BinASTKind::AssignmentTargetIdentifier:
       MOZ_TRY_VAR(result, parseInterfaceAssignmentTargetIdentifier(start, kind,
                                                                    fields));
       break;
-    case BinKind::ComputedMemberAssignmentTarget:
+    case BinASTKind::ComputedMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceComputedMemberAssignmentTarget(
                               start, kind, fields));
       break;
-    case BinKind::ObjectAssignmentTarget:
+    case BinASTKind::ObjectAssignmentTarget:
       MOZ_TRY_VAR(result,
                   parseInterfaceObjectAssignmentTarget(start, kind, fields));
       break;
-    case BinKind::StaticMemberAssignmentTarget:
+    case BinASTKind::StaticMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceStaticMemberAssignmentTarget(
                               start, kind, fields));
       break;
     default:
       return raiseInvalidKind("AssignmentTarget", kind);
   }
   return result;
 }
 
 /*
 Binding ::= ArrayBinding
     BindingIdentifier
     ObjectBinding
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseBinding() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumBinding(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumBinding(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayBinding:
+    case BinASTKind::ArrayBinding:
       MOZ_TRY_VAR(result, parseInterfaceArrayBinding(start, kind, fields));
       break;
-    case BinKind::BindingIdentifier:
+    case BinASTKind::BindingIdentifier:
       MOZ_TRY_VAR(result, parseInterfaceBindingIdentifier(start, kind, fields));
       break;
-    case BinKind::ObjectBinding:
+    case BinASTKind::ObjectBinding:
       MOZ_TRY_VAR(result, parseInterfaceObjectBinding(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("Binding", kind);
   }
   return result;
 }
 
@@ -215,148 +215,148 @@ Expression ::= ArrayExpression
     ThisExpression
     UnaryExpression
     UpdateExpression
     YieldExpression
     YieldStarExpression
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumExpression(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayExpression:
+    case BinASTKind::ArrayExpression:
       MOZ_TRY_VAR(result, parseInterfaceArrayExpression(start, kind, fields));
       break;
-    case BinKind::AssignmentExpression:
+    case BinASTKind::AssignmentExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceAssignmentExpression(start, kind, fields));
       break;
-    case BinKind::AwaitExpression:
+    case BinASTKind::AwaitExpression:
       MOZ_TRY_VAR(result, parseInterfaceAwaitExpression(start, kind, fields));
       break;
-    case BinKind::BinaryExpression:
+    case BinASTKind::BinaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceBinaryExpression(start, kind, fields));
       break;
-    case BinKind::CallExpression:
+    case BinASTKind::CallExpression:
       MOZ_TRY_VAR(result, parseInterfaceCallExpression(start, kind, fields));
       break;
-    case BinKind::ClassExpression:
+    case BinASTKind::ClassExpression:
       MOZ_TRY_VAR(result, parseInterfaceClassExpression(start, kind, fields));
       break;
-    case BinKind::CompoundAssignmentExpression:
+    case BinASTKind::CompoundAssignmentExpression:
       MOZ_TRY_VAR(result, parseInterfaceCompoundAssignmentExpression(
                               start, kind, fields));
       break;
-    case BinKind::ComputedMemberExpression:
+    case BinASTKind::ComputedMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceComputedMemberExpression(start, kind, fields));
       break;
-    case BinKind::ConditionalExpression:
+    case BinASTKind::ConditionalExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceConditionalExpression(start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithExpression:
+    case BinASTKind::EagerArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithFunctionBody:
+    case BinASTKind::EagerArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::EagerFunctionExpression:
+    case BinASTKind::EagerFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceEagerFunctionExpression(start, kind, fields));
       break;
-    case BinKind::IdentifierExpression:
+    case BinASTKind::IdentifierExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceIdentifierExpression(start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithExpression:
+    case BinASTKind::LazyArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithFunctionBody:
+    case BinASTKind::LazyArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::LazyFunctionExpression:
+    case BinASTKind::LazyFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLazyFunctionExpression(start, kind, fields));
       break;
-    case BinKind::LiteralBooleanExpression:
+    case BinASTKind::LiteralBooleanExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralBooleanExpression(start, kind, fields));
       break;
-    case BinKind::LiteralInfinityExpression:
+    case BinASTKind::LiteralInfinityExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralInfinityExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNullExpression:
+    case BinASTKind::LiteralNullExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNullExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNumericExpression:
+    case BinASTKind::LiteralNumericExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNumericExpression(start, kind, fields));
       break;
-    case BinKind::LiteralRegExpExpression:
+    case BinASTKind::LiteralRegExpExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralRegExpExpression(start, kind, fields));
       break;
-    case BinKind::LiteralStringExpression:
+    case BinASTKind::LiteralStringExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralStringExpression(start, kind, fields));
       break;
-    case BinKind::NewExpression:
+    case BinASTKind::NewExpression:
       MOZ_TRY_VAR(result, parseInterfaceNewExpression(start, kind, fields));
       break;
-    case BinKind::NewTargetExpression:
+    case BinASTKind::NewTargetExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceNewTargetExpression(start, kind, fields));
       break;
-    case BinKind::ObjectExpression:
+    case BinASTKind::ObjectExpression:
       MOZ_TRY_VAR(result, parseInterfaceObjectExpression(start, kind, fields));
       break;
-    case BinKind::StaticMemberExpression:
+    case BinASTKind::StaticMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceStaticMemberExpression(start, kind, fields));
       break;
-    case BinKind::TemplateExpression:
+    case BinASTKind::TemplateExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceTemplateExpression(start, kind, fields));
       break;
-    case BinKind::ThisExpression:
+    case BinASTKind::ThisExpression:
       MOZ_TRY_VAR(result, parseInterfaceThisExpression(start, kind, fields));
       break;
-    case BinKind::UnaryExpression:
+    case BinASTKind::UnaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceUnaryExpression(start, kind, fields));
       break;
-    case BinKind::UpdateExpression:
+    case BinASTKind::UpdateExpression:
       MOZ_TRY_VAR(result, parseInterfaceUpdateExpression(start, kind, fields));
       break;
-    case BinKind::YieldExpression:
+    case BinASTKind::YieldExpression:
       MOZ_TRY_VAR(result, parseInterfaceYieldExpression(start, kind, fields));
       break;
-    case BinKind::YieldStarExpression:
+    case BinASTKind::YieldStarExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceYieldStarExpression(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("Expression", kind);
   }
   return result;
 }
@@ -393,151 +393,151 @@ ExpressionOrSuper ::= ArrayExpression
     ThisExpression
     UnaryExpression
     UpdateExpression
     YieldExpression
     YieldStarExpression
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseExpressionOrSuper() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumExpressionOrSuper(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumExpressionOrSuper(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayExpression:
+    case BinASTKind::ArrayExpression:
       MOZ_TRY_VAR(result, parseInterfaceArrayExpression(start, kind, fields));
       break;
-    case BinKind::AssignmentExpression:
+    case BinASTKind::AssignmentExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceAssignmentExpression(start, kind, fields));
       break;
-    case BinKind::AwaitExpression:
+    case BinASTKind::AwaitExpression:
       MOZ_TRY_VAR(result, parseInterfaceAwaitExpression(start, kind, fields));
       break;
-    case BinKind::BinaryExpression:
+    case BinASTKind::BinaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceBinaryExpression(start, kind, fields));
       break;
-    case BinKind::CallExpression:
+    case BinASTKind::CallExpression:
       MOZ_TRY_VAR(result, parseInterfaceCallExpression(start, kind, fields));
       break;
-    case BinKind::ClassExpression:
+    case BinASTKind::ClassExpression:
       MOZ_TRY_VAR(result, parseInterfaceClassExpression(start, kind, fields));
       break;
-    case BinKind::CompoundAssignmentExpression:
+    case BinASTKind::CompoundAssignmentExpression:
       MOZ_TRY_VAR(result, parseInterfaceCompoundAssignmentExpression(
                               start, kind, fields));
       break;
-    case BinKind::ComputedMemberExpression:
+    case BinASTKind::ComputedMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceComputedMemberExpression(start, kind, fields));
       break;
-    case BinKind::ConditionalExpression:
+    case BinASTKind::ConditionalExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceConditionalExpression(start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithExpression:
+    case BinASTKind::EagerArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithFunctionBody:
+    case BinASTKind::EagerArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::EagerFunctionExpression:
+    case BinASTKind::EagerFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceEagerFunctionExpression(start, kind, fields));
       break;
-    case BinKind::IdentifierExpression:
+    case BinASTKind::IdentifierExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceIdentifierExpression(start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithExpression:
+    case BinASTKind::LazyArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithFunctionBody:
+    case BinASTKind::LazyArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::LazyFunctionExpression:
+    case BinASTKind::LazyFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLazyFunctionExpression(start, kind, fields));
       break;
-    case BinKind::LiteralBooleanExpression:
+    case BinASTKind::LiteralBooleanExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralBooleanExpression(start, kind, fields));
       break;
-    case BinKind::LiteralInfinityExpression:
+    case BinASTKind::LiteralInfinityExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralInfinityExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNullExpression:
+    case BinASTKind::LiteralNullExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNullExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNumericExpression:
+    case BinASTKind::LiteralNumericExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNumericExpression(start, kind, fields));
       break;
-    case BinKind::LiteralRegExpExpression:
+    case BinASTKind::LiteralRegExpExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralRegExpExpression(start, kind, fields));
       break;
-    case BinKind::LiteralStringExpression:
+    case BinASTKind::LiteralStringExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralStringExpression(start, kind, fields));
       break;
-    case BinKind::NewExpression:
+    case BinASTKind::NewExpression:
       MOZ_TRY_VAR(result, parseInterfaceNewExpression(start, kind, fields));
       break;
-    case BinKind::NewTargetExpression:
+    case BinASTKind::NewTargetExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceNewTargetExpression(start, kind, fields));
       break;
-    case BinKind::ObjectExpression:
+    case BinASTKind::ObjectExpression:
       MOZ_TRY_VAR(result, parseInterfaceObjectExpression(start, kind, fields));
       break;
-    case BinKind::StaticMemberExpression:
+    case BinASTKind::StaticMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceStaticMemberExpression(start, kind, fields));
       break;
-    case BinKind::Super:
+    case BinASTKind::Super:
       MOZ_TRY_VAR(result, parseInterfaceSuper(start, kind, fields));
       break;
-    case BinKind::TemplateExpression:
+    case BinASTKind::TemplateExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceTemplateExpression(start, kind, fields));
       break;
-    case BinKind::ThisExpression:
+    case BinASTKind::ThisExpression:
       MOZ_TRY_VAR(result, parseInterfaceThisExpression(start, kind, fields));
       break;
-    case BinKind::UnaryExpression:
+    case BinASTKind::UnaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceUnaryExpression(start, kind, fields));
       break;
-    case BinKind::UpdateExpression:
+    case BinASTKind::UpdateExpression:
       MOZ_TRY_VAR(result, parseInterfaceUpdateExpression(start, kind, fields));
       break;
-    case BinKind::YieldExpression:
+    case BinASTKind::YieldExpression:
       MOZ_TRY_VAR(result, parseInterfaceYieldExpression(start, kind, fields));
       break;
-    case BinKind::YieldStarExpression:
+    case BinASTKind::YieldStarExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceYieldStarExpression(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("ExpressionOrSuper", kind);
   }
   return result;
 }
@@ -548,56 +548,56 @@ ForInOfBindingOrAssignmentTarget ::= Arr
     ComputedMemberAssignmentTarget
     ForInOfBinding
     ObjectAssignmentTarget
     StaticMemberAssignmentTarget
 */
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseForInOfBindingOrAssignmentTarget() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(
       result, parseSumForInOfBindingOrAssignmentTarget(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseSumForInOfBindingOrAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayAssignmentTarget:
+    case BinASTKind::ArrayAssignmentTarget:
       MOZ_TRY_VAR(result,
                   parseInterfaceArrayAssignmentTarget(start, kind, fields));
       break;
-    case BinKind::AssignmentTargetIdentifier:
+    case BinASTKind::AssignmentTargetIdentifier:
       MOZ_TRY_VAR(result, parseInterfaceAssignmentTargetIdentifier(start, kind,
                                                                    fields));
       break;
-    case BinKind::ComputedMemberAssignmentTarget:
+    case BinASTKind::ComputedMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceComputedMemberAssignmentTarget(
                               start, kind, fields));
       break;
-    case BinKind::ForInOfBinding:
+    case BinASTKind::ForInOfBinding:
       MOZ_TRY_VAR(result, parseInterfaceForInOfBinding(start, kind, fields));
       break;
-    case BinKind::ObjectAssignmentTarget:
+    case BinASTKind::ObjectAssignmentTarget:
       MOZ_TRY_VAR(result,
                   parseInterfaceObjectAssignmentTarget(start, kind, fields));
       break;
-    case BinKind::StaticMemberAssignmentTarget:
+    case BinASTKind::StaticMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceStaticMemberAssignmentTarget(
                               start, kind, fields));
       break;
     default:
       return raiseInvalidKind("ForInOfBindingOrAssignmentTarget", kind);
   }
   return result;
 }
@@ -609,225 +609,225 @@ ObjectProperty ::= DataProperty
     EagerSetter
     LazyGetter
     LazyMethod
     LazySetter
     ShorthandProperty
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseObjectProperty() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumObjectProperty(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumObjectProperty(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::DataProperty:
+    case BinASTKind::DataProperty:
       MOZ_TRY_VAR(result, parseInterfaceDataProperty(start, kind, fields));
       break;
-    case BinKind::EagerGetter:
+    case BinASTKind::EagerGetter:
       MOZ_TRY_VAR(result, parseInterfaceEagerGetter(start, kind, fields));
       break;
-    case BinKind::EagerMethod:
+    case BinASTKind::EagerMethod:
       MOZ_TRY_VAR(result, parseInterfaceEagerMethod(start, kind, fields));
       break;
-    case BinKind::EagerSetter:
+    case BinASTKind::EagerSetter:
       MOZ_TRY_VAR(result, parseInterfaceEagerSetter(start, kind, fields));
       break;
-    case BinKind::LazyGetter:
+    case BinASTKind::LazyGetter:
       MOZ_TRY_VAR(result, parseInterfaceLazyGetter(start, kind, fields));
       break;
-    case BinKind::LazyMethod:
+    case BinASTKind::LazyMethod:
       MOZ_TRY_VAR(result, parseInterfaceLazyMethod(start, kind, fields));
       break;
-    case BinKind::LazySetter:
+    case BinASTKind::LazySetter:
       MOZ_TRY_VAR(result, parseInterfaceLazySetter(start, kind, fields));
       break;
-    case BinKind::ShorthandProperty:
+    case BinASTKind::ShorthandProperty:
       MOZ_TRY_VAR(result, parseInterfaceShorthandProperty(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("ObjectProperty", kind);
   }
   return result;
 }
 
 /*
 Parameter ::= ArrayBinding
     BindingIdentifier
     BindingWithInitializer
     ObjectBinding
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseParameter() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumParameter(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumParameter(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayBinding:
+    case BinASTKind::ArrayBinding:
       MOZ_TRY_VAR(result, parseInterfaceArrayBinding(start, kind, fields));
       break;
-    case BinKind::BindingIdentifier:
+    case BinASTKind::BindingIdentifier:
       MOZ_TRY_VAR(result, parseInterfaceBindingIdentifier(start, kind, fields));
       if (!pc_->positionalFormalParameterNames().append(
               result->template as<NameNode>().atom())) {
         return raiseOOM();
       }
       if (pc_->isFunctionBox()) {
         pc_->functionBox()->length++;
       }
       break;
-    case BinKind::BindingWithInitializer:
+    case BinASTKind::BindingWithInitializer:
       MOZ_TRY_VAR(result,
                   parseInterfaceBindingWithInitializer(start, kind, fields));
       break;
-    case BinKind::ObjectBinding:
+    case BinASTKind::ObjectBinding:
       MOZ_TRY_VAR(result, parseInterfaceObjectBinding(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("Parameter", kind);
   }
   return result;
 }
 
 /*
 Program ::= Module
     Script
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseProgram() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumProgram(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumProgram(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::Module:
+    case BinASTKind::Module:
       MOZ_TRY_VAR(result, parseInterfaceModule(start, kind, fields));
       break;
-    case BinKind::Script:
+    case BinASTKind::Script:
       MOZ_TRY_VAR(result, parseInterfaceScript(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("Program", kind);
   }
   return result;
 }
 
 /*
 PropertyName ::= ComputedPropertyName
     LiteralPropertyName
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parsePropertyName() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumPropertyName(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumPropertyName(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ComputedPropertyName:
+    case BinASTKind::ComputedPropertyName:
       MOZ_TRY_VAR(result,
                   parseInterfaceComputedPropertyName(start, kind, fields));
       break;
-    case BinKind::LiteralPropertyName:
+    case BinASTKind::LiteralPropertyName:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralPropertyName(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("PropertyName", kind);
   }
   return result;
 }
 
 /*
 SimpleAssignmentTarget ::= AssignmentTargetIdentifier
     ComputedMemberAssignmentTarget
     StaticMemberAssignmentTarget
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSimpleAssignmentTarget() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result,
                      parseSumSimpleAssignmentTarget(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumSimpleAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::AssignmentTargetIdentifier:
+    case BinASTKind::AssignmentTargetIdentifier:
       MOZ_TRY_VAR(result, parseInterfaceAssignmentTargetIdentifier(start, kind,
                                                                    fields));
       break;
-    case BinKind::ComputedMemberAssignmentTarget:
+    case BinASTKind::ComputedMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceComputedMemberAssignmentTarget(
                               start, kind, fields));
       break;
-    case BinKind::StaticMemberAssignmentTarget:
+    case BinASTKind::StaticMemberAssignmentTarget:
       MOZ_TRY_VAR(result, parseInterfaceStaticMemberAssignmentTarget(
                               start, kind, fields));
       break;
     default:
       return raiseInvalidKind("SimpleAssignmentTarget", kind);
   }
   return result;
 }
@@ -864,152 +864,152 @@ SpreadElementOrExpression ::= ArrayExpre
     ThisExpression
     UnaryExpression
     UpdateExpression
     YieldExpression
     YieldStarExpression
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSpreadElementOrExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result,
                      parseSumSpreadElementOrExpression(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumSpreadElementOrExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayExpression:
+    case BinASTKind::ArrayExpression:
       MOZ_TRY_VAR(result, parseInterfaceArrayExpression(start, kind, fields));
       break;
-    case BinKind::AssignmentExpression:
+    case BinASTKind::AssignmentExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceAssignmentExpression(start, kind, fields));
       break;
-    case BinKind::AwaitExpression:
+    case BinASTKind::AwaitExpression:
       MOZ_TRY_VAR(result, parseInterfaceAwaitExpression(start, kind, fields));
       break;
-    case BinKind::BinaryExpression:
+    case BinASTKind::BinaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceBinaryExpression(start, kind, fields));
       break;
-    case BinKind::CallExpression:
+    case BinASTKind::CallExpression:
       MOZ_TRY_VAR(result, parseInterfaceCallExpression(start, kind, fields));
       break;
-    case BinKind::ClassExpression:
+    case BinASTKind::ClassExpression:
       MOZ_TRY_VAR(result, parseInterfaceClassExpression(start, kind, fields));
       break;
-    case BinKind::CompoundAssignmentExpression:
+    case BinASTKind::CompoundAssignmentExpression:
       MOZ_TRY_VAR(result, parseInterfaceCompoundAssignmentExpression(
                               start, kind, fields));
       break;
-    case BinKind::ComputedMemberExpression:
+    case BinASTKind::ComputedMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceComputedMemberExpression(start, kind, fields));
       break;
-    case BinKind::ConditionalExpression:
+    case BinASTKind::ConditionalExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceConditionalExpression(start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithExpression:
+    case BinASTKind::EagerArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithFunctionBody:
+    case BinASTKind::EagerArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::EagerFunctionExpression:
+    case BinASTKind::EagerFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceEagerFunctionExpression(start, kind, fields));
       break;
-    case BinKind::IdentifierExpression:
+    case BinASTKind::IdentifierExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceIdentifierExpression(start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithExpression:
+    case BinASTKind::LazyArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithFunctionBody:
+    case BinASTKind::LazyArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::LazyFunctionExpression:
+    case BinASTKind::LazyFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLazyFunctionExpression(start, kind, fields));
       break;
-    case BinKind::LiteralBooleanExpression:
+    case BinASTKind::LiteralBooleanExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralBooleanExpression(start, kind, fields));
       break;
-    case BinKind::LiteralInfinityExpression:
+    case BinASTKind::LiteralInfinityExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralInfinityExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNullExpression:
+    case BinASTKind::LiteralNullExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNullExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNumericExpression:
+    case BinASTKind::LiteralNumericExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNumericExpression(start, kind, fields));
       break;
-    case BinKind::LiteralRegExpExpression:
+    case BinASTKind::LiteralRegExpExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralRegExpExpression(start, kind, fields));
       break;
-    case BinKind::LiteralStringExpression:
+    case BinASTKind::LiteralStringExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralStringExpression(start, kind, fields));
       break;
-    case BinKind::NewExpression:
+    case BinASTKind::NewExpression:
       MOZ_TRY_VAR(result, parseInterfaceNewExpression(start, kind, fields));
       break;
-    case BinKind::NewTargetExpression:
+    case BinASTKind::NewTargetExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceNewTargetExpression(start, kind, fields));
       break;
-    case BinKind::ObjectExpression:
+    case BinASTKind::ObjectExpression:
       MOZ_TRY_VAR(result, parseInterfaceObjectExpression(start, kind, fields));
       break;
-    case BinKind::SpreadElement:
+    case BinASTKind::SpreadElement:
       MOZ_TRY_VAR(result, parseInterfaceSpreadElement(start, kind, fields));
       break;
-    case BinKind::StaticMemberExpression:
+    case BinASTKind::StaticMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceStaticMemberExpression(start, kind, fields));
       break;
-    case BinKind::TemplateExpression:
+    case BinASTKind::TemplateExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceTemplateExpression(start, kind, fields));
       break;
-    case BinKind::ThisExpression:
+    case BinASTKind::ThisExpression:
       MOZ_TRY_VAR(result, parseInterfaceThisExpression(start, kind, fields));
       break;
-    case BinKind::UnaryExpression:
+    case BinASTKind::UnaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceUnaryExpression(start, kind, fields));
       break;
-    case BinKind::UpdateExpression:
+    case BinASTKind::UpdateExpression:
       MOZ_TRY_VAR(result, parseInterfaceUpdateExpression(start, kind, fields));
       break;
-    case BinKind::YieldExpression:
+    case BinASTKind::YieldExpression:
       MOZ_TRY_VAR(result, parseInterfaceYieldExpression(start, kind, fields));
       break;
-    case BinKind::YieldStarExpression:
+    case BinASTKind::YieldStarExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceYieldStarExpression(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("SpreadElementOrExpression", kind);
   }
   return result;
 }
@@ -1037,277 +1037,277 @@ Statement ::= Block
     TryCatchStatement
     TryFinallyStatement
     VariableDeclaration
     WhileStatement
     WithStatement
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseStatement() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
   const auto start = tokenizer_->offset();
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
   BINJS_MOZ_TRY_DECL(result, parseSumStatement(start, kind, fields));
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSumStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::Block:
+    case BinASTKind::Block:
       MOZ_TRY_VAR(result, parseInterfaceBlock(start, kind, fields));
       break;
-    case BinKind::BreakStatement:
+    case BinASTKind::BreakStatement:
       MOZ_TRY_VAR(result, parseInterfaceBreakStatement(start, kind, fields));
       break;
-    case BinKind::ClassDeclaration:
+    case BinASTKind::ClassDeclaration:
       MOZ_TRY_VAR(result, parseInterfaceClassDeclaration(start, kind, fields));
       break;
-    case BinKind::ContinueStatement:
+    case BinASTKind::ContinueStatement:
       MOZ_TRY_VAR(result, parseInterfaceContinueStatement(start, kind, fields));
       break;
-    case BinKind::DebuggerStatement:
+    case BinASTKind::DebuggerStatement:
       MOZ_TRY_VAR(result, parseInterfaceDebuggerStatement(start, kind, fields));
       break;
-    case BinKind::DoWhileStatement:
+    case BinASTKind::DoWhileStatement:
       MOZ_TRY_VAR(result, parseInterfaceDoWhileStatement(start, kind, fields));
       break;
-    case BinKind::EagerFunctionDeclaration:
+    case BinASTKind::EagerFunctionDeclaration:
       MOZ_TRY_VAR(result,
                   parseInterfaceEagerFunctionDeclaration(start, kind, fields));
       break;
-    case BinKind::EmptyStatement:
+    case BinASTKind::EmptyStatement:
       MOZ_TRY_VAR(result, parseInterfaceEmptyStatement(start, kind, fields));
       break;
-    case BinKind::ExpressionStatement:
+    case BinASTKind::ExpressionStatement:
       MOZ_TRY_VAR(result,
                   parseInterfaceExpressionStatement(start, kind, fields));
       break;
-    case BinKind::ForInStatement:
+    case BinASTKind::ForInStatement:
       MOZ_TRY_VAR(result, parseInterfaceForInStatement(start, kind, fields));
       break;
-    case BinKind::ForOfStatement:
+    case BinASTKind::ForOfStatement:
       MOZ_TRY_VAR(result, parseInterfaceForOfStatement(start, kind, fields));
       break;
-    case BinKind::ForStatement:
+    case BinASTKind::ForStatement:
       MOZ_TRY_VAR(result, parseInterfaceForStatement(start, kind, fields));
       break;
-    case BinKind::IfStatement:
+    case BinASTKind::IfStatement:
       MOZ_TRY_VAR(result, parseInterfaceIfStatement(start, kind, fields));
       break;
-    case BinKind::LabelledStatement:
+    case BinASTKind::LabelledStatement:
       MOZ_TRY_VAR(result, parseInterfaceLabelledStatement(start, kind, fields));
       break;
-    case BinKind::LazyFunctionDeclaration:
+    case BinASTKind::LazyFunctionDeclaration:
       MOZ_TRY_VAR(result,
                   parseInterfaceLazyFunctionDeclaration(start, kind, fields));
       break;
-    case BinKind::ReturnStatement:
+    case BinASTKind::ReturnStatement:
       MOZ_TRY_VAR(result, parseInterfaceReturnStatement(start, kind, fields));
       break;
-    case BinKind::SwitchStatement:
+    case BinASTKind::SwitchStatement:
       MOZ_TRY_VAR(result, parseInterfaceSwitchStatement(start, kind, fields));
       break;
-    case BinKind::SwitchStatementWithDefault:
+    case BinASTKind::SwitchStatementWithDefault:
       MOZ_TRY_VAR(result, parseInterfaceSwitchStatementWithDefault(start, kind,
                                                                    fields));
       break;
-    case BinKind::ThrowStatement:
+    case BinASTKind::ThrowStatement:
       MOZ_TRY_VAR(result, parseInterfaceThrowStatement(start, kind, fields));
       break;
-    case BinKind::TryCatchStatement:
+    case BinASTKind::TryCatchStatement:
       MOZ_TRY_VAR(result, parseInterfaceTryCatchStatement(start, kind, fields));
       break;
-    case BinKind::TryFinallyStatement:
+    case BinASTKind::TryFinallyStatement:
       MOZ_TRY_VAR(result,
                   parseInterfaceTryFinallyStatement(start, kind, fields));
       break;
-    case BinKind::VariableDeclaration:
+    case BinASTKind::VariableDeclaration:
       MOZ_TRY_VAR(result,
                   parseInterfaceVariableDeclaration(start, kind, fields));
       break;
-    case BinKind::WhileStatement:
+    case BinASTKind::WhileStatement:
       MOZ_TRY_VAR(result, parseInterfaceWhileStatement(start, kind, fields));
       break;
-    case BinKind::WithStatement:
+    case BinASTKind::WithStatement:
       MOZ_TRY_VAR(result, parseInterfaceWithStatement(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("Statement", kind);
   }
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseSumVariableDeclarationOrExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   ParseNode* result;
   switch (kind) {
-    case BinKind::ArrayExpression:
+    case BinASTKind::ArrayExpression:
       MOZ_TRY_VAR(result, parseInterfaceArrayExpression(start, kind, fields));
       break;
-    case BinKind::AssignmentExpression:
+    case BinASTKind::AssignmentExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceAssignmentExpression(start, kind, fields));
       break;
-    case BinKind::AwaitExpression:
+    case BinASTKind::AwaitExpression:
       MOZ_TRY_VAR(result, parseInterfaceAwaitExpression(start, kind, fields));
       break;
-    case BinKind::BinaryExpression:
+    case BinASTKind::BinaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceBinaryExpression(start, kind, fields));
       break;
-    case BinKind::CallExpression:
+    case BinASTKind::CallExpression:
       MOZ_TRY_VAR(result, parseInterfaceCallExpression(start, kind, fields));
       break;
-    case BinKind::ClassExpression:
+    case BinASTKind::ClassExpression:
       MOZ_TRY_VAR(result, parseInterfaceClassExpression(start, kind, fields));
       break;
-    case BinKind::CompoundAssignmentExpression:
+    case BinASTKind::CompoundAssignmentExpression:
       MOZ_TRY_VAR(result, parseInterfaceCompoundAssignmentExpression(
                               start, kind, fields));
       break;
-    case BinKind::ComputedMemberExpression:
+    case BinASTKind::ComputedMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceComputedMemberExpression(start, kind, fields));
       break;
-    case BinKind::ConditionalExpression:
+    case BinASTKind::ConditionalExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceConditionalExpression(start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithExpression:
+    case BinASTKind::EagerArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::EagerArrowExpressionWithFunctionBody:
+    case BinASTKind::EagerArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceEagerArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::EagerFunctionExpression:
+    case BinASTKind::EagerFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceEagerFunctionExpression(start, kind, fields));
       break;
-    case BinKind::IdentifierExpression:
+    case BinASTKind::IdentifierExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceIdentifierExpression(start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithExpression:
+    case BinASTKind::LazyArrowExpressionWithExpression:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithExpression(
                               start, kind, fields));
       break;
-    case BinKind::LazyArrowExpressionWithFunctionBody:
+    case BinASTKind::LazyArrowExpressionWithFunctionBody:
       MOZ_TRY_VAR(result, parseInterfaceLazyArrowExpressionWithFunctionBody(
                               start, kind, fields));
       break;
-    case BinKind::LazyFunctionExpression:
+    case BinASTKind::LazyFunctionExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLazyFunctionExpression(start, kind, fields));
       break;
-    case BinKind::LiteralBooleanExpression:
+    case BinASTKind::LiteralBooleanExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralBooleanExpression(start, kind, fields));
       break;
-    case BinKind::LiteralInfinityExpression:
+    case BinASTKind::LiteralInfinityExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralInfinityExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNullExpression:
+    case BinASTKind::LiteralNullExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNullExpression(start, kind, fields));
       break;
-    case BinKind::LiteralNumericExpression:
+    case BinASTKind::LiteralNumericExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralNumericExpression(start, kind, fields));
       break;
-    case BinKind::LiteralRegExpExpression:
+    case BinASTKind::LiteralRegExpExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralRegExpExpression(start, kind, fields));
       break;
-    case BinKind::LiteralStringExpression:
+    case BinASTKind::LiteralStringExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceLiteralStringExpression(start, kind, fields));
       break;
-    case BinKind::NewExpression:
+    case BinASTKind::NewExpression:
       MOZ_TRY_VAR(result, parseInterfaceNewExpression(start, kind, fields));
       break;
-    case BinKind::NewTargetExpression:
+    case BinASTKind::NewTargetExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceNewTargetExpression(start, kind, fields));
       break;
-    case BinKind::ObjectExpression:
+    case BinASTKind::ObjectExpression:
       MOZ_TRY_VAR(result, parseInterfaceObjectExpression(start, kind, fields));
       break;
-    case BinKind::StaticMemberExpression:
+    case BinASTKind::StaticMemberExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceStaticMemberExpression(start, kind, fields));
       break;
-    case BinKind::TemplateExpression:
+    case BinASTKind::TemplateExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceTemplateExpression(start, kind, fields));
       break;
-    case BinKind::ThisExpression:
+    case BinASTKind::ThisExpression:
       MOZ_TRY_VAR(result, parseInterfaceThisExpression(start, kind, fields));
       break;
-    case BinKind::UnaryExpression:
+    case BinASTKind::UnaryExpression:
       MOZ_TRY_VAR(result, parseInterfaceUnaryExpression(start, kind, fields));
       break;
-    case BinKind::UpdateExpression:
+    case BinASTKind::UpdateExpression:
       MOZ_TRY_VAR(result, parseInterfaceUpdateExpression(start, kind, fields));
       break;
-    case BinKind::VariableDeclaration:
+    case BinASTKind::VariableDeclaration:
       MOZ_TRY_VAR(result,
                   parseInterfaceVariableDeclaration(start, kind, fields));
       break;
-    case BinKind::YieldExpression:
+    case BinASTKind::YieldExpression:
       MOZ_TRY_VAR(result, parseInterfaceYieldExpression(start, kind, fields));
       break;
-    case BinKind::YieldStarExpression:
+    case BinASTKind::YieldStarExpression:
       MOZ_TRY_VAR(result,
                   parseInterfaceYieldStarExpression(start, kind, fields));
       break;
     default:
       return raiseInvalidKind("VariableDeclarationOrExpression", kind);
   }
   return result;
 }
 
 // ----- Interfaces (autogenerated, by lexicographical order)
 // When fields have a non-trivial type, implementation is deanonymized and
 // delegated to another parser.
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceArrayAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(ArrayAssignmentTarget)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceArrayBinding(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (ArrayBinding)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceArrayExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ArrayExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ArrayExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Elements};
+  const BinASTField expected_fields[1] = {BinASTField::Elements};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(elements, parseListOfOptionalSpreadElementOrExpression());
 
   if (elements->empty()) {
     elements->setHasNonConstInitializer();
   }
@@ -1318,41 +1318,41 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 /*
  interface AssertedBlockScope : Node {
     FrozenArray<AssertedDeclaredName> declaredNames;
     bool hasDirectEval;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedBlockScope() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedBlockScope) {
+  if (kind != BinASTKind::AssertedBlockScope) {
     return raiseInvalidKind("AssertedBlockScope", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceAssertedBlockScope(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedBlockScope(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssertedBlockScope);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssertedBlockScope);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::DeclaredNames,
-                                       BinField::HasDirectEval};
+  const BinASTField expected_fields[2] = {BinASTField::DeclaredNames,
+                                          BinASTField::HasDirectEval};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto scopeKind = AssertedScopeKind::Block;
 
   MOZ_TRY(parseListOfAssertedDeclaredName(scopeKind));
 
   BINJS_MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
   if (hasDirectEval) {
@@ -1372,41 +1372,42 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
  interface AssertedBoundName : Node {
     [IdentifierName] string name;
     bool isCaptured;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedBoundName(
     AssertedScopeKind scopeKind) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedBoundName) {
+  if (kind != BinASTKind::AssertedBoundName) {
     return raiseInvalidKind("AssertedBoundName", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(
       result, parseInterfaceAssertedBoundName(start, kind, fields, scopeKind));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedBoundName(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     AssertedScopeKind scopeKind) {
-  MOZ_ASSERT(kind == BinKind::AssertedBoundName);
+  MOZ_ASSERT(kind == BinASTKind::AssertedBoundName);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Name, BinField::IsCaptured};
+  const BinASTField expected_fields[2] = {BinASTField::Name,
+                                          BinASTField::IsCaptured};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const bool allowDuplicateName = false;
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
 
   BINJS_MOZ_TRY_DECL(isCaptured, tokenizer_->readBool());
@@ -1422,41 +1423,41 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
 /*
  interface AssertedBoundNamesScope : Node {
     FrozenArray<AssertedBoundName> boundNames;
     bool hasDirectEval;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedBoundNamesScope() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedBoundNamesScope) {
+  if (kind != BinASTKind::AssertedBoundNamesScope) {
     return raiseInvalidKind("AssertedBoundNamesScope", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(
       result, parseInterfaceAssertedBoundNamesScope(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedBoundNamesScope(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssertedBoundNamesScope);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssertedBoundNamesScope);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::BoundNames,
-                                       BinField::HasDirectEval};
+  const BinASTField expected_fields[2] = {BinASTField::BoundNames,
+                                          BinASTField::HasDirectEval};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto scopeKind = AssertedScopeKind::Catch;
 
   MOZ_TRY(parseListOfAssertedBoundName(scopeKind));
 
   BINJS_MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
   if (hasDirectEval) {
@@ -1477,42 +1478,42 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     [IdentifierName] string name;
     AssertedDeclaredKind kind;
     bool isCaptured;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedDeclaredName(
     AssertedScopeKind scopeKind) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedDeclaredName) {
+  if (kind != BinASTKind::AssertedDeclaredName) {
     return raiseInvalidKind("AssertedDeclaredName", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceAssertedDeclaredName(
                                  start, kind, fields, scopeKind));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedDeclaredName(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     AssertedScopeKind scopeKind) {
-  MOZ_ASSERT(kind == BinKind::AssertedDeclaredName);
+  MOZ_ASSERT(kind == BinASTKind::AssertedDeclaredName);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Name, BinField::Kind,
-                                       BinField::IsCaptured};
+  const BinASTField expected_fields[3] = {BinASTField::Name, BinASTField::Kind,
+                                          BinASTField::IsCaptured};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const bool allowDuplicateName = false;
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
 
   BINJS_MOZ_TRY_DECL(kind_, parseAssertedDeclaredKind());
@@ -1537,43 +1538,43 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     FrozenArray<AssertedMaybePositionalParameterName> paramNames;
     bool hasDirectEval;
     bool isSimpleParameterList;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedParameterScope(
     MutableHandle<GCVector<JSAtom*>> positionalParams) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedParameterScope) {
+  if (kind != BinASTKind::AssertedParameterScope) {
     return raiseInvalidKind("AssertedParameterScope", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceAssertedParameterScope(
                                  start, kind, fields, positionalParams));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedParameterScope(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     MutableHandle<GCVector<JSAtom*>> positionalParams) {
-  MOZ_ASSERT(kind == BinKind::AssertedParameterScope);
+  MOZ_ASSERT(kind == BinASTKind::AssertedParameterScope);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::ParamNames,
-                                       BinField::HasDirectEval,
-                                       BinField::IsSimpleParameterList};
+  const BinASTField expected_fields[3] = {BinASTField::ParamNames,
+                                          BinASTField::HasDirectEval,
+                                          BinASTField::IsSimpleParameterList};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto scopeKind = AssertedScopeKind::Parameter;
 
   MOZ_TRY(parseListOfAssertedMaybePositionalParameterName(scopeKind,
                                                           positionalParams));
 
   BINJS_MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
@@ -1589,25 +1590,25 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     pc_->functionBox()->setHasExtensibleScope();
   }
   auto result = Ok();
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedPositionalParameterName(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     AssertedScopeKind scopeKind,
     MutableHandle<GCVector<JSAtom*>> positionalParams) {
-  MOZ_ASSERT(kind == BinKind::AssertedPositionalParameterName);
+  MOZ_ASSERT(kind == BinASTKind::AssertedPositionalParameterName);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Index, BinField::Name,
-                                       BinField::IsCaptured};
+  const BinASTField expected_fields[3] = {BinASTField::Index, BinASTField::Name,
+                                          BinASTField::IsCaptured};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   bool allowDuplicateName = !pc_->sc()->strict();
 
   BINJS_MOZ_TRY_DECL(index, tokenizer_->readUnsignedLong());
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
@@ -1646,41 +1647,41 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
 /*
  interface AssertedScriptGlobalScope : Node {
     FrozenArray<AssertedDeclaredName> declaredNames;
     bool hasDirectEval;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedScriptGlobalScope() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedScriptGlobalScope) {
+  if (kind != BinASTKind::AssertedScriptGlobalScope) {
     return raiseInvalidKind("AssertedScriptGlobalScope", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(
       result, parseInterfaceAssertedScriptGlobalScope(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedScriptGlobalScope(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssertedScriptGlobalScope);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssertedScriptGlobalScope);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::DeclaredNames,
-                                       BinField::HasDirectEval};
+  const BinASTField expected_fields[2] = {BinASTField::DeclaredNames,
+                                          BinASTField::HasDirectEval};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto scopeKind = AssertedScopeKind::Global;
 
   MOZ_TRY(parseListOfAssertedDeclaredName(scopeKind));
 
   BINJS_MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
   if (hasDirectEval) {
@@ -1699,41 +1700,41 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
 /*
  interface AssertedVarScope : Node {
     FrozenArray<AssertedDeclaredName> declaredNames;
     bool hasDirectEval;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseAssertedVarScope() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::AssertedVarScope) {
+  if (kind != BinASTKind::AssertedVarScope) {
     return raiseInvalidKind("AssertedVarScope", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceAssertedVarScope(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceAssertedVarScope(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssertedVarScope);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssertedVarScope);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::DeclaredNames,
-                                       BinField::HasDirectEval};
+  const BinASTField expected_fields[2] = {BinASTField::DeclaredNames,
+                                          BinASTField::HasDirectEval};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto scopeKind = AssertedScopeKind::Var;
 
   MOZ_TRY(parseListOfAssertedDeclaredName(scopeKind));
 
   BINJS_MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
   if (hasDirectEval) {
@@ -1746,72 +1747,73 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     pc_->functionBox()->setHasExtensibleScope();
   }
   auto result = Ok();
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceAssignmentExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssignmentExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssignmentExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Binding, BinField::Expression};
+  const BinASTField expected_fields[2] = {BinASTField::Binding,
+                                          BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(binding, parseAssignmentTarget());
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   BINJS_TRY_DECL(result, handler_.newAssignment(ParseNodeKind::AssignExpr,
                                                 binding, expression));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceAssignmentTargetIdentifier(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::AssignmentTargetIdentifier);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::AssignmentTargetIdentifier);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Name};
+  const BinASTField expected_fields[1] = {BinASTField::Name};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
 
   BINJS_TRY(usedNames_.noteUse(cx_, name, pc_->scriptId(),
                                pc_->innermostScope()->id()));
   BINJS_TRY_DECL(result, handler_.newName(name->asPropertyName(),
                                           tokenizer_->pos(start), cx_));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceAwaitExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (AwaitExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceBinaryExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::BinaryExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::BinaryExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Operator, BinField::Left,
-                                       BinField::Right};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Operator, BinASTField::Left, BinASTField::Right};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(operator_, parseBinaryOperator());
 
   BINJS_MOZ_TRY_DECL(left, parseExpression());
 
   BINJS_MOZ_TRY_DECL(right, parseExpression());
@@ -1913,90 +1915,91 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 
 /*
  interface BindingIdentifier : Node {
     [IdentifierName] string name;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseBindingIdentifier() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::BindingIdentifier) {
+  if (kind != BinASTKind::BindingIdentifier) {
     return raiseInvalidKind("BindingIdentifier", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceBindingIdentifier(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceBindingIdentifier(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::BindingIdentifier);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::BindingIdentifier);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Name};
+  const BinASTField expected_fields[1] = {BinASTField::Name};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
 
   BINJS_TRY_DECL(result, handler_.newName(name->asPropertyName(),
                                           tokenizer_->pos(start), cx_));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceBindingWithInitializer(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(BindingWithInitializer)");
 }
 
 /*
  interface Block : Node {
     AssertedBlockScope scope;
     FrozenArray<Statement> statements;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseBlock() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::Block) {
+  if (kind != BinASTKind::Block) {
     return raiseInvalidKind("Block", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceBlock(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceBlock(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::Block);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::Block);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Scope, BinField::Statements};
+  const BinASTField expected_fields[2] = {BinASTField::Scope,
+                                          BinASTField::Statements};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::Block);
   ParseContext::Scope currentScope(cx_, pc_, usedNames_);
   BINJS_TRY(currentScope.init(pc_));
 
   MOZ_TRY(parseAssertedBlockScope());
 
@@ -2005,22 +2008,22 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   MOZ_TRY(checkClosedVars(currentScope));
   BINJS_TRY_DECL(bindings, NewLexicalScopeData(cx_, currentScope, alloc_, pc_));
   BINJS_TRY_DECL(result, handler_.newLexicalScope(*bindings, statements));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceBreakStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::BreakStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::BreakStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Label};
+  const BinASTField expected_fields[1] = {BinASTField::Label};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   RootedAtom label(cx_);
   MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
 
   if (label) {
     if (!IsIdentifier(label)) {
       return raiseError("Invalid identifier");
@@ -2043,22 +2046,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(result, handler_.newBreakStatement(
                              label ? label->asPropertyName() : nullptr,
                              tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceCallExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::CallExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::CallExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Callee, BinField::Arguments};
+  const BinASTField expected_fields[2] = {BinASTField::Callee,
+                                          BinASTField::Arguments};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(callee, parseExpressionOrSuper());
 
   BINJS_MOZ_TRY_DECL(arguments, parseArguments());
 
   auto op = JSOP_CALL;
@@ -2097,40 +2101,40 @@ JS::Result<ParseNode*> BinASTParser<Tok>
  interface CatchClause : Node {
     AssertedBoundNamesScope bindingScope;
     Binding binding;
     Block body;
  }
 */
 template <typename Tok>
 JS::Result<LexicalScopeNode*> BinASTParser<Tok>::parseCatchClause() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::CatchClause) {
+  if (kind != BinASTKind::CatchClause) {
     return raiseInvalidKind("CatchClause", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceCatchClause(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<LexicalScopeNode*> BinASTParser<Tok>::parseInterfaceCatchClause(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::CatchClause);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::CatchClause);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::BindingScope,
-                                       BinField::Binding, BinField::Body};
+  const BinASTField expected_fields[3] = {
+      BinASTField::BindingScope, BinASTField::Binding, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::Catch);
   ParseContext::Scope currentScope(cx_, pc_, usedNames_);
   BINJS_TRY(currentScope.init(pc_));
 
   MOZ_TRY(parseAssertedBoundNamesScope());
 
@@ -2145,38 +2149,38 @@ JS::Result<LexicalScopeNode*> BinASTPars
   BINJS_TRY_DECL(bindings, NewLexicalScopeData(cx_, currentScope, alloc_, pc_));
   BINJS_TRY_DECL(result, handler_.newLexicalScope(*bindings, body));
   BINJS_TRY(handler_.setupCatchScope(result, binding, body));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceClassDeclaration(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (ClassDeclaration)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceClassExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (ClassExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceCompoundAssignmentExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::CompoundAssignmentExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::CompoundAssignmentExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Operator, BinField::Binding,
-                                       BinField::Expression};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Operator, BinASTField::Binding, BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(operator_, parseCompoundAssignmentOperator());
 
   BINJS_MOZ_TRY_DECL(binding, parseSimpleAssignmentTarget());
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
@@ -2222,93 +2226,95 @@ BinASTParser<Tok>::parseInterfaceCompoun
   }
   BINJS_TRY_DECL(result, handler_.newAssignment(pnk, binding, expression));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceComputedMemberAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ComputedMemberAssignmentTarget);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ComputedMemberAssignmentTarget);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Object, BinField::Expression};
+  const BinASTField expected_fields[2] = {BinASTField::Object,
+                                          BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(object, parseExpressionOrSuper());
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   BINJS_TRY_DECL(result, handler_.newPropertyByValue(object, expression,
                                                      tokenizer_->offset()));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceComputedMemberExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ComputedMemberExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ComputedMemberExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Object, BinField::Expression};
+  const BinASTField expected_fields[2] = {BinASTField::Object,
+                                          BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(object, parseExpressionOrSuper());
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   BINJS_TRY_DECL(result, handler_.newPropertyByValue(object, expression,
                                                      tokenizer_->offset()));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceComputedPropertyName(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(ComputedPropertyName)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceConditionalExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ConditionalExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ConditionalExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Test, BinField::Consequent,
-                                       BinField::Alternate};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Test, BinASTField::Consequent, BinASTField::Alternate};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(test, parseExpression());
 
   BINJS_MOZ_TRY_DECL(consequent, parseExpression());
 
   BINJS_MOZ_TRY_DECL(alternate, parseExpression());
 
   BINJS_TRY_DECL(result, handler_.newConditional(test, consequent, alternate));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceContinueStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ContinueStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ContinueStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Label};
+  const BinASTField expected_fields[1] = {BinASTField::Label};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   RootedAtom label(cx_);
   MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
 
   if (label) {
     if (!IsIdentifier(label)) {
       return raiseError("ContinueStatement - Label MUST be an identifier");
@@ -2331,22 +2337,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(result, handler_.newContinueStatement(
                              label ? label->asPropertyName() : nullptr,
                              tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceDataProperty(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::DataProperty);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::DataProperty);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Name, BinField::Expression};
+  const BinASTField expected_fields[2] = {BinASTField::Name,
+                                          BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(name, parsePropertyName());
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   if (!handler_.isUsableAsObjectPropertyName(name)) {
@@ -2362,112 +2369,112 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     BINJS_TRY_VAR(result, handler_.newObjectMethodOrPropertyDefinition(
                               name, expression, AccessorType::None));
   }
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceDebuggerStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (DebuggerStatement)");
 }
 
 /*
  interface Directive : Node {
     string rawValue;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseDirective() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::Directive) {
+  if (kind != BinASTKind::Directive) {
     return raiseInvalidKind("Directive", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceDirective(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceDirective(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::Directive);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::Directive);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::RawValue};
+  const BinASTField expected_fields[1] = {BinASTField::RawValue};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom rawValue(cx_);
   MOZ_TRY_VAR(rawValue, tokenizer_->readAtom());
 
   TokenPos pos = tokenizer_->pos(start);
   BINJS_TRY_DECL(result, handler_.newStringLiteral(rawValue, pos));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceDoWhileStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::DoWhileStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::DoWhileStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Test, BinField::Body};
+  const BinASTField expected_fields[2] = {BinASTField::Test, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::DoLoop);
 
   BINJS_MOZ_TRY_DECL(test, parseExpression());
 
   BINJS_MOZ_TRY_DECL(body, parseStatement());
 
   BINJS_TRY_DECL(
       result, handler_.newDoWhileStatement(body, test, tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceEagerArrowExpressionWithExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(EagerArrowExpressionWithExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceEagerArrowExpressionWithFunctionBody(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(EagerArrowExpressionWithFunctionBody)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceEagerFunctionDeclaration(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EagerFunctionDeclaration);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EagerFunctionDeclaration);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[6] = {
-      BinField::IsAsync, BinField::IsGenerator, BinField::Name,
-      BinField::Length,  BinField::Directives,  BinField::Contents};
+  const BinASTField expected_fields[6] = {
+      BinASTField::IsAsync, BinASTField::IsGenerator, BinASTField::Name,
+      BinASTField::Length,  BinASTField::Directives,  BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Statement;
 
   BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
   if (isAsync) {
     return raiseError(
         "Async function is not supported in this preview release");
@@ -2492,17 +2499,17 @@ BinASTParser<Tok>::parseInterfaceEagerFu
                                        syntax != FunctionSyntaxKind::Getter)
                                           ? name
                                           : nullptr));
 
   forceStrictIfNecessary(funbox, directives);
 
   // Push a new ParseContext. It will be used to parse `scope`, the arguments,
   // the function.
-  BinParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
+  BinASTParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
   BINJS_TRY(funpc.init());
   pc_->functionScope().useAsVarScope(pc_);
   MOZ_ASSERT(pc_->isFunctionBox());
 
   ParseContext::Scope lexicalScope(cx_, pc_, usedNames_);
   BINJS_TRY(lexicalScope.init(pc_));
   ListNode* params;
   ListNode* body;
@@ -2513,24 +2520,24 @@ BinASTParser<Tok>::parseInterfaceEagerFu
   BINJS_TRY_DECL(bodyScope, handler_.newLexicalScope(*lexicalScopeData, body));
   BINJS_MOZ_TRY_DECL(result,
                      buildFunction(start, kind, name, params, bodyScope));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerFunctionExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EagerFunctionExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EagerFunctionExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[6] = {
-      BinField::IsAsync, BinField::IsGenerator, BinField::Name,
-      BinField::Length,  BinField::Directives,  BinField::Contents};
+  const BinASTField expected_fields[6] = {
+      BinASTField::IsAsync, BinASTField::IsGenerator, BinASTField::Name,
+      BinASTField::Length,  BinASTField::Directives,  BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Expression;
 
   BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
   if (isAsync) {
     return raiseError(
         "Async function is not supported in this preview release");
@@ -2555,17 +2562,17 @@ JS::Result<ParseNode*> BinASTParser<Tok>
                                        syntax != FunctionSyntaxKind::Getter)
                                           ? name
                                           : nullptr));
 
   forceStrictIfNecessary(funbox, directives);
 
   // Push a new ParseContext. It will be used to parse `scope`, the arguments,
   // the function.
-  BinParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
+  BinASTParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
   BINJS_TRY(funpc.init());
   pc_->functionScope().useAsVarScope(pc_);
   MOZ_ASSERT(pc_->isFunctionBox());
 
   ParseContext::Scope lexicalScope(cx_, pc_, usedNames_);
   BINJS_TRY(lexicalScope.init(pc_));
   ListNode* params;
   ListNode* body;
@@ -2576,23 +2583,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(bodyScope, handler_.newLexicalScope(*lexicalScopeData, body));
   BINJS_MOZ_TRY_DECL(result,
                      buildFunction(start, kind, name, params, bodyScope));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerGetter(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EagerGetter);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EagerGetter);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Name, BinField::Directives,
-                                       BinField::Contents};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Name, BinASTField::Directives, BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Setter;
   const bool isGenerator = false;
   const bool isAsync = false;
   const auto accessorType = AccessorType::Getter;
   const uint32_t length = 0;
 
@@ -2610,17 +2617,17 @@ JS::Result<ParseNode*> BinASTParser<Tok>
                                        syntax != FunctionSyntaxKind::Getter)
                                           ? name
                                           : nullptr));
 
   forceStrictIfNecessary(funbox, directives);
 
   // Push a new ParseContext. It will be used to parse `scope`, the arguments,
   // the function.
-  BinParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
+  BinASTParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
   BINJS_TRY(funpc.init());
   pc_->functionScope().useAsVarScope(pc_);
   MOZ_ASSERT(pc_->isFunctionBox());
 
   ParseContext::Scope lexicalScope(cx_, pc_, usedNames_);
   BINJS_TRY(lexicalScope.init(pc_));
   ListNode* params;
   ListNode* body;
@@ -2633,24 +2640,24 @@ JS::Result<ParseNode*> BinASTParser<Tok>
                      buildFunction(start, kind, name, params, bodyScope));
   BINJS_TRY_DECL(result, handler_.newObjectMethodOrPropertyDefinition(
                              name, method, accessorType));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerMethod(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EagerMethod);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EagerMethod);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[6] = {
-      BinField::IsAsync, BinField::IsGenerator, BinField::Name,
-      BinField::Length,  BinField::Directives,  BinField::Contents};
+  const BinASTField expected_fields[6] = {
+      BinASTField::IsAsync, BinASTField::IsGenerator, BinASTField::Name,
+      BinASTField::Length,  BinASTField::Directives,  BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Method;
   const auto accessorType = AccessorType::None;
 
   BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
   if (isAsync) {
     return raiseError(
@@ -2676,17 +2683,17 @@ JS::Result<ParseNode*> BinASTParser<Tok>
                                        syntax != FunctionSyntaxKind::Getter)
                                           ? name
                                           : nullptr));
 
   forceStrictIfNecessary(funbox, directives);
 
   // Push a new ParseContext. It will be used to parse `scope`, the arguments,
   // the function.
-  BinParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
+  BinASTParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
   BINJS_TRY(funpc.init());
   pc_->functionScope().useAsVarScope(pc_);
   MOZ_ASSERT(pc_->isFunctionBox());
 
   ParseContext::Scope lexicalScope(cx_, pc_, usedNames_);
   BINJS_TRY(lexicalScope.init(pc_));
   ListNode* params;
   ListNode* body;
@@ -2699,24 +2706,24 @@ JS::Result<ParseNode*> BinASTParser<Tok>
                      buildFunction(start, kind, name, params, bodyScope));
   BINJS_TRY_DECL(result, handler_.newObjectMethodOrPropertyDefinition(
                              name, method, accessorType));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerSetter(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EagerSetter);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EagerSetter);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[4] = {BinField::Name, BinField::Length,
-                                       BinField::Directives,
-                                       BinField::Contents};
+  const BinASTField expected_fields[4] = {
+      BinASTField::Name, BinASTField::Length, BinASTField::Directives,
+      BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Setter;
   const bool isGenerator = false;
   const bool isAsync = false;
   const auto accessorType = AccessorType::Setter;
 
   BINJS_MOZ_TRY_DECL(name, parsePropertyName());
@@ -2735,17 +2742,17 @@ JS::Result<ParseNode*> BinASTParser<Tok>
                                        syntax != FunctionSyntaxKind::Getter)
                                           ? name
                                           : nullptr));
 
   forceStrictIfNecessary(funbox, directives);
 
   // Push a new ParseContext. It will be used to parse `scope`, the arguments,
   // the function.
-  BinParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
+  BinASTParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
   BINJS_TRY(funpc.init());
   pc_->functionScope().useAsVarScope(pc_);
   MOZ_ASSERT(pc_->isFunctionBox());
 
   ParseContext::Scope lexicalScope(cx_, pc_, usedNames_);
   BINJS_TRY(lexicalScope.init(pc_));
   ListNode* params;
   ListNode* body;
@@ -2758,51 +2765,52 @@ JS::Result<ParseNode*> BinASTParser<Tok>
                      buildFunction(start, kind, name, params, bodyScope));
   BINJS_TRY_DECL(result, handler_.newObjectMethodOrPropertyDefinition(
                              name, method, accessorType));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEmptyStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::EmptyStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::EmptyStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
   MOZ_TRY(tokenizer_->checkFields0(kind, fields));
 
   BINJS_TRY_DECL(result, handler_.newEmptyStatement(tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceExpressionStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ExpressionStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ExpressionStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Expression};
+  const BinASTField expected_fields[1] = {BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   BINJS_TRY_DECL(result,
                  handler_.newExprStatement(expression, tokenizer_->offset()));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceForInOfBinding(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ForInOfBinding);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ForInOfBinding);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Kind, BinField::Binding};
+  const BinASTField expected_fields[2] = {BinASTField::Kind,
+                                          BinASTField::Binding};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   AutoVariableDeclarationKind kindGuard(this);
 
   BINJS_MOZ_TRY_DECL(kind_, parseVariableDeclarationKind());
 
   BINJS_MOZ_TRY_DECL(binding, parseBinding());
 
@@ -2823,23 +2831,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(result,
                  handler_.newDeclarationList(pnk, tokenizer_->pos(start)));
   handler_.addList(result, binding);
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceForInStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ForInStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ForInStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Left, BinField::Right,
-                                       BinField::Body};
+  const BinASTField expected_fields[3] = {BinASTField::Left, BinASTField::Right,
+                                          BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::ForInLoop);
 
   // Implicit scope around the `for`, used to store `for (let x in  ...)`
   // or `for (const x in ...)`-style declarations. Detail on the
   // declaration is stored as part of `scope`.
   ParseContext::Scope scope(cx_, pc_, usedNames_);
@@ -2862,30 +2870,31 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     BINJS_TRY_DECL(bindings, NewLexicalScopeData(cx_, scope, alloc_, pc_));
     BINJS_TRY_VAR(result, handler_.newLexicalScope(*bindings, result));
   }
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceForOfStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (ForOfStatement)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceForStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ForStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ForStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[4] = {BinField::Init, BinField::Test,
-                                       BinField::Update, BinField::Body};
+  const BinASTField expected_fields[4] = {BinASTField::Init, BinASTField::Test,
+                                          BinASTField::Update,
+                                          BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::ForLoop);
 
   // Implicit scope around the `for`, used to store `for (let x; ...; ...)`
   // or `for (const x; ...; ...)`-style declarations. Detail on the
   // declaration is stored as part of `BINJS_Scope`.
   ParseContext::Scope scope(cx_, pc_, usedNames_);
@@ -2915,40 +2924,41 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 /*
  interface FormalParameters : Node {
     FrozenArray<Parameter> items;
     Binding? rest;
  }
 */
 template <typename Tok>
 JS::Result<ListNode*> BinASTParser<Tok>::parseFormalParameters() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::FormalParameters) {
+  if (kind != BinASTKind::FormalParameters) {
     return raiseInvalidKind("FormalParameters", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceFormalParameters(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ListNode*> BinASTParser<Tok>::parseInterfaceFormalParameters(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::FormalParameters);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::FormalParameters);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Items, BinField::Rest};
+  const BinASTField expected_fields[2] = {BinASTField::Items,
+                                          BinASTField::Rest};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(items, parseListOfParameter());
 
   BINJS_MOZ_TRY_DECL(rest, parseOptionalBinding());
 
   auto result = items;
@@ -2967,47 +2977,47 @@ JS::Result<ListNode*> BinASTParser<Tok>:
     FormalParameters params;
     AssertedVarScope bodyScope;
     FunctionBody body;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseFunctionExpressionContents(
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::FunctionExpressionContents) {
+  if (kind != BinASTKind::FunctionExpressionContents) {
     return raiseInvalidKind("FunctionExpressionContents", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceFunctionExpressionContents(
                          start, kind, fields, funLength, paramsOut, bodyOut));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceFunctionExpressionContents(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  MOZ_ASSERT(kind == BinKind::FunctionExpressionContents);
+  MOZ_ASSERT(kind == BinASTKind::FunctionExpressionContents);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[6] = {BinField::IsFunctionNameCaptured,
-                                       BinField::IsThisCaptured,
-                                       BinField::ParameterScope,
-                                       BinField::Params,
-                                       BinField::BodyScope,
-                                       BinField::Body};
+  const BinASTField expected_fields[6] = {BinASTField::IsFunctionNameCaptured,
+                                          BinASTField::IsThisCaptured,
+                                          BinASTField::ParameterScope,
+                                          BinASTField::Params,
+                                          BinASTField::BodyScope,
+                                          BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(isFunctionNameCaptured, tokenizer_->readBool());
   // Per spec, isFunctionNameCaptured can be true for anonymous
   // function.  Check isFunctionNameCaptured only for named
   // function.
   if (pc_->functionBox()->function()->isNamedLambda() &&
@@ -3040,44 +3050,44 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     FormalParameters params;
     AssertedVarScope bodyScope;
     FunctionBody body;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseFunctionOrMethodContents(
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::FunctionOrMethodContents) {
+  if (kind != BinASTKind::FunctionOrMethodContents) {
     return raiseInvalidKind("FunctionOrMethodContents", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceFunctionOrMethodContents(
                          start, kind, fields, funLength, paramsOut, bodyOut));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceFunctionOrMethodContents(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  MOZ_ASSERT(kind == BinKind::FunctionOrMethodContents);
+  MOZ_ASSERT(kind == BinASTKind::FunctionOrMethodContents);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[5] = {
-      BinField::IsThisCaptured, BinField::ParameterScope, BinField::Params,
-      BinField::BodyScope, BinField::Body};
+  const BinASTField expected_fields[5] = {
+      BinASTField::IsThisCaptured, BinASTField::ParameterScope,
+      BinASTField::Params, BinASTField::BodyScope, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(isThisCaptured, tokenizer_->readBool());
   // TODO: Use this in BinASTParser::buildFunction.
   (void)isThisCaptured;
   Rooted<GCVector<JSAtom*>> positionalParams(cx_, GCVector<JSAtom*>(cx_));
   MOZ_TRY(parseAssertedParameterScope(&positionalParams));
@@ -3101,43 +3111,43 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
     AssertedVarScope bodyScope;
     FunctionBody body;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseGetterContents(uint32_t funLength,
                                                       ListNode** paramsOut,
                                                       ListNode** bodyOut) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::GetterContents) {
+  if (kind != BinASTKind::GetterContents) {
     return raiseInvalidKind("GetterContents", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(
       result, parseInterfaceGetterContents(start, kind, fields, funLength,
                                            paramsOut, bodyOut));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceGetterContents(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  MOZ_ASSERT(kind == BinKind::GetterContents);
+  MOZ_ASSERT(kind == BinASTKind::GetterContents);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::IsThisCaptured,
-                                       BinField::BodyScope, BinField::Body};
+  const BinASTField expected_fields[3] = {
+      BinASTField::IsThisCaptured, BinASTField::BodyScope, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(isThisCaptured, tokenizer_->readBool());
   // TODO: Use this in BinASTParser::buildFunction.
   (void)isThisCaptured;
   MOZ_TRY(parseAssertedVarScope());
 
@@ -3152,84 +3162,85 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
 
 /*
  interface IdentifierExpression : Node {
     [IdentifierName] string name;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseIdentifierExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::IdentifierExpression) {
+  if (kind != BinASTKind::IdentifierExpression) {
     return raiseInvalidKind("IdentifierExpression", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceIdentifierExpression(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceIdentifierExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::IdentifierExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::IdentifierExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Name};
+  const BinASTField expected_fields[1] = {BinASTField::Name};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom name(cx_);
   MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
 
   BINJS_TRY(usedNames_.noteUse(cx_, name, pc_->scriptId(),
                                pc_->innermostScope()->id()));
   BINJS_TRY_DECL(result, handler_.newName(name->asPropertyName(),
                                           tokenizer_->pos(start), cx_));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceIfStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::IfStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::IfStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Test, BinField::Consequent,
-                                       BinField::Alternate};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Test, BinASTField::Consequent, BinASTField::Alternate};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(test, parseExpression());
 
   BINJS_MOZ_TRY_DECL(consequent, parseStatement());
 
   BINJS_MOZ_TRY_DECL(alternate, parseOptionalStatement());
 
   BINJS_TRY_DECL(result,
                  handler_.newIfStatement(start, test, consequent, alternate));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLabelledStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LabelledStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LabelledStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Label, BinField::Body};
+  const BinASTField expected_fields[2] = {BinASTField::Label,
+                                          BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom label(cx_);
   MOZ_TRY_VAR(label, tokenizer_->readAtom());
   if (!IsIdentifier(label)) {
     return raiseError("Invalid identifier");
   }
@@ -3239,42 +3250,42 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(result, handler_.newLabeledStatement(label->asPropertyName(),
                                                       body, start));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceLazyArrowExpressionWithExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(LazyArrowExpressionWithExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceLazyArrowExpressionWithFunctionBody(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(LazyArrowExpressionWithFunctionBody)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLazyFunctionDeclaration(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LazyFunctionDeclaration);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LazyFunctionDeclaration);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[7] = {
-      BinField::IsAsync, BinField::IsGenerator, BinField::Name,
-      BinField::Length,  BinField::Directives,  BinField::ContentsSkip,
-      BinField::Contents};
+  const BinASTField expected_fields[7] = {
+      BinASTField::IsAsync, BinASTField::IsGenerator, BinASTField::Name,
+      BinASTField::Length,  BinASTField::Directives,  BinASTField::ContentsSkip,
+      BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Statement;
 
   BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
   if (isAsync) {
     return raiseError(
         "Async function is not supported in this preview release");
@@ -3321,25 +3332,25 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   funbox->function()->initLazyScript(lazy);
 
   BINJS_MOZ_TRY_DECL(result, makeEmptyFunctionNode(skipStart, kind, funbox));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLazyFunctionExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LazyFunctionExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LazyFunctionExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[7] = {
-      BinField::IsAsync, BinField::IsGenerator, BinField::Name,
-      BinField::Length,  BinField::Directives,  BinField::ContentsSkip,
-      BinField::Contents};
+  const BinASTField expected_fields[7] = {
+      BinASTField::IsAsync, BinASTField::IsGenerator, BinASTField::Name,
+      BinASTField::Length,  BinASTField::Directives,  BinASTField::ContentsSkip,
+      BinASTField::Contents};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   const auto syntax = FunctionSyntaxKind::Expression;
 
   BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
   if (isAsync) {
     return raiseError(
         "Async function is not supported in this preview release");
@@ -3386,101 +3397,101 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   funbox->function()->initLazyScript(lazy);
 
   BINJS_MOZ_TRY_DECL(result, makeEmptyFunctionNode(skipStart, kind, funbox));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLazyGetter(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (LazyGetter)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLazyMethod(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (LazyMethod)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLazySetter(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (LazySetter)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceLiteralBooleanExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralBooleanExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralBooleanExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Value};
+  const BinASTField expected_fields[1] = {BinASTField::Value};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(value, tokenizer_->readBool());
 
   BINJS_TRY_DECL(result,
                  handler_.newBooleanLiteral(value, tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceLiteralInfinityExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(LiteralInfinityExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLiteralNullExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralNullExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralNullExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
   MOZ_TRY(tokenizer_->checkFields0(kind, fields));
 
   BINJS_TRY_DECL(result, handler_.newNullLiteral(tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceLiteralNumericExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralNumericExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralNumericExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Value};
+  const BinASTField expected_fields[1] = {BinASTField::Value};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(value, tokenizer_->readDouble());
 
   BINJS_TRY_DECL(result, handler_.newNumber(value, DecimalPoint::HasDecimal,
                                             tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLiteralPropertyName(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralPropertyName);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralPropertyName);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Value};
+  const BinASTField expected_fields[1] = {BinASTField::Value};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom value(cx_);
   MOZ_TRY_VAR(value, tokenizer_->readAtom());
 
   ParseNode* result;
   uint32_t index;
@@ -3492,22 +3503,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     BINJS_TRY_VAR(result, handler_.newObjectLiteralPropertyName(
                               value, tokenizer_->pos(start)));
   }
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLiteralRegExpExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralRegExpExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralRegExpExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Pattern, BinField::Flags};
+  const BinASTField expected_fields[2] = {BinASTField::Pattern,
+                                          BinASTField::Flags};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom pattern(cx_);
   MOZ_TRY_VAR(pattern, tokenizer_->readAtom());
   Chars flags(cx_);
   MOZ_TRY(tokenizer_->readChars(flags));
 
@@ -3534,108 +3546,109 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 
   BINJS_TRY_DECL(result,
                  handler_.newRegExp(reobj, tokenizer_->pos(start), *this));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceLiteralStringExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::LiteralStringExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::LiteralStringExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Value};
+  const BinASTField expected_fields[1] = {BinASTField::Value};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   RootedAtom value(cx_);
   MOZ_TRY_VAR(value, tokenizer_->readAtom());
 
   BINJS_TRY_DECL(result,
                  handler_.newStringLiteral(value, tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceModule(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (Module)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceNewExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::NewExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::NewExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Callee, BinField::Arguments};
+  const BinASTField expected_fields[2] = {BinASTField::Callee,
+                                          BinASTField::Arguments};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(callee, parseExpression());
 
   BINJS_MOZ_TRY_DECL(arguments, parseArguments());
 
   BINJS_TRY_DECL(result, handler_.newNewExpression(tokenizer_->pos(start).begin,
                                                    callee, arguments));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceNewTargetExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(NewTargetExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceObjectAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(ObjectAssignmentTarget)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceObjectBinding(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (ObjectBinding)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceObjectExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ObjectExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ObjectExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Properties};
+  const BinASTField expected_fields[1] = {BinASTField::Properties};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(properties, parseListOfObjectProperty());
 
   auto result = properties;
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceReturnStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ReturnStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ReturnStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Expression};
+  const BinASTField expected_fields[1] = {BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   if (!pc_->isFunctionBox()) {
     // Return statements are permitted only inside functions.
     return raiseInvalidKind("Toplevel Statement", kind);
   }
 
   pc_->functionBox()->usesReturn = true;
@@ -3644,23 +3657,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 
   BINJS_TRY_DECL(
       result, handler_.newReturnStatement(expression, tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceScript(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::Script);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::Script);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Scope, BinField::Directives,
-                                       BinField::Statements};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Scope, BinASTField::Directives, BinASTField::Statements};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   MOZ_TRY(parseAssertedScriptGlobalScope());
 
   BINJS_MOZ_TRY_DECL(directives, parseListOfDirective());
   forceStrictIfNecessary(pc_->sc(), directives);
   BINJS_MOZ_TRY_DECL(statements, parseListOfStatement());
@@ -3679,44 +3692,44 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     AssertedVarScope bodyScope;
     FunctionBody body;
  }
 */
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseSetterContents(uint32_t funLength,
                                                       ListNode** paramsOut,
                                                       ListNode** bodyOut) {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::SetterContents) {
+  if (kind != BinASTKind::SetterContents) {
     return raiseInvalidKind("SetterContents", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(
       result, parseInterfaceSetterContents(start, kind, fields, funLength,
                                            paramsOut, bodyOut));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<Ok> BinASTParser<Tok>::parseInterfaceSetterContents(
-    const size_t start, const BinKind kind, const BinFields& fields,
+    const size_t start, const BinASTKind kind, const BinASTFields& fields,
     uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut) {
-  MOZ_ASSERT(kind == BinKind::SetterContents);
+  MOZ_ASSERT(kind == BinASTKind::SetterContents);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[5] = {
-      BinField::IsThisCaptured, BinField::ParameterScope, BinField::Param,
-      BinField::BodyScope, BinField::Body};
+  const BinASTField expected_fields[5] = {
+      BinASTField::IsThisCaptured, BinASTField::ParameterScope,
+      BinASTField::Param, BinASTField::BodyScope, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(isThisCaptured, tokenizer_->readBool());
   // TODO: Use this in BinASTParser::buildFunction.
   (void)isThisCaptured;
   Rooted<GCVector<JSAtom*>> positionalParams(cx_, GCVector<JSAtom*>(cx_));
   MOZ_TRY(parseAssertedParameterScope(&positionalParams));
@@ -3732,22 +3745,22 @@ JS::Result<Ok> BinASTParser<Tok>::parseI
   *paramsOut = params;
   *bodyOut = body;
   auto result = Ok();
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceShorthandProperty(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ShorthandProperty);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ShorthandProperty);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Name};
+  const BinASTField expected_fields[1] = {BinASTField::Name};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(name, parseIdentifierExpression());
 
   MOZ_ASSERT(name->isKind(ParseNodeKind::Name));
   MOZ_ASSERT(!handler_.isUsableAsObjectPropertyName(name));
   BINJS_TRY_DECL(propName, handler_.newObjectLiteralPropertyName(
@@ -3756,30 +3769,31 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 
   BINJS_TRY_DECL(result,
                  handler_.newShorthandPropertyDefinition(propName, name));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceSpreadElement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (SpreadElement)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceStaticMemberAssignmentTarget(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::StaticMemberAssignmentTarget);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::StaticMemberAssignmentTarget);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Object, BinField::Property};
+  const BinASTField expected_fields[2] = {BinASTField::Object,
+                                          BinASTField::Property};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   size_t nameStart;
 
   BINJS_MOZ_TRY_DECL(object, parseExpressionOrSuper());
   RootedAtom property(cx_);
   {
     nameStart = tokenizer_->offset();
@@ -3789,22 +3803,23 @@ BinASTParser<Tok>::parseInterfaceStaticM
   BINJS_TRY_DECL(name, handler_.newPropertyName(property->asPropertyName(),
                                                 tokenizer_->pos(nameStart)));
   BINJS_TRY_DECL(result, handler_.newPropertyAccess(object, name));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceStaticMemberExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::StaticMemberExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::StaticMemberExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Object, BinField::Property};
+  const BinASTField expected_fields[2] = {BinASTField::Object,
+                                          BinASTField::Property};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   size_t nameStart;
 
   BINJS_MOZ_TRY_DECL(object, parseExpressionOrSuper());
   RootedAtom property(cx_);
   {
     nameStart = tokenizer_->offset();
@@ -3814,52 +3829,53 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(name, handler_.newPropertyName(property->asPropertyName(),
                                                 tokenizer_->pos(nameStart)));
   BINJS_TRY_DECL(result, handler_.newPropertyAccess(object, name));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceSuper(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (Super)");
 }
 
 /*
  interface SwitchCase : Node {
     Expression test;
     FrozenArray<Statement> consequent;
  }
 */
 template <typename Tok>
 JS::Result<CaseClause*> BinASTParser<Tok>::parseSwitchCase() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::SwitchCase) {
+  if (kind != BinASTKind::SwitchCase) {
     return raiseInvalidKind("SwitchCase", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceSwitchCase(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<CaseClause*> BinASTParser<Tok>::parseInterfaceSwitchCase(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::SwitchCase);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::SwitchCase);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Test, BinField::Consequent};
+  const BinASTField expected_fields[2] = {BinASTField::Test,
+                                          BinASTField::Consequent};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(test, parseExpression());
 
   BINJS_MOZ_TRY_DECL(consequent, parseListOfStatement());
 
   BINJS_TRY_DECL(result, handler_.newCaseOrDefault(start, test, consequent));
@@ -3868,80 +3884,81 @@ JS::Result<CaseClause*> BinASTParser<Tok
 
 /*
  interface SwitchDefault : Node {
     FrozenArray<Statement> consequent;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseSwitchDefault() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::SwitchDefault) {
+  if (kind != BinASTKind::SwitchDefault) {
     return raiseInvalidKind("SwitchDefault", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result, parseInterfaceSwitchDefault(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceSwitchDefault(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::SwitchDefault);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::SwitchDefault);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Consequent};
+  const BinASTField expected_fields[1] = {BinASTField::Consequent};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(consequent, parseListOfStatement());
 
   BINJS_TRY_DECL(result, handler_.newCaseOrDefault(start, nullptr, consequent));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceSwitchStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::SwitchStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::SwitchStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Discriminant, BinField::Cases};
+  const BinASTField expected_fields[2] = {BinASTField::Discriminant,
+                                          BinASTField::Cases};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(discriminant, parseExpression());
   ParseContext::Statement stmt(pc_, StatementKind::Switch);
   BINJS_MOZ_TRY_DECL(cases, parseListOfSwitchCase());
 
   BINJS_TRY_DECL(scope, handler_.newLexicalScope(nullptr, cases));
   BINJS_TRY_DECL(result, handler_.newSwitchStatement(start, discriminant, scope,
                                                      /* hasDefault = */ false));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceSwitchStatementWithDefault(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::SwitchStatementWithDefault);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::SwitchStatementWithDefault);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[4] = {
-      BinField::Discriminant, BinField::PreDefaultCases, BinField::DefaultCase,
-      BinField::PostDefaultCases};
+  const BinASTField expected_fields[4] = {
+      BinASTField::Discriminant, BinASTField::PreDefaultCases,
+      BinASTField::DefaultCase, BinASTField::PostDefaultCases};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(discriminant, parseExpression());
   ParseContext::Statement stmt(pc_, StatementKind::Switch);
   BINJS_MOZ_TRY_DECL(preDefaultCases, parseListOfSwitchCase());
 
   BINJS_MOZ_TRY_DECL(defaultCase, parseSwitchDefault());
@@ -3960,26 +3977,26 @@ BinASTParser<Tok>::parseInterfaceSwitchS
   BINJS_TRY_DECL(scope, handler_.newLexicalScope(nullptr, cases));
   BINJS_TRY_DECL(result, handler_.newSwitchStatement(start, discriminant, scope,
                                                      /* hasDefault = */ true));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceTemplateExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(TemplateExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceThisExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ThisExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ThisExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
   MOZ_TRY(tokenizer_->checkFields0(kind, fields));
 
   if (pc_->isFunctionBox()) {
     pc_->functionBox()->usesThis = true;
   }
 
   TokenPos pos = tokenizer_->pos(start);
@@ -3992,40 +4009,41 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   }
 
   BINJS_TRY_DECL(result, handler_.newThisLiteral(pos, thisName));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceThrowStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::ThrowStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::ThrowStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[1] = {BinField::Expression};
+  const BinASTField expected_fields[1] = {BinASTField::Expression};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(expression, parseExpression());
 
   BINJS_TRY_DECL(
       result, handler_.newThrowStatement(expression, tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceTryCatchStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::TryCatchStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::TryCatchStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Body, BinField::CatchClause};
+  const BinASTField expected_fields[2] = {BinASTField::Body,
+                                          BinASTField::CatchClause};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseNode* body;
   {
     ParseContext::Statement stmt(pc_, StatementKind::Try);
     ParseContext::Scope scope(cx_, pc_, usedNames_);
     BINJS_TRY(scope.init(pc_));
     MOZ_TRY_VAR(body, parseBlock());
@@ -4036,23 +4054,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
   BINJS_TRY_DECL(result,
                  handler_.newTryStatement(start, body, catchClause,
                                           /* finallyBlock = */ nullptr));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceTryFinallyStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::TryFinallyStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::TryFinallyStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::Body, BinField::CatchClause,
-                                       BinField::Finalizer};
+  const BinASTField expected_fields[3] = {
+      BinASTField::Body, BinASTField::CatchClause, BinASTField::Finalizer};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseNode* body;
   {
     ParseContext::Statement stmt(pc_, StatementKind::Try);
     ParseContext::Scope scope(cx_, pc_, usedNames_);
     BINJS_TRY(scope.init(pc_));
     MOZ_TRY_VAR(body, parseBlock());
@@ -4069,22 +4087,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 
   BINJS_TRY_DECL(result,
                  handler_.newTryStatement(start, body, catchClause, finalizer));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceUnaryExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::UnaryExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::UnaryExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Operator, BinField::Operand};
+  const BinASTField expected_fields[2] = {BinASTField::Operator,
+                                          BinASTField::Operand};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(operator_, parseUnaryOperator());
 
   BINJS_MOZ_TRY_DECL(operand, parseExpression());
 
   ParseNodeKind pnk;
@@ -4133,23 +4152,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     }
   }
   BINJS_TRY_DECL(result, handler_.newUnary(pnk, start, operand));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceUpdateExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::UpdateExpression);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::UpdateExpression);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[3] = {BinField::IsPrefix, BinField::Operator,
-                                       BinField::Operand};
+  const BinASTField expected_fields[3] = {
+      BinASTField::IsPrefix, BinASTField::Operator, BinASTField::Operand};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(isPrefix, tokenizer_->readBool());
 
   BINJS_MOZ_TRY_DECL(operator_, parseUpdateOperator());
 
   BINJS_MOZ_TRY_DECL(operand, parseSimpleAssignmentTarget());
@@ -4166,22 +4185,23 @@ JS::Result<ParseNode*> BinASTParser<Tok>
       break;
   }
   BINJS_TRY_DECL(result, handler_.newUnary(pnk, start, operand));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceVariableDeclaration(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::VariableDeclaration);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::VariableDeclaration);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Kind, BinField::Declarators};
+  const BinASTField expected_fields[2] = {BinASTField::Kind,
+                                          BinASTField::Declarators};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   AutoVariableDeclarationKind kindGuard(this);
 
   BINJS_MOZ_TRY_DECL(kind_, parseVariableDeclarationKind());
   // Restored by `kindGuard`.
   variableDeclarationKind_ = kind_;
   ParseNodeKind declarationListKind;
@@ -4209,40 +4229,41 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 /*
  interface VariableDeclarator : Node {
     Binding binding;
     Expression? init;
  }
 */
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseVariableDeclarator() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-  if (kind != BinKind::VariableDeclarator) {
+  if (kind != BinASTKind::VariableDeclarator) {
     return raiseInvalidKind("VariableDeclarator", kind);
   }
   const auto start = tokenizer_->offset();
   BINJS_MOZ_TRY_DECL(result,
                      parseInterfaceVariableDeclarator(start, kind, fields));
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceVariableDeclarator(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::VariableDeclarator);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::VariableDeclarator);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Binding, BinField::Init};
+  const BinASTField expected_fields[2] = {BinASTField::Binding,
+                                          BinASTField::Init};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(binding, parseBinding());
 
   BINJS_MOZ_TRY_DECL(init, parseOptionalExpression());
 
   ParseNode* result;
@@ -4256,79 +4277,80 @@ JS::Result<ParseNode*> BinASTParser<Tok>
     } else {
       result = bindingNameNode;
     }
   } else {
     // `var pattern = bar`
     if (!init) {
       // Here, `init` is required.
       return raiseMissingField("VariableDeclarator (with non-trivial pattern)",
-                               BinField::Init);
+                               BinASTField::Init);
     }
 
     MOZ_CRASH(
         "Unimplemented: AssertedScope check for BindingPattern variable "
         "declaration");
     BINJS_TRY_VAR(result, handler_.newAssignment(ParseNodeKind::AssignExpr,
                                                  binding, init));
   }
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceWhileStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::WhileStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::WhileStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Test, BinField::Body};
+  const BinASTField expected_fields[2] = {BinASTField::Test, BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
   ParseContext::Statement stmt(pc_, StatementKind::WhileLoop);
 
   BINJS_MOZ_TRY_DECL(test, parseExpression());
 
   BINJS_MOZ_TRY_DECL(body, parseStatement());
 
   BINJS_TRY_DECL(result, handler_.newWhileStatement(start, test, body));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceWithStatement(
-    const size_t start, const BinKind kind, const BinFields& fields) {
-  MOZ_ASSERT(kind == BinKind::WithStatement);
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
+  MOZ_ASSERT(kind == BinASTKind::WithStatement);
   BINJS_TRY(CheckRecursionLimit(cx_));
 
 #if defined(DEBUG)
-  const BinField expected_fields[2] = {BinField::Object, BinField::Body};
+  const BinASTField expected_fields[2] = {BinASTField::Object,
+                                          BinASTField::Body};
   MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif  // defined(DEBUG)
 
   BINJS_MOZ_TRY_DECL(object, parseExpression());
 
   ParseContext::Statement stmt(pc_, StatementKind::With);
   BINJS_MOZ_TRY_DECL(body, parseStatement());
 
   pc_->sc()->setBindingsAccessedDynamically();
   BINJS_TRY_DECL(result, handler_.newWithStatement(start, object, body));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceYieldExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release (YieldExpression)");
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceYieldStarExpression(
-    const size_t start, const BinKind kind, const BinFields& fields) {
+    const size_t start, const BinASTKind kind, const BinASTFields& fields) {
   return raiseError(
       "FIXME: Not implemented yet in this preview release "
       "(YieldStarExpression)");
 }
 
 // ----- String enums (autogenerated, by lexicographical order)
 /*
 enum AssertedDeclaredKind {
@@ -4338,21 +4360,21 @@ enum AssertedDeclaredKind {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::AssertedDeclaredKind>
 BinASTParser<Tok>::parseAssertedDeclaredKind() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::AssertedDeclaredKindOrVariableDeclarationKindVar:
+    case BinASTVariant::AssertedDeclaredKindOrVariableDeclarationKindVar:
       return AssertedDeclaredKind::Var;
-    case BinVariant::AssertedDeclaredKindNonConstLexical:
+    case BinASTVariant::AssertedDeclaredKindNonConstLexical:
       return AssertedDeclaredKind::NonConstLexical;
-    case BinVariant::AssertedDeclaredKindConstLexical:
+    case BinASTVariant::AssertedDeclaredKindConstLexical:
       return AssertedDeclaredKind::ConstLexical;
     default:
       return raiseInvalidVariant("AssertedDeclaredKind", variant);
   }
 }
 
 /*
 enum BinaryOperator {
@@ -4384,65 +4406,65 @@ enum BinaryOperator {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::BinaryOperator>
 BinASTParser<Tok>::parseBinaryOperator() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::BinaryOperatorComma:
+    case BinASTVariant::BinaryOperatorComma:
       return BinaryOperator::Comma;
-    case BinVariant::BinaryOperatorLogicalOr:
+    case BinASTVariant::BinaryOperatorLogicalOr:
       return BinaryOperator::LogicalOr;
-    case BinVariant::BinaryOperatorLogicalAnd:
+    case BinASTVariant::BinaryOperatorLogicalAnd:
       return BinaryOperator::LogicalAnd;
-    case BinVariant::BinaryOperatorBitOr:
+    case BinASTVariant::BinaryOperatorBitOr:
       return BinaryOperator::BitOr;
-    case BinVariant::BinaryOperatorBitXor:
+    case BinASTVariant::BinaryOperatorBitXor:
       return BinaryOperator::BitXor;
-    case BinVariant::BinaryOperatorBitAnd:
+    case BinASTVariant::BinaryOperatorBitAnd:
       return BinaryOperator::BitAnd;
-    case BinVariant::BinaryOperatorEq:
+    case BinASTVariant::BinaryOperatorEq:
       return BinaryOperator::Eq;
-    case BinVariant::BinaryOperatorNeq:
+    case BinASTVariant::BinaryOperatorNeq:
       return BinaryOperator::Neq;
-    case BinVariant::BinaryOperatorStrictEq:
+    case BinASTVariant::BinaryOperatorStrictEq:
       return BinaryOperator::StrictEq;
-    case BinVariant::BinaryOperatorStrictNeq:
+    case BinASTVariant::BinaryOperatorStrictNeq:
       return BinaryOperator::StrictNeq;
-    case BinVariant::BinaryOperatorLessThan:
+    case BinASTVariant::BinaryOperatorLessThan:
       return BinaryOperator::LessThan;
-    case BinVariant::BinaryOperatorLeqThan:
+    case BinASTVariant::BinaryOperatorLeqThan:
       return BinaryOperator::LeqThan;
-    case BinVariant::BinaryOperatorGreaterThan:
+    case BinASTVariant::BinaryOperatorGreaterThan:
       return BinaryOperator::GreaterThan;
-    case BinVariant::BinaryOperatorGeqThan:
+    case BinASTVariant::BinaryOperatorGeqThan:
       return BinaryOperator::GeqThan;
-    case BinVariant::BinaryOperatorIn:
+    case BinASTVariant::BinaryOperatorIn:
       return BinaryOperator::In;
-    case BinVariant::BinaryOperatorInstanceof:
+    case BinASTVariant::BinaryOperatorInstanceof:
       return BinaryOperator::Instanceof;
-    case BinVariant::BinaryOperatorLsh:
+    case BinASTVariant::BinaryOperatorLsh:
       return BinaryOperator::Lsh;
-    case BinVariant::BinaryOperatorRsh:
+    case BinASTVariant::BinaryOperatorRsh:
       return BinaryOperator::Rsh;
-    case BinVariant::BinaryOperatorUrsh:
+    case BinASTVariant::BinaryOperatorUrsh:
       return BinaryOperator::Ursh;
-    case BinVariant::BinaryOperatorOrUnaryOperatorPlus:
+    case BinASTVariant::BinaryOperatorOrUnaryOperatorPlus:
       return BinaryOperator::Plus;
-    case BinVariant::BinaryOperatorOrUnaryOperatorMinus:
+    case BinASTVariant::BinaryOperatorOrUnaryOperatorMinus:
       return BinaryOperator::Minus;
-    case BinVariant::BinaryOperatorMul:
+    case BinASTVariant::BinaryOperatorMul:
       return BinaryOperator::Mul;
-    case BinVariant::BinaryOperatorDiv:
+    case BinASTVariant::BinaryOperatorDiv:
       return BinaryOperator::Div;
-    case BinVariant::BinaryOperatorMod:
+    case BinASTVariant::BinaryOperatorMod:
       return BinaryOperator::Mod;
-    case BinVariant::BinaryOperatorPow:
+    case BinASTVariant::BinaryOperatorPow:
       return BinaryOperator::Pow;
     default:
       return raiseInvalidVariant("BinaryOperator", variant);
   }
 }
 
 /*
 enum CompoundAssignmentOperator {
@@ -4461,39 +4483,39 @@ enum CompoundAssignmentOperator {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::CompoundAssignmentOperator>
 BinASTParser<Tok>::parseCompoundAssignmentOperator() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::CompoundAssignmentOperatorPlusAssign:
+    case BinASTVariant::CompoundAssignmentOperatorPlusAssign:
       return CompoundAssignmentOperator::PlusAssign;
-    case BinVariant::CompoundAssignmentOperatorMinusAssign:
+    case BinASTVariant::CompoundAssignmentOperatorMinusAssign:
       return CompoundAssignmentOperator::MinusAssign;
-    case BinVariant::CompoundAssignmentOperatorMulAssign:
+    case BinASTVariant::CompoundAssignmentOperatorMulAssign:
       return CompoundAssignmentOperator::MulAssign;
-    case BinVariant::CompoundAssignmentOperatorDivAssign:
+    case BinASTVariant::CompoundAssignmentOperatorDivAssign:
       return CompoundAssignmentOperator::DivAssign;
-    case BinVariant::CompoundAssignmentOperatorModAssign:
+    case BinASTVariant::CompoundAssignmentOperatorModAssign:
       return CompoundAssignmentOperator::ModAssign;
-    case BinVariant::CompoundAssignmentOperatorPowAssign:
+    case BinASTVariant::CompoundAssignmentOperatorPowAssign:
       return CompoundAssignmentOperator::PowAssign;
-    case BinVariant::CompoundAssignmentOperatorLshAssign:
+    case BinASTVariant::CompoundAssignmentOperatorLshAssign:
       return CompoundAssignmentOperator::LshAssign;
-    case BinVariant::CompoundAssignmentOperatorRshAssign:
+    case BinASTVariant::CompoundAssignmentOperatorRshAssign:
       return CompoundAssignmentOperator::RshAssign;
-    case BinVariant::CompoundAssignmentOperatorUrshAssign:
+    case BinASTVariant::CompoundAssignmentOperatorUrshAssign:
       return CompoundAssignmentOperator::UrshAssign;
-    case BinVariant::CompoundAssignmentOperatorBitOrAssign:
+    case BinASTVariant::CompoundAssignmentOperatorBitOrAssign:
       return CompoundAssignmentOperator::BitOrAssign;
-    case BinVariant::CompoundAssignmentOperatorBitXorAssign:
+    case BinASTVariant::CompoundAssignmentOperatorBitXorAssign:
       return CompoundAssignmentOperator::BitXorAssign;
-    case BinVariant::CompoundAssignmentOperatorBitAndAssign:
+    case BinASTVariant::CompoundAssignmentOperatorBitAndAssign:
       return CompoundAssignmentOperator::BitAndAssign;
     default:
       return raiseInvalidVariant("CompoundAssignmentOperator", variant);
   }
 }
 
 /*
 enum UnaryOperator {
@@ -4507,29 +4529,29 @@ enum UnaryOperator {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::UnaryOperator>
 BinASTParser<Tok>::parseUnaryOperator() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::BinaryOperatorOrUnaryOperatorPlus:
+    case BinASTVariant::BinaryOperatorOrUnaryOperatorPlus:
       return UnaryOperator::Plus;
-    case BinVariant::BinaryOperatorOrUnaryOperatorMinus:
+    case BinASTVariant::BinaryOperatorOrUnaryOperatorMinus:
       return UnaryOperator::Minus;
-    case BinVariant::UnaryOperatorNot:
+    case BinASTVariant::UnaryOperatorNot:
       return UnaryOperator::Not;
-    case BinVariant::UnaryOperatorBitNot:
+    case BinASTVariant::UnaryOperatorBitNot:
       return UnaryOperator::BitNot;
-    case BinVariant::UnaryOperatorTypeof:
+    case BinASTVariant::UnaryOperatorTypeof:
       return UnaryOperator::Typeof;
-    case BinVariant::UnaryOperatorVoid:
+    case BinASTVariant::UnaryOperatorVoid:
       return UnaryOperator::Void;
-    case BinVariant::UnaryOperatorDelete:
+    case BinASTVariant::UnaryOperatorDelete:
       return UnaryOperator::Delete;
     default:
       return raiseInvalidVariant("UnaryOperator", variant);
   }
 }
 
 /*
 enum UpdateOperator {
@@ -4538,19 +4560,19 @@ enum UpdateOperator {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::UpdateOperator>
 BinASTParser<Tok>::parseUpdateOperator() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::UpdateOperatorIncr:
+    case BinASTVariant::UpdateOperatorIncr:
       return UpdateOperator::Incr;
-    case BinVariant::UpdateOperatorDecr:
+    case BinASTVariant::UpdateOperatorDecr:
       return UpdateOperator::Decr;
     default:
       return raiseInvalidVariant("UpdateOperator", variant);
   }
 }
 
 /*
 enum VariableDeclarationKind {
@@ -4560,21 +4582,21 @@ enum VariableDeclarationKind {
 };
 */
 template <typename Tok>
 JS::Result<typename BinASTParser<Tok>::VariableDeclarationKind>
 BinASTParser<Tok>::parseVariableDeclarationKind() {
   BINJS_MOZ_TRY_DECL(variant, tokenizer_->readVariant());
 
   switch (variant) {
-    case BinVariant::AssertedDeclaredKindOrVariableDeclarationKindVar:
+    case BinASTVariant::AssertedDeclaredKindOrVariableDeclarationKindVar:
       return VariableDeclarationKind::Var;
-    case BinVariant::VariableDeclarationKindLet:
+    case BinASTVariant::VariableDeclarationKindLet:
       return VariableDeclarationKind::Let;
-    case BinVariant::VariableDeclarationKindConst:
+    case BinASTVariant::VariableDeclarationKindConst:
       return VariableDeclarationKind::Const;
     default:
       return raiseInvalidVariant("VariableDeclarationKind", variant);
   }
 }
 
 // ----- Lists (autogenerated, by lexicographical order)
 
@@ -4818,153 +4840,153 @@ JS::Result<ListNode*> BinASTParser<Tok>:
 
   MOZ_TRY(guard.done());
   return result;
 }
 
 // ----- Default values (by lexicographical order)
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseOptionalBinding() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
   } else {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseSumBinding(start, kind, fields));
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseOptionalBindingIdentifier() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
-  } else if (kind == BinKind::BindingIdentifier) {
+  } else if (kind == BinASTKind::BindingIdentifier) {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseInterfaceBindingIdentifier(start, kind, fields));
   } else {
     return raiseInvalidKind("BindingIdentifier", kind);
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<LexicalScopeNode*> BinASTParser<Tok>::parseOptionalCatchClause() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   LexicalScopeNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
-  } else if (kind == BinKind::CatchClause) {
+  } else if (kind == BinASTKind::CatchClause) {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseInterfaceCatchClause(start, kind, fields));
   } else {
     return raiseInvalidKind("CatchClause", kind);
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseOptionalExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
   } else {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseSumExpression(start, kind, fields));
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseOptionalSpreadElementOrExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
   } else {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseSumSpreadElementOrExpression(start, kind, fields));
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseOptionalStatement() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
   } else {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result, parseSumStatement(start, kind, fields));
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*>
 BinASTParser<Tok>::parseOptionalVariableDeclarationOrExpression() {
-  BinKind kind;
-  BinFields fields(cx_);
+  BinASTKind kind;
+  BinASTFields fields(cx_);
   AutoTaggedTuple guard(*tokenizer_);
 
   MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
   ParseNode* result;
-  if (kind == BinKind::_Null) {
+  if (kind == BinASTKind::_Null) {
     result = nullptr;
   } else {
     const auto start = tokenizer_->offset();
     MOZ_TRY_VAR(result,
                 parseSumVariableDeclarationOrExpression(start, kind, fields));
   }
   MOZ_TRY(guard.done());
 
   return result;
 }
 
 // Force class instantiation.
 // This ensures that the symbols are built, without having to export all our
 // code (and its baggage of #include and macros) in the header.
-template class BinASTParser<BinTokenReaderMultipart>;
+template class BinASTParser<BinASTTokenReaderMultipart>;
 
 }  // namespace frontend
 }  // namespace js
--- a/js/src/frontend/BinASTParser.h
+++ b/js/src/frontend/BinASTParser.h
@@ -2,27 +2,27 @@
 // please DO NOT EDIT BY HAND.
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * 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/. */
 
 // To generate this file, see the documentation in
-// js/src/frontend/binsource/README.md.
+// js/src/frontend/binast/README.md.
 
 #ifndef frontend_BinASTParser_h
 #define frontend_BinASTParser_h
 
 #include "mozilla/Maybe.h"
 
 #include "frontend/BCEParserHandle.h"
 #include "frontend/BinASTParserPerTokenizer.h"
-#include "frontend/BinToken.h"
-#include "frontend/BinTokenReaderMultipart.h"
+#include "frontend/BinASTToken.h"
+#include "frontend/BinASTTokenReaderMultipart.h"
 #include "frontend/FullParseHandler.h"
 #include "frontend/ParseContext.h"
 #include "frontend/ParseNode.h"
 #include "frontend/SharedContext.h"
 
 #include "js/CompileOptions.h"
 #include "js/GCHashTable.h"
 #include "js/GCVector.h"
@@ -33,17 +33,17 @@ namespace frontend {
 
 template <typename Tok>
 class BinASTParser : public BinASTParserPerTokenizer<Tok> {
  public:
   using Base = BinASTParserPerTokenizer<Tok>;
 
   using Tokenizer = Tok;
 
-  using BinFields = typename Tokenizer::BinFields;
+  using BinASTFields = typename Tokenizer::BinASTFields;
   using AutoList = typename Tokenizer::AutoList;
   using AutoTaggedTuple = typename Tokenizer::AutoTaggedTuple;
   using Chars = typename Tokenizer::Chars;
 
  public:
   // Auto-generated types.
   using AssertedDeclaredKind = binast::AssertedDeclaredKind;
   using BinaryOperator = binast::BinaryOperator;
@@ -130,52 +130,54 @@ class BinASTParser : public BinASTParser
   JS::Result<ParseNode*> parseObjectProperty();
   JS::Result<ParseNode*> parseParameter();
   JS::Result<ParseNode*> parseProgram();
   JS::Result<ParseNode*> parsePropertyName();
   JS::Result<ParseNode*> parseSimpleAssignmentTarget();
   JS::Result<ParseNode*> parseSpreadElementOrExpression();
   JS::Result<ParseNode*> parseStatement();
   JS::Result<Ok> parseSumAssertedMaybePositionalParameterName(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       AssertedScopeKind scopeKind,
       MutableHandle<GCVector<JSAtom*>> positionalParams);
   JS::Result<ParseNode*> parseSumAssignmentTarget(const size_t start,
-                                                  const BinKind kind,
-                                                  const BinFields& fields);
-  JS::Result<ParseNode*> parseSumBinding(const size_t start, const BinKind kind,
-                                         const BinFields& fields);
+                                                  const BinASTKind kind,
+                                                  const BinASTFields& fields);
+  JS::Result<ParseNode*> parseSumBinding(const size_t start,
+                                         const BinASTKind kind,
+                                         const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumExpression(const size_t start,
-                                            const BinKind kind,
-                                            const BinFields& fields);
+                                            const BinASTKind kind,
+                                            const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumExpressionOrSuper(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumForInOfBindingOrAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumObjectProperty(const size_t start,
-                                                const BinKind kind,
-                                                const BinFields& fields);
+                                                const BinASTKind kind,
+                                                const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumParameter(const size_t start,
-                                           const BinKind kind,
-                                           const BinFields& fields);
-  JS::Result<ParseNode*> parseSumProgram(const size_t start, const BinKind kind,
-                                         const BinFields& fields);
+                                           const BinASTKind kind,
+                                           const BinASTFields& fields);
+  JS::Result<ParseNode*> parseSumProgram(const size_t start,
+                                         const BinASTKind kind,
+                                         const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumPropertyName(const size_t start,
-                                              const BinKind kind,
-                                              const BinFields& fields);
+                                              const BinASTKind kind,
+                                              const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumSimpleAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumSpreadElementOrExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumStatement(const size_t start,
-                                           const BinKind kind,
-                                           const BinFields& fields);
+                                           const BinASTKind kind,
+                                           const BinASTFields& fields);
   JS::Result<ParseNode*> parseSumVariableDeclarationOrExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
 
   // ----- Interfaces (by lexicographical order)
   // `ParseNode*` may never be nullptr
   JS::Result<Ok> parseAssertedBlockScope();
   JS::Result<Ok> parseAssertedBoundName(AssertedScopeKind scopeKind);
   JS::Result<Ok> parseAssertedBoundNamesScope();
   JS::Result<Ok> parseAssertedDeclaredName(AssertedScopeKind scopeKind);
   JS::Result<Ok> parseAssertedParameterScope(
@@ -197,262 +199,239 @@ class BinASTParser : public BinASTParser
                                      ListNode** bodyOut);
   JS::Result<ParseNode*> parseIdentifierExpression();
   JS::Result<Ok> parseSetterContents(uint32_t funLength, ListNode** paramsOut,
                                      ListNode** bodyOut);
   JS::Result<CaseClause*> parseSwitchCase();
   JS::Result<ParseNode*> parseSwitchDefault();
   JS::Result<ParseNode*> parseVariableDeclarator();
   JS::Result<ParseNode*> parseInterfaceArrayAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceArrayBinding(const size_t start,
-                                                    const BinKind kind,
-                                                    const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceArrayExpression(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+                                                    const BinASTKind kind,
+                                                    const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceArrayExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceAssertedBlockScope(const size_t start,
-                                                  const BinKind kind,
-                                                  const BinFields& fields);
+                                                  const BinASTKind kind,
+                                                  const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceAssertedBoundName(const size_t start,
-                                                 const BinKind kind,
-                                                 const BinFields& fields,
+                                                 const BinASTKind kind,
+                                                 const BinASTFields& fields,
                                                  AssertedScopeKind scopeKind);
-  JS::Result<Ok> parseInterfaceAssertedBoundNamesScope(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+  JS::Result<Ok> parseInterfaceAssertedBoundNamesScope(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceAssertedDeclaredName(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       AssertedScopeKind scopeKind);
   JS::Result<Ok> parseInterfaceAssertedParameterScope(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       MutableHandle<GCVector<JSAtom*>> positionalParams);
   JS::Result<Ok> parseInterfaceAssertedPositionalParameterName(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       AssertedScopeKind scopeKind,
       MutableHandle<GCVector<JSAtom*>> positionalParams);
   JS::Result<Ok> parseInterfaceAssertedScriptGlobalScope(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceAssertedVarScope(const size_t start,
-                                                const BinKind kind,
-                                                const BinFields& fields);
+                                                const BinASTKind kind,
+                                                const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceAssignmentExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceAssignmentTargetIdentifier(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceAwaitExpression(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceAwaitExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceBinaryExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceBindingIdentifier(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceBindingWithInitializer(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceBlock(const size_t start,
-                                             const BinKind kind,
-                                             const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceBreakStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceCallExpression(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
+                                             const BinASTKind kind,
+                                             const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceBreakStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceCallExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<LexicalScopeNode*> parseInterfaceCatchClause(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceClassDeclaration(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceClassExpression(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceClassExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceCompoundAssignmentExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceComputedMemberAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceComputedMemberExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceComputedPropertyName(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceConditionalExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceContinueStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceDataProperty(const size_t start,
-                                                    const BinKind kind,
-                                                    const BinFields& fields);
+                                                    const BinASTKind kind,
+                                                    const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceDebuggerStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceDirective(const size_t start,
-                                                 const BinKind kind,
-                                                 const BinFields& fields);
+                                                 const BinASTKind kind,
+                                                 const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceDoWhileStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerArrowExpressionWithExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerArrowExpressionWithFunctionBody(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerFunctionDeclaration(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerFunctionExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerGetter(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerMethod(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceEagerSetter(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceEmptyStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceEmptyStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceExpressionStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceForInOfBinding(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceForInStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceForOfStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceForInOfBinding(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceForInStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceForOfStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceForStatement(const size_t start,
-                                                    const BinKind kind,
-                                                    const BinFields& fields);
-  JS::Result<ListNode*> parseInterfaceFormalParameters(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+                                                    const BinASTKind kind,
+                                                    const BinASTFields& fields);
+  JS::Result<ListNode*> parseInterfaceFormalParameters(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceFunctionExpressionContents(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut);
   JS::Result<Ok> parseInterfaceFunctionOrMethodContents(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut);
   JS::Result<Ok> parseInterfaceGetterContents(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut);
   JS::Result<ParseNode*> parseInterfaceIdentifierExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceIfStatement(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLabelledStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyArrowExpressionWithExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyArrowExpressionWithFunctionBody(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyFunctionDeclaration(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyFunctionExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyGetter(const size_t start,
-                                                  const BinKind kind,
-                                                  const BinFields& fields);
+                                                  const BinASTKind kind,
+                                                  const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazyMethod(const size_t start,
-                                                  const BinKind kind,
-                                                  const BinFields& fields);
+                                                  const BinASTKind kind,
+                                                  const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLazySetter(const size_t start,
-                                                  const BinKind kind,
-                                                  const BinFields& fields);
+                                                  const BinASTKind kind,
+                                                  const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralBooleanExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralInfinityExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralNullExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralNumericExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralPropertyName(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralRegExpExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceLiteralStringExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceModule(const size_t start,
-                                              const BinKind kind,
-                                              const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceNewExpression(const size_t start,
-                                                     const BinKind kind,
-                                                     const BinFields& fields);
+                                              const BinASTKind kind,
+                                              const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceNewExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceNewTargetExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceObjectAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceObjectBinding(const size_t start,
-                                                     const BinKind kind,
-                                                     const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceObjectBinding(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceObjectExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceReturnStatement(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceReturnStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceScript(const size_t start,
-                                              const BinKind kind,
-                                              const BinFields& fields);
+                                              const BinASTKind kind,
+                                              const BinASTFields& fields);
   JS::Result<Ok> parseInterfaceSetterContents(
-      const size_t start, const BinKind kind, const BinFields& fields,
+      const size_t start, const BinASTKind kind, const BinASTFields& fields,
       uint32_t funLength, ListNode** paramsOut, ListNode** bodyOut);
   JS::Result<ParseNode*> parseInterfaceShorthandProperty(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceSpreadElement(const size_t start,
-                                                     const BinKind kind,
-                                                     const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceSpreadElement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceStaticMemberAssignmentTarget(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceStaticMemberExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceSuper(const size_t start,
-                                             const BinKind kind,
-                                             const BinFields& fields);
+                                             const BinASTKind kind,
+                                             const BinASTFields& fields);
   JS::Result<CaseClause*> parseInterfaceSwitchCase(const size_t start,
-                                                   const BinKind kind,
-                                                   const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceSwitchDefault(const size_t start,
-                                                     const BinKind kind,
-                                                     const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceSwitchStatement(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+                                                   const BinASTKind kind,
+                                                   const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceSwitchDefault(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceSwitchStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceSwitchStatementWithDefault(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceTemplateExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceThisExpression(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceThrowStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceThisExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceThrowStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceTryCatchStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceTryFinallyStatement(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceUnaryExpression(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceUnaryExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceUpdateExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceVariableDeclaration(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceVariableDeclarator(
-      const size_t start, const BinKind kind, const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceWhileStatement(const size_t start,
-                                                      const BinKind kind,
-                                                      const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceWithStatement(const size_t start,
-                                                     const BinKind kind,
-                                                     const BinFields& fields);
-  JS::Result<ParseNode*> parseInterfaceYieldExpression(const size_t start,
-                                                       const BinKind kind,
-                                                       const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceWhileStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceWithStatement(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
+  JS::Result<ParseNode*> parseInterfaceYieldExpression(
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
   JS::Result<ParseNode*> parseInterfaceYieldStarExpression(
-      const size_t start, const BinKind kind, const BinFields& fields);
+      const size_t start, const BinASTKind kind, const BinASTFields& fields);
 
   // ----- String enums (by lexicographical order)
   JS::Result<typename BinASTParser<Tok>::AssertedDeclaredKind>
   parseAssertedDeclaredKind();
   JS::Result<typename BinASTParser<Tok>::BinaryOperator> parseBinaryOperator();
   JS::Result<typename BinASTParser<Tok>::CompoundAssignmentOperator>
   parseCompoundAssignmentOperator();
   JS::Result<typename BinASTParser<Tok>::UnaryOperator> parseUnaryOperator();
@@ -482,14 +461,14 @@ class BinASTParser : public BinASTParser
   JS::Result<ParseNode*> parseOptionalBindingIdentifier();
   JS::Result<LexicalScopeNode*> parseOptionalCatchClause();
   JS::Result<ParseNode*> parseOptionalExpression();
   JS::Result<ParseNode*> parseOptionalSpreadElementOrExpression();
   JS::Result<ParseNode*> parseOptionalStatement();
   JS::Result<ParseNode*> parseOptionalVariableDeclarationOrExpression();
 };
 
-extern template class BinASTParser<BinTokenReaderMultipart>;
+extern template class BinASTParser<BinASTTokenReaderMultipart>;
 
 }  // namespace frontend
 }  // namespace js
 
 #endif  // frontend_BinASTParser_h
--- a/js/src/frontend/BinASTParserPerTokenizer.cpp
+++ b/js/src/frontend/BinASTParserPerTokenizer.cpp
@@ -9,19 +9,19 @@
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Casting.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/Move.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/ScopeExit.h"
 #include "mozilla/Vector.h"
 
+#include "frontend/BinAST-macros.h"
 #include "frontend/BinASTParser.h"
-#include "frontend/BinSource-macros.h"
-#include "frontend/BinTokenReaderMultipart.h"
+#include "frontend/BinASTTokenReaderMultipart.h"
 #include "frontend/FullParseHandler.h"
 #include "frontend/ParseNode.h"
 #include "frontend/Parser.h"
 #include "frontend/SharedContext.h"
 
 #include "js/Result.h"
 #include "vm/RegExpObject.h"
 
@@ -113,17 +113,18 @@ JS::Result<ParseNode*> BinASTParserPerTo
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParserPerTokenizer<Tok>::parseAux(
     GlobalSharedContext* globalsc, const uint8_t* start, const size_t length,
     BinASTSourceMetadata** metadataPtr) {
   MOZ_ASSERT(globalsc);
 
   tokenizer_.emplace(cx_, this, start, length);
 
-  BinParseContext globalpc(cx_, this, globalsc, /* newDirectives = */ nullptr);
+  BinASTParseContext globalpc(cx_, this, globalsc,
+                              /* newDirectives = */ nullptr);
   if (!globalpc.init()) {
     return cx_->alreadyReportedError();
   }
 
   ParseContext::VarScope varScope(cx_, &globalpc, usedNames_);
   if (!varScope.init(&globalpc)) {
     return cx_->alreadyReportedError();
   }
@@ -174,36 +175,36 @@ JS::Result<FunctionNode*> BinASTParserPe
   auto syntaxKind =
       isExpr ? FunctionSyntaxKind::Expression : FunctionSyntaxKind::Statement;
   BINJS_MOZ_TRY_DECL(
       funbox, buildFunctionBox(lazyScript_->generatorKind(),
                                lazyScript_->asyncKind(), syntaxKind, nullptr));
 
   // Push a new ParseContext. It will be used to parse `scope`, the arguments,
   // the function.
-  BinParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
+  BinASTParseContext funpc(cx_, this, funbox, /* newDirectives = */ nullptr);
   BINJS_TRY(funpc.init());
   pc_->functionScope().useAsVarScope(pc_);
   MOZ_ASSERT(pc_->isFunctionBox());
 
   ParseContext::Scope lexicalScope(cx_, pc_, usedNames_);
   BINJS_TRY(lexicalScope.init(pc_));
   ListNode* params;
   ListNode* tmpBody;
   auto parseFunc = isExpr ? &FinalParser::parseFunctionExpressionContents
                           : &FinalParser::parseFunctionOrMethodContents;
   MOZ_TRY((asFinalParser()->*parseFunc)(func->nargs(), &params, &tmpBody));
 
   BINJS_TRY_DECL(lexicalScopeData,
                  NewLexicalScopeData(cx_, lexicalScope, alloc_, pc_));
   BINJS_TRY_DECL(body, handler_.newLexicalScope(*lexicalScopeData, tmpBody));
 
-  auto binKind = isExpr ? BinKind::LazyFunctionExpression
-                        : BinKind::LazyFunctionDeclaration;
-  return buildFunction(firstOffset, binKind, nullptr, params, body);
+  auto binASTKind = isExpr ? BinASTKind::LazyFunctionExpression
+                           : BinASTKind::LazyFunctionDeclaration;
+  return buildFunction(firstOffset, binASTKind, nullptr, params, body);
 }
 
 template <typename Tok>
 void BinASTParserPerTokenizer<Tok>::forceStrictIfNecessary(
     SharedContext* sc, ListNode* directives) {
   JSAtom* useStrict = cx_->names().useStrict;
 
   for (const ParseNode* directive : directives->contents()) {
@@ -269,63 +270,63 @@ JS::Result<FunctionBox*> BinASTParserPer
   if (pc_) {
     funbox->initWithEnclosingParseContext(pc_, syntax);
   } else {
     funbox->initFromLazyFunction();
   }
   return funbox;
 }
 
-FunctionSyntaxKind BinKindToFunctionSyntaxKind(const BinKind kind) {
+FunctionSyntaxKind BinASTKindToFunctionSyntaxKind(const BinASTKind kind) {
   // FIXME: this doesn't cover FunctionSyntaxKind::ClassConstructor and
   // FunctionSyntaxKind::DerivedClassConstructor.
   switch (kind) {
-    case BinKind::EagerFunctionDeclaration:
-    case BinKind::LazyFunctionDeclaration:
+    case BinASTKind::EagerFunctionDeclaration:
+    case BinASTKind::LazyFunctionDeclaration:
       return FunctionSyntaxKind::Statement;
-    case BinKind::EagerFunctionExpression:
-    case BinKind::LazyFunctionExpression:
+    case BinASTKind::EagerFunctionExpression:
+    case BinASTKind::LazyFunctionExpression:
       return FunctionSyntaxKind::Expression;
-    case BinKind::EagerArrowExpressionWithFunctionBody:
-    case BinKind::LazyArrowExpressionWithFunctionBody:
-    case BinKind::EagerArrowExpressionWithExpression:
-    case BinKind::LazyArrowExpressionWithExpression:
+    case BinASTKind::EagerArrowExpressionWithFunctionBody:
+    case BinASTKind::LazyArrowExpressionWithFunctionBody:
+    case BinASTKind::EagerArrowExpressionWithExpression:
+    case BinASTKind::LazyArrowExpressionWithExpression:
       return FunctionSyntaxKind::Arrow;
-    case BinKind::EagerMethod:
-    case BinKind::LazyMethod:
+    case BinASTKind::EagerMethod:
+    case BinASTKind::LazyMethod:
       return FunctionSyntaxKind::Method;
-    case BinKind::EagerGetter:
-    case BinKind::LazyGetter:
+    case BinASTKind::EagerGetter:
+    case BinASTKind::LazyGetter:
       return FunctionSyntaxKind::Getter;
-    case BinKind::EagerSetter:
-    case BinKind::LazySetter:
+    case BinASTKind::EagerSetter:
+    case BinASTKind::LazySetter:
       return FunctionSyntaxKind::Setter;
     default:
       MOZ_CRASH("Invalid/ kind");
   }
 }
 
 template <typename Tok>
 JS::Result<FunctionNode*> BinASTParserPerTokenizer<Tok>::makeEmptyFunctionNode(
-    const size_t start, const BinKind kind, FunctionBox* funbox) {
+    const size_t start, const BinASTKind kind, FunctionBox* funbox) {
   // LazyScript compilation requires basically none of the fields filled out.
   TokenPos pos = tokenizer_->pos(start);
-  FunctionSyntaxKind syntaxKind = BinKindToFunctionSyntaxKind(kind);
+  FunctionSyntaxKind syntaxKind = BinASTKindToFunctionSyntaxKind(kind);
 
   BINJS_TRY_DECL(result, handler_.newFunction(syntaxKind, pos));
 
   handler_.setFunctionBox(result, funbox);
 
   return result;
 }
 
 template <typename Tok>
 JS::Result<FunctionNode*> BinASTParserPerTokenizer<Tok>::buildFunction(
-    const size_t start, const BinKind kind, ParseNode* name, ListNode* params,
-    ParseNode* body) {
+    const size_t start, const BinASTKind kind, ParseNode* name,
+    ListNode* params, ParseNode* body) {
   FunctionBox* funbox = pc_->functionBox();
 
   // Set the argument count for building argument packets. Function.length is
   // handled by setting the appropriate funbox field during argument parsing.
   if (!lazyScript_ ||
       lazyScript_->functionNonDelazifying() != funbox->function()) {
     funbox->function()->setArgCount(params ? uint16_t(params->count()) : 0);
   }
@@ -677,44 +678,44 @@ template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseMissingDirectEvalInAssertedScope() {
   return raiseError("Direct call to `eval` was not declared in AssertedScope");
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseInvalidKind(const char* superKind,
-                                                const BinKind kind) {
+                                                const BinASTKind kind) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
-  BINJS_TRY(
-      out.printf("In %s, invalid kind %s", superKind, describeBinKind(kind)));
+  BINJS_TRY(out.printf("In %s, invalid kind %s", superKind,
+                       describeBinASTKind(kind)));
   return raiseError(out.string());
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseInvalidVariant(const char* kind,
-                                                   const BinVariant value) {
+                                                   const BinASTVariant value) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
   BINJS_TRY(out.printf("In %s, invalid variant '%s'", kind,
-                       describeBinVariant(value)));
+                       describeBinASTVariant(value)));
 
   return raiseError(out.string());
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseMissingField(const char* kind,
-                                                 const BinField field) {
+                                                 const BinASTField field) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
-  BINJS_TRY(
-      out.printf("In %s, missing field '%s'", kind, describeBinField(field)));
+  BINJS_TRY(out.printf("In %s, missing field '%s'", kind,
+                       describeBinASTField(field)));
 
   return raiseError(out.string());
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseEmpty(const char* description) {
   Sprinter out(cx_);
@@ -727,21 +728,21 @@ BinASTParserPerTokenizer<Tok>::raiseEmpt
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseOOM() {
   return tokenizer_->raiseOOM();
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
-BinASTParserPerTokenizer<Tok>::raiseError(BinKind kind,
+BinASTParserPerTokenizer<Tok>::raiseError(BinASTKind kind,
                                           const char* description) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
-  BINJS_TRY(out.printf("In %s, %s", describeBinKind(kind), description));
+  BINJS_TRY(out.printf("In %s, %s", describeBinASTKind(kind), description));
   return tokenizer_->raiseError(out.string());
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseError(const char* description) {
   return tokenizer_->raiseError(description);
 }
@@ -800,12 +801,12 @@ BinASTParserPerTokenizer<Tok>::asFinalPa
       "inheritance relationship required by the static_cast<> below");
 
   return static_cast<const FinalParser*>(this);
 }
 
 // Force class instantiation.
 // This ensures that the symbols are built, without having to export all our
 // code (and its baggage of #include and macros) in the header.
-template class BinASTParserPerTokenizer<BinTokenReaderMultipart>;
+template class BinASTParserPerTokenizer<BinASTTokenReaderMultipart>;
 
 }  // namespace frontend
 }  // namespace js
--- a/js/src/frontend/BinASTParserPerTokenizer.h
+++ b/js/src/frontend/BinASTParserPerTokenizer.h
@@ -14,18 +14,18 @@
  * and trusts its input (in particular, variable declarations).
  */
 
 #include "mozilla/Maybe.h"
 
 #include "frontend/BCEParserHandle.h"
 #include "frontend/BinASTEnum.h"
 #include "frontend/BinASTParserBase.h"
-#include "frontend/BinToken.h"
-#include "frontend/BinTokenReaderMultipart.h"
+#include "frontend/BinASTToken.h"
+#include "frontend/BinASTTokenReaderMultipart.h"
 #include "frontend/FullParseHandler.h"
 #include "frontend/ParseContext.h"
 #include "frontend/ParseNode.h"
 #include "frontend/SharedContext.h"
 
 #include "js/CompileOptions.h"
 #include "js/GCHashTable.h"
 #include "js/GCVector.h"
@@ -49,17 +49,17 @@ template <typename Tok>
 class BinASTParserPerTokenizer : public BinASTParserBase,
                                  public ErrorReporter,
                                  public BCEParserHandle {
  public:
   using Tokenizer = Tok;
 
   using AutoList = typename Tokenizer::AutoList;
   using AutoTaggedTuple = typename Tokenizer::AutoTaggedTuple;
-  using BinFields = typename Tokenizer::BinFields;
+  using BinASTFields = typename Tokenizer::BinASTFields;
   using Chars = typename Tokenizer::Chars;
 
  public:
   // Auto-generated types.
   using AssertedDeclaredKind = binast::AssertedDeclaredKind;
   using VariableDeclarationKind = binast::VariableDeclarationKind;
 
  public:
@@ -101,28 +101,28 @@ class BinASTParserPerTokenizer : public 
 
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseInvalidClosedVar(
       JSAtom* name);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&>
   raiseMissingVariableInAssertedScope(JSAtom* name);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&>
   raiseMissingDirectEvalInAssertedScope();
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseInvalidKind(
-      const char* superKind, const BinKind kind);
+      const char* superKind, const BinASTKind kind);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseInvalidVariant(
-      const char* kind, const BinVariant value);
+      const char* kind, const BinASTVariant value);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseMissingField(
-      const char* kind, const BinField field);
+      const char* kind, const BinASTField field);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseEmpty(
       const char* description);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseOOM();
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseError(
       const char* description);
   MOZ_MUST_USE mozilla::GenericErrorResult<JS::Error&> raiseError(
-      BinKind kind, const char* description);
+      BinASTKind kind, const char* description);
 
   // Ensure that this parser will never be used again.
   void poison();
 
   // The owner or the target of Asserted*Scope.
   enum class AssertedScopeKind {
     Block,
     Catch,
@@ -131,22 +131,23 @@ class BinASTParserPerTokenizer : public 
     Var,
   };
 
   // --- Auxiliary parsing functions
 
   // Build a function object for a function-producing production. Called AFTER
   // creating the scope.
   JS::Result<FunctionNode*> makeEmptyFunctionNode(const size_t start,
-                                                  const BinKind kind,
+                                                  const BinASTKind kind,
                                                   FunctionBox* funbox);
 
   JS::Result<FunctionNode*> buildFunction(const size_t start,
-                                          const BinKind kind, ParseNode* name,
-                                          ListNode* params, ParseNode* body);
+                                          const BinASTKind kind,
+                                          ParseNode* name, ListNode* params,
+                                          ParseNode* body);
   JS::Result<FunctionBox*> buildFunctionBox(GeneratorKind generatorKind,
                                             FunctionAsyncKind functionAsyncKind,
                                             FunctionSyntaxKind syntax,
                                             ParseNode* name);
 
   // Add name to a given scope.
   MOZ_MUST_USE JS::Result<Ok> addScopeName(
       AssertedScopeKind scopeKind, HandleAtom name, ParseContext::Scope* scope,
@@ -279,17 +280,17 @@ class BinASTParserPerTokenizer : public 
 
  protected:
   Rooted<LazyScript*> lazyScript_;
   FullParseHandler handler_;
 
   mozilla::Maybe<Tokenizer> tokenizer_;
   VariableDeclarationKind variableDeclarationKind_;
 
-  friend class BinParseContext;
+  friend class BinASTParseContext;
   friend class AutoVariableDeclarationKind;
 
   // Helper class: Restore field `variableDeclarationKind` upon leaving a scope.
   class MOZ_RAII AutoVariableDeclarationKind {
    public:
     explicit AutoVariableDeclarationKind(
         BinASTParserPerTokenizer<Tok>* parser MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
         : parser_(parser), kind(parser->variableDeclarationKind_) {
@@ -309,25 +310,25 @@ class BinASTParserPerTokenizer : public 
   // asFinalParser methods provide the access to BinASTParser class methods
   // of this instance.
   using FinalParser = BinASTParser<Tok>;
 
   inline FinalParser* asFinalParser();
   inline const FinalParser* asFinalParser() const;
 };
 
-class BinParseContext : public ParseContext {
+class BinASTParseContext : public ParseContext {
  public:
   template <typename Tok>
-  BinParseContext(JSContext* cx, BinASTParserPerTokenizer<Tok>* parser,
-                  SharedContext* sc, Directives* newDirectives)
+  BinASTParseContext(JSContext* cx, BinASTParserPerTokenizer<Tok>* parser,
+                     SharedContext* sc, Directives* newDirectives)
       : ParseContext(cx, parser->pc_, sc, *parser, parser->usedNames_,
                      newDirectives, /* isFull = */ true) {}
 };
 
 void TraceBinASTParser(JSTracer* trc, JS::AutoGCRooter* parser);
 
-extern template class BinASTParserPerTokenizer<BinTokenReaderMultipart>;
+extern template class BinASTParserPerTokenizer<BinASTTokenReaderMultipart>;
 
 }  // namespace frontend
 }  // namespace js
 
 #endif  // frontend_BinASTParserPerTokenizer_h
rename from js/src/frontend/BinSourceRuntimeSupport.cpp
rename to js/src/frontend/BinASTRuntimeSupport.cpp
--- a/js/src/frontend/BinSourceRuntimeSupport.cpp
+++ b/js/src/frontend/BinASTRuntimeSupport.cpp
@@ -1,37 +1,37 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "frontend/BinSourceRuntimeSupport.h"
+#include "frontend/BinASTRuntimeSupport.h"
 
 #include "gc/Tracer.h"
 #include "js/Vector.h"
 #include "vm/StringType.h"
 
 namespace js {
 namespace frontend {
 
 /* static */
 BinASTSourceMetadata* BinASTSourceMetadata::Create(
-    const Vector<BinKind>& binKinds, uint32_t numStrings) {
-  uint32_t numBinKinds = binKinds.length();
+    const Vector<BinASTKind>& binASTKinds, uint32_t numStrings) {
+  uint32_t numBinASTKinds = binASTKinds.length();
 
   BinASTSourceMetadata* data = static_cast<BinASTSourceMetadata*>(
-      js_malloc(BinASTSourceMetadata::totalSize(numBinKinds, numStrings)));
+      js_malloc(BinASTSourceMetadata::totalSize(numBinASTKinds, numStrings)));
   if (!data) {
     return nullptr;
   }
 
-  new (data) BinASTSourceMetadata(numBinKinds, numStrings);
-  memcpy(data->binKindBase(), binKinds.begin(),
-         binKinds.length() * sizeof(BinKind));
+  new (data) BinASTSourceMetadata(numBinASTKinds, numStrings);
+  memcpy(data->binASTKindBase(), binASTKinds.begin(),
+         binASTKinds.length() * sizeof(BinASTKind));
 
   return data;
 }
 
 void BinASTSourceMetadata::trace(JSTracer* tracer) {
   JSAtom** base = atomsBase();
   for (uint32_t i = 0; i < numStrings_; i++) {
     if (base[i]) {
rename from js/src/frontend/BinSourceRuntimeSupport.h
rename to js/src/frontend/BinASTRuntimeSupport.h
--- a/js/src/frontend/BinSourceRuntimeSupport.h
+++ b/js/src/frontend/BinASTRuntimeSupport.h
@@ -1,37 +1,37 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * 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 frontend_BinSourceSupport_h
-#define frontend_BinSourceSupport_h
+#ifndef frontend_BinASTSupport_h
+#define frontend_BinASTSupport_h
 
 #include "mozilla/HashFunctions.h"
 
-#include "frontend/BinToken.h"
+#include "frontend/BinASTToken.h"
 #include "gc/DeletePolicy.h"
 
 #include "js/AllocPolicy.h"
 #include "js/HashTable.h"
 #include "js/Result.h"
 #include "js/UniquePtr.h"
 #include "js/Vector.h"
 
 namespace js {
 
 class ScriptSource;
 
 // Support for parsing JS Binary ASTs.
 struct BinaryASTSupport {
-  using BinVariant = js::frontend::BinVariant;
-  using BinField = js::frontend::BinField;
-  using BinKind = js::frontend::BinKind;
+  using BinASTVariant = js::frontend::BinASTVariant;
+  using BinASTField = js::frontend::BinASTField;
+  using BinASTKind = js::frontend::BinASTKind;
 
   // A structure designed to perform fast char* + length lookup
   // without copies.
   struct CharSlice {
     const char* start_;
     uint32_t byteLen_;
     CharSlice(const CharSlice& other)
         : start_(other.start_), byteLen_(other.byteLen_) {}
@@ -59,84 +59,85 @@ struct BinaryASTSupport {
         return false;
       }
       return strncmp(key.start_, lookup.start_, key.byteLen_) == 0;
     }
   };
 
   BinaryASTSupport();
 
-  JS::Result<const BinVariant*> binVariant(JSContext*, const CharSlice);
-  JS::Result<const BinKind*> binKind(JSContext*, const CharSlice);
+  JS::Result<const BinASTVariant*> binASTVariant(JSContext*, const CharSlice);
+  JS::Result<const BinASTKind*> binASTKind(JSContext*, const CharSlice);
 
   bool ensureBinTablesInitialized(JSContext*);
 
  private:
-  bool ensureBinKindsInitialized(JSContext*);
-  bool ensureBinVariantsInitialized(JSContext*);
+  bool ensureBinASTKindsInitialized(JSContext*);
+  bool ensureBinASTVariantsInitialized(JSContext*);
 
  private:
   // A HashMap that can be queried without copies from a CharSlice key.
   // Initialized on first call. Keys are CharSlices into static strings.
-  using BinKindMap =
-      js::HashMap<const CharSlice, BinKind, CharSlice, js::SystemAllocPolicy>;
-  BinKindMap binKindMap_;
+  using BinASTKindMap = js::HashMap<const CharSlice, BinASTKind, CharSlice,
+                                    js::SystemAllocPolicy>;
+  BinASTKindMap binASTKindMap_;
 
-  using BinFieldMap =
-      js::HashMap<const CharSlice, BinField, CharSlice, js::SystemAllocPolicy>;
-  BinFieldMap binFieldMap_;
+  using BinASTFieldMap = js::HashMap<const CharSlice, BinASTField, CharSlice,
+                                     js::SystemAllocPolicy>;
+  BinASTFieldMap binASTFieldMap_;
 
-  using BinVariantMap = js::HashMap<const CharSlice, BinVariant, CharSlice,
-                                    js::SystemAllocPolicy>;
-  BinVariantMap binVariantMap_;
+  using BinASTVariantMap = js::HashMap<const CharSlice, BinASTVariant,
+                                       CharSlice, js::SystemAllocPolicy>;
+  BinASTVariantMap binASTVariantMap_;
 };
 
 namespace frontend {
 
 class BinASTSourceMetadata {
   using CharSlice = BinaryASTSupport::CharSlice;
 
   const uint32_t numStrings_;
-  const uint32_t numBinKinds_;
+  const uint32_t numBinASTKinds_;
 
   // The data lives inline in the allocation, after this class.
   inline JSAtom** atomsBase() {
     return reinterpret_cast<JSAtom**>(reinterpret_cast<uintptr_t>(this + 1));
   }
   inline CharSlice* sliceBase() {
     return reinterpret_cast<CharSlice*>(
         reinterpret_cast<uintptr_t>(atomsBase()) +
         numStrings_ * sizeof(JSAtom*));
   }
-  inline BinKind* binKindBase() {
-    return reinterpret_cast<BinKind*>(reinterpret_cast<uintptr_t>(sliceBase()) +
-                                      numStrings_ * sizeof(CharSlice));
+  inline BinASTKind* binASTKindBase() {
+    return reinterpret_cast<BinASTKind*>(
+        reinterpret_cast<uintptr_t>(sliceBase()) +
+        numStrings_ * sizeof(CharSlice));
   }
 
-  static inline size_t totalSize(uint32_t numBinKinds, uint32_t numStrings) {
+  static inline size_t totalSize(uint32_t numBinASTKinds, uint32_t numStrings) {
     return sizeof(BinASTSourceMetadata) + numStrings * sizeof(JSAtom*) +
-           numStrings * sizeof(CharSlice) + numBinKinds * sizeof(BinKind);
+           numStrings * sizeof(CharSlice) + numBinASTKinds * sizeof(BinASTKind);
   }
 
-  BinASTSourceMetadata(uint32_t numBinKinds, uint32_t numStrings)
-      : numStrings_(numStrings), numBinKinds_(numBinKinds) {}
+  BinASTSourceMetadata(uint32_t numBinASTKinds, uint32_t numStrings)
+      : numStrings_(numStrings), numBinASTKinds_(numBinASTKinds) {}
 
   friend class js::ScriptSource;
 
  public:
-  static BinASTSourceMetadata* Create(const Vector<BinKind>& binKinds,
+  static BinASTSourceMetadata* Create(const Vector<BinASTKind>& binASTKinds,
                                       uint32_t numStrings);
 
-  inline uint32_t numBinKinds() { return numBinKinds_; }
+  inline uint32_t numBinASTKinds() { return numBinASTKinds_; }
 
   inline uint32_t numStrings() { return numStrings_; }
 
-  inline BinKind& getBinKind(uint32_t index) {
-    MOZ_ASSERT(index < numBinKinds_);
-    return binKindBase()[index];
+  inline BinASTKind& getBinASTKind(uint32_t index) {
+    MOZ_ASSERT(index < numBinASTKinds_);
+    return binASTKindBase()[index];
   }
 
   inline CharSlice& getSlice(uint32_t index) {
     MOZ_ASSERT(index < numStrings_);
     return sliceBase()[index];
   }
 
   inline JSAtom*& getAtom(uint32_t index) {
@@ -150,9 +151,9 @@ class BinASTSourceMetadata {
 }  // namespace frontend
 
 typedef UniquePtr<frontend::BinASTSourceMetadata,
                   GCManagedDeletePolicy<frontend::BinASTSourceMetadata>>
     UniqueBinASTSourceMetadataPtr;
 
 }  // namespace js
 
-#endif  // frontend_BinSourceSupport_h
+#endif  // frontend_BinASTSupport_h
rename from js/src/frontend/BinToken.cpp
rename to js/src/frontend/BinASTToken.cpp
--- a/js/src/frontend/BinToken.cpp
+++ b/js/src/frontend/BinASTToken.cpp
@@ -1,153 +1,155 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "frontend/BinToken.h"
+#include "frontend/BinASTToken.h"
 
 #include "mozilla/Maybe.h"
 
 #include <sys/types.h>
 
-#include "frontend/BinSourceRuntimeSupport.h"
+#include "frontend/BinASTRuntimeSupport.h"
 #include "frontend/TokenStream.h"
 #include "js/Result.h"
 #include "vm/JSContext.h"
 
 namespace js {
 namespace frontend {
 
-const BinaryASTSupport::CharSlice BINKIND_DESCRIPTIONS[] = {
+const BinaryASTSupport::CharSlice BINASTKIND_DESCRIPTIONS[] = {
 #define WITH_VARIANT(_, SPEC_NAME) \
   BinaryASTSupport::CharSlice(SPEC_NAME, sizeof(SPEC_NAME) - 1),
     FOR_EACH_BIN_KIND(WITH_VARIANT)
 #undef WITH_VARIANT
 };
 
-const BinaryASTSupport::CharSlice BINFIELD_DESCRIPTIONS[] = {
+const BinaryASTSupport::CharSlice BINASTFIELD_DESCRIPTIONS[] = {
 #define WITH_VARIANT(_, SPEC_NAME) \
   BinaryASTSupport::CharSlice(SPEC_NAME, sizeof(SPEC_NAME) - 1),
     FOR_EACH_BIN_FIELD(WITH_VARIANT)
 #undef WITH_VARIANT
 };
 
-const BinaryASTSupport::CharSlice BINVARIANT_DESCRIPTIONS[] = {
+const BinaryASTSupport::CharSlice BINASTVARIANT_DESCRIPTIONS[] = {
 #define WITH_VARIANT(_, SPEC_NAME) \
   BinaryASTSupport::CharSlice(SPEC_NAME, sizeof(SPEC_NAME) - 1),
     FOR_EACH_BIN_VARIANT(WITH_VARIANT)
 #undef WITH_VARIANT
 };
 
-const BinaryASTSupport::CharSlice& getBinKind(const BinKind& variant) {
-  return BINKIND_DESCRIPTIONS[static_cast<size_t>(variant)];
+const BinaryASTSupport::CharSlice& getBinASTKind(const BinASTKind& variant) {
+  return BINASTKIND_DESCRIPTIONS[static_cast<size_t>(variant)];
 }
 
-const BinaryASTSupport::CharSlice& getBinVariant(const BinVariant& variant) {
-  return BINVARIANT_DESCRIPTIONS[static_cast<size_t>(variant)];
+const BinaryASTSupport::CharSlice& getBinASTVariant(
+    const BinASTVariant& variant) {
+  return BINASTVARIANT_DESCRIPTIONS[static_cast<size_t>(variant)];
 }
 
-const BinaryASTSupport::CharSlice& getBinField(const BinField& variant) {
-  return BINFIELD_DESCRIPTIONS[static_cast<size_t>(variant)];
+const BinaryASTSupport::CharSlice& getBinASTField(const BinASTField& variant) {
+  return BINASTFIELD_DESCRIPTIONS[static_cast<size_t>(variant)];
 }
 
-const char* describeBinKind(const BinKind& variant) {
-  return getBinKind(variant).begin();
+const char* describeBinASTKind(const BinASTKind& kind) {
+  return getBinASTKind(kind).begin();
 }
 
-const char* describeBinField(const BinField& variant) {
-  return getBinField(variant).begin();
+const char* describeBinASTField(const BinASTField& field) {
+  return getBinASTField(field).begin();
 }
 
-const char* describeBinVariant(const BinVariant& variant) {
-  return getBinVariant(variant).begin();
+const char* describeBinASTVariant(const BinASTVariant& variant) {
+  return getBinASTVariant(variant).begin();
 }
 
 }  // namespace frontend
 
 BinaryASTSupport::BinaryASTSupport()
-    : binKindMap_(frontend::BINKIND_LIMIT),
-      binFieldMap_(frontend::BINFIELD_LIMIT),
-      binVariantMap_(frontend::BINVARIANT_LIMIT) {}
+    : binASTKindMap_(frontend::BINASTKIND_LIMIT),
+      binASTFieldMap_(frontend::BINASTFIELD_LIMIT),
+      binASTVariantMap_(frontend::BINASTVARIANT_LIMIT) {}
 
 /**
  * It is expected that all bin tables are initialized on the main thread, and
  * that any helper threads will find the read-only tables properly initialized,
  * so that they can do their accesses safely without taking any locks.
  */
 bool BinaryASTSupport::ensureBinTablesInitialized(JSContext* cx) {
-  return ensureBinKindsInitialized(cx) && ensureBinVariantsInitialized(cx);
+  return ensureBinASTKindsInitialized(cx) &&
+         ensureBinASTVariantsInitialized(cx);
 }
 
-bool BinaryASTSupport::ensureBinKindsInitialized(JSContext* cx) {
+bool BinaryASTSupport::ensureBinASTKindsInitialized(JSContext* cx) {
   MOZ_ASSERT(!cx->helperThread());
-  if (binKindMap_.empty()) {
-    for (size_t i = 0; i < frontend::BINKIND_LIMIT; ++i) {
-      const BinKind variant = static_cast<BinKind>(i);
-      const CharSlice& key = getBinKind(variant);
-      auto ptr = binKindMap_.lookupForAdd(key);
+  if (binASTKindMap_.empty()) {
+    for (size_t i = 0; i < frontend::BINASTKIND_LIMIT; ++i) {
+      const BinASTKind variant = static_cast<BinASTKind>(i);
+      const CharSlice& key = getBinASTKind(variant);
+      auto ptr = binASTKindMap_.lookupForAdd(key);
       MOZ_ASSERT(!ptr);
-      if (!binKindMap_.add(ptr, key, variant)) {
+      if (!binASTKindMap_.add(ptr, key, variant)) {
         ReportOutOfMemory(cx);
         return false;
       }
     }
   }
 
   return true;
 }
 
-bool BinaryASTSupport::ensureBinVariantsInitialized(JSContext* cx) {
+bool BinaryASTSupport::ensureBinASTVariantsInitialized(JSContext* cx) {
   MOZ_ASSERT(!cx->helperThread());
-  if (binVariantMap_.empty()) {
-    for (size_t i = 0; i < frontend::BINVARIANT_LIMIT; ++i) {
-      const BinVariant variant = static_cast<BinVariant>(i);
-      const CharSlice& key = getBinVariant(variant);
-      auto ptr = binVariantMap_.lookupForAdd(key);
+  if (binASTVariantMap_.empty()) {
+    for (size_t i = 0; i < frontend::BINASTVARIANT_LIMIT; ++i) {
+      const BinASTVariant variant = static_cast<BinASTVariant>(i);
+      const CharSlice& key = getBinASTVariant(variant);
+      auto ptr = binASTVariantMap_.lookupForAdd(key);
       MOZ_ASSERT(!ptr);
-      if (!binVariantMap_.add(ptr, key, variant)) {
+      if (!binASTVariantMap_.add(ptr, key, variant)) {
         ReportOutOfMemory(cx);
         return false;
       }
     }
   }
   return true;
 }
 
-JS::Result<const js::frontend::BinKind*> BinaryASTSupport::binKind(
+JS::Result<const js::frontend::BinASTKind*> BinaryASTSupport::binASTKind(
     JSContext* cx, const CharSlice key) {
-  MOZ_ASSERT_IF(cx->helperThread(), !binKindMap_.empty());
+  MOZ_ASSERT_IF(cx->helperThread(), !binASTKindMap_.empty());
   if (!cx->helperThread()) {
     // Initialize Lazily if on main thread.
-    if (!ensureBinKindsInitialized(cx)) {
+    if (!ensureBinASTKindsInitialized(cx)) {
       return cx->alreadyReportedError();
     }
   }
 
-  auto ptr = binKindMap_.readonlyThreadsafeLookup(key);
+  auto ptr = binASTKindMap_.readonlyThreadsafeLookup(key);
   if (!ptr) {
     return nullptr;
   }
 
   return &ptr->value();
 }
 
-JS::Result<const js::frontend::BinVariant*> BinaryASTSupport::binVariant(
+JS::Result<const js::frontend::BinASTVariant*> BinaryASTSupport::binASTVariant(
     JSContext* cx, const CharSlice key) {
-  MOZ_ASSERT_IF(cx->helperThread(), !binVariantMap_.empty());
+  MOZ_ASSERT_IF(cx->helperThread(), !binASTVariantMap_.empty());
   if (!cx->helperThread()) {
     // Initialize lazily if on main thread.
-    if (!ensureBinVariantsInitialized(cx)) {
+    if (!ensureBinASTVariantsInitialized(cx)) {
       return cx->alreadyReportedError();
     }
   }
 
-  auto ptr = binVariantMap_.readonlyThreadsafeLookup(key);
+  auto ptr = binASTVariantMap_.readonlyThreadsafeLookup(key);
   if (!ptr) {
     return nullptr;
   }
 
   return &ptr->value();
 }
 
 }  // namespace js
rename from js/src/frontend/BinToken.h
rename to js/src/frontend/BinASTToken.h
--- a/js/src/frontend/BinToken.h
+++ b/js/src/frontend/BinASTToken.h
@@ -2,31 +2,31 @@
 // please DO NOT EDIT BY HAND.
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * 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/. */
 
 // To generate this file, see the documentation in
-// js/src/frontend/binsource/README.md.
+// js/src/frontend/binast/README.md.
 
-#ifndef frontend_BinToken_h
-#define frontend_BinToken_h
+#ifndef frontend_BinASTToken_h
+#define frontend_BinASTToken_h
 
 #include <stddef.h>
 
 /**
  * Definition of Binary AST tokens.
  *
  * In the Binary AST world, an AST is composed of nodes, where a node is
  * defined by:
- * - a Kind (see `BinKind`);
+ * - a Kind (see `BinASTKind`);
  * - a list of fields, where each field is:
- *    - a Name (see `BinField`);
+ *    - a Name (see `BinASTField`);
  *    - a Value, which may be either a node or a primitive value.
  *
  * The mapping between Kind and list of fields is determined entirely by
  * the grammar of Binary AST. The mapping between (Kind, Name) and the
  * structure of Value is also determined entirely by the grammar of
  * Binary AST.
  *
  * As per the specifications of Binary AST, kinds may be added as the
@@ -180,24 +180,24 @@ namespace frontend {
   F(UpdateExpression, "UpdateExpression")                                     \
   F(VariableDeclaration, "VariableDeclaration")                               \
   F(VariableDeclarator, "VariableDeclarator")                                 \
   F(WhileStatement, "WhileStatement")                                         \
   F(WithStatement, "WithStatement")                                           \
   F(YieldExpression, "YieldExpression")                                       \
   F(YieldStarExpression, "YieldStarExpression")
 
-enum class BinKind {
+enum class BinASTKind {
 #define EMIT_ENUM(name, _) name,
   FOR_EACH_BIN_KIND(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 
-// The number of distinct values of BinKind.
-const size_t BINKIND_LIMIT = 120;
+// The number of distinct values of BinASTKind.
+const size_t BINASTKIND_LIMIT = 120;
 
 /**
  * The different fields of Binary AST nodes, as per the specifications of
  * Binary AST.
  *
  * Usage:
  *
  * ```c++
@@ -273,24 +273,24 @@ const size_t BINKIND_LIMIT = 120;
   F(Scope, "scope")                                   \
   F(Statements, "statements")                         \
   F(Super, "super")                                   \
   F(Tag, "tag")                                       \
   F(Test, "test")                                     \
   F(Update, "update")                                 \
   F(Value, "value")
 
-enum class BinField {
+enum class BinASTField {
 #define EMIT_ENUM(name, _) name,
   FOR_EACH_BIN_FIELD(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 
-// The number of distinct values of BinField.
-const size_t BINFIELD_LIMIT = 69;
+// The number of distinct values of BinASTField.
+const size_t BINASTFIELD_LIMIT = 69;
 
 /**
  * The different variants of Binary AST string enums, as per
  * the specifications of Binary AST, as a single macro and
  * `enum class`.
  *
  * Separate enum classes are also defined in BinASTParser.h.
  *
@@ -349,36 +349,36 @@ const size_t BINFIELD_LIMIT = 69;
   F(UnaryOperatorNot, "!")                                    \
   F(UnaryOperatorTypeof, "typeof")                            \
   F(UnaryOperatorVoid, "void")                                \
   F(UpdateOperatorDecr, "--")                                 \
   F(UpdateOperatorIncr, "++")                                 \
   F(VariableDeclarationKindConst, "const")                    \
   F(VariableDeclarationKindLet, "let")
 
-enum class BinVariant {
+enum class BinASTVariant {
 #define EMIT_ENUM(name, _) name,
   FOR_EACH_BIN_VARIANT(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 
-// The number of distinct values of BinVariant.
-const size_t BINVARIANT_LIMIT = 49;
+// The number of distinct values of BinASTVariant.
+const size_t BINASTVARIANT_LIMIT = 49;
 
 /**
- * Return a string describing a `BinKind`.
+ * Return a string describing a `BinASTKind`.
  */
-const char* describeBinKind(const BinKind& kind);
+const char* describeBinASTKind(const BinASTKind& kind);
 
 /**
- * Return a string describing a `BinField`.
+ * Return a string describing a `BinASTField`.
  */
-const char* describeBinField(const BinField& kind);
+const char* describeBinASTField(const BinASTField& field);
 
 /**
- * Return a string describing a `BinVariant`.
+ * Return a string describing a `BinASTVariant`.
  */
-const char* describeBinVariant(const BinVariant& kind);
+const char* describeBinASTVariant(const BinASTVariant& variant);
 
 }  // namespace frontend
 }  // namespace js
 
-#endif  // frontend_BinToken_h
+#endif  // frontend_BinASTToken_h
rename from js/src/frontend/BinTokenReaderBase.cpp
rename to js/src/frontend/BinASTTokenReaderBase.cpp
--- a/js/src/frontend/BinTokenReaderBase.cpp
+++ b/js/src/frontend/BinASTTokenReaderBase.cpp
@@ -1,108 +1,108 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "frontend/BinTokenReaderBase.h"
+#include "frontend/BinASTTokenReaderBase.h"
 
-#include "frontend/BinSource-macros.h"
+#include "frontend/BinAST-macros.h"
 #include "js/Result.h"
 
 namespace js {
 namespace frontend {
 
 template <typename T>
 using ErrorResult = mozilla::GenericErrorResult<T>;
 
 // We use signalling NaN (which doesn't exist in the JS syntax)
 // to represent a `null` number.
 const uint64_t NULL_FLOAT_REPRESENTATION = 0x7FF0000000000001;
 
-void BinTokenReaderBase::updateLatestKnownGood() {
+void BinASTTokenReaderBase::updateLatestKnownGood() {
   MOZ_ASSERT(current_ >= start_);
   const size_t update = current_ - start_;
   MOZ_ASSERT(update >= latestKnownGoodPos_);
   latestKnownGoodPos_ = update;
 }
 
-ErrorResult<JS::Error&> BinTokenReaderBase::raiseError(
+ErrorResult<JS::Error&> BinASTTokenReaderBase::raiseError(
     const char* description) {
   MOZ_ASSERT(!hasRaisedError());
   errorReporter_->errorNoOffset(JSMSG_BINAST, description);
   return cx_->alreadyReportedError();
 }
 
-ErrorResult<JS::Error&> BinTokenReaderBase::raiseOOM() {
+ErrorResult<JS::Error&> BinASTTokenReaderBase::raiseOOM() {
   ReportOutOfMemory(cx_);
   return cx_->alreadyReportedError();
 }
 
-ErrorResult<JS::Error&> BinTokenReaderBase::raiseInvalidNumberOfFields(
-    const BinKind kind, const uint32_t expected, const uint32_t got) {
+ErrorResult<JS::Error&> BinASTTokenReaderBase::raiseInvalidNumberOfFields(
+    const BinASTKind kind, const uint32_t expected, const uint32_t got) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
   BINJS_TRY(out.printf("In %s, invalid number of fields: expected %u, got %u",
-                       describeBinKind(kind), expected, got));
+                       describeBinASTKind(kind), expected, got));
   return raiseError(out.string());
 }
 
-ErrorResult<JS::Error&> BinTokenReaderBase::raiseInvalidField(
-    const char* kind, const BinField field) {
+ErrorResult<JS::Error&> BinASTTokenReaderBase::raiseInvalidField(
+    const char* kind, const BinASTField field) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
-  BINJS_TRY(
-      out.printf("In %s, invalid field '%s'", kind, describeBinField(field)));
+  BINJS_TRY(out.printf("In %s, invalid field '%s'", kind,
+                       describeBinASTField(field)));
   return raiseError(out.string());
 }
 
-bool BinTokenReaderBase::hasRaisedError() const {
+bool BinASTTokenReaderBase::hasRaisedError() const {
   if (cx_->helperThread()) {
     // When performing off-main-thread parsing, we don't set a pending
     // exception but instead add a pending compile error.
     return cx_->isCompileErrorPending();
   }
 
   return cx_->isExceptionPending();
 }
 
-size_t BinTokenReaderBase::offset() const { return current_ - start_; }
+size_t BinASTTokenReaderBase::offset() const { return current_ - start_; }
 
-TokenPos BinTokenReaderBase::pos() { return pos(offset()); }
+TokenPos BinASTTokenReaderBase::pos() { return pos(offset()); }
 
-TokenPos BinTokenReaderBase::pos(size_t start) {
+TokenPos BinASTTokenReaderBase::pos(size_t start) {
   TokenPos pos;
   pos.begin = start;
   pos.end = current_ - start_;
   MOZ_ASSERT(pos.end >= pos.begin);
   return pos;
 }
 
-void BinTokenReaderBase::seek(size_t offset) {
+void BinASTTokenReaderBase::seek(size_t offset) {
   MOZ_ASSERT(start_ + offset >= start_ && start_ + offset < stop_);
   current_ = start_ + offset;
 }
 
-JS::Result<Ok> BinTokenReaderBase::readBuf(uint8_t* bytes, uint32_t len) {
+JS::Result<Ok> BinASTTokenReaderBase::readBuf(uint8_t* bytes, uint32_t len) {
   MOZ_ASSERT(!hasRaisedError());
   MOZ_ASSERT(len > 0);
 
   if (stop_ < current_ + len) {
     return raiseError("Buffer exceeds length");
   }
 
   for (uint32_t i = 0; i < len; ++i) {
     *bytes++ = *current_++;
   }
 
   return Ok();
 }
 
-JS::Result<uint8_t> BinTokenReaderBase::readByte() {
+JS::Result<uint8_t> BinASTTokenReaderBase::readByte() {
   uint8_t byte;
   MOZ_TRY(readBuf(&byte, 1));
   return byte;
 }
 
 }  // namespace frontend
 }  // namespace js
rename from js/src/frontend/BinTokenReaderBase.h
rename to js/src/frontend/BinASTTokenReaderBase.h
--- a/js/src/frontend/BinTokenReaderBase.h
+++ b/js/src/frontend/BinASTTokenReaderBase.h
@@ -1,31 +1,31 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * 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 frontend_BinTokenReaderBase_h
-#define frontend_BinTokenReaderBase_h
+#ifndef frontend_BinASTTokenReaderBase_h
+#define frontend_BinASTTokenReaderBase_h
 
-#include "frontend/BinToken.h"
+#include "frontend/BinASTToken.h"
 #include "frontend/ErrorReporter.h"
 #include "frontend/TokenStream.h"
 
 #include "js/Result.h"
 #include "js/TypeDecls.h"
 
 namespace js {
 namespace frontend {
 
 // A constant used by tokenizers to represent a null float.
 extern const uint64_t NULL_FLOAT_REPRESENTATION;
 
-class MOZ_STACK_CLASS BinTokenReaderBase {
+class MOZ_STACK_CLASS BinASTTokenReaderBase {
  public:
   template <typename T>
   using ErrorResult = mozilla::GenericErrorResult<T>;
 
   // The information needed to skip a subtree.
   class SkippableSubTree {
    public:
     SkippableSubTree(const size_t startOffset, const size_t length)
@@ -62,23 +62,23 @@ class MOZ_STACK_CLASS BinTokenReaderBase
   /**
    * Raise an error.
    *
    * Once `raiseError` has been called, the tokenizer is poisoned.
    */
   MOZ_MUST_USE ErrorResult<JS::Error&> raiseError(const char* description);
   MOZ_MUST_USE ErrorResult<JS::Error&> raiseOOM();
   MOZ_MUST_USE ErrorResult<JS::Error&> raiseInvalidNumberOfFields(
-      const BinKind kind, const uint32_t expected, const uint32_t got);
-  MOZ_MUST_USE ErrorResult<JS::Error&> raiseInvalidField(const char* kind,
-                                                         const BinField field);
+      const BinASTKind kind, const uint32_t expected, const uint32_t got);
+  MOZ_MUST_USE ErrorResult<JS::Error&> raiseInvalidField(
+      const char* kind, const BinASTField field);
 
  protected:
-  BinTokenReaderBase(JSContext* cx, ErrorReporter* er, const uint8_t* start,
-                     const size_t length)
+  BinASTTokenReaderBase(JSContext* cx, ErrorReporter* er, const uint8_t* start,
+                        const size_t length)
       : cx_(cx),
         errorReporter_(er),
         poisoned_(false),
         start_(start),
         current_(start),
         stop_(start + length),
         latestKnownGoodPos_(0) {
     MOZ_ASSERT(errorReporter_);
@@ -167,17 +167,17 @@ class MOZ_STACK_CLASS BinTokenReaderBase
 
   // The last+1 byte of the buffer.
   const uint8_t* stop_;
 
   // Latest known good position. Used for error reporting.
   size_t latestKnownGoodPos_;
 
  private:
-  BinTokenReaderBase(const BinTokenReaderBase&) = delete;
-  BinTokenReaderBase(BinTokenReaderBase&&) = delete;
-  BinTokenReaderBase& operator=(BinTokenReaderBase&) = delete;
+  BinASTTokenReaderBase(const BinASTTokenReaderBase&) = delete;
+  BinASTTokenReaderBase(BinASTTokenReaderBase&&) = delete;
+  BinASTTokenReaderBase& operator=(BinASTTokenReaderBase&) = delete;
 };
 
 }  // namespace frontend
 }  // namespace js
 
-#endif  // frontend_BinTokenReaderBase_h
+#endif  // frontend_BinASTTokenReaderBase_h
rename from js/src/frontend/BinTokenReaderMultipart.cpp
rename to js/src/frontend/BinASTTokenReaderMultipart.cpp
--- a/js/src/frontend/BinTokenReaderMultipart.cpp
+++ b/js/src/frontend/BinASTTokenReaderMultipart.cpp
@@ -1,26 +1,26 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "frontend/BinTokenReaderMultipart.h"
+#include "frontend/BinASTTokenReaderMultipart.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Casting.h"
 #include "mozilla/EndianUtils.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/ScopeExit.h"
 
 #include <utility>
 
-#include "frontend/BinSource-macros.h"
-#include "frontend/BinSourceRuntimeSupport.h"
+#include "frontend/BinAST-macros.h"
+#include "frontend/BinASTRuntimeSupport.h"
 #include "frontend/BytecodeCompiler.h" // IsIdentifier
 
 #include "js/Result.h"
 
 namespace js {
 namespace frontend {
 
 // The magic header, at the start of every binjs file.
@@ -35,52 +35,52 @@ const char SECTION_HEADER_TREE[] = "[TRE
 
 // The (only) internal compression mechanism understood by this parser.
 const char COMPRESSION_IDENTITY[] = "identity;";
 
 // The maximal number of distinct strings that may be declared in a
 // single file.
 const uint32_t MAX_NUMBER_OF_STRINGS = 32768;
 
-using AutoList = BinTokenReaderMultipart::AutoList;
-using AutoTaggedTuple = BinTokenReaderMultipart::AutoTaggedTuple;
+using AutoList = BinASTTokenReaderMultipart::AutoList;
+using AutoTaggedTuple = BinASTTokenReaderMultipart::AutoTaggedTuple;
 using CharSlice = BinaryASTSupport::CharSlice;
-using Chars = BinTokenReaderMultipart::Chars;
+using Chars = BinASTTokenReaderMultipart::Chars;
 
-BinTokenReaderMultipart::BinTokenReaderMultipart(JSContext* cx,
-                                                 ErrorReporter* er,
-                                                 const uint8_t* start,
-                                                 const size_t length)
-    : BinTokenReaderBase(cx, er, start, length),
+BinASTTokenReaderMultipart::BinASTTokenReaderMultipart(JSContext* cx,
+                                                       ErrorReporter* er,
+                                                       const uint8_t* start,
+                                                       const size_t length)
+    : BinASTTokenReaderBase(cx, er, start, length),
       metadata_(nullptr),
       posBeforeTree_(nullptr) {
   MOZ_ASSERT(er);
 }
 
-BinTokenReaderMultipart::~BinTokenReaderMultipart() {
+BinASTTokenReaderMultipart::~BinASTTokenReaderMultipart() {
   if (metadata_ && metadataOwned_ == MetadataOwnership::Owned) {
     UniqueBinASTSourceMetadataPtr ptr(metadata_);
   }
 }
 
-BinASTSourceMetadata* BinTokenReaderMultipart::takeMetadata() {
+BinASTSourceMetadata* BinASTTokenReaderMultipart::takeMetadata() {
   MOZ_ASSERT(metadataOwned_ == MetadataOwnership::Owned);
   metadataOwned_ = MetadataOwnership::Unowned;
   return metadata_;
 }
 
-JS::Result<Ok> BinTokenReaderMultipart::initFromScriptSource(
+JS::Result<Ok> BinASTTokenReaderMultipart::initFromScriptSource(
     ScriptSource* scriptSource) {
   metadata_ = scriptSource->binASTSourceMetadata();
   metadataOwned_ = MetadataOwnership::Unowned;
 
   return Ok();
 }
 
-JS::Result<Ok> BinTokenReaderMultipart::readHeader() {
+JS::Result<Ok> BinASTTokenReaderMultipart::readHeader() {
   // Check that we don't call this function twice.
   MOZ_ASSERT(!posBeforeTree_);
 
   // Read global headers.
   MOZ_TRY(readConst(MAGIC_HEADER));
   BINJS_MOZ_TRY_DECL(version, readInternalUint32());
 
   // For the moment, MAGIC_FORMAT_VERSION is 0. Once we have a story
@@ -98,39 +98,39 @@ JS::Result<Ok> BinTokenReaderMultipart::
   const auto posBeforeGrammar = current_;
 
   if (posBeforeGrammar + grammarByteLen > stop_ ||
       posBeforeGrammar + grammarByteLen < current_) {  // Sanity check.
     return raiseError("Invalid byte length in grammar table");
   }
 
   BINJS_MOZ_TRY_DECL(grammarNumberOfEntries, readInternalUint32());
-  if (grammarNumberOfEntries > BINKIND_LIMIT) {  // Sanity check.
+  if (grammarNumberOfEntries > BINASTKIND_LIMIT) {  // Sanity check.
     return raiseError("Invalid number of entries in grammar table");
   }
 
-  // This table maps BinKind index -> BinKind.
+  // This table maps BinASTKind index -> BinASTKind.
   // Initialize and populate.
-  Vector<BinKind> grammarTable_(cx_);
+  Vector<BinASTKind> grammarTable_(cx_);
   if (!grammarTable_.reserve(grammarNumberOfEntries)) {
     return raiseOOM();
   }
 
   for (uint32_t i = 0; i < grammarNumberOfEntries; ++i) {
     BINJS_MOZ_TRY_DECL(byteLen, readInternalUint32());
     if (current_ + byteLen > stop_) {
       return raiseError("Invalid byte length in grammar table");
     }
     if (current_ + byteLen < current_) {  // Overflow.
       return raiseError("Invalid byte length in grammar table");
     }
     CharSlice name((const char*)current_, byteLen);
     current_ += byteLen;
 
-    BINJS_MOZ_TRY_DECL(kind, cx_->runtime()->binast().binKind(cx_, name));
+    BINJS_MOZ_TRY_DECL(kind, cx_->runtime()->binast().binASTKind(cx_, name));
     if (!kind) {
       return raiseError("Invalid entry in grammar table");
     }
 
     grammarTable_.infallibleAppend(
         *kind);  // We called `reserve` before the loop.
   }
   if (current_ != grammarByteLen + posBeforeGrammar) {
@@ -210,23 +210,23 @@ JS::Result<Ok> BinTokenReaderMultipart::
       posBeforeTree_ + treeByteLen < posBeforeTree_) {  // Sanity check.
     return raiseError("Invalid byte length in tree table");
   }
 
   // At this stage, we're ready to start reading the tree.
   return Ok();
 }
 
-void BinTokenReaderMultipart::traceMetadata(JSTracer* trc) {
+void BinASTTokenReaderMultipart::traceMetadata(JSTracer* trc) {
   if (metadata_) {
     metadata_->trace(trc);
   }
 }
 
-JS::Result<bool> BinTokenReaderMultipart::readBool() {
+JS::Result<bool> BinASTTokenReaderMultipart::readBool() {
   updateLatestKnownGood();
   BINJS_MOZ_TRY_DECL(byte, readByte());
 
   switch (byte) {
     case 0:
       return false;
     case 1:
       return true;
@@ -236,17 +236,17 @@ JS::Result<bool> BinTokenReaderMultipart
       return raiseError("Invalid boolean value");
   }
 }
 
 // Nullable doubles (little-endian)
 //
 // NULL_FLOAT_REPRESENTATION (signaling NaN) => null
 // anything other 64 bit sequence => IEEE-764 64-bit floating point number
-JS::Result<double> BinTokenReaderMultipart::readDouble() {
+JS::Result<double> BinASTTokenReaderMultipart::readDouble() {
   updateLatestKnownGood();
 
   uint8_t bytes[8];
   MOZ_ASSERT(sizeof(bytes) == sizeof(double));
   MOZ_TRY(
       readBuf(reinterpret_cast<uint8_t*>(bytes), mozilla::ArrayLength(bytes)));
 
   // Decode little-endian.
@@ -257,75 +257,75 @@ JS::Result<double> BinTokenReaderMultipa
   }
 
   // Canonicalize NaN, just to make sure another form of signalling NaN
   // doesn't slip past us.
   return JS::CanonicalizeNaN(mozilla::BitwiseCast<double>(asInt));
 }
 
 // A single atom is represented as an index into the table of strings.
-JS::Result<JSAtom*> BinTokenReaderMultipart::readMaybeAtom() {
+JS::Result<JSAtom*> BinASTTokenReaderMultipart::readMaybeAtom() {
   updateLatestKnownGood();
   BINJS_MOZ_TRY_DECL(index, readInternalUint32());
 
   if (index >= metadata_->numStrings()) {
     return raiseError("Invalid index to strings table");
   }
   return metadata_->getAtom(index);
 }
 
-JS::Result<JSAtom*> BinTokenReaderMultipart::readAtom() {
+JS::Result<JSAtom*> BinASTTokenReaderMultipart::readAtom() {
   BINJS_MOZ_TRY_DECL(maybe, readMaybeAtom());
 
   if (!maybe) {
     return raiseError("Empty string");
   }
 
   return maybe;
 }
 
-JS::Result<JSAtom*> BinTokenReaderMultipart::readMaybeIdentifierName() {
+JS::Result<JSAtom*> BinASTTokenReaderMultipart::readMaybeIdentifierName() {
   BINJS_MOZ_TRY_DECL(result, readMaybeAtom());
   if (result) {
     if (!IsIdentifier(result)) {
       return raiseError("Invalid identifier");
     }
   }
   return result;
 }
 
-JS::Result<JSAtom*> BinTokenReaderMultipart::readIdentifierName() {
+JS::Result<JSAtom*> BinASTTokenReaderMultipart::readIdentifierName() {
   BINJS_MOZ_TRY_DECL(result, readMaybeAtom());
   if (!IsIdentifier(result)) {
     return raiseError("Invalid identifier");
   }
   return result;
 }
 
-JS::Result<JSAtom*> BinTokenReaderMultipart::readMaybePropertyKey() {
+JS::Result<JSAtom*> BinASTTokenReaderMultipart::readMaybePropertyKey() {
   return readMaybeAtom();
 }
 
-JS::Result<JSAtom*> BinTokenReaderMultipart::readPropertyKey() {
+JS::Result<JSAtom*> BinASTTokenReaderMultipart::readPropertyKey() {
   return readAtom();
 }
 
-JS::Result<Ok> BinTokenReaderMultipart::readChars(Chars& out) {
+JS::Result<Ok> BinASTTokenReaderMultipart::readChars(Chars& out) {
   updateLatestKnownGood();
   BINJS_MOZ_TRY_DECL(index, readInternalUint32());
 
   if (index >= metadata_->numStrings()) {
     return raiseError("Invalid index to strings table for string enum");
   }
 
   out = metadata_->getSlice(index);
   return Ok();
 }
 
-JS::Result<BinVariant> BinTokenReaderMultipart::readVariant() {
+JS::Result<BinASTVariant> BinASTTokenReaderMultipart::readVariant() {
   updateLatestKnownGood();
   BINJS_MOZ_TRY_DECL(index, readInternalUint32());
 
   if (index >= metadata_->numStrings()) {
     return raiseError("Invalid index to strings table for string enum");
   }
 
   auto variantsPtr = variantsTable_.lookupForAdd(index);
@@ -335,122 +335,126 @@ JS::Result<BinVariant> BinTokenReaderMul
 
   // Either we haven't cached the result yet or this is not a variant.
   // Check in the slices table and, in case of success, cache the result.
 
   // Note that we stop parsing if we attempt to readVariant() with an
   // ill-formed variant, so we don't run the risk of feching an ill-variant
   // more than once.
   Chars slice = metadata_->getSlice(index);  // We have checked `index` above.
-  BINJS_MOZ_TRY_DECL(variant, cx_->runtime()->binast().binVariant(cx_, slice));
+  BINJS_MOZ_TRY_DECL(variant,
+                     cx_->runtime()->binast().binASTVariant(cx_, slice));
 
   if (!variant) {
     return raiseError("Invalid string enum variant");
   }
 
   if (!variantsTable_.add(variantsPtr, index, *variant)) {
     return raiseOOM();
   }
 
   return *variant;
 }
 
-JS::Result<BinTokenReaderBase::SkippableSubTree>
-BinTokenReaderMultipart::readSkippableSubTree() {
+JS::Result<BinASTTokenReaderBase::SkippableSubTree>
+BinASTTokenReaderMultipart::readSkippableSubTree() {
   updateLatestKnownGood();
   BINJS_MOZ_TRY_DECL(byteLen, readInternalUint32());
 
   if (current_ + byteLen > stop_ || current_ + byteLen < current_) {
     return raiseError("Invalid byte length in readSkippableSubTree");
   }
 
   const auto start = offset();
 
   current_ += byteLen;
 
-  return BinTokenReaderBase::SkippableSubTree(start, byteLen);
+  return BinASTTokenReaderBase::SkippableSubTree(start, byteLen);
 }
 
 // Tagged tuples:
 // - uint32_t index in table [grammar];
 // - content (specified by the higher-level grammar);
-JS::Result<Ok> BinTokenReaderMultipart::enterTaggedTuple(
-    BinKind& tag, BinTokenReaderMultipart::BinFields&, AutoTaggedTuple& guard) {
+JS::Result<Ok> BinASTTokenReaderMultipart::enterTaggedTuple(
+    BinASTKind& tag, BinASTTokenReaderMultipart::BinASTFields&,
+    AutoTaggedTuple& guard) {
   BINJS_MOZ_TRY_DECL(index, readInternalUint32());
-  if (index >= metadata_->numBinKinds()) {
+  if (index >= metadata_->numBinASTKinds()) {
     return raiseError("Invalid index to grammar table");
   }
 
-  tag = metadata_->getBinKind(index);
+  tag = metadata_->getBinASTKind(index);
 
   // Enter the body.
   guard.init();
   return Ok();
 }
 
 // List:
 //
 // - uint32_t number of items;
 // - contents (specified by higher-level grammar);
 //
 // The total byte length of `number of items` + `contents` must be `byte
 // length`.
-JS::Result<Ok> BinTokenReaderMultipart::enterList(uint32_t& items,
-                                                  AutoList& guard) {
+JS::Result<Ok> BinASTTokenReaderMultipart::enterList(uint32_t& items,
+                                                     AutoList& guard) {
   guard.init();
 
   MOZ_TRY_VAR(items, readInternalUint32());
 
   return Ok();
 }
 
-void BinTokenReaderMultipart::AutoBase::init() { initialized_ = true; }
+void BinASTTokenReaderMultipart::AutoBase::init() { initialized_ = true; }
 
-BinTokenReaderMultipart::AutoBase::AutoBase(BinTokenReaderMultipart& reader)
+BinASTTokenReaderMultipart::AutoBase::AutoBase(
+    BinASTTokenReaderMultipart& reader)
     : initialized_(false), reader_(reader) {}
 
-BinTokenReaderMultipart::AutoBase::~AutoBase() {
+BinASTTokenReaderMultipart::AutoBase::~AutoBase() {
   // By now, the `AutoBase` must have been deinitialized by calling `done()`.
   // The only case in which we can accept not calling `done()` is if we have
   // bailed out because of an error.
   MOZ_ASSERT_IF(initialized_, reader_.hasRaisedError());
 }
 
-JS::Result<Ok> BinTokenReaderMultipart::AutoBase::checkPosition(
+JS::Result<Ok> BinASTTokenReaderMultipart::AutoBase::checkPosition(
     const uint8_t* expectedEnd) {
   if (reader_.current_ != expectedEnd) {
     return reader_.raiseError(
         "Caller did not consume the expected set of bytes");
   }
 
   return Ok();
 }
 
-BinTokenReaderMultipart::AutoList::AutoList(BinTokenReaderMultipart& reader)
+BinASTTokenReaderMultipart::AutoList::AutoList(
+    BinASTTokenReaderMultipart& reader)
     : AutoBase(reader) {}
 
-void BinTokenReaderMultipart::AutoList::init() { AutoBase::init(); }
+void BinASTTokenReaderMultipart::AutoList::init() { AutoBase::init(); }
 
-JS::Result<Ok> BinTokenReaderMultipart::AutoList::done() {
+JS::Result<Ok> BinASTTokenReaderMultipart::AutoList::done() {
   MOZ_ASSERT(initialized_);
   initialized_ = false;
   if (reader_.hasRaisedError()) {
     // Already errored, no need to check further.
     return reader_.cx_->alreadyReportedError();
   }
 
   return Ok();
 }
 
 // Internal uint32_t
 //
 // Encoded as variable length number.
 
 MOZ_MUST_USE JS::Result<uint32_t>
-BinTokenReaderMultipart::readInternalUint32() {
+BinASTTokenReaderMultipart::readInternalUint32() {
   uint32_t result = 0;
   uint32_t shift = 0;
   while (true) {
     MOZ_ASSERT(shift < 32);
     uint32_t byte;
     MOZ_TRY_VAR(byte, readByte());
 
     const uint32_t newResult = result | (byte >> 1) << shift;
@@ -466,21 +470,21 @@ BinTokenReaderMultipart::readInternalUin
     }
 
     if (shift >= 32) {
       return raiseError("Overflow during readInternalUint32");
     }
   }
 }
 
-BinTokenReaderMultipart::AutoTaggedTuple::AutoTaggedTuple(
-    BinTokenReaderMultipart& reader)
+BinASTTokenReaderMultipart::AutoTaggedTuple::AutoTaggedTuple(
+    BinASTTokenReaderMultipart& reader)
     : AutoBase(reader) {}
 
-JS::Result<Ok> BinTokenReaderMultipart::AutoTaggedTuple::done() {
+JS::Result<Ok> BinASTTokenReaderMultipart::AutoTaggedTuple::done() {
   MOZ_ASSERT(initialized_);
   initialized_ = false;
   if (reader_.hasRaisedError()) {
     // Already errored, no need to check further.
     return reader_.cx_->alreadyReportedError();
   }
 
   return Ok();
rename from js/src/frontend/BinTokenReaderMultipart.h
rename to js/src/frontend/BinASTTokenReaderMultipart.h
--- a/js/src/frontend/BinTokenReaderMultipart.h
+++ b/js/src/frontend/BinASTTokenReaderMultipart.h
@@ -1,22 +1,22 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * 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 frontend_BinTokenReaderMultipart_h
-#define frontend_BinTokenReaderMultipart_h
+#ifndef frontend_BinASTTokenReaderMultipart_h
+#define frontend_BinASTTokenReaderMultipart_h
 
 #include "mozilla/Maybe.h"
 
-#include "frontend/BinSourceRuntimeSupport.h"
-#include "frontend/BinToken.h"
-#include "frontend/BinTokenReaderBase.h"
+#include "frontend/BinASTRuntimeSupport.h"
+#include "frontend/BinASTToken.h"
+#include "frontend/BinASTTokenReaderBase.h"
 
 #include "js/Result.h"
 
 namespace js {
 namespace frontend {
 
 /**
  * A token reader implementing the "multipart" serialization format for BinAST.
@@ -25,49 +25,50 @@ namespace frontend {
  * implementation of the BinAST compression suite, is designed to be
  * space- and time-efficient.
  *
  * As other token readers for the BinAST:
  *
  * - the reader does not support error recovery;
  * - the reader does not support lookahead or pushback.
  */
-class MOZ_STACK_CLASS BinTokenReaderMultipart : public BinTokenReaderBase {
+class MOZ_STACK_CLASS BinASTTokenReaderMultipart
+    : public BinASTTokenReaderBase {
  public:
   class AutoList;
   class AutoTaggedTuple;
 
   using CharSlice = BinaryASTSupport::CharSlice;
 
-  // This implementation of `BinFields` is effectively `void`, as the format
+  // This implementation of `BinASTFields` is effectively `void`, as the format
   // does not embed field information.
-  class BinFields {
+  class BinASTFields {
    public:
-    explicit BinFields(JSContext*) {}
+    explicit BinASTFields(JSContext*) {}
   };
   using Chars = CharSlice;
 
  public:
   /**
    * Construct a token reader.
    *
    * Does NOT copy the buffer.
    */
-  BinTokenReaderMultipart(JSContext* cx, ErrorReporter* er,
-                          const uint8_t* start, const size_t length);
+  BinASTTokenReaderMultipart(JSContext* cx, ErrorReporter* er,
+                             const uint8_t* start, const size_t length);
 
   /**
    * Construct a token reader.
    *
    * Does NOT copy the buffer.
    */
-  BinTokenReaderMultipart(JSContext* cx, ErrorReporter* er,
-                          const Vector<uint8_t>& chars);
+  BinASTTokenReaderMultipart(JSContext* cx, ErrorReporter* er,
+                             const Vector<uint8_t>& chars);
 
-  ~BinTokenReaderMultipart();
+  ~BinASTTokenReaderMultipart();
 
   /**
    * Read the header of the file.
    */
   MOZ_MUST_USE JS::Result<Ok> readHeader();
 
   // --- Primitive values.
   //
@@ -112,20 +113,20 @@ class MOZ_STACK_CLASS BinTokenReaderMult
   /**
    * Read a single `string | null` value.
    *
    * MAY check if that string is not valid UTF-8.
    */
   MOZ_MUST_USE JS::Result<Ok> readChars(Chars&);
 
   /**
-   * Read a single `BinVariant | null` value.
+   * Read a single `BinASTVariant | null` value.
    */
-  MOZ_MUST_USE JS::Result<mozilla::Maybe<BinVariant>> readMaybeVariant();
-  MOZ_MUST_USE JS::Result<BinVariant> readVariant();
+  MOZ_MUST_USE JS::Result<mozilla::Maybe<BinASTVariant>> readMaybeVariant();
+  MOZ_MUST_USE JS::Result<BinASTVariant> readVariant();
 
   /**
    * Read over a single `[Skippable]` subtree value.
    *
    * This does *not* attempt to parse the subtree itself. Rather, the
    * returned `SkippableSubTree` contains the necessary information
    * to parse/tokenize the subtree at a later stage
    */
@@ -165,47 +166,48 @@ class MOZ_STACK_CLASS BinTokenReaderMult
    * exactly all the bytes from that tuple. The `guard` MUST therefore be
    * destroyed at the point where the caller has reached the end of the tuple.
    * If the caller has consumed too few/too many bytes, this will be reported
    * in the call go `guard.done()`.
    *
    * @return out If the header of the tuple is invalid.
    */
   MOZ_MUST_USE JS::Result<Ok> enterTaggedTuple(
-      BinKind& tag, BinTokenReaderMultipart::BinFields& fields,
+      BinASTKind& tag, BinASTTokenReaderMultipart::BinASTFields& fields,
       AutoTaggedTuple& guard);
 
   /**
    * Read a single unsigned long.
    */
   MOZ_MUST_USE JS::Result<uint32_t> readUnsignedLong() {
     return readInternalUint32();
   }
 
  private:
   /**
    * Read a single uint32_t.
    */
   MOZ_MUST_USE JS::Result<uint32_t> readInternalUint32();
 
  private:
-  // A mapping string index => BinVariant as extracted from the [STRINGS]
+  // A mapping string index => BinASTVariant as extracted from the [STRINGS]
   // section of the file. Populated lazily.
-  js::HashMap<uint32_t, BinVariant, DefaultHasher<uint32_t>, SystemAllocPolicy>
+  js::HashMap<uint32_t, BinASTVariant, DefaultHasher<uint32_t>,
+              SystemAllocPolicy>
       variantsTable_;
 
   enum class MetadataOwnership { Owned, Unowned };
-  MetadataOwnership metadataOwned_;
+  MetadataOwnership metadataOwned_ = MetadataOwnership::Owned;
   BinASTSourceMetadata* metadata_;
 
   const uint8_t* posBeforeTree_;
 
-  BinTokenReaderMultipart(const BinTokenReaderMultipart&) = delete;
-  BinTokenReaderMultipart(BinTokenReaderMultipart&&) = delete;
-  BinTokenReaderMultipart& operator=(BinTokenReaderMultipart&) = delete;
+  BinASTTokenReaderMultipart(const BinASTTokenReaderMultipart&) = delete;
+  BinASTTokenReaderMultipart(BinASTTokenReaderMultipart&&) = delete;
+  BinASTTokenReaderMultipart& operator=(BinASTTokenReaderMultipart&) = delete;
 
  public:
   void traceMetadata(JSTracer* trc);
   BinASTSourceMetadata* takeMetadata();
   MOZ_MUST_USE JS::Result<Ok> initFromScriptSource(ScriptSource* scriptSource);
 
  public:
   // The following classes are used whenever we encounter a tuple/tagged
@@ -219,48 +221,48 @@ class MOZ_STACK_CLASS BinTokenReaderMult
   //
   // In either case, the caller MUST call method `done()` of the guard once
   // it is done reading the tuple/tagged tuple/list, to report any pending
   // error.
 
   // Base class used by other Auto* classes.
   class MOZ_STACK_CLASS AutoBase {
    protected:
-    explicit AutoBase(BinTokenReaderMultipart& reader);
+    explicit AutoBase(BinASTTokenReaderMultipart& reader);
     ~AutoBase();
 
     // Raise an error if we are not in the expected position.
     MOZ_MUST_USE JS::Result<Ok> checkPosition(const uint8_t* expectedPosition);
 
-    friend BinTokenReaderMultipart;
+    friend BinASTTokenReaderMultipart;
     void init();
 
     // Set to `true` if `init()` has been called. Reset to `false` once
     // all conditions have been checked.
     bool initialized_;
-    BinTokenReaderMultipart& reader_;
+    BinASTTokenReaderMultipart& reader_;
   };
 
   // Guard class used to ensure that `enterList` is used properly.
   class MOZ_STACK_CLASS AutoList : public AutoBase {
    public:
-    explicit AutoList(BinTokenReaderMultipart& reader);
+    explicit AutoList(BinASTTokenReaderMultipart& reader);
 
     // Check that we have properly read to the end of the list.
     MOZ_MUST_USE JS::Result<Ok> done();
 
    protected:
-    friend BinTokenReaderMultipart;
+    friend BinASTTokenReaderMultipart;
     void init();
   };
 
   // Guard class used to ensure that `enterTaggedTuple` is used properly.
   class MOZ_STACK_CLASS AutoTaggedTuple : public AutoBase {
    public:
-    explicit AutoTaggedTuple(BinTokenReaderMultipart& reader);
+    explicit AutoTaggedTuple(BinASTTokenReaderMultipart& reader);
 
     // Check that we have properly read to the end of the tuple.
     MOZ_MUST_USE JS::Result<Ok> done();
   };
 
   // Compare a `Chars` and a string literal (ONLY a string literal).
   template <size_t N>
   static bool equals(const Chars& left, const char (&right)[N]) {
@@ -273,26 +275,26 @@ class MOZ_STACK_CLASS BinTokenReaderMult
     if (!std::equal(left.start_, left.start_ + left.byteLen_, right)) {
       return false;
     }
 
     return true;
   }
 
   template <size_t N>
-  static JS::Result<Ok, JS::Error&> checkFields(const BinKind kind,
-                                                const BinFields& actual,
-                                                const BinField (&expected)[N]) {
+  static JS::Result<Ok, JS::Error&> checkFields(
+      const BinASTKind kind, const BinASTFields& actual,
+      const BinASTField (&expected)[N]) {
     // Not implemented in this tokenizer.
     return Ok();
   }
 
-  static JS::Result<Ok, JS::Error&> checkFields0(const BinKind kind,
-                                                 const BinFields& actual) {
+  static JS::Result<Ok, JS::Error&> checkFields0(const BinASTKind kind,
+                                                 const BinASTFields& actual) {
     // Not implemented in this tokenizer.
     return Ok();
   }
 };
 
 }  // namespace frontend
 }  // namespace js
 
-#endif  // frontend_BinTokenReaderMultipart_h
+#endif  // frontend_BinASTTokenReaderMultipart_h
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -761,18 +761,18 @@ JSScript* frontend::CompileGlobalBinASTS
   if (!script) {
     return nullptr;
   }
 
   Directives directives(options.strictOption);
   GlobalSharedContext globalsc(cx, ScopeKind::Global, directives,
                                options.extraWarningsOption);
 
-  frontend::BinASTParser<BinTokenReaderMultipart> parser(cx, alloc, usedNames,
-                                                         options, sourceObj);
+  frontend::BinASTParser<BinASTTokenReaderMultipart> parser(
+      cx, alloc, usedNames, options, sourceObj);
 
   // Metadata stores internal pointers, so we must use the same buffer every
   // time, including for lazy parses
   ScriptSource* ss = sourceObj->source();
   BinASTSourceMetadata* metadata = nullptr;
   auto parsed =
       parser.parse(&globalsc, ss->binASTSource(), ss->length(), &metadata);
 
@@ -1052,17 +1052,17 @@ bool frontend::CompileLazyBinASTFunction
   if (!script) {
     return false;
   }
 
   if (lazy->hasBeenCloned()) {
     script->setHasBeenCloned();
   }
 
-  frontend::BinASTParser<BinTokenReaderMultipart> parser(
+  frontend::BinASTParser<BinASTTokenReaderMultipart> parser(
       cx, cx->tempLifoAlloc(), usedNames, options, sourceObj, lazy);
 
   auto parsed =
       parser.parseLazyFunction(lazy->scriptSource(), lazy->sourceStart());
 
   if (parsed.isErr()) {
     return false;
   }
--- a/js/src/frontend/BytecodeCompiler.h
+++ b/js/src/frontend/BytecodeCompiler.h
@@ -55,17 +55,17 @@
  * ParseContext.h: class UsedNameTracker: Track which bindings are used in which
  * scopes. This helps determine which bindings are closed-over, which affects
  * how they're stored; and whether special bindings like `this` and `arguments`
  * can be optimized away.
  *
  * ParseContext.h: class ParseContext: Extremely complex class that serves a lot
  * of purposes, but it's a single class - essentially no derived classes - so
  * it's a little easier to comprehend all at once. (SourceParseContext and
- * BinParseContext do derive from ParseContext, but they do nothing except
+ * BinASTParseContext do derive from ParseContext, but they do nothing except
  * adjust the constructor's arguments).
  * Note it uses a thing called Nestable, which implements a stack of objects:
  * you can push (and pop) instances to a stack (linked list) as you parse
  * further into the parse tree. You may push to this stack via calling the
  * constructor with a GeneralParser as an argument (usually `this`), which
  * pushes itself onto `this->pc` (so it does get assigned/pushed, even though no
  * assignment ever appears directly in the parser)
  *
rename from js/src/frontend/binsource/Cargo.toml
rename to js/src/frontend/binast/Cargo.toml
--- a/js/src/frontend/binsource/Cargo.toml
+++ b/js/src/frontend/binast/Cargo.toml
@@ -9,10 +9,10 @@ binjs_meta = "^0.4.3"
 clap = "^2"
 env_logger = "^0.5.6"
 itertools = "^0.7.6"
 log = "0.4"
 yaml-rust = "^0.4.2"
 webidl = "^0.8"
 
 [[bin]]
-name = "binsource"
+name = "binast"
 path = "src/main.rs"
rename from js/src/frontend/binsource/README.md
rename to js/src/frontend/binast/README.md
--- a/js/src/frontend/binsource/README.md
+++ b/js/src/frontend/binast/README.md
@@ -1,16 +1,16 @@
 A parser generator used to generate the following files:
 
-- js/src/frontend/BinSource-auto.h
-- js/src/frontend/BinSource-auto.cpp
-- js/src/frontent/BinToken.h
+- js/src/frontend/BinASTParser.h
+- js/src/frontend/BinASTParser.cpp
+- js/src/frontent/BinASTToken.h
 
 from the following files:
 
-- js/src/frontend/BinSource.webidl_ (specifications of BinAST)
-- js/src/frontend/BinSource.yaml (parser generator driver)
+- js/src/frontend/BinAST.webidl_ (specifications of BinAST)
+- js/src/frontend/BinAST.yaml (parser generator driver)
 
 To use it:
 ```sh
-$ cd $(topsrcdir)/js/src/frontend/binsource
+$ cd $(topsrcdir)/js/src/frontend/binast
 % ./build.sh
 ```
rename from js/src/frontend/binsource/build.sh
rename to js/src/frontend/binast/build.sh
--- a/js/src/frontend/binsource/build.sh
+++ b/js/src/frontend/binast/build.sh
@@ -1,25 +1,25 @@
 #!/bin/sh
 
 cargo run -- \
-      ../BinSource.webidl_ \
-      ../BinSource.yaml \
+      ../BinAST.webidl_ \
+      ../BinAST.yaml \
       --out-class ../BinASTParser-tmp.h    \
       --out-impl ../BinASTParser-tmp.cpp   \
       --out-enum ../BinASTEnum-tmp.h    \
-      --out-token ../BinToken-tmp.h
+      --out-token ../BinASTToken-tmp.h
 
 MACH=../../../../mach
 
 ${MACH} clang-format --path \
         ../BinASTParser-tmp.h \
         ../BinASTParser-tmp.cpp \
         ../BinASTEnum-tmp.h \
-        ../BinToken-tmp.h
+        ../BinASTToken-tmp.h
 
 # Usage: update SRC DST
 #
 # If SRC file and DST file have different content, move SRC file to DST file.
 # If not, remove SRC file.
 update() {
   SRC=$1
   DST=$2
@@ -31,9 +31,9 @@ update() {
       echo "UPDATED: ${DST} was modified"
       mv ${SRC} ${DST}
   fi
 }
 
 update ../BinASTParser-tmp.h ../BinASTParser.h
 update ../BinASTParser-tmp.cpp ../BinASTParser.cpp
 update ../BinASTEnum-tmp.h ../BinASTEnum.h
-update ../BinToken-tmp.h ../BinToken.h
+update ../BinASTToken-tmp.h ../BinASTToken.h
rename from js/src/frontend/binsource/moz.build
rename to js/src/frontend/binast/moz.build
--- a/js/src/frontend/binsource/moz.build
+++ b/js/src/frontend/binast/moz.build
@@ -1,7 +1,7 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
-HOST_RUST_PROGRAMS += ['binsource']
+HOST_RUST_PROGRAMS += ['binast']
rename from js/src/frontend/binsource/src/main.rs
rename to js/src/frontend/binast/src/main.rs
--- a/js/src/frontend/binsource/src/main.rs
+++ b/js/src/frontend/binast/src/main.rs
@@ -157,23 +157,23 @@ struct GlobalRules {
     /// Header to add at the start of the .hpp file.
     /// defining the tokens.
     hpp_tokens_header: Option<String>,
 
     /// Footer to add at the start of the .hpp file.
     /// defining the tokens.
     hpp_tokens_footer: Option<String>,
 
-    /// Documentation for the `BinKind` class enum.
+    /// Documentation for the `BinASTKind` class enum.
     hpp_tokens_kind_doc: Option<String>,
 
-    /// Documentation for the `BinField` class enum.
+    /// Documentation for the `BinASTField` class enum.
     hpp_tokens_field_doc: Option<String>,
 
-    /// Documentation for the `BinVariant` class enum.
+    /// Documentation for the `BinASTVariant` class enum.
     hpp_tokens_variants_doc: Option<String>,
 
     /// Per-node rules.
     per_node: HashMap<NodeName, NodeRules>,
 }
 impl GlobalRules {
     fn new(syntax: &Spec, yaml: &yaml_rust::yaml::Yaml) -> Self {
         let rules = yaml.as_hash()
@@ -527,17 +527,17 @@ enum MethodCallKind {
     Var,
 
     /// Always use MOZ_TRY_VAR regardless of the result type.
     AlwaysVar,
 }
 
 /// Fixed parameter of interface method.
 const INTERFACE_PARAMS: &str =
-    "const size_t start, const BinKind kind, const BinFields& fields";
+    "const size_t start, const BinASTKind kind, const BinASTFields& fields";
 
 /// Fixed arguments of interface method.
 const INTERFACE_ARGS: &str =
     "start, kind, fields";
 
 /// The name of the toplevel interface for the script.
 const TOPLEVEL_INTERFACE: &str =
     "Program";
@@ -555,17 +555,17 @@ struct CPPExporter {
 
     /// All parsers of lists.
     list_parsers_to_generate: Vec<ListParserData>,
 
     /// All parsers of options.
     option_parsers_to_generate: Vec<OptionParserData>,
 
     /// A mapping from symbol (e.g. `+`, `-`, `instanceof`, ...) to the
-    /// name of the symbol as part of `enum class BinVariant`
+    /// name of the symbol as part of `enum class BinASTVariant`
     /// (e.g. `UnaryOperatorDelete`).
     variants_by_symbol: HashMap<String, String>,
 
     // A map from enum class names to the type.
     enum_types: HashMap<NodeName, Rc<String>>,
 }
 
 impl CPPExporter {
@@ -596,17 +596,17 @@ impl CPPExporter {
                     supports_empty: *supports_empty,
                     elements: content_node_name
                 });
             }
         }
         list_parsers_to_generate.sort_by(|a, b| str::cmp(a.name.to_str(), b.name.to_str()));
         option_parsers_to_generate.sort_by(|a, b| str::cmp(a.name.to_str(), b.name.to_str()));
 
-        // Prepare variant_by_symbol, which will let us lookup the BinVariant name of
+        // Prepare variant_by_symbol, which will let us lookup the BinASTVariant name of
         // a symbol. Since some symbols can appear in several enums (e.g. "+"
         // is both a unary and a binary operator), we need to collect all the
         // string enums that contain each symbol and come up with a unique name
         // (note that there is no guarantee of unicity – if collisions show up,
         // we may need to tweak the name generation algorithm).
         let mut enum_by_string : HashMap<String, Vec<NodeName>> = HashMap::new();
         let mut enum_types : HashMap<NodeName, Rc<String>> = HashMap::new();
         for (name, enum_) in syntax.string_enums_by_name().iter() {
@@ -939,47 +939,47 @@ impl CPPExporter {
         let kind_limit = node_names.len();
         buffer.push_str(&format!("\n#define FOR_EACH_BIN_KIND(F) \\\n{nodes}\n",
             nodes = node_names.iter()
                 .map(|name| format!("    F({enum_name}, \"{spec_name}\")",
                     enum_name = name.to_cpp_enum_case(),
                     spec_name = name))
                 .format(" \\\n")));
         buffer.push_str("
-enum class BinKind {
+enum class BinASTKind {
 #define EMIT_ENUM(name, _) name,
     FOR_EACH_BIN_KIND(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 ");
 
-        buffer.push_str(&format!("\n// The number of distinct values of BinKind.\nconst size_t BINKIND_LIMIT = {};\n\n\n", kind_limit));
+        buffer.push_str(&format!("\n// The number of distinct values of BinASTKind.\nconst size_t BINASTKIND_LIMIT = {};\n\n\n", kind_limit));
         buffer.push_str("\n\n");
         if self.rules.hpp_tokens_field_doc.is_some() {
             buffer.push_str(&self.rules.hpp_tokens_field_doc.reindent(""));
         }
 
         let field_names = self.syntax.field_names()
             .keys()
             .sorted();
         let field_limit = field_names.len();
         buffer.push_str(&format!("\n#define FOR_EACH_BIN_FIELD(F) \\\n{nodes}\n",
             nodes = field_names.iter()
                 .map(|name| format!("    F({enum_name}, \"{spec_name}\")",
                     spec_name = name,
                     enum_name = name.to_cpp_enum_case()))
                 .format(" \\\n")));
         buffer.push_str("
-enum class BinField {
+enum class BinASTField {
 #define EMIT_ENUM(name, _) name,
     FOR_EACH_BIN_FIELD(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 ");
-        buffer.push_str(&format!("\n// The number of distinct values of BinField.\nconst size_t BINFIELD_LIMIT = {};\n\n\n", field_limit));
+        buffer.push_str(&format!("\n// The number of distinct values of BinASTField.\nconst size_t BINASTFIELD_LIMIT = {};\n\n\n", field_limit));
 
         if self.rules.hpp_tokens_variants_doc.is_some() {
             buffer.push_str(&self.rules.hpp_tokens_variants_doc.reindent(""));
         }
         let enum_variants : Vec<_> = self.variants_by_symbol
             .iter()
             .sorted_by(|&(ref symbol_1, ref name_1), &(ref symbol_2, ref name_2)| {
                 Ord::cmp(name_1, name_2)
@@ -990,23 +990,23 @@ enum class BinField {
         buffer.push_str(&format!("\n#define FOR_EACH_BIN_VARIANT(F) \\\n{nodes}\n",
             nodes = enum_variants.into_iter()
                 .map(|(symbol, name)| format!("    F({variant_name}, \"{spec_name}\")",
                     spec_name = symbol,
                     variant_name = name))
                 .format(" \\\n")));
 
         buffer.push_str("
-enum class BinVariant {
+enum class BinASTVariant {
 #define EMIT_ENUM(name, _) name,
     FOR_EACH_BIN_VARIANT(EMIT_ENUM)
 #undef EMIT_ENUM
 };
 ");
-        buffer.push_str(&format!("\n// The number of distinct values of BinVariant.\nconst size_t BINVARIANT_LIMIT = {};\n\n\n",
+        buffer.push_str(&format!("\n// The number of distinct values of BinASTVariant.\nconst size_t BINASTVARIANT_LIMIT = {};\n\n\n",
             variants_limit));
 
         buffer.push_str(&self.rules.hpp_tokens_footer.reindent(""));
         buffer.push_str("\n");
     }
 
     /// Declare string enums
     fn export_declare_string_enums(&self, buffer: &mut String) {
@@ -1238,18 +1238,18 @@ impl CPPExporter {
                 nodes = nodes.iter()
                     .format("\n    "),
                 name = name.to_str());
 
             // Generate outer method
             buffer.push_str(&format!("{bnf}
 {first_line}
 {{
-    BinKind kind;
-    BinFields fields(cx_);
+    BinASTKind kind;
+    BinASTFields fields(cx_);
     AutoTaggedTuple guard(*tokenizer_);
     const auto start = tokenizer_->offset();
 
     MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
 
 {call}
 
     MOZ_TRY(guard.done());
@@ -1275,24 +1275,24 @@ impl CPPExporter {
         let mut buffer_cases = String::new();
         for node in nodes {
             let rule_for_this_arm = rules_for_this_sum.by_sum.get(&node)
                 .cloned()
                 .unwrap_or_default();
 
             if rule_for_this_arm.disabled {
                 buffer_cases.push_str(&format!("
-      case BinKind::{variant_name}:
+      case BinASTKind::{variant_name}:
         return raiseError(\"FIXME: Not implemented yet in this preview release ({variant_name})\");",
                     variant_name = node.to_cpp_enum_case()));
                 continue;
             }
 
             buffer_cases.push_str(&format!("
-      case BinKind::{variant_name}:
+      case BinASTKind::{variant_name}:
 {call}
 {arm_after}        break;",
                 call = self.get_method_call("result", node,
                                             "Interface", INTERFACE_ARGS,
                                             &extra_args,
                                             MethodCallKind::AlwaysVar)
                     .reindent("        "),
                 variant_name = node.to_cpp_enum_case(),
@@ -1453,25 +1453,25 @@ impl CPPExporter {
             } else {
                 panic!("Internal error: In {}, there should be a type with that name",
                     parser.name.to_str());
             };
         match named_implementation {
             NamedType::Interface(_) => {
                 buffer.push_str(&format!("{first_line}
 {{
-    BinKind kind;
-    BinFields fields(cx_);
+    BinASTKind kind;
+    BinASTFields fields(cx_);
     AutoTaggedTuple guard(*tokenizer_);
 
     MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
     {type_ok} result;
-    if (kind == BinKind::{null}) {{
+    if (kind == BinASTKind::{null}) {{
 {none_block}
-    }} else if (kind == BinKind::{kind}) {{
+    }} else if (kind == BinASTKind::{kind}) {{
         const auto start = tokenizer_->offset();
 {before}{call}{after}
     }} else {{
         return raiseInvalidKind(\"{kind}\", kind);
     }}
     MOZ_TRY(guard.done());
 
     return result;
@@ -1506,23 +1506,23 @@ impl CPPExporter {
                     kind = parser.elements.to_cpp_enum_case(),
                 ));
             }
             NamedType::Typedef(ref type_) => {
                 match type_.spec() {
                     &TypeSpec::TypeSum(_) => {
                 buffer.push_str(&format!("{first_line}
 {{
-    BinKind kind;
-    BinFields fields(cx_);
+    BinASTKind kind;
+    BinASTFields fields(cx_);
     AutoTaggedTuple guard(*tokenizer_);
 
     MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
     {type_ok} result;
-    if (kind == BinKind::{null}) {{
+    if (kind == BinASTKind::{null}) {{
 {none_block}
     }} else {{
         const auto start = tokenizer_->offset();
 {before}{call}{after}
     }}
     MOZ_TRY(guard.done());
 
     return result;
@@ -1668,22 +1668,22 @@ impl CPPExporter {
         if self.refgraph.is_used(name.to_rc_string().clone()) {
             // Generate comments
             let comment = format!("\n/*\n{}*/\n", ToWebidl::interface(interface, "", "    "));
             buffer.push_str(&comment);
 
             // Generate public method
             buffer.push_str(&format!("{first_line}
 {{
-    BinKind kind;
-    BinFields fields(cx_);
+    BinASTKind kind;
+    BinASTFields fields(cx_);
     AutoTaggedTuple guard(*tokenizer_);
 
     MOZ_TRY(tokenizer_->enterTaggedTuple(kind, fields, guard));
-    if (kind != BinKind::{kind}) {{
+    if (kind != BinASTKind::{kind}) {{
         return raiseInvalidKind(\"{kind}\", kind);
     }}
     const auto start = tokenizer_->offset();
 {call}
     MOZ_TRY(guard.done());
 
     return result;
 }}
@@ -1709,17 +1709,17 @@ impl CPPExporter {
         let number_of_fields = interface.contents().fields().len();
         let first_line = self.get_method_definition_start(name, inner_prefix,
                                                           INTERFACE_PARAMS,
                                                           &extra_params);
 
         let fields_type_list = format!("{{ {} }}", interface.contents()
             .fields()
             .iter()
-            .map(|field| format!("BinField::{}", field.name().to_cpp_enum_case()))
+            .map(|field| format!("BinASTField::{}", field.name().to_cpp_enum_case()))
             .format(", "));
 
         let mut fields_implem = String::new();
         for field in interface.contents().fields() {
             let rules_for_this_field = rules_for_this_interface.by_field.get(field.name())
                 .cloned()
                 .unwrap_or_default();
             let needs_block = rules_for_this_field.block_before_field.is_some() || rules_for_this_field.block_after_field.is_some();
@@ -1750,17 +1750,17 @@ impl CPPExporter {
                         Some(format!("MOZ_TRY_VAR({var_name}, tokenizer_->readBool());", var_name = var_name)))
                     } else {
                         (None,
                         Some(format!("BINJS_MOZ_TRY_DECL({var_name}, tokenizer_->readBool());", var_name = var_name)))
                     }
                 }
                 Some(IsNullable { is_nullable: false, content: Primitive::Offset }) => {
                     if needs_block {
-                        (Some(format!("BinTokenReaderBase::SkippableSubTree {var_name};", var_name = var_name)),
+                        (Some(format!("BinASTTokenReaderBase::SkippableSubTree {var_name};", var_name = var_name)),
                         Some(format!("MOZ_TRY_VAR({var_name}, tokenizer_->readSkippableSubTree());", var_name = var_name)))
                     } else {
                         (None,
                         Some(format!("BINJS_MOZ_TRY_DECL({var_name}, tokenizer_->readSkippableSubTree());", var_name = var_name)))
                     }
                 }
                 Some(IsNullable { content: Primitive::Void, .. }) => {
                     warn!("Internal error: We shouldn't have any `void` types at this stage.");
@@ -1876,25 +1876,25 @@ impl CPPExporter {
             ));
         } else {
             let check_fields = if number_of_fields == 0 {
                 format!("MOZ_TRY(tokenizer_->checkFields0(kind, fields));")
             } else {
                 // The following strategy is designed for old versions of clang.
                 format!("
 #if defined(DEBUG)
-    const BinField expected_fields[{number_of_fields}] = {fields_type_list};
+    const BinASTField expected_fields[{number_of_fields}] = {fields_type_list};
     MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif // defined(DEBUG)",
                     fields_type_list = fields_type_list,
                     number_of_fields = number_of_fields)
             };
             buffer.push_str(&format!("{first_line}
 {{
-    MOZ_ASSERT(kind == BinKind::{kind});
+    MOZ_ASSERT(kind == BinASTKind::{kind});
     BINJS_TRY(CheckRecursionLimit(cx_));
 {check_fields}
 {pre}{fields_implem}
 {post}    return result;
 }}
 
 ",
                 check_fields = check_fields,
@@ -1955,21 +1955,21 @@ impl CPPExporter {
 {cases}
       default:
         return raiseInvalidVariant(\"{kind}\", variant);
     }}",
                     kind = kind,
                     cases = enum_.strings()
                         .iter()
                         .map(|symbol| {
-                            format!("    case BinVariant::{binvariant_variant}:
+                            format!("    case BinASTVariant::{binastvariant_variant}:
         return {kind}::{specialized_variant};",
                                 kind = kind,
                                 specialized_variant = symbol.to_cpp_enum_case(),
-                                binvariant_variant  = self.variants_by_symbol.get(symbol)
+                                binastvariant_variant  = self.variants_by_symbol.get(symbol)
                                     .unwrap()
                             )
                         })
                         .format("\n")
                 );
 
                 let rendered_doc = format!("/*\nenum {kind} {{\n{cases}\n}};\n*/\n",
                     kind = kind,
rename from js/src/frontend/binsource/src/refgraph.rs
rename to js/src/frontend/binast/src/refgraph.rs
--- a/js/src/frontend/moz.build
+++ b/js/src/frontend/moz.build
@@ -67,28 +67,28 @@ if CONFIG['JS_BUILD_BINAST']:
     # Using SOURCES, as UNIFIED_SOURCES causes mysterious bugs on 32-bit
     # platforms.
 
     # These parts of BinAST should eventually move to release.
     SOURCES += [
         'BinASTParser.cpp',
         'BinASTParserBase.cpp',
         'BinASTParserPerTokenizer.cpp',
-        'BinSourceRuntimeSupport.cpp',
-        'BinToken.cpp',
-        'BinTokenReaderBase.cpp',
-        'BinTokenReaderMultipart.cpp',
+        'BinASTRuntimeSupport.cpp',
+        'BinASTToken.cpp',
+        'BinASTTokenReaderBase.cpp',
+        'BinASTTokenReaderMultipart.cpp',
     ]
 
     DIRS += [
-        'binsource'
+        'binast'
     ]
 
     # Instrument BinAST files for fuzzing as we have a fuzzing target for BinAST.
     if CONFIG['FUZZING_INTERFACES'] and CONFIG['LIBFUZZER']:
         include('/tools/fuzzing/libfuzzer-flags.mozbuild')
 
         SOURCES['BinASTParser.cpp'].flags += libfuzzer_flags
         SOURCES['BinASTParserBase.cpp'].flags += libfuzzer_flags
         SOURCES['BinASTParserPerTokenizer.cpp'].flags += libfuzzer_flags
-        SOURCES['BinToken.cpp'].flags += libfuzzer_flags
-        SOURCES['BinTokenReaderBase.cpp'].flags += libfuzzer_flags
-        SOURCES['BinTokenReaderMultipart.cpp'].flags += libfuzzer_flags
+        SOURCES['BinASTToken.cpp'].flags += libfuzzer_flags
+        SOURCES['BinASTTokenReaderBase.cpp'].flags += libfuzzer_flags
+        SOURCES['BinASTTokenReaderMultipart.cpp'].flags += libfuzzer_flags
--- a/js/src/fuzz-tests/testBinASTReader.cpp
+++ b/js/src/fuzz-tests/testBinASTReader.cpp
@@ -56,17 +56,17 @@ static int testBinASTReaderFuzz(const ui
 
   RootedScriptSourceObject sourceObj(
       gCx,
       frontend::CreateScriptSourceObject(gCx, options, mozilla::Nothing()));
   if (!sourceObj) {
     ReportOutOfMemory(gCx);
     return 0;
   }
-  BinASTParser<js::frontend::BinTokenReaderMultipart> reader(
+  BinASTParser<js::frontend::BinASTTokenReaderMultipart> reader(
       gCx, gCx->tempLifoAlloc(), binUsedNames, options, sourceObj);
 
   // Will be deallocated once `reader` goes out of scope.
   auto binParsed = reader.parse(&globalsc, binSource);
   RootedValue binExn(gCx);
   if (binParsed.isErr()) {
     js::GetAndClearException(gCx, &binExn);
     return 0;
--- a/js/src/jsapi-tests/testBinASTReader.cpp
+++ b/js/src/jsapi-tests/testBinASTReader.cpp
@@ -454,17 +454,17 @@ void runTestFromPath(JSContext* cx, cons
   if (closedir(dir) != 0) {
     MOZ_CRASH("Could not close dir");
   }
 #endif  // defined(XP_WIN)
 }
 
 BEGIN_TEST(testBinASTReaderMultipartECMAScript2) {
 #if defined(XP_WIN)
-  runTestFromPath<js::frontend::BinTokenReaderMultipart>(
+  runTestFromPath<js::frontend::BinASTTokenReaderMultipart>(
       cx, "jsapi-tests\\binast\\parser\\multipart\\");
 #else
-  runTestFromPath<js::frontend::BinTokenReaderMultipart>(
+  runTestFromPath<js::frontend::BinASTTokenReaderMultipart>(
       cx, "jsapi-tests/binast/parser/multipart/");
 #endif  // defined(XP_XIN)
   return true;
 }
 END_TEST(testBinASTReaderMultipartECMAScript2)
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -80,17 +80,17 @@
 #include "gc/PublicIterators.h"
 #include "jit/arm/Simulator-arm.h"
 #include "jit/InlinableNatives.h"
 #include "jit/Ion.h"
 #include "jit/JitcodeMap.h"
 #include "jit/JitRealm.h"
 #include "jit/shared/CodeGenerator-shared.h"
 #include "js/ArrayBuffer.h"  // JS::{CreateMappedArrayBufferContents,NewMappedArrayBufferWithContents,IsArrayBufferObject,GetArrayBufferLengthAndData}
-#include "js/BuildId.h"  // JS::BuildIdCharVector, JS::SetProcessBuildIdOp
+#include "js/BuildId.h"      // JS::BuildIdCharVector, JS::SetProcessBuildIdOp
 #include "js/CharacterEncoding.h"
 #include "js/CompilationAndEvaluation.h"
 #include "js/CompileOptions.h"
 #include "js/ContextOptions.h"  // JS::ContextOptions{,Ref}
 #include "js/Debug.h"
 #include "js/Equality.h"  // JS::SameValue
 #include "js/GCVector.h"
 #include "js/Initialization.h"
@@ -5104,17 +5104,17 @@ static bool BinParse(JSContext* cx, unsi
       cx, frontend::CreateScriptSourceObject(cx, options, Nothing()));
   if (!sourceObj) {
     return false;
   }
 
   Directives directives(false);
   GlobalSharedContext globalsc(cx, ScopeKind::Global, directives, false);
 
-  auto parseFunc = ParseBinASTData<frontend::BinTokenReaderMultipart>;
+  auto parseFunc = ParseBinASTData<frontend::BinASTTokenReaderMultipart>;
   if (!parseFunc(cx, buf_data, buf_length, &globalsc, usedNames, options,
                  sourceObj)) {
     return false;
   }
 
   args.rval().setUndefined();
   return true;
 }
@@ -10884,17 +10884,18 @@ int main(int argc, char** argv, char** e
           "Choose to enable a subset of the wasm compilers (valid options are "
           "none/baseline/ion/cranelift/baseline+ion/baseline+cranelift)") ||
       !op.addBoolOption('\0', "wasm-verbose",
                         "Enable WebAssembly verbose logging") ||
       !op.addBoolOption('\0', "test-wasm-await-tier2",
                         "Forcibly activate tiering and block "
                         "instantiation on completion of tier2")
 #ifdef ENABLE_WASM_GC
-      || !op.addBoolOption('\0', "wasm-gc", "Enable experimental wasm GC features")
+      ||
+      !op.addBoolOption('\0', "wasm-gc", "Enable experimental wasm GC features")
 #else
       || !op.addBoolOption('\0', "wasm-gc", "No-op")
 #endif
       || !op.addBoolOption('\0', "no-native-regexp",
                            "Disable native regexp compilation") ||
       !op.addBoolOption('\0', "no-unboxed-objects",
                         "Disable creating unboxed plain objects") ||
       !op.addBoolOption('\0', "enable-streams",
--- a/js/src/vm/JSScript.cpp
+++ b/js/src/vm/JSScript.cpp
@@ -2626,41 +2626,42 @@ XDRResult ScriptSource::XDR(XDRState<mod
     }
 
     uint8_t hasMetadata = !!ss->binASTMetadata_;
     MOZ_TRY(xdr->codeUint8(&hasMetadata));
     if (hasMetadata) {
 #if defined(JS_BUILD_BINAST)
       UniquePtr<frontend::BinASTSourceMetadata>& binASTMetadata =
           ss->binASTMetadata_;
-      uint32_t numBinKinds;
+      uint32_t numBinASTKinds;
       uint32_t numStrings;
       if (mode == XDR_ENCODE) {
-        numBinKinds = binASTMetadata->numBinKinds();
+        numBinASTKinds = binASTMetadata->numBinASTKinds();
         numStrings = binASTMetadata->numStrings();
       }
-      MOZ_TRY(xdr->codeUint32(&numBinKinds));
+      MOZ_TRY(xdr->codeUint32(&numBinASTKinds));
       MOZ_TRY(xdr->codeUint32(&numStrings));
 
       if (mode == XDR_DECODE) {
         // Use calloc, since we're storing this immediately, and filling it
         // might GC, to avoid marking bogus atoms.
         auto metadata = static_cast<frontend::BinASTSourceMetadata*>(
-            js_calloc(frontend::BinASTSourceMetadata::totalSize(numBinKinds,
+            js_calloc(frontend::BinASTSourceMetadata::totalSize(numBinASTKinds,
                                                                 numStrings)));
         if (!metadata) {
           return xdr->fail(JS::TranscodeResult_Throw);
         }
-        new (metadata) frontend::BinASTSourceMetadata(numBinKinds, numStrings);
+        new (metadata)
+            frontend::BinASTSourceMetadata(numBinASTKinds, numStrings);
         ss->setBinASTSourceMetadata(metadata);
       }
 
-      for (uint32_t i = 0; i < numBinKinds; i++) {
-        frontend::BinKind* binKindBase = binASTMetadata->binKindBase();
-        MOZ_TRY(xdr->codeEnum32(&binKindBase[i]));
+      for (uint32_t i = 0; i < numBinASTKinds; i++) {
+        frontend::BinASTKind* binASTKindBase = binASTMetadata->binASTKindBase();
+        MOZ_TRY(xdr->codeEnum32(&binASTKindBase[i]));
       }
 
       RootedAtom atom(xdr->cx());
       JSAtom** atomsBase = binASTMetadata->atomsBase();
       auto slices = binASTMetadata->sliceBase();
       auto sourceBase = reinterpret_cast<const char*>(ss->binASTSource());
 
       for (uint32_t i = 0; i < numStrings; i++) {
--- a/js/src/vm/JSScript.h
+++ b/js/src/vm/JSScript.h
@@ -20,17 +20,17 @@
 #include "mozilla/Utf8.h"
 #include "mozilla/Variant.h"
 
 #include <type_traits>  // std::is_same
 #include <utility>      // std::move
 
 #include "jstypes.h"
 
-#include "frontend/BinSourceRuntimeSupport.h"
+#include "frontend/BinASTRuntimeSupport.h"
 #include "frontend/NameAnalysisTypes.h"
 #include "gc/Barrier.h"
 #include "gc/Rooting.h"
 #include "jit/IonCode.h"
 #include "js/CompileOptions.h"
 #include "js/UbiNode.h"
 #include "js/UniquePtr.h"
 #include "js/Utility.h"
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -19,17 +19,17 @@
 #include "mozilla/Vector.h"
 
 #include <algorithm>
 #include <setjmp.h>
 
 #include "builtin/AtomicsObject.h"
 #include "builtin/intl/SharedIntlData.h"
 #include "builtin/Promise.h"
-#include "frontend/BinSourceRuntimeSupport.h"
+#include "frontend/BinASTRuntimeSupport.h"
 #include "frontend/NameCollections.h"
 #include "gc/GCRuntime.h"
 #include "gc/Tracer.h"
 #include "irregexp/RegExpStack.h"
 #include "js/BuildId.h"  // JS::BuildIdOp
 #include "js/Debug.h"
 #include "js/GCVector.h"
 #include "js/HashTable.h"
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -6520,21 +6520,19 @@ nsresult PresShell::EventHandler::Handle
                                        aDontRetargetEvents);
   }
 
   // Activation events need to be dispatched even if no frame was found, since
   // we don't want the focus to be out of sync.
   if (!aFrame) {
     if (!NS_EVENT_NEEDS_FRAME(aGUIEvent)) {
       mPresShell->mCurrentEventFrame = nullptr;
-      nsCOMPtr<nsIContent> overrideClickTarget;  // Required due to bug  1506439
       // XXX Shouldn't we create AutoCurrentEventInfoSetter instance for this
       //     call even if we set the target to nullptr.
-      return HandleEventWithCurrentEventInfo(aGUIEvent, aEventStatus, true,
-                                             overrideClickTarget);
+      return HandleEventWithCurrentEventInfo(aGUIEvent, aEventStatus, true, nullptr);
     }
 
     if (aGUIEvent->HasKeyEventMessage()) {
       // Keypress events in new blank tabs should not be completely thrown away.
       // Retarget them -- the parent chrome shell might make use of them.
       return RetargetEventToParent(aGUIEvent, aEventStatus);
     }
 
@@ -7447,19 +7445,17 @@ nsresult PresShell::EventHandler::Handle
   // with parent PresShell.
   mPresShell->mCurrentEventContent = eventTargetElement;
   if (!mPresShell->GetCurrentEventContent() ||
       !mPresShell->GetCurrentEventFrame() ||
       InZombieDocument(mPresShell->mCurrentEventContent)) {
     return RetargetEventToParent(aGUIEvent, aEventStatus);
   }
 
-  nsCOMPtr<nsIContent> overrideClickTarget;  // Required due to bug  1506439
-  nsresult rv = HandleEventWithCurrentEventInfo(aGUIEvent, aEventStatus, true,
-                                                overrideClickTarget);
+  nsresult rv = HandleEventWithCurrentEventInfo(aGUIEvent, aEventStatus, true, nullptr);
 
 #ifdef DEBUG
   mPresShell->ShowEventTargetDebug();
 #endif
 
   return rv;
 }
 
@@ -7553,19 +7549,17 @@ nsresult PresShell::EventHandler::Handle
   MOZ_ASSERT(!aGUIEvent->IsTargetedAtFocusedContent());
   MOZ_ASSERT(aEventStatus);
 
   AutoCurrentEventInfoSetter eventInfoSetter(*this, aFrameForPresShell,
                                              nullptr);
 
   nsresult rv = NS_OK;
   if (mPresShell->GetCurrentEventFrame()) {
-    nsCOMPtr<nsIContent> overrideClickTarget;  // Required due to bug  1506439
-    rv = HandleEventWithCurrentEventInfo(aGUIEvent, aEventStatus, true,
-                                         overrideClickTarget);
+    rv = HandleEventWithCurrentEventInfo(aGUIEvent, aEventStatus, true, nullptr);
   }
 
 #ifdef DEBUG
   mPresShell->ShowEventTargetDebug();
 #endif
 
   return rv;
 }
--- a/toolkit/actors/PictureInPictureChild.jsm
+++ b/toolkit/actors/PictureInPictureChild.jsm
@@ -101,12 +101,16 @@ class PictureInPictureChild extends Acto
     originatingVideo.cloneElementVisually(playerVideo);
 
     let originatingWindow = originatingVideo.ownerGlobal;
     originatingWindow.addEventListener("unload", (e) => {
       this.closePictureInPicture(originatingVideo);
     }, { once: true });
 
     this.content.addEventListener("unload", () => {
+      let video = gWeakVideo && gWeakVideo.get();
+      if (video) {
+        video.stopCloningElementVisually();
+      }
       gWeakVideo = null;
     }, { once: true });
   }
 }
--- a/toolkit/components/passwordmgr/LoginManager.jsm
+++ b/toolkit/components/passwordmgr/LoginManager.jsm
@@ -52,25 +52,16 @@ LoginManager.prototype = {
 
     throw new Components.Exception("Interface not available", Cr.NS_ERROR_NO_INTERFACE);
   },
 
 
   /* ---------- private members ---------- */
 
 
-  __formFillService: null, // FormFillController, for username autocompleting
-  get _formFillService() {
-    if (!this.__formFillService) {
-      this.__formFillService = Cc["@mozilla.org/satchel/form-fill-controller;1"].
-                               getService(Ci.nsIFormFillController);
-    }
-    return this.__formFillService;
-  },
-
 
   _storage: null, // Storage component which contains the saved logins
   _prefBranch: null, // Preferences service
   _remember: true,  // mirrors signon.rememberSignons preference
 
 
   /**
    * Initialize the Login Manager. Automatically called when service
@@ -133,17 +124,16 @@ LoginManager.prototype = {
 
         if (prefName == "rememberSignons") {
           this._pwmgr._remember =
               this._pwmgr._prefBranch.getBoolPref("rememberSignons");
         } else {
           log.debug("Oops! Pref not handled, change ignored.");
         }
       } else if (topic == "xpcom-shutdown") {
-        delete this._pwmgr.__formFillService;
         delete this._pwmgr._storage;
         delete this._pwmgr._prefBranch;
         this._pwmgr = null;
       } else if (topic == "passwordmgr-storage-replace") {
         (async () => {
           await this._pwmgr._storage.terminate();
           this._pwmgr._initStorage();
           await this._pwmgr.initializationPromise;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -13227,16 +13227,27 @@
     "expires_in_version": "72",
     "keyed": true,
     "keys": ["dl", "flb", "fr", "r"],
     "kind": "linear",
     "high": 100,
     "n_buckets": 10,
     "description": "Percentages of times for phases in a normal content paint relative to the time spent in the entire normal paint. (\"dl\" = Display list, \"flb\" = Frame layer builder, \"fr\" = Flush rasterization, \"r\" = Rasterization)"
   },
+  "GPU_WAIT_TIME_MS": {
+    "record_in_processes": ["main", "gpu"],
+    "alert_emails": ["gfx-telemetry-alerts@mozilla.com", "jmuizelaar@mozilla.com"],
+    "bug_numbers": [1524090],
+    "expires_in_version": "82",
+    "releaseChannelCollection": "opt-out",
+    "kind": "exponential",
+    "high": 5000,
+    "n_buckets": 50,
+    "description": "The number of milliseconds we spend waiting for the GPU"
+  },
   "NARRATE_CONTENT_BY_LANGUAGE_2": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["eisaacson@mozilla.com"],
     "bug_numbers": [1308030, 1324868],
     "releaseChannelCollection": "opt-out",
     "expires_in_version": "60",
     "kind": "enumerated",
     "keyed": true,
--- a/toolkit/content/tests/widgets/test_videocontrols_error.html
+++ b/toolkit/content/tests/widgets/test_videocontrols_error.html
@@ -32,30 +32,30 @@
       video.addEventListener("loadedmetadata", () => SimpleTest.executeSoon(resolve));
     });
 
     // Wait for the fade out transition to complete in case the throbber
     // shows up on slower platforms.
     await SimpleTest.promiseWaitForCondition(() => statusOverlay.hidden,
       "statusOverlay should not present without error");
 
-    ok(!statusOverlay.hasAttribute("error"), "statusOverlay should not in error state");
+    ok(!statusOverlay.hasAttribute("status"), "statusOverlay should not be showing a state message.");
     isnot(statusIcon.getAttribute("type"), "error", "should not show error icon");
   });
 
   add_task(async function invalid_source() {
     const errorType = "errorNoSource";
 
     await new Promise(resolve => {
       video.src = "invalid_source.ogg";
       video.addEventListener("error", () => SimpleTest.executeSoon(resolve));
     });
 
     ok(!statusOverlay.hidden, `statusOverlay should show when ${errorType}`);
-    is(statusOverlay.getAttribute("error"), errorType, `statusOverlay should have correct error state: ${errorType}`);
+    is(statusOverlay.getAttribute("status"), errorType, `statusOverlay should have correct error state: ${errorType}`);
     is(statusIcon.getAttribute("type"), "error", `should show error icon when ${errorType}`);
     isnot(statusLabelErrorNoSource.getBoundingClientRect().height, 0,
       "errorNoSource status label should be visible.");
   });
 </script>
 </pre>
 </body>
 </html>
--- a/toolkit/content/widgets/videocontrols.js
+++ b/toolkit/content/widgets/videocontrols.js
@@ -33,29 +33,38 @@ this.VideoControlsWidget = class {
    */
   onchange() {
     this.switchImpl();
   }
 
   /*
    * Actually switch the implementation.
    * - With "controls" set, the VideoControlsImplWidget controls should load.
-   * - Without it, on mobile, the NoControlsImplWidget should load, so
+   * - Without it, on mobile, the NoControlsMobileImplWidget should load, so
    *   the user could see the click-to-play button when the video/audio is blocked.
+   * - Without it, on desktop, the NoControlsPictureInPictureImpleWidget should load
+   *   if the video is being viewed in Picture-in-Picture.
    */
   switchImpl() {
     let newImpl;
     if (this.element.controls) {
       newImpl = VideoControlsImplWidget;
     } else if (this.isMobile) {
-      newImpl = NoControlsImplWidget;
+      newImpl = NoControlsMobileImplWidget;
+    } else if (VideoControlsWidget.isPictureInPictureVideo(this.element)) {
+      newImpl = NoControlsPictureInPictureImplWidget;
     }
-    // Skip if we are asked to load the same implementation.
-    // This can happen if the property is set again w/o value change.
-    if (this.impl && this.impl.constructor == newImpl) {
+
+    // Skip if we are asked to load the same implementation, and
+    // the underlying element state hasn't changed in ways that we
+    // care about. This can happen if the property is set again
+    // without a value change.
+    if (this.impl &&
+        this.impl.constructor == newImpl &&
+        this.impl.elementStateMatches(this.element)) {
       return;
     }
     if (this.impl) {
       this.impl.destructor();
       this.shadowRoot.firstChild.remove();
     }
     if (newImpl) {
       this.impl = new newImpl(this.shadowRoot);
@@ -68,16 +77,20 @@ this.VideoControlsWidget = class {
   destructor() {
     if (!this.impl) {
       return;
     }
     this.impl.destructor();
     this.shadowRoot.firstChild.remove();
     delete this.impl;
   }
+
+  static isPictureInPictureVideo(someVideo) {
+    return someVideo.isCloningElementVisually;
+  }
 };
 
 this.VideoControlsImplWidget = class {
   constructor(shadowRoot) {
     this.shadowRoot = shadowRoot;
     this.element = shadowRoot.host;
     this.document = this.element.ownerDocument;
     this.window = this.document.defaultView;
@@ -100,16 +113,17 @@ this.VideoControlsImplWidget = class {
       progressBar: null,
       bufferBar: null,
       statusOverlay: null,
       controlsSpacer: null,
       clickToPlay: null,
       controlsOverlay: null,
       fullscreenButton: null,
       layoutControls: null,
+      isShowingPictureInPictureMessage: false,
 
       textTracksCount: 0,
       videoEvents: ["play", "pause", "ended", "volumechange", "loadeddata",
                     "loadstart", "timeupdate", "progress",
                     "playing", "waiting", "canplay", "canplaythrough",
                     "seeking", "seeked", "emptied", "loadedmetadata",
                     "error", "suspend", "stalled",
                     "mozvideoonlyseekbegin", "mozvideoonlyseekcompleted"],
@@ -242,16 +256,18 @@ this.VideoControlsImplWidget = class {
         }
 
         // Set the current status icon.
         if (this.hasError()) {
           this.startFadeOut(this.clickToPlay, true);
           this.statusIcon.setAttribute("type", "error");
           this.updateErrorText();
           this.setupStatusFader(true);
+        } else if (VideoControlsWidget.isPictureInPictureVideo(this.video)) {
+          this.setShowPictureInPictureMessage(true);
         }
 
         let adjustableControls = [
           ...this.prioritizedControls,
           this.controlBar,
           this.clickToPlay,
         ];
 
@@ -360,17 +376,18 @@ this.VideoControlsImplWidget = class {
         // For videos with |autoplay| set, we'll leave the controls initially hidden,
         // so that they don't get in the way of the playing video. Otherwise we'll
         // go ahead and reveal the controls now, so they're an obvious user cue.
         var shouldShow = !this.dynamicControls ||
                          (this.video.paused &&
                          !this.video.autoplay);
         // Hide the overlay if the video time is non-zero or if an error occurred to workaround bug 718107.
         let shouldClickToPlayShow = shouldShow && !this.isAudioOnly &&
-                                    this.video.currentTime == 0 && !this.hasError();
+                                    this.video.currentTime == 0 && !this.hasError() &&
+                                    !this.isShowingPictureInPictureMessage;
         this.startFade(this.clickToPlay, shouldClickToPlayShow, true);
         this.startFade(this.controlBar, shouldShow, true);
       },
 
       get dynamicControls() {
         // Don't fade controls for <audio> elements.
         var enabled = !this.isAudioOnly;
 
@@ -512,17 +529,17 @@ this.VideoControlsImplWidget = class {
             break;
           case "loadeddata":
             this.firstFrameShown = true;
             this.setupStatusFader();
             break;
           case "loadstart":
             this.maxCurrentTimeSeen = 0;
             this.controlsSpacer.removeAttribute("aria-label");
-            this.statusOverlay.removeAttribute("error");
+            this.statusOverlay.removeAttribute("status");
             this.statusIcon.setAttribute("type", "throbber");
             this.isAudioOnly = this.video.localName == "audio";
             this.setPlayButtonState(true);
             this.setupNewLoadState();
             this.setupStatusFader();
             break;
           case "progress":
             this.statusIcon.removeAttribute("stalled");
@@ -745,16 +762,26 @@ this.VideoControlsImplWidget = class {
         // do this intentionally to work around requires-user-interaction to
         // play restrictions, and we don't want to display a debug message
         // if that's the case.
         return this.video.error != null ||
                (this.video.networkState == this.video.NETWORK_NO_SOURCE &&
                this.hasSources());
       },
 
+      setShowPictureInPictureMessage(showMessage) {
+        if (showMessage) {
+          this.pictureInPictureOverlay.removeAttribute("hidden");
+        } else {
+          this.pictureInPictureOverlay.setAttribute("hidden", true);
+        }
+
+        this.isShowingPictureInPictureMessage = showMessage;
+      },
+
       hasSources() {
         if (this.video.hasAttribute("src") &&
             this.video.getAttribute("src") !== "") {
           return true;
         }
         for (var child = this.video.firstChild;
              child !== null;
              child = child.nextElementSibling) {
@@ -794,17 +821,17 @@ this.VideoControlsImplWidget = class {
         } else if (v.networkState == v.NETWORK_NO_SOURCE) {
           error = "errorNoSource";
         } else {
           return; // No error found.
         }
 
         let label = this.shadowRoot.getElementById(error);
         this.controlsSpacer.setAttribute("aria-label", label.textContent);
-        this.statusOverlay.setAttribute("error", error);
+        this.statusOverlay.setAttribute("status", error);
       },
 
       formatTime(aTime, showHours = false) {
         // Format the duration as "h:mm:ss" or "m:ss"
         aTime = Math.round(aTime / 1000);
         let hours = Math.floor(aTime / 3600);
         let mins  = Math.floor((aTime % 3600) / 60);
         let secs  = Math.floor(aTime % 60);
@@ -1936,16 +1963,17 @@ this.VideoControlsImplWidget = class {
         this.bufferBar = this.shadowRoot.getElementById("bufferBar");
         this.scrubberStack = this.shadowRoot.getElementById("scrubberStack");
         this.scrubber = this.shadowRoot.getElementById("scrubber");
         this.durationLabel = this.shadowRoot.getElementById("durationLabel");
         this.positionLabel = this.shadowRoot.getElementById("positionLabel");
         this.positionDurationBox = this.shadowRoot.getElementById("positionDurationBox");
         this.statusOverlay = this.shadowRoot.getElementById("statusOverlay");
         this.controlsOverlay = this.shadowRoot.getElementById("controlsOverlay");
+        this.pictureInPictureOverlay = this.shadowRoot.getElementById("pictureInPictureOverlay");
         this.controlsSpacer = this.shadowRoot.getElementById("controlsSpacer");
         this.clickToPlay = this.shadowRoot.getElementById("clickToPlay");
         this.fullscreenButton = this.shadowRoot.getElementById("fullscreenButton");
         this.castingButton = this.shadowRoot.getElementById("castingButton");
         this.closedCaptionButton = this.shadowRoot.getElementById("closedCaptionButton");
         this.textTrackList = this.shadowRoot.getElementById("textTrackList");
 
         if (this.positionDurationBox) {
@@ -2201,22 +2229,27 @@ this.VideoControlsImplWidget = class {
       <!ENTITY % videocontrolsDTD SYSTEM "chrome://global/locale/videocontrols.dtd">
       %videocontrolsDTD;
       ]>
       <div class="videocontrols" xmlns="http://www.w3.org/1999/xhtml" role="none">
         <link rel="stylesheet" type="text/css" href="chrome://global/skin/media/videocontrols.css" />
         <div id="controlsContainer" class="controlsContainer" role="none">
           <div id="statusOverlay" class="statusOverlay stackItem" hidden="true">
             <div id="statusIcon" class="statusIcon"></div>
-            <span class="errorLabel" id="errorAborted">&error.aborted;</span>
-            <span class="errorLabel" id="errorNetwork">&error.network;</span>
-            <span class="errorLabel" id="errorDecode">&error.decode;</span>
-            <span class="errorLabel" id="errorSrcNotSupported">&error.srcNotSupported;</span>
-            <span class="errorLabel" id="errorNoSource">&error.noSource2;</span>
-            <span class="errorLabel" id="errorGeneric">&error.generic;</span>
+            <span class="statusLabel" id="errorAborted">&error.aborted;</span>
+            <span class="statusLabel" id="errorNetwork">&error.network;</span>
+            <span class="statusLabel" id="errorDecode">&error.decode;</span>
+            <span class="statusLabel" id="errorSrcNotSupported">&error.srcNotSupported;</span>
+            <span class="statusLabel" id="errorNoSource">&error.noSource2;</span>
+            <span class="statusLabel" id="errorGeneric">&error.generic;</span>
+          </div>
+
+          <div id="pictureInPictureOverlay" class="pictureInPictureOverlay stackItem" status="pictureInPicture" hidden="true">
+            <div class="statusIcon" type="pictureInPicture"></div>
+            <span class="statusLabel" id="pictureInPicture">&status.pictureInPicture;</span>
           </div>
 
           <div id="controlsOverlay" class="controlsOverlay stackItem" role="none">
             <div class="controlsSpacerStack">
               <div id="controlsSpacer" class="controlsSpacer stackItem" role="none"></div>
               <div id="clickToPlay" class="clickToPlay" hidden="true"></div>
             </div>
 
@@ -2260,16 +2293,21 @@ this.VideoControlsImplWidget = class {
             </div>
             <div id="textTrackList" class="textTrackList" hidden="true" offlabel="&closedCaption.off;"></div>
           </div>
         </div>
       </div>`, "application/xml");
     this.shadowRoot.importNodeAndAppendChildAt(this.shadowRoot, parserDoc.documentElement, true);
   }
 
+  elementStateMatches(element) {
+    let elementInPiP = VideoControlsWidget.isPictureInPictureVideo(element);
+    return this.isShowingPictureInPictureMessage == elementInPiP;
+  }
+
   destructor() {
     this.Utils.terminate();
     this.TouchUtils.terminate();
     this.Utils.updateOrientationState(false);
   }
 
   _setupEventListeners() {
     this.shadowRoot.firstChild.addEventListener("mouseover", event => {
@@ -2287,17 +2325,17 @@ this.VideoControlsImplWidget = class {
     this.shadowRoot.firstChild.addEventListener("mousemove", event => {
       if (!this.Utils.isTouchControls) {
         this.Utils.onMouseMove(event);
       }
     });
   }
 };
 
-this.NoControlsImplWidget = class {
+this.NoControlsMobileImplWidget = class {
   constructor(shadowRoot) {
     this.shadowRoot = shadowRoot;
     this.element = shadowRoot.host;
     this.document = this.element.ownerDocument;
     this.window = this.document.defaultView;
   }
 
   onsetup() {
@@ -2392,16 +2430,20 @@ this.NoControlsImplWidget = class {
           });
         }
       },
     };
     this.Utils.init(this.shadowRoot);
     this.Utils.video.dispatchEvent(new this.window.CustomEvent("MozNoControlsVideoBindingAttached"));
   }
 
+  elementStateMatches(element) {
+    return true;
+  }
+
   destructor() {
     this.Utils.terminate();
   }
 
   generateContent() {
     /*
      * Pass the markup through XML parser purely for the reason of loading the localization DTD.
      * Remove it when migrate to Fluent.
@@ -2419,8 +2461,51 @@ this.NoControlsImplWidget = class {
               <div id="clickToPlay" class="clickToPlay"></div>
             </div>
           </div>
         </div>
       </div>`, "application/xml");
     this.shadowRoot.importNodeAndAppendChildAt(this.shadowRoot, parserDoc.documentElement, true);
   }
 };
+
+this.NoControlsPictureInPictureImplWidget = class {
+  constructor(shadowRoot) {
+    this.shadowRoot = shadowRoot;
+    this.element = shadowRoot.host;
+    this.document = this.element.ownerDocument;
+    this.window = this.document.defaultView;
+  }
+
+  onsetup() {
+    this.generateContent();
+  }
+
+  elementStateMatches(element) {
+    return true;
+  }
+
+  destructor() {
+  }
+
+  generateContent() {
+    /*
+     * Pass the markup through XML parser purely for the reason of loading the localization DTD.
+     * Remove it when migrate to Fluent.
+     */
+    const parser = new this.window.DOMParser();
+    let parserDoc = parser.parseFromString(`<!DOCTYPE bindings [
+      <!ENTITY % videocontrolsDTD SYSTEM "chrome://global/locale/videocontrols.dtd">
+      %videocontrolsDTD;
+      ]>
+      <div class="videocontrols" xmlns="http://www.w3.org/1999/xhtml" role="none">
+        <link rel="stylesheet" type="text/css" href="chrome://global/skin/media/videocontrols.css" />
+        <div id="controlsContainer" class="controlsContainer" role="none">
+          <div class="pictureInPictureOverlay stackItem" status="pictureInPicture">
+            <div id="statusIcon" class="statusIcon" type="pictureInPicture"></div>
+            <span class="statusLabel" id="pictureInPicture">&status.pictureInPicture;</span>
+          </div>
+          <div class="controlsOverlay stackItem"></div>
+        </div>
+      </div>`, "application/xml");
+    this.shadowRoot.importNodeAndAppendChildAt(this.shadowRoot, parserDoc.documentElement, true);
+  }
+};
--- a/toolkit/locales/en-US/chrome/global/videocontrols.dtd
+++ b/toolkit/locales/en-US/chrome/global/videocontrols.dtd
@@ -29,16 +29,18 @@
 
 <!ENTITY error.aborted "Video loading stopped.">
 <!ENTITY error.network "Video playback aborted due to a network error.">
 <!ENTITY error.decode "Video can’t be played because the file is corrupt.">
 <!ENTITY error.srcNotSupported "Video format or MIME type is not supported.">
 <!ENTITY error.noSource2 "No video with supported format and MIME type found.">
 <!ENTITY error.generic "Video playback aborted due to an unknown error.">
 
+<!ENTITY status.pictureInPicture "This video is playing in Picture-in-Picture mode.">
+
 <!-- LOCALIZATION NOTE (scrubberScale.nameFormat): the #1 string is the current
 media position, and the #2 string is the total duration. For example, when at
 the 5 minute mark in a 6 hour long video, #1 would be "5:00" and #2 would be
 "6:00:00", result string would be "5:00 of 6:00:00 elapsed".
 -->
 <!ENTITY scrubberScale.nameFormat "#1 of #2 elapsed">
 
 <!-- LOCALIZATION NOTE (positionAndDuration.nameFormat): the #1 string is the current
--- a/toolkit/themes/shared/jar.inc.mn
+++ b/toolkit/themes/shared/jar.inc.mn
@@ -102,10 +102,11 @@ toolkit.jar:
   skin/classic/global/plugins/plugin-blocked.svg            (../../shared/plugins/plugin-blocked.svg)
   skin/classic/global/plugins/pluginGeneric.svg             (../../shared/extensions/category-plugins.svg)
   skin/classic/global/plugins/pluginProblem.css             (../../shared/plugins/pluginProblem.css)
   skin/classic/global/plugins/contentPluginBlocked.png      (../../shared/plugins/contentPluginBlocked.png)
   skin/classic/global/plugins/contentPluginCrashed.png      (../../shared/plugins/contentPluginCrashed.png)
   skin/classic/global/plugins/contentPluginStripe.png       (../../shared/plugins/contentPluginStripe.png)
 #ifdef NIGHTLY_BUILD
   skin/classic/global/pictureinpicture/player.css           (../../shared/pictureinpicture/player.css)
+  skin/classic/global/media/pictureinpicture.svg            (../../shared/media/pictureinpicture.svg)
 #endif
 
new file mode 100644
--- /dev/null
+++ b/toolkit/themes/shared/media/pictureinpicture.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" version="1.1">
+  <g fill="none" fill-rule="evenodd" stroke="none" stroke-width="1">
+    <path stroke="context-stroke" d="M0.5 0.5h13v13h-13z"/>
+    <path fill="context-fill" d="M8 10h8v6h-8z"/>
+    <path stroke="context-stroke" d="M0.5 5.5h7v-5h-5.5a1.5 1.5 0 0 0 -1.5 1.5v3.5z"/>
+  </g>
+</svg>
\ No newline at end of file
--- a/toolkit/themes/shared/media/videocontrols.css
+++ b/toolkit/themes/shared/media/videocontrols.css
@@ -406,21 +406,36 @@
 .controlsContainer:not(.mobile) .statusIcon[type="throbber"] {
   background: url(chrome://global/skin/media/throbber.png) no-repeat center;
 }
 
 .controlsContainer:not(.mobile) .statusIcon[type="throbber"][stalled] {
   background: url(chrome://global/skin/media/stalled.png) no-repeat center;
 }
 
+.statusIcon[type="error"],
+.statusIcon[type="pictureInPicture"] {
+  background-size: contain;
+  background-repeat: no-repeat;
+  background-position: center;
+}
+
 .statusIcon[type="error"] {
   min-width: 70px;
   min-height: 60px;
-  background: url(chrome://global/skin/media/error.png) no-repeat center;
-  background-size: contain;
+  background-image: url(chrome://global/skin/media/error.png);
+}
+
+.statusIcon[type="pictureInPicture"] {
+  min-width: 84px;
+  min-height: 84px;
+  background-image: url(chrome://global/skin/media/pictureinpicture.svg);
+  -moz-context-properties: fill, stroke;
+  fill: #fff;
+  stroke: #fff;
 }
 
 /* Overlay Play button */
 .clickToPlay {
   min-width: var(--clickToPlay-size);
   min-height: var(--clickToPlay-size);
   border-radius: 50%;
   background-image: url(chrome://global/skin/media/playButton.svg);
@@ -448,41 +463,45 @@
   display: none;
 }
 
 .statusOverlay[fadeout],
 .statusOverlay[error] + .controlsOverlay > .controlsSpacerStack {
   opacity: 0;
 }
 
-/* Error description formatting */
-.errorLabel {
+.pictureInPictureOverlay {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  opacity: 1;
+  background-color: rgb(12, 12, 13);
+}
+
+/* Status description formatting */
+.statusLabel {
   padding: 0 10px;
   text-align: center;
   font: message-box;
   font-size: 14px;
   color: #ffffff;
 }
 
-.errorLabel {
+.statusLabel {
   display: none;
 }
 
-[error="errorAborted"]         > [anonid="errorAborted"],
-[error="errorNetwork"]         > [anonid="errorNetwork"],
-[error="errorDecode"]          > [anonid="errorDecode"],
-[error="errorSrcNotSupported"] > [anonid="errorSrcNotSupported"],
-[error="errorNoSource"]        > [anonid="errorNoSource"],
-[error="errorGeneric"]         > [anonid="errorGeneric"],
-[error="errorAborted"]         > [id="errorAborted"],
-[error="errorNetwork"]         > [id="errorNetwork"],
-[error="errorDecode"]          > [id="errorDecode"],
-[error="errorSrcNotSupported"] > [id="errorSrcNotSupported"],
-[error="errorNoSource"]        > [id="errorNoSource"],
-[error="errorGeneric"]         > [id="errorGeneric"] {
+[status="errorAborted"]         > [id="errorAborted"],
+[status="errorNetwork"]         > [id="errorNetwork"],
+[status="errorDecode"]          > [id="errorDecode"],
+[status="errorSrcNotSupported"] > [id="errorSrcNotSupported"],
+[status="errorNoSource"]        > [id="errorNoSource"],
+[status="errorGeneric"]         > [id="errorGeneric"],
+[status="pictureInPicture"]     > [id="pictureInPicture"] {
   display: inline;
 }
 
 %ifdef XP_WIN
 @media (-moz-windows-default-theme: 0) {
   .controlsSpacer,
   .clickToPlay {
     background-color: transparent;