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

Unified Diff: src/prettyprinter.cc

Issue 6685088: Merge isolates to bleeding_edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 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/profile-generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/prettyprinter.cc
===================================================================
--- src/prettyprinter.cc (revision 7267)
+++ src/prettyprinter.cc (working copy)
@@ -526,13 +526,13 @@
Print("%c", string->Get(i));
}
if (quote) Print("\"");
- } else if (object == Heap::null_value()) {
+ } else if (object->IsNull()) {
Print("null");
- } else if (object == Heap::true_value()) {
+ } else if (object->IsTrue()) {
Print("true");
- } else if (object == Heap::false_value()) {
+ } else if (object->IsFalse()) {
Print("false");
- } else if (object == Heap::undefined_value()) {
+ } else if (object->IsUndefined()) {
Print("undefined");
} else if (object->IsNumber()) {
Print("%g", object->Number());
@@ -602,7 +602,7 @@
class IndentedScope BASE_EMBEDDED {
public:
- IndentedScope() {
+ explicit IndentedScope(AstPrinter* printer) : ast_printer_(printer) {
ast_printer_->inc_indent();
}
@@ -626,30 +626,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);
}
@@ -1009,7 +999,7 @@
node->type());
Variable* var = node->var();
if (var != NULL && var->rewrite() != NULL) {
- IndentedScope indent;
+ IndentedScope indent(this);
Visit(var->rewrite());
}
}
@@ -1055,7 +1045,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/profile-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698