Bug 1505343 - Part 1: Rename binsource => binast. r=Yoric
☠☠ backed out by 7cbe3fbc4b7f ☠ ☠
authorTooru Fujisawa <arai_a@mac.com>
Wed, 13 Mar 2019 02:46:12 +0000
changeset 463770 c1e2b7779d6a13626b13bbb1916f8819756a19ff
parent 463769 e2cb9629e540d06b3c4c20106cf2663acba5cf59
child 463771 b2456f6d11c4f3a9e02f601e16a3c8b80ae4aaa5
push id80355
push userarai_a@mac.com
push dateWed, 13 Mar 2019 03:09:12 +0000
treeherderautoland@4ac13d1f0d7c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs1505343
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
Bug 1505343 - Part 1: Rename binsource => binast. r=Yoric Differential Revision: https://phabricator.services.mozilla.com/D23097
Cargo.toml
js/src/frontend/BinAST-macros.h
js/src/frontend/BinAST.webidl_
js/src/frontend/BinAST.yaml
js/src/frontend/BinASTEnum.h
js/src/frontend/BinASTParser.cpp
js/src/frontend/BinASTParser.h
js/src/frontend/BinASTParserPerTokenizer.cpp
js/src/frontend/BinASTParserPerTokenizer.h
js/src/frontend/BinASTRuntimeSupport.cpp
js/src/frontend/BinASTRuntimeSupport.h
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/BinTokenReaderMultipart.cpp
js/src/frontend/BinTokenReaderMultipart.h
js/src/frontend/BytecodeCompiler.h
js/src/frontend/binast/Cargo.toml
js/src/frontend/binast/README.md
js/src/frontend/binast/build.sh
js/src/frontend/binast/moz.build
js/src/frontend/binast/src/main.rs
js/src/frontend/binast/src/refgraph.rs
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
js/src/frontend/moz.build
js/src/vm/JSScript.h
js/src/vm/Runtime.h
--- 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.
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,28 +22,28 @@ 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/BinAST-macros.h"
     #include "frontend/BinTokenReaderMultipart.h"
     #include "frontend/FullParseHandler.h"
     #include "frontend/ParseNode.h"
     #include "frontend/Parser.h"
     #include "frontend/SharedContext.h"
 
     #include "vm/RegExpObject.h"
 
@@ -75,17 +75,17 @@ hpp:
     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"
@@ -204,17 +204,17 @@ hpp:
     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: |
@@ -282,17 +282,17 @@ 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
 
       #include <stddef.h>
 
       /**
        * Definition of Binary AST tokens.
@@ -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;
--- 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,28 +2,28 @@
 // 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/BinAST-macros.h"
 #include "frontend/BinTokenReaderMultipart.h"
 #include "frontend/FullParseHandler.h"
 #include "frontend/ParseNode.h"
 #include "frontend/Parser.h"
 #include "frontend/SharedContext.h"
 
 #include "vm/RegExpObject.h"
 
@@ -2492,17 +2492,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;
@@ -2555,17 +2555,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;
@@ -2610,17 +2610,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;
@@ -2676,17 +2676,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;
@@ -2735,17 +2735,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;
--- a/js/src/frontend/BinASTParser.h
+++ b/js/src/frontend/BinASTParser.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_BinASTParser_h
 #define frontend_BinASTParser_h
 
 #include "mozilla/Maybe.h"
 
 #include "frontend/BCEParserHandle.h"
 #include "frontend/BinASTParserPerTokenizer.h"
--- a/js/src/frontend/BinASTParserPerTokenizer.cpp
+++ b/js/src/frontend/BinASTParserPerTokenizer.cpp
@@ -9,18 +9,18 @@
 #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/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,17 +175,17 @@ 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;
--- a/js/src/frontend/BinASTParserPerTokenizer.h
+++ b/js/src/frontend/BinASTParserPerTokenizer.h
@@ -279,17 +279,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,21 +309,21 @@ 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>;
 
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,15 +1,15 @@
 /* -*- 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 {
 
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,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_BinSourceSupport_h
-#define frontend_BinSourceSupport_h
+#ifndef frontend_BinASTSupport_h
+#define frontend_BinASTSupport_h
 
 #include "mozilla/HashFunctions.h"
 
 #include "frontend/BinToken.h"
 #include "gc/DeletePolicy.h"
 
 #include "js/AllocPolicy.h"
 #include "js/HashTable.h"
@@ -150,9 +150,9 @@ class BinASTSourceMetadata {
 }  // namespace frontend
 
 typedef UniquePtr<frontend::BinASTSourceMetadata,
                   GCManagedDeletePolicy<frontend::BinASTSourceMetadata>>
     UniqueBinASTSourceMetadataPtr;
 
 }  // namespace js
 
-#endif  // frontend_BinSourceSupport_h
+#endif  // frontend_BinASTSupport_h
--- a/js/src/frontend/BinToken.cpp
+++ b/js/src/frontend/BinToken.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "frontend/BinToken.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[] = {
--- a/js/src/frontend/BinToken.h
+++ b/js/src/frontend/BinToken.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_BinToken_h
 #define frontend_BinToken_h
 
 #include <stddef.h>
 
 /**
  * Definition of Binary AST tokens.
--- a/js/src/frontend/BinTokenReaderBase.cpp
+++ b/js/src/frontend/BinTokenReaderBase.cpp
@@ -1,17 +1,17 @@
 /* -*- 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/BinSource-macros.h"
+#include "frontend/BinAST-macros.h"
 #include "js/Result.h"
 
 namespace js {
 namespace frontend {
 
 template <typename T>
 using ErrorResult = mozilla::GenericErrorResult<T>;
 
--- a/js/src/frontend/BinTokenReaderMultipart.cpp
+++ b/js/src/frontend/BinTokenReaderMultipart.cpp
@@ -9,18 +9,18 @@
 #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.
--- a/js/src/frontend/BinTokenReaderMultipart.h
+++ b/js/src/frontend/BinTokenReaderMultipart.h
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef frontend_BinTokenReaderMultipart_h
 #define frontend_BinTokenReaderMultipart_h
 
 #include "mozilla/Maybe.h"
 
-#include "frontend/BinSourceRuntimeSupport.h"
+#include "frontend/BinASTRuntimeSupport.h"
 #include "frontend/BinToken.h"
 #include "frontend/BinTokenReaderBase.h"
 
 #include "js/Result.h"
 
 namespace js {
 namespace frontend {
 
--- 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/frontend/BinASTParser.h
+- js/src/frontend/BinASTParser.cpp
 - js/src/frontent/BinToken.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,13 +1,13 @@
 #!/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
 
 MACH=../../../../mach
 
 ${MACH} clang-format --path \
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
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,24 +67,24 @@ 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',
+        'BinASTRuntimeSupport.cpp',
         'BinToken.cpp',
         'BinTokenReaderBase.cpp',
         'BinTokenReaderMultipart.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
--- 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"