V8 Project
ast.h File Reference
#include "src/v8.h"
#include "src/assembler.h"
#include "src/ast-value-factory.h"
#include "src/bailout-reason.h"
#include "src/factory.h"
#include "src/feedback-slots.h"
#include "src/interface.h"
#include "src/isolate.h"
#include "src/jsregexp.h"
#include "src/list-inl.h"
#include "src/runtime/runtime.h"
#include "src/small-pointer-list.h"
#include "src/smart-pointers.h"
#include "src/token.h"
#include "src/types.h"
#include "src/utils.h"
#include "src/variables.h"
#include "src/zone-inl.h"
+ Include dependency graph for ast.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  v8::internal::BASE_EMBEDDED< Visitor >
 
class  v8::internal::BASE_EMBEDDED< Visitor >::Flags
 
class  v8::internal::AstNode
 
class  v8::internal::AstNode::IdGen
 
class  v8::internal::Statement
 
class  v8::internal::FINAL< kOperandKind, kNumCachedOperands >
 Source to read snapshot and builtins files from. More...
 
class  v8::internal::Expression
 
class  v8::internal::BreakableStatement
 
class  v8::internal::Declaration
 
class  v8::internal::Module
 
class  v8::internal::IterationStatement
 
class  v8::internal::ForEachStatement
 
class  v8::internal::JumpStatement
 
class  v8::internal::TryStatement
 
class  v8::internal::MaterializedLiteral
 
struct  v8::internal::FINAL< kOperandKind, kNumCachedOperands >::Accessors
 
class  v8::internal::FINAL< kOperandKind, kNumCachedOperands >::IsExpression
 
class  v8::internal::FINAL< kOperandKind, kNumCachedOperands >::IsAnonymous
 
class  v8::internal::FINAL< kOperandKind, kNumCachedOperands >::Pretenure
 
class  v8::internal::FINAL< kOperandKind, kNumCachedOperands >::HasDuplicateParameters
 
class  v8::internal::FINAL< kOperandKind, kNumCachedOperands >::IsFunction
 
class  v8::internal::FINAL< kOperandKind, kNumCachedOperands >::IsParenthesized
 
class  v8::internal::FINAL< kOperandKind, kNumCachedOperands >::FunctionKindBits
 
class  v8::internal::RegExpTree
 

Namespaces

 v8
 Debugger support for the V8 JavaScript engine.
 
 v8::internal
 

Macros

#define DECLARATION_NODE_LIST(V)
 
#define MODULE_NODE_LIST(V)
 
#define STATEMENT_NODE_LIST(V)
 
#define EXPRESSION_NODE_LIST(V)
 
#define AST_NODE_LIST(V)
 
#define DEF_FORWARD_DECLARATION(type)   class type;
 
#define DECLARE_NODE_TYPE(type)
 
#define DECLARE_TYPE_ENUM(type)   k##type,
 
#define DECLARE_NODE_FUNCTIONS(type)
 
#define MAKE_CASE(Name)    virtual void* Visit##Name(RegExp##Name*, void* data) = 0;
 
#define MAKE_ASTYPE(Name)
 
#define DEF_VISIT(type)    virtual void Visit##type(type* node) = 0;
 
#define DEFINE_AST_VISITOR_SUBCLASS_MEMBERS()
 
#define DEF_VISIT(type)    void Visit##type(type* node);
 
#define DEF_VISIT(type)    void Visit##type(type* node) {}
 
#define VISIT_AND_RETURN(NodeType, node)
 
#define STATEMENT_WITH_LABELS(NodeType)
 

Typedefs

typedef ZoneList< Handle< String > > v8::internal::ZoneStringList
 
typedef ZoneList< Handle< Object > > v8::internal::ZoneObjectList
 

Enumerations

enum  v8::internal::AstPropertiesFlag { v8::internal::kDontSelfOptimize , v8::internal::kDontSoftInline , v8::internal::kDontCache }
 

Macro Definition Documentation

◆ AST_NODE_LIST

#define AST_NODE_LIST (   V)
Value:
MODULE_NODE_LIST(V) \
STATEMENT_NODE_LIST(V) \
EXPRESSION_NODE_LIST(V)
#define DECLARATION_NODE_LIST(V)
Definition: ast.h:44

Definition at line 102 of file ast.h.

◆ DECLARATION_NODE_LIST

#define DECLARATION_NODE_LIST (   V)
Value:
V(VariableDeclaration) \
V(FunctionDeclaration) \
V(ModuleDeclaration) \
V(ImportDeclaration) \
V(ExportDeclaration)
#define V(NAME, Name, id)
Definition: execution.h:170

Definition at line 44 of file ast.h.

◆ DECLARE_NODE_FUNCTIONS

#define DECLARE_NODE_FUNCTIONS (   type)
Value:
bool Is##type() const { return node_type() == AstNode::k##type; } \
type* As##type() { \
return Is##type() ? reinterpret_cast<type*>(this) : NULL; \
} \
const type* As##type() const { \
return Is##type() ? reinterpret_cast<const type*>(this) : NULL; \
}
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
bool Is(Object *obj)

Definition at line 221 of file ast.h.

