OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
10 #include "src/ast-numbering.h" | 10 #include "src/ast-numbering.h" |
(...skipping 4631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4642 environment()->Bind(i, undefined_constant); | 4642 environment()->Bind(i, undefined_constant); |
4643 } | 4643 } |
4644 | 4644 |
4645 // Handle the arguments and arguments shadow variables specially (they do | 4645 // Handle the arguments and arguments shadow variables specially (they do |
4646 // not have declarations). | 4646 // not have declarations). |
4647 if (scope->arguments() != NULL) { | 4647 if (scope->arguments() != NULL) { |
4648 environment()->Bind(scope->arguments(), | 4648 environment()->Bind(scope->arguments(), |
4649 graph()->GetArgumentsObject()); | 4649 graph()->GetArgumentsObject()); |
4650 } | 4650 } |
4651 | 4651 |
4652 int rest_index; | |
4653 Variable* rest = scope->rest_parameter(&rest_index); | |
4654 if (rest) { | |
4655 return Bailout(kRestParameter); | |
4656 } | |
4657 | |
4658 if (scope->this_function_var() != nullptr || | 4652 if (scope->this_function_var() != nullptr || |
4659 scope->new_target_var() != nullptr) { | 4653 scope->new_target_var() != nullptr) { |
4660 return Bailout(kSuperReference); | 4654 return Bailout(kSuperReference); |
4661 } | 4655 } |
4662 } | 4656 } |
4663 | 4657 |
4664 | 4658 |
4665 void HOptimizedGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { | 4659 void HOptimizedGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { |
4666 for (int i = 0; i < statements->length(); i++) { | 4660 for (int i = 0; i < statements->length(); i++) { |
4667 Statement* stmt = statements->at(i); | 4661 Statement* stmt = statements->at(i); |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5685 new(zone()) HLoadContextSlot(context, variable->index(), mode); | 5679 new(zone()) HLoadContextSlot(context, variable->index(), mode); |
5686 return ast_context()->ReturnInstruction(instr, expr->id()); | 5680 return ast_context()->ReturnInstruction(instr, expr->id()); |
5687 } | 5681 } |
5688 | 5682 |
5689 case VariableLocation::LOOKUP: | 5683 case VariableLocation::LOOKUP: |
5690 return Bailout(kReferenceToAVariableWhichRequiresDynamicLookup); | 5684 return Bailout(kReferenceToAVariableWhichRequiresDynamicLookup); |
5691 } | 5685 } |
5692 } | 5686 } |
5693 | 5687 |
5694 | 5688 |
| 5689 void HOptimizedGraphBuilder::VisitRestParameter(RestParameter* node) { |
| 5690 UNREACHABLE(); |
| 5691 } |
| 5692 |
| 5693 |
5695 void HOptimizedGraphBuilder::VisitLiteral(Literal* expr) { | 5694 void HOptimizedGraphBuilder::VisitLiteral(Literal* expr) { |
5696 DCHECK(!HasStackOverflow()); | 5695 DCHECK(!HasStackOverflow()); |
5697 DCHECK(current_block() != NULL); | 5696 DCHECK(current_block() != NULL); |
5698 DCHECK(current_block()->HasPredecessor()); | 5697 DCHECK(current_block()->HasPredecessor()); |
5699 HConstant* instr = New<HConstant>(expr->value()); | 5698 HConstant* instr = New<HConstant>(expr->value()); |
5700 return ast_context()->ReturnInstruction(instr, expr->id()); | 5699 return ast_context()->ReturnInstruction(instr, expr->id()); |
5701 } | 5700 } |
5702 | 5701 |
5703 | 5702 |
5704 void HOptimizedGraphBuilder::VisitRegExpLiteral(RegExpLiteral* expr) { | 5703 void HOptimizedGraphBuilder::VisitRegExpLiteral(RegExpLiteral* expr) { |
(...skipping 7730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13435 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13434 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13436 } | 13435 } |
13437 | 13436 |
13438 #ifdef DEBUG | 13437 #ifdef DEBUG |
13439 graph_->Verify(false); // No full verify. | 13438 graph_->Verify(false); // No full verify. |
13440 #endif | 13439 #endif |
13441 } | 13440 } |
13442 | 13441 |
13443 } // namespace internal | 13442 } // namespace internal |
13444 } // namespace v8 | 13443 } // namespace v8 |
OLD | NEW |