| 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 <stdarg.h> | 5 #include <stdarg.h> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.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 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1429 } | 1429 } |
| 1430 } | 1430 } |
| 1431 | 1431 |
| 1432 | 1432 |
| 1433 // TODO(svenpanne) Start with IndentedScope. | 1433 // TODO(svenpanne) Start with IndentedScope. |
| 1434 void AstPrinter::VisitVariableProxy(VariableProxy* node) { | 1434 void AstPrinter::VisitVariableProxy(VariableProxy* node) { |
| 1435 Variable* var = node->var(); | 1435 Variable* var = node->var(); |
| 1436 EmbeddedVector<char, 128> buf; | 1436 EmbeddedVector<char, 128> buf; |
| 1437 int pos = SNPrintF(buf, "VAR PROXY"); | 1437 int pos = SNPrintF(buf, "VAR PROXY"); |
| 1438 switch (var->location()) { | 1438 switch (var->location()) { |
| 1439 case Variable::UNALLOCATED: | 1439 case VariableLocation::UNALLOCATED: |
| 1440 break; | 1440 break; |
| 1441 case Variable::PARAMETER: | 1441 case VariableLocation::PARAMETER: |
| 1442 SNPrintF(buf + pos, " parameter[%d]", var->index()); | 1442 SNPrintF(buf + pos, " parameter[%d]", var->index()); |
| 1443 break; | 1443 break; |
| 1444 case Variable::LOCAL: | 1444 case VariableLocation::LOCAL: |
| 1445 SNPrintF(buf + pos, " local[%d]", var->index()); | 1445 SNPrintF(buf + pos, " local[%d]", var->index()); |
| 1446 break; | 1446 break; |
| 1447 case Variable::CONTEXT: | 1447 case VariableLocation::CONTEXT: |
| 1448 SNPrintF(buf + pos, " context[%d]", var->index()); | 1448 SNPrintF(buf + pos, " context[%d]", var->index()); |
| 1449 break; | 1449 break; |
| 1450 case Variable::LOOKUP: | 1450 case VariableLocation::GLOBAL: |
| 1451 SNPrintF(buf + pos, " global[%d]", var->index()); |
| 1452 break; |
| 1453 case VariableLocation::LOOKUP: |
| 1451 SNPrintF(buf + pos, " lookup"); | 1454 SNPrintF(buf + pos, " lookup"); |
| 1452 break; | 1455 break; |
| 1453 } | 1456 } |
| 1454 PrintLiteralWithModeIndented(buf.start(), var, node->name()); | 1457 PrintLiteralWithModeIndented(buf.start(), var, node->name()); |
| 1455 } | 1458 } |
| 1456 | 1459 |
| 1457 | 1460 |
| 1458 void AstPrinter::VisitAssignment(Assignment* node) { | 1461 void AstPrinter::VisitAssignment(Assignment* node) { |
| 1459 IndentedScope indent(this, Token::Name(node->op())); | 1462 IndentedScope indent(this, Token::Name(node->op())); |
| 1460 Visit(node->target()); | 1463 Visit(node->target()); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 | 1557 |
| 1555 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { | 1558 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { |
| 1556 IndentedScope indent(this, "SUPER-CALL-REFERENCE"); | 1559 IndentedScope indent(this, "SUPER-CALL-REFERENCE"); |
| 1557 } | 1560 } |
| 1558 | 1561 |
| 1559 | 1562 |
| 1560 #endif // DEBUG | 1563 #endif // DEBUG |
| 1561 | 1564 |
| 1562 } // namespace internal | 1565 } // namespace internal |
| 1563 } // namespace v8 | 1566 } // namespace v8 |
| OLD | NEW |