Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: src/ast/prettyprinter.cc

Issue 1877403003: [ast] Annotate some nodes with number of yields. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/ast/ast-numbering.cc ('K') | « src/ast/ast-numbering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/prettyprinter.cc
diff --git a/src/ast/prettyprinter.cc b/src/ast/prettyprinter.cc
index e845821ebdaedacb1cb42012d315585f67e4f972..4f95d914d0a7649083f4c17bb5d29184a658f2b2 100644
--- a/src/ast/prettyprinter.cc
+++ b/src/ast/prettyprinter.cc
@@ -1192,6 +1192,10 @@ void AstPrinter::PrintIndentedVisit(const char* s, AstNode* node) {
const char* AstPrinter::PrintProgram(FunctionLiteral* program) {
Init();
{ IndentedScope indent(this, "FUNC", program->position());
+ PrintIndented("KIND");
+ Print(" %d\n", program->kind());
+ PrintIndented("YIELD COUNT");
+ Print(" %d\n", program->yield_count());
PrintLiteralIndented("NAME", program->name(), true);
PrintLiteralIndented("INFERRED NAME", program->inferred_name(), true);
PrintParameters(program->scope());
@@ -1360,6 +1364,8 @@ void AstPrinter::VisitCaseClause(CaseClause* clause) {
void AstPrinter::VisitDoWhileStatement(DoWhileStatement* node) {
IndentedScope indent(this, "DO", node->position());
+ PrintIndented("YIELD COUNT");
+ Print(" %d\n", node->yield_count());
PrintLabelsIndented(node->labels());
PrintIndentedVisit("BODY", node->body());
PrintIndentedVisit("COND", node->cond());
@@ -1368,6 +1374,8 @@ void AstPrinter::VisitDoWhileStatement(DoWhileStatement* node) {
void AstPrinter::VisitWhileStatement(WhileStatement* node) {
IndentedScope indent(this, "WHILE", node->position());
+ PrintIndented("YIELD COUNT");
+ Print(" %d\n", node->yield_count());
PrintLabelsIndented(node->labels());
PrintIndentedVisit("COND", node->cond());
PrintIndentedVisit("BODY", node->body());
@@ -1376,6 +1384,8 @@ void AstPrinter::VisitWhileStatement(WhileStatement* node) {
void AstPrinter::VisitForStatement(ForStatement* node) {
IndentedScope indent(this, "FOR", node->position());
+ PrintIndented("YIELD COUNT");
+ Print(" %d\n", node->yield_count());
PrintLabelsIndented(node->labels());
if (node->init()) PrintIndentedVisit("INIT", node->init());
if (node->cond()) PrintIndentedVisit("COND", node->cond());
@@ -1386,6 +1396,8 @@ void AstPrinter::VisitForStatement(ForStatement* node) {
void AstPrinter::VisitForInStatement(ForInStatement* node) {
IndentedScope indent(this, "FOR IN", node->position());
+ PrintIndented("YIELD COUNT");
+ Print(" %d\n", node->yield_count());
PrintIndentedVisit("FOR", node->each());
PrintIndentedVisit("IN", node->enumerable());
PrintIndentedVisit("BODY", node->body());
@@ -1394,6 +1406,8 @@ void AstPrinter::VisitForInStatement(ForInStatement* node) {
void AstPrinter::VisitForOfStatement(ForOfStatement* node) {
IndentedScope indent(this, "FOR OF", node->position());
+ PrintIndented("YIELD COUNT");
+ Print(" %d\n", node->yield_count());
PrintIndentedVisit("FOR", node->each());
PrintIndentedVisit("OF", node->iterable());
PrintIndentedVisit("BODY", node->body());
« src/ast/ast-numbering.cc ('K') | « src/ast/ast-numbering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698