v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ast.h File Reference
#include "v8.h"
#include "assembler.h"
#include "factory.h"
#include "feedback-slots.h"
#include "isolate.h"
#include "jsregexp.h"
#include "list-inl.h"
#include "runtime.h"
#include "small-pointer-list.h"
#include "smart-pointers.h"
#include "token.h"
#include "types.h"
#include "utils.h"
#include "variables.h"
#include "interface.h"
#include "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.

Data Structures

class  AstNodeFactory< class >
 
class  BASE_EMBEDDED< Visitor >
 
class  BASE_EMBEDDED< Visitor >::Flags
 
class  AstNode
 
class  Statement
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  Expression
 
class  BreakableStatement
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  Declaration
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  Module
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  IterationStatement
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  ForEachStatement
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  JumpStatement
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  TryStatement
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  MaterializedLiteral
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
struct  V8_FINAL< kOperandKind, kNumCachedOperands >::Accessors
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  BASE_EMBEDDED< Visitor >
 
class  RegExpTree
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  BASE_EMBEDDED< Visitor >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  V8_FINAL< kOperandKind, kNumCachedOperands >
 
class  BASE_EMBEDDED< Visitor >
 
class  BASE_EMBEDDED< Visitor >
 
class  BASE_EMBEDDED< Visitor >
 
class  BASE_EMBEDDED< Visitor >
 

Namespaces

 v8
 
 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 > > 
ZoneStringList
 
typedef ZoneList< Handle
< Object > > 
ZoneObjectList
 

Enumerations

enum  AstPropertiesFlag { kDontInline, kDontSelfOptimize, kDontSoftInline, kDontCache }
 

Macro Definition Documentation

#define AST_NODE_LIST (   V)
Value:
#define STATEMENT_NODE_LIST(V)
Definition: ast.h:78
#define MODULE_NODE_LIST(V)
Definition: ast.h:72
#define DECLARATION_NODE_LIST(V)
Definition: ast.h:65
#define EXPRESSION_NODE_LIST(V)
Definition: ast.h:98

Definition at line 121 of file ast.h.

#define DECLARATION_NODE_LIST (   V)
Value:
V(VariableDeclaration) \
V(FunctionDeclaration) \
V(ModuleDeclaration) \
V(ImportDeclaration) \
V(ExportDeclaration) \

Definition at line 65 of file ast.h.

#define DECLARE_NODE_FUNCTIONS (   type)
Value:
bool Is##type() { return node_type() == AstNode::k##type; } \
type* As##type() { return Is##type() ? reinterpret_cast<type*>(this) : NULL; }
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
bool Is(Object *obj)

Definition at line 218 of file ast.h.

#define DECLARE_NODE_TYPE (   type)
Value:
virtual void Accept(AstVisitor* v) V8_OVERRIDE; \
virtual AstNode::NodeType node_type() const V8_FINAL V8_OVERRIDE { \
return AstNode::k##type; \
} \
template<class> friend class AstNodeFactory;
#define V8_OVERRIDE
Definition: v8config.h:402

Definition at line 165 of file ast.h.

#define DECLARE_TYPE_ENUM (   type)    k##type,

Definition at line 199 of file ast.h.

#define DEF_FORWARD_DECLARATION (   type)    class type;

Definition at line 154 of file ast.h.

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

Definition at line 2951 of file ast.h.

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

Definition at line 2951 of file ast.h.

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

Definition at line 2951 of file ast.h.

#define DEFINE_AST_VISITOR_SUBCLASS_MEMBERS ( )
Value:
public: \
virtual void Visit(AstNode* node) V8_FINAL V8_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 upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths true
void check(i::Vector< const uint8_t > string)
#define V8_OVERRIDE
Definition: v8config.h:402

Definition at line 2878 of file ast.h.

#define EXPRESSION_NODE_LIST (   V)
Value:
V(FunctionLiteral) \
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(CaseClause)

Definition at line 98 of file ast.h.

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

Definition at line 2517 of file ast.h.

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

Definition at line 2493 of file ast.h.

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

Definition at line 72 of file ast.h.

#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 78 of file ast.h.

#define STATEMENT_WITH_LABELS (   NodeType)
Value:
NodeType* New##NodeType(ZoneStringList* labels, int pos) { \
NodeType* stmt = new(zone_) NodeType(zone_, labels, pos); \
VISIT_AND_RETURN(NodeType, stmt); \
}
#define VISIT_AND_RETURN(NodeType, node)
Definition: ast.h:2971
ZoneList< Handle< String > > ZoneStringList
Definition: ast.h:161

Definition at line 3050 of file ast.h.

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

Definition at line 2971 of file ast.h.

Referenced by BASE_EMBEDDED< Visitor >::NewArrayLiteral(), BASE_EMBEDDED< Visitor >::NewAssignment(), BASE_EMBEDDED< Visitor >::NewBinaryOperation(), BASE_EMBEDDED< Visitor >::NewBlock(), BASE_EMBEDDED< Visitor >::NewBreakStatement(), BASE_EMBEDDED< Visitor >::NewCall(), BASE_EMBEDDED< Visitor >::NewCallNew(), BASE_EMBEDDED< Visitor >::NewCallRuntime(), BASE_EMBEDDED< Visitor >::NewCaseClause(), BASE_EMBEDDED< Visitor >::NewCompareOperation(), BASE_EMBEDDED< Visitor >::NewConditional(), BASE_EMBEDDED< Visitor >::NewContinueStatement(), BASE_EMBEDDED< Visitor >::NewCountOperation(), BASE_EMBEDDED< Visitor >::NewDebuggerStatement(), BASE_EMBEDDED< Visitor >::NewExportDeclaration(), BASE_EMBEDDED< Visitor >::NewExpressionStatement(), BASE_EMBEDDED< Visitor >::NewForEachStatement(), BASE_EMBEDDED< Visitor >::NewFunctionDeclaration(), BASE_EMBEDDED< Visitor >::NewIfStatement(), BASE_EMBEDDED< Visitor >::NewImportDeclaration(), BASE_EMBEDDED< Visitor >::NewLiteral(), BASE_EMBEDDED< Visitor >::NewModuleDeclaration(), BASE_EMBEDDED< Visitor >::NewModuleLiteral(), BASE_EMBEDDED< Visitor >::NewModulePath(), BASE_EMBEDDED< Visitor >::NewModuleStatement(), BASE_EMBEDDED< Visitor >::NewModuleUrl(), BASE_EMBEDDED< Visitor >::NewModuleVariable(), BASE_EMBEDDED< Visitor >::NewNativeFunctionLiteral(), BASE_EMBEDDED< Visitor >::NewObjectLiteral(), BASE_EMBEDDED< Visitor >::NewProperty(), BASE_EMBEDDED< Visitor >::NewRegExpLiteral(), BASE_EMBEDDED< Visitor >::NewReturnStatement(), BASE_EMBEDDED< Visitor >::NewThisFunction(), BASE_EMBEDDED< Visitor >::NewThrow(), BASE_EMBEDDED< Visitor >::NewTryCatchStatement(), BASE_EMBEDDED< Visitor >::NewTryFinallyStatement(), BASE_EMBEDDED< Visitor >::NewUnaryOperation(), BASE_EMBEDDED< Visitor >::NewVariableDeclaration(), BASE_EMBEDDED< Visitor >::NewVariableProxy(), BASE_EMBEDDED< Visitor >::NewWithStatement(), and BASE_EMBEDDED< Visitor >::NewYield().