| 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/ast-numbering.h" | 5 #include "src/ast/ast-numbering.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 node->set_base_id(ReserveIdRange(node->num_ids())); | 525 node->set_base_id(ReserveIdRange(node->num_ids())); |
| 526 for (int i = 0; i < node->values()->length(); i++) { | 526 for (int i = 0; i < node->values()->length(); i++) { |
| 527 Visit(node->values()->at(i)); | 527 Visit(node->values()->at(i)); |
| 528 } | 528 } |
| 529 node->BuildConstantElements(isolate_); | 529 node->BuildConstantElements(isolate_); |
| 530 ReserveFeedbackSlots(node); | 530 ReserveFeedbackSlots(node); |
| 531 } | 531 } |
| 532 | 532 |
| 533 | 533 |
| 534 void AstNumberingVisitor::VisitCall(Call* node) { | 534 void AstNumberingVisitor::VisitCall(Call* node) { |
| 535 if (node->is_possibly_eval()) { |
| 536 DisableFullCodegenAndCrankshaft(kFunctionCallsEval); |
| 537 } |
| 535 IncrementNodeCount(); | 538 IncrementNodeCount(); |
| 536 ReserveFeedbackSlots(node); | 539 ReserveFeedbackSlots(node); |
| 537 node->set_base_id(ReserveIdRange(Call::num_ids())); | 540 node->set_base_id(ReserveIdRange(Call::num_ids())); |
| 538 Visit(node->expression()); | 541 Visit(node->expression()); |
| 539 VisitArguments(node->arguments()); | 542 VisitArguments(node->arguments()); |
| 540 } | 543 } |
| 541 | 544 |
| 542 | 545 |
| 543 void AstNumberingVisitor::VisitCallNew(CallNew* node) { | 546 void AstNumberingVisitor::VisitCallNew(CallNew* node) { |
| 544 IncrementNodeCount(); | 547 IncrementNodeCount(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 RewritableExpression* node) { | 583 RewritableExpression* node) { |
| 581 IncrementNodeCount(); | 584 IncrementNodeCount(); |
| 582 node->set_base_id(ReserveIdRange(RewritableExpression::num_ids())); | 585 node->set_base_id(ReserveIdRange(RewritableExpression::num_ids())); |
| 583 Visit(node->expression()); | 586 Visit(node->expression()); |
| 584 } | 587 } |
| 585 | 588 |
| 586 | 589 |
| 587 bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { | 590 bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { |
| 588 DeclarationScope* scope = node->scope(); | 591 DeclarationScope* scope = node->scope(); |
| 589 if (scope->new_target_var()) DisableFullCodegenAndCrankshaft(kSuperReference); | 592 if (scope->new_target_var()) DisableFullCodegenAndCrankshaft(kSuperReference); |
| 590 if (scope->calls_eval()) DisableFullCodegenAndCrankshaft(kFunctionCallsEval); | |
| 591 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { | 593 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { |
| 592 DisableFullCodegenAndCrankshaft(kContextAllocatedArguments); | 594 DisableFullCodegenAndCrankshaft(kContextAllocatedArguments); |
| 593 } | 595 } |
| 594 | 596 |
| 595 if (scope->rest_parameter() != nullptr) { | 597 if (scope->rest_parameter() != nullptr) { |
| 596 DisableFullCodegenAndCrankshaft(kRestParameter); | 598 DisableFullCodegenAndCrankshaft(kRestParameter); |
| 597 } | 599 } |
| 598 | 600 |
| 599 if (IsResumableFunction(node->kind())) { | 601 if (IsResumableFunction(node->kind())) { |
| 600 DisableFullCodegenAndCrankshaft(kGenerator); | 602 DisableFullCodegenAndCrankshaft(kGenerator); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 614 } | 616 } |
| 615 | 617 |
| 616 | 618 |
| 617 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 619 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
| 618 FunctionLiteral* function) { | 620 FunctionLiteral* function) { |
| 619 AstNumberingVisitor visitor(isolate, zone); | 621 AstNumberingVisitor visitor(isolate, zone); |
| 620 return visitor.Renumber(function); | 622 return visitor.Renumber(function); |
| 621 } | 623 } |
| 622 } // namespace internal | 624 } // namespace internal |
| 623 } // namespace v8 | 625 } // namespace v8 |
| OLD | NEW |