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

Unified Diff: src/prettyprinter.cc

Issue 2840018: [Isolates] Moved more compilation-related globals (builtins, runtime, &c.)... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: rebase Created 10 years, 6 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
« no previous file with comments | « src/prettyprinter.h ('k') | src/runtime.h » ('j') | src/runtime.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/prettyprinter.cc
===================================================================
--- src/prettyprinter.cc (revision 4955)
+++ src/prettyprinter.cc (working copy)
@@ -590,7 +590,7 @@
class IndentedScope BASE_EMBEDDED {
public:
- IndentedScope() {
+ explicit IndentedScope(AstPrinter* printer) : ast_printer_(printer) {
ast_printer_->inc_indent();
}
@@ -619,30 +619,20 @@
ast_printer_->dec_indent();
}
- static void SetAstPrinter(AstPrinter* a) { ast_printer_ = a; }
-
private:
- static AstPrinter* ast_printer_;
+ AstPrinter* ast_printer_;
};
-AstPrinter* IndentedScope::ast_printer_ = NULL;
-
-
//-----------------------------------------------------------------------------
-int AstPrinter::indent_ = 0;
-
-AstPrinter::AstPrinter() {
- ASSERT(indent_ == 0);
- IndentedScope::SetAstPrinter(this);
+AstPrinter::AstPrinter() : indent_(0) {
}
AstPrinter::~AstPrinter() {
ASSERT(indent_ == 0);
- IndentedScope::SetAstPrinter(NULL);
}
@@ -1030,7 +1020,7 @@
node->type(), node->num(), node->IsPrimitive());
Variable* var = node->var();
if (var != NULL && var->rewrite() != NULL) {
- IndentedScope indent;
+ IndentedScope indent(this);
Visit(var->rewrite());
}
}
@@ -1076,7 +1066,7 @@
void AstPrinter::VisitCallRuntime(CallRuntime* node) {
PrintLiteralIndented("CALL RUNTIME ", node->name(), false);
- IndentedScope indent;
+ IndentedScope indent(this);
PrintArguments(node->arguments());
}
« no previous file with comments | « src/prettyprinter.h ('k') | src/runtime.h » ('j') | src/runtime.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698