OLD | NEW |
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/ast/prettyprinter.h" | 5 #include "src/ast/prettyprinter.h" |
6 | 6 |
7 #include <stdarg.h> | 7 #include <stdarg.h> |
8 | 8 |
9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
11 #include "src/base/platform/platform.h" | 11 #include "src/base/platform/platform.h" |
| 12 #include "src/globals.h" |
12 | 13 |
13 namespace v8 { | 14 namespace v8 { |
14 namespace internal { | 15 namespace internal { |
15 | 16 |
16 CallPrinter::CallPrinter(Isolate* isolate, bool is_builtin) | 17 CallPrinter::CallPrinter(Isolate* isolate, bool is_builtin) |
17 : builder_(isolate) { | 18 : builder_(isolate) { |
18 isolate_ = isolate; | 19 isolate_ = isolate; |
19 position_ = 0; | 20 position_ = 0; |
20 num_prints_ = 0; | 21 num_prints_ = 0; |
21 found_ = false; | 22 found_ = false; |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 } | 597 } |
597 | 598 |
598 | 599 |
599 void AstPrinter::PrintLiteralWithModeIndented(const char* info, | 600 void AstPrinter::PrintLiteralWithModeIndented(const char* info, |
600 Variable* var, | 601 Variable* var, |
601 Handle<Object> value) { | 602 Handle<Object> value) { |
602 if (var == NULL) { | 603 if (var == NULL) { |
603 PrintLiteralIndented(info, value, true); | 604 PrintLiteralIndented(info, value, true); |
604 } else { | 605 } else { |
605 EmbeddedVector<char, 256> buf; | 606 EmbeddedVector<char, 256> buf; |
606 int pos = SNPrintF(buf, "%s (mode = %s", info, | 607 int pos = |
607 Variable::Mode2String(var->mode())); | 608 SNPrintF(buf, "%s (mode = %s", info, VariableMode2String(var->mode())); |
608 SNPrintF(buf + pos, ")"); | 609 SNPrintF(buf + pos, ")"); |
609 PrintLiteralIndented(buf.start(), value, true); | 610 PrintLiteralIndented(buf.start(), value, true); |
610 } | 611 } |
611 } | 612 } |
612 | 613 |
613 | 614 |
614 void AstPrinter::PrintLabelsIndented(ZoneList<const AstRawString*>* labels) { | 615 void AstPrinter::PrintLabelsIndented(ZoneList<const AstRawString*>* labels) { |
615 if (labels == NULL || labels->length() == 0) return; | 616 if (labels == NULL || labels->length() == 0) return; |
616 PrintIndented("LABELS "); | 617 PrintIndented("LABELS "); |
617 PrintLabels(labels); | 618 PrintLabels(labels); |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 | 1184 |
1184 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { | 1185 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { |
1185 Visit(node->expression()); | 1186 Visit(node->expression()); |
1186 } | 1187 } |
1187 | 1188 |
1188 | 1189 |
1189 #endif // DEBUG | 1190 #endif // DEBUG |
1190 | 1191 |
1191 } // namespace internal | 1192 } // namespace internal |
1192 } // namespace v8 | 1193 } // namespace v8 |
OLD | NEW |