◆ DECLARE_NODE_TYPE

#define DECLARE_NODE_TYPE (   type)
Value:
virtual void Accept(AstVisitor* v) OVERRIDE; \
virtual AstNode::NodeType node_type() const FINAL OVERRIDE { \
return AstNode::k##type; \
} \
template<class> friend class AstNodeFactory;
#define OVERRIDE
#define FINAL

Definition at line 147 of file ast.h.

◆ DECLARE_TYPE_ENUM

#define DECLARE_TYPE_ENUM (   type)    k##type,

Definition at line 202 of file ast.h.

◆ DEF_FORWARD_DECLARATION

#define DEF_FORWARD_DECLARATION (   type)    class type;

Definition at line 136 of file ast.h.

◆ DEF_VISIT [1/3]

#define DEF_VISIT (   type)     virtual void Visit##type(type* node) = 0;

Definition at line 3054 of file ast.h.

◆ DEF_VISIT [2/3]

#define DEF_VISIT (   type)     void Visit##type(type* node);

Definition at line 3054 of file ast.h.

◆ DEF_VISIT [3/3]

#define DEF_VISIT (   type)     void Visit##type(type* node) {}

Definition at line 3054 of file ast.h.

◆ DEFINE_AST_VISITOR_SUBCLASS_MEMBERS

#define DEFINE_AST_VISITOR_SUBCLASS_MEMBERS ( )
Value:
public: \
virtual void Visit(AstNode* node) FINAL OVERRIDE { \
if (!CheckStackOverflow()) node->Accept(this); \
} \
\
void SetStackOverflow() { stack_overflow_ = true; } \
void ClearStackOverflow() { stack_overflow_ = false; } \
bool HasStackOverflow() const { return stack_overflow_; } \
\
bool CheckStackOverflow() { \
if (stack_overflow_) return true; \
StackLimitCheck check(zone_->isolate()); \
if (!check.HasOverflowed()) return false; \
return (stack_overflow_ = true); \
} \
\
private: \
void InitializeAstVisitor(Zone* zone) { \
zone_ = zone; \
stack_overflow_ = false; \
} \
Zone* zone() { return zone_; } \
Isolate* isolate() { return zone_->isolate(); } \
\
Zone* zone_; \
bool stack_overflow_
enable harmony numeric enable harmony object literal extensions true

Definition at line 2973 of file ast.h.

◆ EXPRESSION_NODE_LIST

#define EXPRESSION_NODE_LIST (   V)
Value:
V(FunctionLiteral) \
V(ClassLiteral) \
V(NativeFunctionLiteral) \
V(Conditional) \
V(VariableProxy) \
V(Literal) \
V(RegExpLiteral) \
V(ObjectLiteral) \
V(ArrayLiteral) \
V(Assignment) \
V(Yield) \
V(Throw) \
V(Property) \
V(Call) \
V(CallNew) \
V(CallRuntime) \
V(UnaryOperation) \
V(CountOperation) \
V(BinaryOperation) \
V(CompareOperation) \
V(ThisFunction) \
V(SuperReference) \
V(CaseClause)
static Handle< Value > Throw(Isolate *isolate, const char *message)
Definition: d8.cc:72

Definition at line 77 of file ast.h.

◆ MAKE_ASTYPE

#define MAKE_ASTYPE (   Name)
Value:
virtual RegExp##Name* As##Name(); \
virtual bool Is##Name();

Definition at line 2612 of file ast.h.

◆ MAKE_CASE

#define MAKE_CASE (   Name)     virtual void* Visit##Name(RegExp##Name*, void* data) = 0;

Definition at line 2588 of file ast.h.

◆ MODULE_NODE_LIST

#define MODULE_NODE_LIST (   V)
Value:
V(ModuleLiteral) \
V(ModuleVariable) \
V(ModulePath) \
V(ModuleUrl)

Definition at line 51 of file ast.h.

◆ STATEMENT_NODE_LIST

#define STATEMENT_NODE_LIST (   V)
Value:
V(Block) \
V(ModuleStatement) \
V(ExpressionStatement) \
V(EmptyStatement) \
V(IfStatement) \
V(ContinueStatement) \
V(BreakStatement) \
V(ReturnStatement) \
V(WithStatement) \
V(SwitchStatement) \
V(DoWhileStatement) \
V(WhileStatement) \
V(ForStatement) \
V(ForInStatement) \
V(ForOfStatement) \
V(TryCatchStatement) \
V(TryFinallyStatement) \
V(DebuggerStatement)

Definition at line 57 of file ast.h.

◆ STATEMENT_WITH_LABELS

#define STATEMENT_WITH_LABELS (   NodeType)
Value:
NodeType* New##NodeType(ZoneList<const AstRawString*>* labels, int pos) { \
NodeType* stmt = new (zone_) NodeType(zone_, labels, pos, id_gen_); \
VISIT_AND_RETURN(NodeType, stmt); \
}

Definition at line 3153 of file ast.h.

◆ VISIT_AND_RETURN

#define VISIT_AND_RETURN (   NodeType,
  node 
)
Value:
visitor_.Visit##NodeType((node)); \
return node;

Definition at line 3074 of file ast.h.