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

Unified Diff: runtime/vm/ast_printer.h

Issue 2327693002: Add --parse-all option in order to benchmark and measure the scanner/parser performance. (Closed)
Patch Set: Address review comments. Created 4 years, 3 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
Index: runtime/vm/ast_printer.h
diff --git a/runtime/vm/ast_printer.h b/runtime/vm/ast_printer.h
index 7c43ef69356d6ef5328baee79ace529be620c2a5..b5ee0bdaae348ef06102ec332826e2dffd3394d2 100644
--- a/runtime/vm/ast_printer.h
+++ b/runtime/vm/ast_printer.h
@@ -12,12 +12,16 @@ namespace dart {
// Forward declaration.
class ParsedFunction;
+class Log;
class AstPrinter : public AstNodeVisitor {
public:
- static void PrintNode(AstNode* node);
- static void PrintFunctionScope(const ParsedFunction& parsed_function);
- static void PrintFunctionNodes(const ParsedFunction& parsed_function);
+ explicit AstPrinter(bool log = true);
+ ~AstPrinter();
+
+ void PrintNode(AstNode* node);
+ void PrintFunctionScope(const ParsedFunction& parsed_function);
+ void PrintFunctionNodes(const ParsedFunction& parsed_function);
#define DECLARE_VISITOR_FUNCTION(BaseName) \
virtual void Visit##BaseName##Node(BaseName##Node* node);
@@ -26,23 +30,22 @@ class AstPrinter : public AstNodeVisitor {
#undef DECLARE_VISITOR_FUNCTION
private:
- AstPrinter();
- ~AstPrinter();
-
static const int kScopeIndent = 2;
- static void PrintLocalScopeVariable(const LocalScope* scope,
- LocalVariable* var,
- int indent = 0);
- static void PrintLocalScope(const LocalScope* scope,
- int variable_index,
- int indent = 0);
+ void IndentN(int count);
+ void PrintLocalScopeVariable(const LocalScope* scope,
+ LocalVariable* var,
+ int indent = 0);
+ void PrintLocalScope(const LocalScope* scope,
+ int variable_index,
+ int indent = 0);
void VisitGenericAstNode(AstNode* node);
void VisitGenericLocalNode(AstNode* node, const LocalVariable& local);
void VisitGenericFieldNode(AstNode* node, const Field& field);
intptr_t indent_;
+ Log* logger_;
DISALLOW_COPY_AND_ASSIGN(AstPrinter);
};

Powered by Google App Engine
This is Rietveld 408576698