28 #ifndef V8_PRETTYPRINTER_H_
29 #define V8_PRETTYPRINTER_H_
39 class PrettyPrinter:
public AstVisitor {
41 explicit PrettyPrinter(Zone* zone);
42 virtual ~PrettyPrinter();
46 const char*
Print(AstNode* node);
47 const char* PrintExpression(FunctionLiteral* program);
48 const char* PrintProgram(FunctionLiteral* program);
50 void Print(
const char* format, ...);
53 static void PrintOut(Zone* zone, AstNode* node);
56 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
67 const char* Output()
const {
return output_; }
69 virtual void PrintStatements(ZoneList<Statement*>* statements);
71 virtual void PrintArguments(ZoneList<Expression*>* arguments);
72 void PrintLiteral(Handle<Object> value,
bool quote);
73 void PrintParameters(Scope* scope);
74 void PrintDeclarations(ZoneList<Declaration*>* declarations);
75 void PrintFunctionLiteral(FunctionLiteral*
function);
76 void PrintCaseClause(CaseClause* clause);
83 class AstPrinter:
public PrettyPrinter {
85 explicit AstPrinter(Zone* zone);
86 virtual ~AstPrinter();
88 const char* PrintProgram(FunctionLiteral* program);
91 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
96 friend class IndentedScope;
97 void PrintIndented(
const char* txt);
98 void PrintIndentedVisit(
const char* s, AstNode* node);
100 void PrintStatements(ZoneList<Statement*>* statements);
101 void PrintDeclarations(ZoneList<Declaration*>* declarations);
102 void PrintParameters(Scope* scope);
103 void PrintArguments(ZoneList<Expression*>* arguments);
104 void PrintCaseClause(CaseClause* clause);
105 void PrintLiteralIndented(
const char*
info, Handle<Object> value,
bool quote);
106 void PrintLiteralWithModeIndented(
const char*
info,
108 Handle<Object> value);
111 void inc_indent() { indent_++; }
112 void dec_indent() { indent_--; }
121 #endif // V8_PRETTYPRINTER_H_
#define DECLARE_VISIT(type)
#define DEFINE_AST_VISITOR_SUBCLASS_MEMBERS()
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 trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function info
void Print(const v8::FunctionCallbackInfo< v8::Value > &args)
ZoneList< Handle< String > > ZoneStringList