| 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/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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 void CallPrinter::VisitCallNew(CallNew* node) { | 314 void CallPrinter::VisitCallNew(CallNew* node) { |
| 315 bool was_found = !found_ && node->position() == position_; | 315 bool was_found = !found_ && node->position() == position_; |
| 316 if (was_found) found_ = true; | 316 if (was_found) found_ = true; |
| 317 Find(node->expression(), was_found); | 317 Find(node->expression(), was_found); |
| 318 FindArguments(node->arguments()); | 318 FindArguments(node->arguments()); |
| 319 if (was_found) done_ = true; | 319 if (was_found) done_ = true; |
| 320 } | 320 } |
| 321 | 321 |
| 322 | 322 |
| 323 void CallPrinter::VisitCallRuntime(CallRuntime* node) { | 323 void CallPrinter::VisitCallRuntime(CallRuntime* node) { |
| 324 if (node->function() == |
| 325 Runtime::FunctionForId(Runtime::kInlineDefaultConstructorCallSuper)) { |
| 326 found_ = true; |
| 327 Print("super"); |
| 328 done_ = true; |
| 329 return; |
| 330 } |
| 324 FindArguments(node->arguments()); | 331 FindArguments(node->arguments()); |
| 325 } | 332 } |
| 326 | 333 |
| 327 | 334 |
| 328 void CallPrinter::VisitUnaryOperation(UnaryOperation* node) { | 335 void CallPrinter::VisitUnaryOperation(UnaryOperation* node) { |
| 329 Token::Value op = node->op(); | 336 Token::Value op = node->op(); |
| 330 bool needsSpace = | 337 bool needsSpace = |
| 331 op == Token::DELETE || op == Token::TYPEOF || op == Token::VOID; | 338 op == Token::DELETE || op == Token::TYPEOF || op == Token::VOID; |
| 332 Print("(%s%s", Token::String(op), needsSpace ? " " : ""); | 339 Print("(%s%s", Token::String(op), needsSpace ? " " : ""); |
| 333 Find(node->expression(), true); | 340 Find(node->expression(), true); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 UNREACHABLE(); | 380 UNREACHABLE(); |
| 374 } | 381 } |
| 375 | 382 |
| 376 | 383 |
| 377 void CallPrinter::VisitThisFunction(ThisFunction* node) {} | 384 void CallPrinter::VisitThisFunction(ThisFunction* node) {} |
| 378 | 385 |
| 379 | 386 |
| 380 void CallPrinter::VisitSuperPropertyReference(SuperPropertyReference* node) {} | 387 void CallPrinter::VisitSuperPropertyReference(SuperPropertyReference* node) {} |
| 381 | 388 |
| 382 | 389 |
| 383 void CallPrinter::VisitSuperCallReference(SuperCallReference* node) {} | 390 void CallPrinter::VisitSuperCallReference(SuperCallReference* node) { |
| 391 Print("super"); |
| 392 } |
| 384 | 393 |
| 385 | 394 |
| 386 void CallPrinter::FindStatements(ZoneList<Statement*>* statements) { | 395 void CallPrinter::FindStatements(ZoneList<Statement*>* statements) { |
| 387 if (statements == NULL) return; | 396 if (statements == NULL) return; |
| 388 for (int i = 0; i < statements->length(); i++) { | 397 for (int i = 0; i < statements->length(); i++) { |
| 389 Find(statements->at(i)); | 398 Find(statements->at(i)); |
| 390 } | 399 } |
| 391 } | 400 } |
| 392 | 401 |
| 393 | 402 |
| (...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1629 | 1638 |
| 1630 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { | 1639 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { |
| 1631 IndentedScope indent(this, "SUPER-CALL-REFERENCE", node->position()); | 1640 IndentedScope indent(this, "SUPER-CALL-REFERENCE", node->position()); |
| 1632 } | 1641 } |
| 1633 | 1642 |
| 1634 | 1643 |
| 1635 #endif // DEBUG | 1644 #endif // DEBUG |
| 1636 | 1645 |
| 1637 } // namespace internal | 1646 } // namespace internal |
| 1638 } // namespace v8 | 1647 } // namespace v8 |
| OLD | NEW |