Lines Matching refs:node

39 void CallPrinter::Find(AstNode* node, bool print) {  in Find()  argument
44 Visit(node); in Find()
49 Visit(node); in Find()
92 void CallPrinter::VisitBlock(Block* node) { in VisitBlock() argument
93 FindStatements(node->statements()); in VisitBlock()
97 void CallPrinter::VisitVariableDeclaration(VariableDeclaration* node) {} in VisitVariableDeclaration() argument
100 void CallPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) {} in VisitFunctionDeclaration() argument
103 void CallPrinter::VisitImportDeclaration(ImportDeclaration* node) { in VisitImportDeclaration() argument
107 void CallPrinter::VisitExportDeclaration(ExportDeclaration* node) {} in VisitExportDeclaration() argument
110 void CallPrinter::VisitExpressionStatement(ExpressionStatement* node) { in VisitExpressionStatement() argument
111 Find(node->expression()); in VisitExpressionStatement()
115 void CallPrinter::VisitEmptyStatement(EmptyStatement* node) {} in VisitEmptyStatement() argument
119 SloppyBlockFunctionStatement* node) { in VisitSloppyBlockFunctionStatement() argument
120 Find(node->statement()); in VisitSloppyBlockFunctionStatement()
124 void CallPrinter::VisitIfStatement(IfStatement* node) { in VisitIfStatement() argument
125 Find(node->condition()); in VisitIfStatement()
126 Find(node->then_statement()); in VisitIfStatement()
127 if (node->HasElseStatement()) { in VisitIfStatement()
128 Find(node->else_statement()); in VisitIfStatement()
133 void CallPrinter::VisitContinueStatement(ContinueStatement* node) {} in VisitContinueStatement() argument
136 void CallPrinter::VisitBreakStatement(BreakStatement* node) {} in VisitBreakStatement() argument
139 void CallPrinter::VisitReturnStatement(ReturnStatement* node) { in VisitReturnStatement() argument
140 Find(node->expression()); in VisitReturnStatement()
144 void CallPrinter::VisitWithStatement(WithStatement* node) { in VisitWithStatement() argument
145 Find(node->expression()); in VisitWithStatement()
146 Find(node->statement()); in VisitWithStatement()
150 void CallPrinter::VisitSwitchStatement(SwitchStatement* node) { in VisitSwitchStatement() argument
151 Find(node->tag()); in VisitSwitchStatement()
152 ZoneList<CaseClause*>* cases = node->cases(); in VisitSwitchStatement()
165 void CallPrinter::VisitDoWhileStatement(DoWhileStatement* node) { in VisitDoWhileStatement() argument
166 Find(node->body()); in VisitDoWhileStatement()
167 Find(node->cond()); in VisitDoWhileStatement()
171 void CallPrinter::VisitWhileStatement(WhileStatement* node) { in VisitWhileStatement() argument
172 Find(node->cond()); in VisitWhileStatement()
173 Find(node->body()); in VisitWhileStatement()
177 void CallPrinter::VisitForStatement(ForStatement* node) { in VisitForStatement() argument
178 if (node->init() != NULL) { in VisitForStatement()
179 Find(node->init()); in VisitForStatement()
181 if (node->cond() != NULL) Find(node->cond()); in VisitForStatement()
182 if (node->next() != NULL) Find(node->next()); in VisitForStatement()
183 Find(node->body()); in VisitForStatement()
187 void CallPrinter::VisitForInStatement(ForInStatement* node) { in VisitForInStatement() argument
188 Find(node->each()); in VisitForInStatement()
189 Find(node->enumerable()); in VisitForInStatement()
190 Find(node->body()); in VisitForInStatement()
194 void CallPrinter::VisitForOfStatement(ForOfStatement* node) { in VisitForOfStatement() argument
195 Find(node->each()); in VisitForOfStatement()
196 Find(node->assign_iterator()); in VisitForOfStatement()
197 Find(node->body()); in VisitForOfStatement()
198 Find(node->next_result()); in VisitForOfStatement()
202 void CallPrinter::VisitTryCatchStatement(TryCatchStatement* node) { in VisitTryCatchStatement() argument
203 Find(node->try_block()); in VisitTryCatchStatement()
204 Find(node->catch_block()); in VisitTryCatchStatement()
208 void CallPrinter::VisitTryFinallyStatement(TryFinallyStatement* node) { in VisitTryFinallyStatement() argument
209 Find(node->try_block()); in VisitTryFinallyStatement()
210 Find(node->finally_block()); in VisitTryFinallyStatement()
214 void CallPrinter::VisitDebuggerStatement(DebuggerStatement* node) {} in VisitDebuggerStatement() argument
217 void CallPrinter::VisitFunctionLiteral(FunctionLiteral* node) { in VisitFunctionLiteral() argument
218 FindStatements(node->body()); in VisitFunctionLiteral()
222 void CallPrinter::VisitClassLiteral(ClassLiteral* node) { in VisitClassLiteral() argument
223 if (node->extends()) Find(node->extends()); in VisitClassLiteral()
224 for (int i = 0; i < node->properties()->length(); i++) { in VisitClassLiteral()
225 Find(node->properties()->at(i)->value()); in VisitClassLiteral()
230 void CallPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) {} in VisitNativeFunctionLiteral() argument
233 void CallPrinter::VisitDoExpression(DoExpression* node) { Find(node->block()); } in VisitDoExpression() argument
236 void CallPrinter::VisitConditional(Conditional* node) { in VisitConditional() argument
237 Find(node->condition()); in VisitConditional()
238 Find(node->then_expression()); in VisitConditional()
239 Find(node->else_expression()); in VisitConditional()
243 void CallPrinter::VisitLiteral(Literal* node) { in VisitLiteral() argument
244 PrintLiteral(*node->value(), true); in VisitLiteral()
248 void CallPrinter::VisitRegExpLiteral(RegExpLiteral* node) { in VisitRegExpLiteral() argument
250 PrintLiteral(*node->pattern(), false); in VisitRegExpLiteral()
252 if (node->flags() & RegExp::kGlobal) Print("g"); in VisitRegExpLiteral()
253 if (node->flags() & RegExp::kIgnoreCase) Print("i"); in VisitRegExpLiteral()
254 if (node->flags() & RegExp::kMultiline) Print("m"); in VisitRegExpLiteral()
255 if (node->flags() & RegExp::kUnicode) Print("u"); in VisitRegExpLiteral()
256 if (node->flags() & RegExp::kSticky) Print("y"); in VisitRegExpLiteral()
260 void CallPrinter::VisitObjectLiteral(ObjectLiteral* node) { in VisitObjectLiteral() argument
261 for (int i = 0; i < node->properties()->length(); i++) { in VisitObjectLiteral()
262 Find(node->properties()->at(i)->value()); in VisitObjectLiteral()
267 void CallPrinter::VisitArrayLiteral(ArrayLiteral* node) { in VisitArrayLiteral() argument
269 for (int i = 0; i < node->values()->length(); i++) { in VisitArrayLiteral()
271 Find(node->values()->at(i), true); in VisitArrayLiteral()
277 void CallPrinter::VisitVariableProxy(VariableProxy* node) { in VisitVariableProxy() argument
282 PrintLiteral(*node->name(), false); in VisitVariableProxy()
287 void CallPrinter::VisitAssignment(Assignment* node) { in VisitAssignment() argument
288 Find(node->target()); in VisitAssignment()
289 Find(node->value()); in VisitAssignment()
293 void CallPrinter::VisitYield(Yield* node) { Find(node->expression()); } in VisitYield() argument
296 void CallPrinter::VisitThrow(Throw* node) { Find(node->exception()); } in VisitThrow() argument
299 void CallPrinter::VisitProperty(Property* node) { in VisitProperty() argument
300 Expression* key = node->key(); in VisitProperty()
303 Find(node->obj(), true); in VisitProperty()
307 Find(node->obj(), true); in VisitProperty()
315 void CallPrinter::VisitCall(Call* node) { in VisitCall() argument
316 bool was_found = !found_ && node->position() == position_; in VisitCall()
320 if (is_builtin_ && node->expression()->IsVariableProxy()) { in VisitCall()
326 Find(node->expression(), true); in VisitCall()
328 FindArguments(node->arguments()); in VisitCall()
333 void CallPrinter::VisitCallNew(CallNew* node) { in VisitCallNew() argument
334 bool was_found = !found_ && node->position() == position_; in VisitCallNew()
338 if (is_builtin_ && node->expression()->IsVariableProxy()) { in VisitCallNew()
344 Find(node->expression(), was_found); in VisitCallNew()
345 FindArguments(node->arguments()); in VisitCallNew()
350 void CallPrinter::VisitCallRuntime(CallRuntime* node) { in VisitCallRuntime() argument
351 FindArguments(node->arguments()); in VisitCallRuntime()
355 void CallPrinter::VisitUnaryOperation(UnaryOperation* node) { in VisitUnaryOperation() argument
356 Token::Value op = node->op(); in VisitUnaryOperation()
360 Find(node->expression(), true); in VisitUnaryOperation()
365 void CallPrinter::VisitCountOperation(CountOperation* node) { in VisitCountOperation() argument
367 if (node->is_prefix()) Print("%s", Token::String(node->op())); in VisitCountOperation()
368 Find(node->expression(), true); in VisitCountOperation()
369 if (node->is_postfix()) Print("%s", Token::String(node->op())); in VisitCountOperation()
374 void CallPrinter::VisitBinaryOperation(BinaryOperation* node) { in VisitBinaryOperation() argument
376 Find(node->left(), true); in VisitBinaryOperation()
377 Print(" %s ", Token::String(node->op())); in VisitBinaryOperation()
378 Find(node->right(), true); in VisitBinaryOperation()
383 void CallPrinter::VisitCompareOperation(CompareOperation* node) { in VisitCompareOperation() argument
385 Find(node->left(), true); in VisitCompareOperation()
386 Print(" %s ", Token::String(node->op())); in VisitCompareOperation()
387 Find(node->right(), true); in VisitCompareOperation()
392 void CallPrinter::VisitSpread(Spread* node) { in VisitSpread() argument
394 Find(node->expression(), true); in VisitSpread()
399 void CallPrinter::VisitEmptyParentheses(EmptyParentheses* node) { in VisitEmptyParentheses() argument
404 void CallPrinter::VisitThisFunction(ThisFunction* node) {} in VisitThisFunction() argument
407 void CallPrinter::VisitSuperPropertyReference(SuperPropertyReference* node) {} in VisitSuperPropertyReference() argument
410 void CallPrinter::VisitSuperCallReference(SuperCallReference* node) { in VisitSuperCallReference() argument
416 RewritableAssignmentExpression* node) { in VisitRewritableAssignmentExpression() argument
417 Find(node->expression()); in VisitRewritableAssignmentExpression()
471 static int FormatSlotNode(Vector<char>* buf, Expression* node, in FormatSlotNode() argument
494 void PrettyPrinter::VisitBlock(Block* node) { in VisitBlock() argument
495 if (!node->ignore_completion_value()) Print("{ "); in VisitBlock()
496 PrintStatements(node->statements()); in VisitBlock()
497 if (node->statements()->length() > 0) Print(" "); in VisitBlock()
498 if (!node->ignore_completion_value()) Print("}"); in VisitBlock()
502 void PrettyPrinter::VisitVariableDeclaration(VariableDeclaration* node) { in VisitVariableDeclaration() argument
504 PrintLiteral(node->proxy()->name(), false); in VisitVariableDeclaration()
509 void PrettyPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) { in VisitFunctionDeclaration() argument
511 PrintLiteral(node->proxy()->name(), false); in VisitFunctionDeclaration()
513 PrintFunctionLiteral(node->fun()); in VisitFunctionDeclaration()
518 void PrettyPrinter::VisitImportDeclaration(ImportDeclaration* node) { in VisitImportDeclaration() argument
520 PrintLiteral(node->proxy()->name(), false); in VisitImportDeclaration()
522 PrintLiteral(node->module_specifier()->string(), true); in VisitImportDeclaration()
527 void PrettyPrinter::VisitExportDeclaration(ExportDeclaration* node) { in VisitExportDeclaration() argument
529 PrintLiteral(node->proxy()->name(), false); in VisitExportDeclaration()
534 void PrettyPrinter::VisitExpressionStatement(ExpressionStatement* node) { in VisitExpressionStatement() argument
535 Visit(node->expression()); in VisitExpressionStatement()
540 void PrettyPrinter::VisitEmptyStatement(EmptyStatement* node) { in VisitEmptyStatement() argument
546 SloppyBlockFunctionStatement* node) { in VisitSloppyBlockFunctionStatement() argument
547 Visit(node->statement()); in VisitSloppyBlockFunctionStatement()
551 void PrettyPrinter::VisitIfStatement(IfStatement* node) { in VisitIfStatement() argument
553 Visit(node->condition()); in VisitIfStatement()
555 Visit(node->then_statement()); in VisitIfStatement()
556 if (node->HasElseStatement()) { in VisitIfStatement()
558 Visit(node->else_statement()); in VisitIfStatement()
563 void PrettyPrinter::VisitContinueStatement(ContinueStatement* node) { in VisitContinueStatement() argument
565 ZoneList<const AstRawString*>* labels = node->target()->labels(); in VisitContinueStatement()
575 void PrettyPrinter::VisitBreakStatement(BreakStatement* node) { in VisitBreakStatement() argument
577 ZoneList<const AstRawString*>* labels = node->target()->labels(); in VisitBreakStatement()
587 void PrettyPrinter::VisitReturnStatement(ReturnStatement* node) { in VisitReturnStatement() argument
589 Visit(node->expression()); in VisitReturnStatement()
594 void PrettyPrinter::VisitWithStatement(WithStatement* node) { in VisitWithStatement() argument
596 Visit(node->expression()); in VisitWithStatement()
598 Visit(node->statement()); in VisitWithStatement()
602 void PrettyPrinter::VisitSwitchStatement(SwitchStatement* node) { in VisitSwitchStatement() argument
603 PrintLabels(node->labels()); in VisitSwitchStatement()
605 Visit(node->tag()); in VisitSwitchStatement()
607 ZoneList<CaseClause*>* cases = node->cases(); in VisitSwitchStatement()
628 void PrettyPrinter::VisitDoWhileStatement(DoWhileStatement* node) { in VisitDoWhileStatement() argument
629 PrintLabels(node->labels()); in VisitDoWhileStatement()
631 Visit(node->body()); in VisitDoWhileStatement()
633 Visit(node->cond()); in VisitDoWhileStatement()
638 void PrettyPrinter::VisitWhileStatement(WhileStatement* node) { in VisitWhileStatement() argument
639 PrintLabels(node->labels()); in VisitWhileStatement()
641 Visit(node->cond()); in VisitWhileStatement()
643 Visit(node->body()); in VisitWhileStatement()
647 void PrettyPrinter::VisitForStatement(ForStatement* node) { in VisitForStatement() argument
648 PrintLabels(node->labels()); in VisitForStatement()
650 if (node->init() != NULL) { in VisitForStatement()
651 Visit(node->init()); in VisitForStatement()
656 if (node->cond() != NULL) Visit(node->cond()); in VisitForStatement()
658 if (node->next() != NULL) { in VisitForStatement()
659 Visit(node->next()); // prints extra ';', unfortunately in VisitForStatement()
663 Visit(node->body()); in VisitForStatement()
667 void PrettyPrinter::VisitForInStatement(ForInStatement* node) { in VisitForInStatement() argument
668 PrintLabels(node->labels()); in VisitForInStatement()
670 Visit(node->each()); in VisitForInStatement()
672 Visit(node->enumerable()); in VisitForInStatement()
674 Visit(node->body()); in VisitForInStatement()
678 void PrettyPrinter::VisitForOfStatement(ForOfStatement* node) { in VisitForOfStatement() argument
679 PrintLabels(node->labels()); in VisitForOfStatement()
681 Visit(node->each()); in VisitForOfStatement()
683 Visit(node->iterable()); in VisitForOfStatement()
685 Visit(node->body()); in VisitForOfStatement()
689 void PrettyPrinter::VisitTryCatchStatement(TryCatchStatement* node) { in VisitTryCatchStatement() argument
691 Visit(node->try_block()); in VisitTryCatchStatement()
694 PrintLiteral(node->variable()->name(), quote); in VisitTryCatchStatement()
696 Visit(node->catch_block()); in VisitTryCatchStatement()
700 void PrettyPrinter::VisitTryFinallyStatement(TryFinallyStatement* node) { in VisitTryFinallyStatement() argument
702 Visit(node->try_block()); in VisitTryFinallyStatement()
704 Visit(node->finally_block()); in VisitTryFinallyStatement()
708 void PrettyPrinter::VisitDebuggerStatement(DebuggerStatement* node) { in VisitDebuggerStatement() argument
713 void PrettyPrinter::VisitFunctionLiteral(FunctionLiteral* node) { in VisitFunctionLiteral() argument
715 PrintFunctionLiteral(node); in VisitFunctionLiteral()
720 void PrettyPrinter::VisitClassLiteral(ClassLiteral* node) { in VisitClassLiteral() argument
722 PrintLiteral(node->name(), false); in VisitClassLiteral()
723 if (node->extends()) { in VisitClassLiteral()
725 Visit(node->extends()); in VisitClassLiteral()
728 for (int i = 0; i < node->properties()->length(); i++) { in VisitClassLiteral()
729 PrintObjectLiteralProperty(node->properties()->at(i)); in VisitClassLiteral()
735 void PrettyPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) { in VisitNativeFunctionLiteral() argument
737 PrintLiteral(node->name(), false); in VisitNativeFunctionLiteral()
742 void PrettyPrinter::VisitDoExpression(DoExpression* node) { in VisitDoExpression() argument
744 PrintStatements(node->block()->statements()); in VisitDoExpression()
749 void PrettyPrinter::VisitConditional(Conditional* node) { in VisitConditional() argument
750 Visit(node->condition()); in VisitConditional()
752 Visit(node->then_expression()); in VisitConditional()
754 Visit(node->else_expression()); in VisitConditional()
758 void PrettyPrinter::VisitLiteral(Literal* node) { in VisitLiteral() argument
759 PrintLiteral(node->value(), true); in VisitLiteral()
763 void PrettyPrinter::VisitRegExpLiteral(RegExpLiteral* node) { in VisitRegExpLiteral() argument
765 PrintLiteral(node->pattern(), false); in VisitRegExpLiteral()
767 if (node->flags() & RegExp::kGlobal) Print("g"); in VisitRegExpLiteral()
768 if (node->flags() & RegExp::kIgnoreCase) Print("i"); in VisitRegExpLiteral()
769 if (node->flags() & RegExp::kMultiline) Print("m"); in VisitRegExpLiteral()
770 if (node->flags() & RegExp::kUnicode) Print("u"); in VisitRegExpLiteral()
771 if (node->flags() & RegExp::kSticky) Print("y"); in VisitRegExpLiteral()
776 void PrettyPrinter::VisitObjectLiteral(ObjectLiteral* node) { in VisitObjectLiteral() argument
778 for (int i = 0; i < node->properties()->length(); i++) { in VisitObjectLiteral()
780 PrintObjectLiteralProperty(node->properties()->at(i)); in VisitObjectLiteral()
796 void PrettyPrinter::VisitArrayLiteral(ArrayLiteral* node) { in VisitArrayLiteral() argument
798 Print(" literal_index = %d", node->literal_index()); in VisitArrayLiteral()
799 for (int i = 0; i < node->values()->length(); i++) { in VisitArrayLiteral()
801 Visit(node->values()->at(i)); in VisitArrayLiteral()
807 void PrettyPrinter::VisitVariableProxy(VariableProxy* node) { in VisitVariableProxy() argument
808 PrintLiteral(node->name(), false); in VisitVariableProxy()
812 void PrettyPrinter::VisitAssignment(Assignment* node) { in VisitAssignment() argument
813 Visit(node->target()); in VisitAssignment()
814 Print(" %s ", Token::String(node->op())); in VisitAssignment()
815 Visit(node->value()); in VisitAssignment()
819 void PrettyPrinter::VisitYield(Yield* node) { in VisitYield() argument
821 Visit(node->expression()); in VisitYield()
825 void PrettyPrinter::VisitThrow(Throw* node) { in VisitThrow() argument
827 Visit(node->exception()); in VisitThrow()
831 void PrettyPrinter::VisitProperty(Property* node) { in VisitProperty() argument
832 Expression* key = node->key(); in VisitProperty()
836 Visit(node->obj()); in VisitProperty()
840 Visit(node->obj()); in VisitProperty()
848 void PrettyPrinter::VisitCall(Call* node) { in VisitCall() argument
849 Visit(node->expression()); in VisitCall()
850 PrintArguments(node->arguments()); in VisitCall()
854 void PrettyPrinter::VisitCallNew(CallNew* node) { in VisitCallNew() argument
856 Visit(node->expression()); in VisitCallNew()
858 PrintArguments(node->arguments()); in VisitCallNew()
862 void PrettyPrinter::VisitCallRuntime(CallRuntime* node) { in VisitCallRuntime() argument
863 Print("%%%s\n", node->debug_name()); in VisitCallRuntime()
864 PrintArguments(node->arguments()); in VisitCallRuntime()
868 void PrettyPrinter::VisitUnaryOperation(UnaryOperation* node) { in VisitUnaryOperation() argument
869 Token::Value op = node->op(); in VisitUnaryOperation()
873 Visit(node->expression()); in VisitUnaryOperation()
878 void PrettyPrinter::VisitCountOperation(CountOperation* node) { in VisitCountOperation() argument
880 if (node->is_prefix()) Print("%s", Token::String(node->op())); in VisitCountOperation()
881 Visit(node->expression()); in VisitCountOperation()
882 if (node->is_postfix()) Print("%s", Token::String(node->op())); in VisitCountOperation()
887 void PrettyPrinter::VisitBinaryOperation(BinaryOperation* node) { in VisitBinaryOperation() argument
889 Visit(node->left()); in VisitBinaryOperation()
890 Print(" %s ", Token::String(node->op())); in VisitBinaryOperation()
891 Visit(node->right()); in VisitBinaryOperation()
896 void PrettyPrinter::VisitCompareOperation(CompareOperation* node) { in VisitCompareOperation() argument
898 Visit(node->left()); in VisitCompareOperation()
899 Print(" %s ", Token::String(node->op())); in VisitCompareOperation()
900 Visit(node->right()); in VisitCompareOperation()
905 void PrettyPrinter::VisitSpread(Spread* node) { in VisitSpread() argument
907 Visit(node->expression()); in VisitSpread()
912 void PrettyPrinter::VisitEmptyParentheses(EmptyParentheses* node) { in VisitEmptyParentheses() argument
917 void PrettyPrinter::VisitThisFunction(ThisFunction* node) { in VisitThisFunction() argument
922 void PrettyPrinter::VisitSuperPropertyReference(SuperPropertyReference* node) { in VisitSuperPropertyReference() argument
927 void PrettyPrinter::VisitSuperCallReference(SuperCallReference* node) { in VisitSuperCallReference() argument
933 RewritableAssignmentExpression* node) { in VisitRewritableAssignmentExpression() argument
934 Visit(node->expression()); in VisitRewritableAssignmentExpression()
938 const char* PrettyPrinter::Print(AstNode* node) { in Print() argument
940 Visit(node); in Print()
962 void PrettyPrinter::PrintOut(Isolate* isolate, AstNode* node) { in PrintOut() argument
964 PrintF("%s\n", printer.Print(node)); in PrintOut()
1187 void AstPrinter::PrintIndentedVisit(const char* s, AstNode* node) { in PrintIndentedVisit() argument
1188 IndentedScope indent(this, s, node->position()); in PrintIndentedVisit()
1189 Visit(node); in PrintIndentedVisit()
1241 void AstPrinter::VisitBlock(Block* node) { in VisitBlock() argument
1243 node->ignore_completion_value() ? "BLOCK NOCOMPLETIONS" : "BLOCK"; in VisitBlock()
1244 IndentedScope indent(this, block_txt, node->position()); in VisitBlock()
1245 PrintStatements(node->statements()); in VisitBlock()
1250 void AstPrinter::VisitVariableDeclaration(VariableDeclaration* node) { in VisitVariableDeclaration() argument
1251 PrintLiteralWithModeIndented(Variable::Mode2String(node->mode()), in VisitVariableDeclaration()
1252 node->proxy()->var(), in VisitVariableDeclaration()
1253 node->proxy()->name()); in VisitVariableDeclaration()
1258 void AstPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) { in VisitFunctionDeclaration() argument
1260 PrintLiteral(node->proxy()->name(), true); in VisitFunctionDeclaration()
1262 PrintLiteral(node->fun()->name(), false); in VisitFunctionDeclaration()
1267 void AstPrinter::VisitImportDeclaration(ImportDeclaration* node) { in VisitImportDeclaration() argument
1268 IndentedScope indent(this, "IMPORT", node->position()); in VisitImportDeclaration()
1269 PrintLiteralIndented("NAME", node->proxy()->name(), true); in VisitImportDeclaration()
1270 PrintLiteralIndented("FROM", node->module_specifier()->string(), true); in VisitImportDeclaration()
1274 void AstPrinter::VisitExportDeclaration(ExportDeclaration* node) { in VisitExportDeclaration() argument
1275 IndentedScope indent(this, "EXPORT", node->position()); in VisitExportDeclaration()
1276 PrintLiteral(node->proxy()->name(), true); in VisitExportDeclaration()
1280 void AstPrinter::VisitExpressionStatement(ExpressionStatement* node) { in VisitExpressionStatement() argument
1281 IndentedScope indent(this, "EXPRESSION STATEMENT", node->position()); in VisitExpressionStatement()
1282 Visit(node->expression()); in VisitExpressionStatement()
1286 void AstPrinter::VisitEmptyStatement(EmptyStatement* node) { in VisitEmptyStatement() argument
1287 IndentedScope indent(this, "EMPTY", node->position()); in VisitEmptyStatement()
1292 SloppyBlockFunctionStatement* node) { in VisitSloppyBlockFunctionStatement() argument
1293 Visit(node->statement()); in VisitSloppyBlockFunctionStatement()
1297 void AstPrinter::VisitIfStatement(IfStatement* node) { in VisitIfStatement() argument
1298 IndentedScope indent(this, "IF", node->position()); in VisitIfStatement()
1299 PrintIndentedVisit("CONDITION", node->condition()); in VisitIfStatement()
1300 PrintIndentedVisit("THEN", node->then_statement()); in VisitIfStatement()
1301 if (node->HasElseStatement()) { in VisitIfStatement()
1302 PrintIndentedVisit("ELSE", node->else_statement()); in VisitIfStatement()
1307 void AstPrinter::VisitContinueStatement(ContinueStatement* node) { in VisitContinueStatement() argument
1308 IndentedScope indent(this, "CONTINUE", node->position()); in VisitContinueStatement()
1309 PrintLabelsIndented(node->target()->labels()); in VisitContinueStatement()
1313 void AstPrinter::VisitBreakStatement(BreakStatement* node) { in VisitBreakStatement() argument
1314 IndentedScope indent(this, "BREAK", node->position()); in VisitBreakStatement()
1315 PrintLabelsIndented(node->target()->labels()); in VisitBreakStatement()
1319 void AstPrinter::VisitReturnStatement(ReturnStatement* node) { in VisitReturnStatement() argument
1320 IndentedScope indent(this, "RETURN", node->position()); in VisitReturnStatement()
1321 Visit(node->expression()); in VisitReturnStatement()
1325 void AstPrinter::VisitWithStatement(WithStatement* node) { in VisitWithStatement() argument
1326 IndentedScope indent(this, "WITH", node->position()); in VisitWithStatement()
1327 PrintIndentedVisit("OBJECT", node->expression()); in VisitWithStatement()
1328 PrintIndentedVisit("BODY", node->statement()); in VisitWithStatement()
1332 void AstPrinter::VisitSwitchStatement(SwitchStatement* node) { in VisitSwitchStatement() argument
1333 IndentedScope indent(this, "SWITCH", node->position()); in VisitSwitchStatement()
1334 PrintLabelsIndented(node->labels()); in VisitSwitchStatement()
1335 PrintIndentedVisit("TAG", node->tag()); in VisitSwitchStatement()
1336 for (int i = 0; i < node->cases()->length(); i++) { in VisitSwitchStatement()
1337 Visit(node->cases()->at(i)); in VisitSwitchStatement()
1354 void AstPrinter::VisitDoWhileStatement(DoWhileStatement* node) { in VisitDoWhileStatement() argument
1355 IndentedScope indent(this, "DO", node->position()); in VisitDoWhileStatement()
1356 PrintLabelsIndented(node->labels()); in VisitDoWhileStatement()
1357 PrintIndentedVisit("BODY", node->body()); in VisitDoWhileStatement()
1358 PrintIndentedVisit("COND", node->cond()); in VisitDoWhileStatement()
1362 void AstPrinter::VisitWhileStatement(WhileStatement* node) { in VisitWhileStatement() argument
1363 IndentedScope indent(this, "WHILE", node->position()); in VisitWhileStatement()
1364 PrintLabelsIndented(node->labels()); in VisitWhileStatement()
1365 PrintIndentedVisit("COND", node->cond()); in VisitWhileStatement()
1366 PrintIndentedVisit("BODY", node->body()); in VisitWhileStatement()
1370 void AstPrinter::VisitForStatement(ForStatement* node) { in VisitForStatement() argument
1371 IndentedScope indent(this, "FOR", node->position()); in VisitForStatement()
1372 PrintLabelsIndented(node->labels()); in VisitForStatement()
1373 if (node->init()) PrintIndentedVisit("INIT", node->init()); in VisitForStatement()
1374 if (node->cond()) PrintIndentedVisit("COND", node->cond()); in VisitForStatement()
1375 PrintIndentedVisit("BODY", node->body()); in VisitForStatement()
1376 if (node->next()) PrintIndentedVisit("NEXT", node->next()); in VisitForStatement()
1380 void AstPrinter::VisitForInStatement(ForInStatement* node) { in VisitForInStatement() argument
1381 IndentedScope indent(this, "FOR IN", node->position()); in VisitForInStatement()
1382 PrintIndentedVisit("FOR", node->each()); in VisitForInStatement()
1383 PrintIndentedVisit("IN", node->enumerable()); in VisitForInStatement()
1384 PrintIndentedVisit("BODY", node->body()); in VisitForInStatement()
1388 void AstPrinter::VisitForOfStatement(ForOfStatement* node) { in VisitForOfStatement() argument
1389 IndentedScope indent(this, "FOR OF", node->position()); in VisitForOfStatement()
1390 PrintIndentedVisit("FOR", node->each()); in VisitForOfStatement()
1391 PrintIndentedVisit("OF", node->iterable()); in VisitForOfStatement()
1392 PrintIndentedVisit("BODY", node->body()); in VisitForOfStatement()
1396 void AstPrinter::VisitTryCatchStatement(TryCatchStatement* node) { in VisitTryCatchStatement() argument
1397 IndentedScope indent(this, "TRY CATCH", node->position()); in VisitTryCatchStatement()
1398 PrintIndentedVisit("TRY", node->try_block()); in VisitTryCatchStatement()
1400 node->variable(), in VisitTryCatchStatement()
1401 node->variable()->name()); in VisitTryCatchStatement()
1402 PrintIndentedVisit("CATCH", node->catch_block()); in VisitTryCatchStatement()
1406 void AstPrinter::VisitTryFinallyStatement(TryFinallyStatement* node) { in VisitTryFinallyStatement() argument
1407 IndentedScope indent(this, "TRY FINALLY", node->position()); in VisitTryFinallyStatement()
1408 PrintIndentedVisit("TRY", node->try_block()); in VisitTryFinallyStatement()
1409 PrintIndentedVisit("FINALLY", node->finally_block()); in VisitTryFinallyStatement()
1413 void AstPrinter::VisitDebuggerStatement(DebuggerStatement* node) { in VisitDebuggerStatement() argument
1414 IndentedScope indent(this, "DEBUGGER", node->position()); in VisitDebuggerStatement()
1418 void AstPrinter::VisitFunctionLiteral(FunctionLiteral* node) { in VisitFunctionLiteral() argument
1419 IndentedScope indent(this, "FUNC LITERAL", node->position()); in VisitFunctionLiteral()
1420 PrintLiteralIndented("NAME", node->name(), false); in VisitFunctionLiteral()
1421 PrintLiteralIndented("INFERRED NAME", node->inferred_name(), false); in VisitFunctionLiteral()
1422 PrintParameters(node->scope()); in VisitFunctionLiteral()
1430 void AstPrinter::VisitClassLiteral(ClassLiteral* node) { in VisitClassLiteral() argument
1431 IndentedScope indent(this, "CLASS LITERAL", node->position()); in VisitClassLiteral()
1432 if (node->raw_name() != nullptr) { in VisitClassLiteral()
1433 PrintLiteralIndented("NAME", node->name(), false); in VisitClassLiteral()
1435 if (node->extends() != nullptr) { in VisitClassLiteral()
1436 PrintIndentedVisit("EXTENDS", node->extends()); in VisitClassLiteral()
1438 PrintProperties(node->properties()); in VisitClassLiteral()
1477 void AstPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) { in VisitNativeFunctionLiteral() argument
1478 IndentedScope indent(this, "NATIVE FUNC LITERAL", node->position()); in VisitNativeFunctionLiteral()
1479 PrintLiteralIndented("NAME", node->name(), false); in VisitNativeFunctionLiteral()
1483 void AstPrinter::VisitDoExpression(DoExpression* node) { in VisitDoExpression() argument
1484 IndentedScope indent(this, "DO EXPRESSION", node->position()); in VisitDoExpression()
1485 PrintStatements(node->block()->statements()); in VisitDoExpression()
1489 void AstPrinter::VisitConditional(Conditional* node) { in VisitConditional() argument
1490 IndentedScope indent(this, "CONDITIONAL", node->position()); in VisitConditional()
1491 PrintIndentedVisit("CONDITION", node->condition()); in VisitConditional()
1492 PrintIndentedVisit("THEN", node->then_expression()); in VisitConditional()
1493 PrintIndentedVisit("ELSE", node->else_expression()); in VisitConditional()
1498 void AstPrinter::VisitLiteral(Literal* node) { in VisitLiteral() argument
1499 PrintLiteralIndented("LITERAL", node->value(), true); in VisitLiteral()
1503 void AstPrinter::VisitRegExpLiteral(RegExpLiteral* node) { in VisitRegExpLiteral() argument
1504 IndentedScope indent(this, "REGEXP LITERAL", node->position()); in VisitRegExpLiteral()
1506 SNPrintF(buf, "literal_index = %d\n", node->literal_index()); in VisitRegExpLiteral()
1508 PrintLiteralIndented("PATTERN", node->pattern(), false); in VisitRegExpLiteral()
1510 if (node->flags() & RegExp::kGlobal) buf[i++] = 'g'; in VisitRegExpLiteral()
1511 if (node->flags() & RegExp::kIgnoreCase) buf[i++] = 'i'; in VisitRegExpLiteral()
1512 if (node->flags() & RegExp::kMultiline) buf[i++] = 'm'; in VisitRegExpLiteral()
1513 if (node->flags() & RegExp::kUnicode) buf[i++] = 'u'; in VisitRegExpLiteral()
1514 if (node->flags() & RegExp::kSticky) buf[i++] = 'y'; in VisitRegExpLiteral()
1522 void AstPrinter::VisitObjectLiteral(ObjectLiteral* node) { in VisitObjectLiteral() argument
1523 IndentedScope indent(this, "OBJ LITERAL", node->position()); in VisitObjectLiteral()
1525 SNPrintF(buf, "literal_index = %d\n", node->literal_index()); in VisitObjectLiteral()
1527 PrintProperties(node->properties()); in VisitObjectLiteral()
1531 void AstPrinter::VisitArrayLiteral(ArrayLiteral* node) { in VisitArrayLiteral() argument
1532 IndentedScope indent(this, "ARRAY LITERAL", node->position()); in VisitArrayLiteral()
1535 SNPrintF(buf, "literal_index = %d\n", node->literal_index()); in VisitArrayLiteral()
1537 if (node->values()->length() > 0) { in VisitArrayLiteral()
1538 IndentedScope indent(this, "VALUES", node->position()); in VisitArrayLiteral()
1539 for (int i = 0; i < node->values()->length(); i++) { in VisitArrayLiteral()
1540 Visit(node->values()->at(i)); in VisitArrayLiteral()
1546 void AstPrinter::VisitVariableProxy(VariableProxy* node) { in VisitVariableProxy() argument
1547 Variable* var = node->var(); in VisitVariableProxy()
1550 FormatSlotNode(&buf, node, "VAR PROXY", node->VariableFeedbackSlot()); in VisitVariableProxy()
1571 PrintLiteralWithModeIndented(buf.start(), var, node->name()); in VisitVariableProxy()
1575 void AstPrinter::VisitAssignment(Assignment* node) { in VisitAssignment() argument
1576 IndentedScope indent(this, Token::Name(node->op()), node->position()); in VisitAssignment()
1577 Visit(node->target()); in VisitAssignment()
1578 Visit(node->value()); in VisitAssignment()
1582 void AstPrinter::VisitYield(Yield* node) { in VisitYield() argument
1583 IndentedScope indent(this, "YIELD", node->position()); in VisitYield()
1584 Visit(node->expression()); in VisitYield()
1588 void AstPrinter::VisitThrow(Throw* node) { in VisitThrow() argument
1589 IndentedScope indent(this, "THROW", node->position()); in VisitThrow()
1590 Visit(node->exception()); in VisitThrow()
1594 void AstPrinter::VisitProperty(Property* node) { in VisitProperty() argument
1596 FormatSlotNode(&buf, node, "PROPERTY", node->PropertyFeedbackSlot()); in VisitProperty()
1597 IndentedScope indent(this, buf.start(), node->position()); in VisitProperty()
1599 Visit(node->obj()); in VisitProperty()
1600 Literal* literal = node->key()->AsLiteral(); in VisitProperty()
1604 PrintIndentedVisit("KEY", node->key()); in VisitProperty()
1609 void AstPrinter::VisitCall(Call* node) { in VisitCall() argument
1611 FormatSlotNode(&buf, node, "CALL", node->CallFeedbackICSlot()); in VisitCall()
1614 Visit(node->expression()); in VisitCall()
1615 PrintArguments(node->arguments()); in VisitCall()
1619 void AstPrinter::VisitCallNew(CallNew* node) { in VisitCallNew() argument
1620 IndentedScope indent(this, "CALL NEW", node->position()); in VisitCallNew()
1621 Visit(node->expression()); in VisitCallNew()
1622 PrintArguments(node->arguments()); in VisitCallNew()
1626 void AstPrinter::VisitCallRuntime(CallRuntime* node) { in VisitCallRuntime() argument
1628 SNPrintF(buf, "CALL RUNTIME %s", node->debug_name()); in VisitCallRuntime()
1629 IndentedScope indent(this, buf.start(), node->position()); in VisitCallRuntime()
1630 PrintArguments(node->arguments()); in VisitCallRuntime()
1634 void AstPrinter::VisitUnaryOperation(UnaryOperation* node) { in VisitUnaryOperation() argument
1635 IndentedScope indent(this, Token::Name(node->op()), node->position()); in VisitUnaryOperation()
1636 Visit(node->expression()); in VisitUnaryOperation()
1640 void AstPrinter::VisitCountOperation(CountOperation* node) { in VisitCountOperation() argument
1642 SNPrintF(buf, "%s %s", (node->is_prefix() ? "PRE" : "POST"), in VisitCountOperation()
1643 Token::Name(node->op())); in VisitCountOperation()
1644 IndentedScope indent(this, buf.start(), node->position()); in VisitCountOperation()
1645 Visit(node->expression()); in VisitCountOperation()
1649 void AstPrinter::VisitBinaryOperation(BinaryOperation* node) { in VisitBinaryOperation() argument
1650 IndentedScope indent(this, Token::Name(node->op()), node->position()); in VisitBinaryOperation()
1651 Visit(node->left()); in VisitBinaryOperation()
1652 Visit(node->right()); in VisitBinaryOperation()
1656 void AstPrinter::VisitCompareOperation(CompareOperation* node) { in VisitCompareOperation() argument
1657 IndentedScope indent(this, Token::Name(node->op()), node->position()); in VisitCompareOperation()
1658 Visit(node->left()); in VisitCompareOperation()
1659 Visit(node->right()); in VisitCompareOperation()
1663 void AstPrinter::VisitSpread(Spread* node) { in VisitSpread() argument
1664 IndentedScope indent(this, "...", node->position()); in VisitSpread()
1665 Visit(node->expression()); in VisitSpread()
1669 void AstPrinter::VisitEmptyParentheses(EmptyParentheses* node) { in VisitEmptyParentheses() argument
1670 IndentedScope indent(this, "()", node->position()); in VisitEmptyParentheses()
1674 void AstPrinter::VisitThisFunction(ThisFunction* node) { in VisitThisFunction() argument
1675 IndentedScope indent(this, "THIS-FUNCTION", node->position()); in VisitThisFunction()
1679 void AstPrinter::VisitSuperPropertyReference(SuperPropertyReference* node) { in VisitSuperPropertyReference() argument
1680 IndentedScope indent(this, "SUPER-PROPERTY-REFERENCE", node->position()); in VisitSuperPropertyReference()
1684 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { in VisitSuperCallReference() argument
1685 IndentedScope indent(this, "SUPER-CALL-REFERENCE", node->position()); in VisitSuperCallReference()
1690 RewritableAssignmentExpression* node) { in VisitRewritableAssignmentExpression() argument
1691 Visit(node->expression()); in VisitRewritableAssignmentExpression()