зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1505343 - Part 1: Rename binsource => binast. r=Yoric
Differential Revision: https://phabricator.services.mozilla.com/D23097 --HG-- rename : js/src/frontend/BinSource-macros.h => js/src/frontend/BinAST-macros.h rename : js/src/frontend/BinSource.webidl_ => js/src/frontend/BinAST.webidl_ rename : js/src/frontend/BinSource.yaml => js/src/frontend/BinAST.yaml rename : js/src/frontend/BinSourceRuntimeSupport.cpp => js/src/frontend/BinASTRuntimeSupport.cpp rename : js/src/frontend/BinSourceRuntimeSupport.h => js/src/frontend/BinASTRuntimeSupport.h rename : js/src/frontend/binsource/Cargo.toml => js/src/frontend/binast/Cargo.toml rename : js/src/frontend/binsource/README.md => js/src/frontend/binast/README.md rename : js/src/frontend/binsource/build.sh => js/src/frontend/binast/build.sh rename : js/src/frontend/binsource/moz.build => js/src/frontend/binast/moz.build rename : js/src/frontend/binsource/src/main.rs => js/src/frontend/binast/src/main.rs rename : js/src/frontend/binsource/src/refgraph.rs => js/src/frontend/binast/src/refgraph.rs extra : moz-landing-system : lando
This commit is contained in:
Родитель
c8995710a9
Коммит
9b128e23cc
|
@ -9,7 +9,7 @@ members = [
|
|||
"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",
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* 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"
|
||||
|
||||
|
@ -59,4 +59,4 @@
|
|||
if (_##VAR.isErr()) return ::mozilla::Err(_##VAR.unwrapErr()); \
|
||||
auto VAR = _##VAR.unwrap();
|
||||
|
||||
#endif // frontend_BinSource_macros_h
|
||||
#endif // frontend_BinAST_macros_h
|
|
@ -27,7 +27,7 @@ cpp:
|
|||
* 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"
|
||||
|
||||
|
@ -38,7 +38,7 @@ cpp:
|
|||
#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"
|
||||
|
@ -80,7 +80,7 @@ hpp:
|
|||
* 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
|
||||
|
@ -209,7 +209,7 @@ hpp:
|
|||
* 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
|
||||
|
@ -287,7 +287,7 @@ hpp:
|
|||
|
||||
|
||||
// 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
|
||||
|
@ -921,7 +921,7 @@ EagerFunctionExpression:
|
|||
|
||||
// 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());
|
|
@ -7,7 +7,7 @@
|
|||
* 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
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* 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"
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
|||
#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"
|
||||
|
@ -2497,7 +2497,7 @@ BinASTParser<Tok>::parseInterfaceEagerFunctionDeclaration(
|
|||
|
||||
// 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());
|
||||
|
@ -2560,7 +2560,7 @@ JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerFunctionExpression(
|
|||
|
||||
// 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());
|
||||
|
@ -2615,7 +2615,7 @@ JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerGetter(
|
|||
|
||||
// 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());
|
||||
|
@ -2681,7 +2681,7 @@ JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerMethod(
|
|||
|
||||
// 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());
|
||||
|
@ -2740,7 +2740,7 @@ JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceEagerSetter(
|
|||
|
||||
// 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());
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* 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
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
#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"
|
||||
|
@ -118,7 +118,8 @@ JS::Result<ParseNode*> BinASTParserPerTokenizer<Tok>::parseAux(
|
|||
|
||||
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();
|
||||
}
|
||||
|
@ -179,7 +180,7 @@ JS::Result<FunctionNode*> BinASTParserPerTokenizer<Tok>::parseLazyFunction(
|
|||
|
||||
// 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());
|
||||
|
|
|
@ -284,7 +284,7 @@ class BinASTParserPerTokenizer : public BinASTParserBase,
|
|||
mozilla::Maybe<Tokenizer> tokenizer_;
|
||||
VariableDeclarationKind variableDeclarationKind_;
|
||||
|
||||
friend class BinParseContext;
|
||||
friend class BinASTParseContext;
|
||||
friend class AutoVariableDeclarationKind;
|
||||
|
||||
// Helper class: Restore field `variableDeclarationKind` upon leaving a scope.
|
||||
|
@ -314,11 +314,11 @@ class BinASTParserPerTokenizer : public BinASTParserBase,
|
|||
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) {}
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 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"
|
|
@ -4,8 +4,8 @@
|
|||
* 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"
|
||||
|
||||
|
@ -155,4 +155,4 @@ typedef UniquePtr<frontend::BinASTSourceMetadata,
|
|||
|
||||
} // namespace js
|
||||
|
||||
#endif // frontend_BinSourceSupport_h
|
||||
#endif // frontend_BinASTSupport_h
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "frontend/BinSourceRuntimeSupport.h"
|
||||
#include "frontend/BinASTRuntimeSupport.h"
|
||||
#include "frontend/TokenStream.h"
|
||||
#include "js/Result.h"
|
||||
#include "vm/JSContext.h"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* 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
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "frontend/BinTokenReaderBase.h"
|
||||
|
||||
#include "frontend/BinSource-macros.h"
|
||||
#include "frontend/BinAST-macros.h"
|
||||
#include "js/Result.h"
|
||||
|
||||
namespace js {
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
#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"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "mozilla/Maybe.h"
|
||||
|
||||
#include "frontend/BinSourceRuntimeSupport.h"
|
||||
#include "frontend/BinASTRuntimeSupport.h"
|
||||
#include "frontend/BinToken.h"
|
||||
#include "frontend/BinTokenReaderBase.h"
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
* 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
|
||||
|
|
|
@ -14,5 +14,5 @@ yaml-rust = "^0.4.2"
|
|||
webidl = "^0.8"
|
||||
|
||||
[[bin]]
|
||||
name = "binsource"
|
||||
name = "binast"
|
||||
path = "src/main.rs"
|
|
@ -0,0 +1,16 @@
|
|||
A parser generator used to generate the following files:
|
||||
|
||||
- js/src/frontend/BinASTParser.h
|
||||
- js/src/frontend/BinASTParser.cpp
|
||||
- js/src/frontent/BinToken.h
|
||||
|
||||
from the following files:
|
||||
|
||||
- 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/binast
|
||||
% ./build.sh
|
||||
```
|
|
@ -1,8 +1,8 @@
|
|||
#!/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 \
|
|
@ -4,4 +4,4 @@
|
|||
# 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']
|
|
@ -1,16 +0,0 @@
|
|||
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
|
||||
|
||||
from the following files:
|
||||
|
||||
- js/src/frontend/BinSource.webidl_ (specifications of BinAST)
|
||||
- js/src/frontend/BinSource.yaml (parser generator driver)
|
||||
|
||||
To use it:
|
||||
```sh
|
||||
$ cd $(topsrcdir)/js/src/frontend/binsource
|
||||
% ./build.sh
|
||||
```
|
|
@ -72,14 +72,14 @@ if CONFIG['JS_BUILD_BINAST']:
|
|||
'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.
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "jstypes.h"
|
||||
|
||||
#include "frontend/BinSourceRuntimeSupport.h"
|
||||
#include "frontend/BinASTRuntimeSupport.h"
|
||||
#include "frontend/NameAnalysisTypes.h"
|
||||
#include "gc/Barrier.h"
|
||||
#include "gc/Rooting.h"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче