Name Description Size Usage: FILE This script aligns the stack transition comment in BytecodeEmitter and its helper classes. The stack transition comment looks like the following: // [stack] VAL1 VAL2 VAL3 2658
BCEParserHandle.h 919
BinASTEnum.h 2116
BinASTParser.cpp AssertedMaybePositionalParameterName ::= AssertedParameterName AssertedPositionalParameterName AssertedRestParameterName 170321
BinASTParser.h 28041
BinASTParserBase.cpp The parser can allocate enormous amounts of memory for large functions. Eagerly free the memory now (which otherwise won't be freed until the next GC) to avoid unnecessary OOMs. 1882
BinASTParserBase.h 2162
BinASTParserPerTokenizer.cpp newDirectives = 28676
BinASTParserPerTokenizer.h A Binary AST parser. At the time of this writing, this parser implements the grammar of ES5 and trusts its input (in particular, variable declarations). 12121
binsource A parser generator used to generate the following files: 5
BinSource-macros.h 2640
BinSource.webidl_ 27383
BinSource.yaml 52615
BinSourceRuntimeSupport.cpp static 1283
BinSourceRuntimeSupport.h 4798
BinToken.cpp 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. 4538
BinToken.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 list of fields, where each field is: - a Name (see `BinField`); - 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 language grows, but never removed. The mapping between Kind and list of fields may also change to add new fields or make some fields optional, but may never remove a field. Finally, the mapping between (Kind, Name) and the structure of Value may be modified to add new possible values, but never to remove a value. A Binary AST parser must be able to fail gracefully when confronted with unknown Kinds or Names. 20600
BinTokenReaderBase.cpp 3120
BinTokenReaderBase.h Return the position of the latest token. 5203
BinTokenReaderMultipart.cpp 15288
BinTokenReaderMultipart.h A token reader implementing the "multipart" serialization format for BinAST. This serialization format, which is also supported by the reference 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. 10276
BytecodeCompilation.h 6408
BytecodeCompiler.cpp 38469
BytecodeCompiler.h ", " 5196
BytecodeControlStructures.cpp 4638
BytecodeControlStructures.h 6712
BytecodeEmitter.cpp JS bytecode generation. 276830
BytecodeEmitter.h JS bytecode generation. 36345
CallOrNewEmitter.cpp 8214
CallOrNewEmitter.h 10956
CForEmitter.cpp 6795
CForEmitter.h 6120
DoWhileEmitter.cpp 2580
DoWhileEmitter.h namespace frontend 2168
EitherParser.h A variant-like class abstracting operations on a Parser with a given ParseHandler but unspecified character type. 4972
ElemOpEmitter.cpp 7423
ElemOpEmitter.h 8106
EmitterScope.cpp static 35555
EmitterScope.h 5720
ErrorReporter.h 16432
ExpressionStatementEmitter.cpp 1517
ExpressionStatementEmitter.h frontend_ExpressionStatementEmitter_h 2129
FoldConstants.cpp 49316
FoldConstants.h namespace frontend 1503
ForInEmitter.cpp 5068
ForInEmitter.h namespace frontend 3774
ForOfEmitter.cpp 7574
ForOfEmitter.h namespace frontend 3589
ForOfLoopControl.cpp = CompletionKind::Normal 6936
ForOfLoopControl.h namespace frontend 3221
FullParseHandler.h If this is a full parse to construct the bytecode for a function that was previously lazily parsed, that lazy function and the current index into its inner functions. We do not want to reparse the inner functions. 35884 6293
IfEmitter.cpp 6750
IfEmitter.h 9013
JumpList.cpp 969
JumpList.h namespace frontend 2305
LabelEmitter.cpp 1539
LabelEmitter.h namespace frontend 1732
LexicalScopeEmitter.cpp 1405
LexicalScopeEmitter.h namespace frontend 2888
ModuleSharedContext.h frontend_ModuleSharedContext_h 1532 2752
NameAnalysisTypes.h 10313
NameCollections.h 10773
NameFunctions.cpp number of parents in the parents array 32910
NameFunctions.h namespace frontend 654
NameOpEmitter.cpp 11506
NameOpEmitter.h namespace frontend 4867
ObjectEmitter.cpp = Kind::Prototype 22962
ObjectEmitter.h 24898
ParseContext-inl.h 4807
ParseContext.cpp 17365
ParseContext.h 20741
ParseNode.cpp Allocate a ParseNode from parser's node freelist or, failing that, from cx's temporary arena. 13769
ParseNode.h clang-format off 77184
ParseNodeVisitor.h Utility class for walking a JS AST. Simple usage: class HowTrueVisitor : public ParseNodeVisitor<HowTrueVisitor> { public: bool visitTrue(ParseNode*& pn) { std::cout << "How true.\n"; return true; } bool visitClass(ParseNode*& pn) { // The base-class implementation of each visit method // simply visits the node's children. So the subclass // gets to decide whether to descend into a subtree // and can do things either before or after: std::cout << "How classy.\n"; return ParseNodeVisitor::visitClass(pn); } }; HowTrueVisitor v; v.visit(programRootNode); // walks the entire tree Note that the Curiously Recurring Template Pattern is used for performance, as it eliminates the need for virtual method calls. Some rough testing shows about a 12% speedup in the FoldConstants.cpp pass. 2690
Parser.cpp JS parser. This is a recursive-descent parser for the JavaScript language specified by "The ECMAScript Language Specification" (Standard ECMA-262). It uses lexical and semantic feedback to disambiguate non-LL(1) structures. It generates trees of nodes induced by the recursive parsing (not precise syntax trees, see Parser.h). After tree construction, it rewrites trees to fold constants and evaluate compile-time expressions. This parser attempts no error recovery. 311226
Parser.h JS parser. 71573
PropOpEmitter.cpp 6787
PropOpEmitter.h 7424
ReservedWords.h A higher-order macro for enumerating reserved word tokens. 5540
SharedContext-inl.h 725
SharedContext.cpp 9071
SharedContext.h The struct SharedContext is part of the current parser context (see ParseContext). It stores information that is reused between the parser and the bytecode emitter. 21183
SourceNotes.h Source notes generated along with bytecode for decompiling and debugging. A source note is a uint8_t with 5 bits of type and 3 of offset from the pc of the previous note. If 3 bits of offset aren't enough, extended delta notes (SRC_XDELTA) consisting of 2 set high order bits followed by 6 offset bits are emitted before the next note. Some notes have operand offsets encoded immediately after them, in note bytes or byte-triples. Source Note Extended Delta +7-6-5-4-3+2-1-0+ +7-6-5+4-3-2-1-0+ |note-type|delta| |1 1| ext-delta | +---------+-----+ +---+-----------+ At most one "gettable" note (i.e., a note of type other than SRC_NEWLINE, SRC_COLSPAN, SRC_SETLINE, and SRC_XDELTA) applies to a given bytecode. NB: the js_SrcNoteSpec array in BytecodeEmitter.cpp is indexed by this enum, so its initializers need to match the order here. 11486
SwitchEmitter.cpp 11844
SwitchEmitter.h 13482
SyntaxParseHandler.h 24203
TDZCheckCache.cpp 1943
TDZCheckCache.h namespace frontend 2204
TokenKind.h List of token kinds and their ranges. The format for each line is: MACRO(<TOKEN_KIND_NAME>, <DESCRIPTION>) or RANGE(<TOKEN_RANGE_NAME>, <TOKEN_KIND_NAME>) where ; <TOKEN_KIND_NAME> is a legal C identifier of the token, that will be used in the JS engine source. <DESCRIPTION> is a string that describe about the token, and will be used in error message. <TOKEN_RANGE_NAME> is a legal C identifier of the range that will be used to JS engine source. It should end with `First` or `Last`. This is used to check TokenKind by range-testing: BinOpFirst <= tt && tt <= BinOpLast Second argument of `RANGE` is the actual value of the <TOKEN_RANGE_NAME>, should be same as one of <TOKEN_KIND_NAME> in other `MACRO`s. To use this macro, define two macros for `MACRO` and `RANGE`, and pass them as arguments. #define EMIT_TOKEN(name, desc) ... #define EMIT_RANGE(name, value) ... FOR_EACH_TOKEN_KIND_WITH_RANGE(EMIT_TOKEN, EMIT_RANGE) #undef EMIT_TOKEN #undef EMIT_RANGE If you don't need range data, use FOR_EACH_TOKEN_KIND instead. #define EMIT_TOKEN(name, desc) ... FOR_EACH_TOKEN_KIND(EMIT_TOKEN) #undef EMIT_TOKEN Note that this list does not contain ERROR and LIMIT. 18415
TokenStream.cpp 109304
TokenStream.h Streaming access to the raw tokens of JavaScript source. Because JS tokenization is context-sensitive -- a '/' could be either a regular expression *or* a division operator depending on context -- the various token stream classes are mostly not useful outside of the Parser where they reside. We should probably eventually merge the two concepts. 102981
TryEmitter.cpp = Nothing() 7187
TryEmitter.h 6753
ValueUsage.h namespace frontend 983
WhileEmitter.cpp 3529
WhileEmitter.h namespace frontend 2693