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

Side by Side Diff: src/prettyprinter.cc

Issue 1354433004: Make prettyprinter useful in gdb. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/prettyprinter.h" 5 #include "src/prettyprinter.h"
6 6
7 #include <stdarg.h> 7 #include <stdarg.h>
8 8
9 #include "src/ast-value-factory.h" 9 #include "src/ast-value-factory.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 const char* PrettyPrinter::PrintProgram(FunctionLiteral* program) { 900 const char* PrettyPrinter::PrintProgram(FunctionLiteral* program) {
901 Init(); 901 Init();
902 PrintStatements(program->body()); 902 PrintStatements(program->body());
903 Print("\n"); 903 Print("\n");
904 return output_; 904 return output_;
905 } 905 }
906 906
907 907
908 void PrettyPrinter::PrintOut(Isolate* isolate, Zone* zone, AstNode* node) { 908 void PrettyPrinter::PrintOut(Isolate* isolate, Zone* zone, AstNode* node) {
909 PrettyPrinter printer(isolate, zone); 909 PrettyPrinter printer(isolate, zone);
910 PrintF("%s", printer.Print(node)); 910 PrintF("%s\n", printer.Print(node));
911 } 911 }
912 912
913 913
914 void PrettyPrinter::Init() { 914 void PrettyPrinter::Init() {
915 if (size_ == 0) { 915 if (size_ == 0) {
916 DCHECK(output_ == NULL); 916 DCHECK(output_ == NULL);
917 const int initial_size = 256; 917 const int initial_size = 256;
918 output_ = NewArray<char>(initial_size); 918 output_ = NewArray<char>(initial_size);
919 size_ = initial_size; 919 size_ = initial_size;
920 } 920 }
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 1608
1609 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { 1609 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) {
1610 IndentedScope indent(this, "SUPER-CALL-REFERENCE"); 1610 IndentedScope indent(this, "SUPER-CALL-REFERENCE");
1611 } 1611 }
1612 1612
1613 1613
1614 #endif // DEBUG 1614 #endif // DEBUG
1615 1615
1616 } // namespace internal 1616 } // namespace internal
1617 } // namespace v8 1617 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698