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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 4633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4644 } | 4644 } |
4645 | 4645 |
4646 AddInstruction(arguments_object); | 4646 AddInstruction(arguments_object); |
4647 | 4647 |
4648 // Handle the arguments and arguments shadow variables specially (they do | 4648 // Handle the arguments and arguments shadow variables specially (they do |
4649 // not have declarations). | 4649 // not have declarations). |
4650 if (scope->arguments() != NULL) { | 4650 if (scope->arguments() != NULL) { |
4651 environment()->Bind(scope->arguments(), arguments_object); | 4651 environment()->Bind(scope->arguments(), arguments_object); |
4652 } | 4652 } |
4653 | 4653 |
4654 int rest_index; | 4654 if (scope->rest_parameter() != nullptr) { |
4655 Variable* rest = scope->rest_parameter(&rest_index); | |
4656 if (rest) { | |
4657 return Bailout(kRestParameter); | 4655 return Bailout(kRestParameter); |
4658 } | 4656 } |
4659 | 4657 |
4660 if (scope->this_function_var() != nullptr || | 4658 if (scope->this_function_var() != nullptr || |
4661 scope->new_target_var() != nullptr) { | 4659 scope->new_target_var() != nullptr) { |
4662 return Bailout(kSuperReference); | 4660 return Bailout(kSuperReference); |
4663 } | 4661 } |
4664 | 4662 |
4665 // Trace the call. | 4663 // Trace the call. |
4666 if (FLAG_trace && top_info()->IsOptimizing()) { | 4664 if (FLAG_trace && top_info()->IsOptimizing()) { |
(...skipping 3732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8399 if (target_shared->dont_crankshaft()) { | 8397 if (target_shared->dont_crankshaft()) { |
8400 TraceInline(target, caller, "ParseAndAnalyze found incompatibility"); | 8398 TraceInline(target, caller, "ParseAndAnalyze found incompatibility"); |
8401 return false; | 8399 return false; |
8402 } | 8400 } |
8403 | 8401 |
8404 if (target_info.scope()->num_heap_slots() > 0) { | 8402 if (target_info.scope()->num_heap_slots() > 0) { |
8405 TraceInline(target, caller, "target has context-allocated variables"); | 8403 TraceInline(target, caller, "target has context-allocated variables"); |
8406 return false; | 8404 return false; |
8407 } | 8405 } |
8408 | 8406 |
8409 int rest_index; | 8407 if (target_info.scope()->rest_parameter() != nullptr) { |
8410 Variable* rest = target_info.scope()->rest_parameter(&rest_index); | |
8411 if (rest) { | |
8412 TraceInline(target, caller, "target uses rest parameters"); | 8408 TraceInline(target, caller, "target uses rest parameters"); |
8413 return false; | 8409 return false; |
8414 } | 8410 } |
8415 | 8411 |
8416 FunctionLiteral* function = target_info.literal(); | 8412 FunctionLiteral* function = target_info.literal(); |
8417 | 8413 |
8418 // The following conditions must be checked again after re-parsing, because | 8414 // The following conditions must be checked again after re-parsing, because |
8419 // earlier the information might not have been complete due to lazy parsing. | 8415 // earlier the information might not have been complete due to lazy parsing. |
8420 nodes_added = function->ast_node_count(); | 8416 nodes_added = function->ast_node_count(); |
8421 if (nodes_added > Min(FLAG_max_inlined_nodes, kUnlimitedMaxInlinedNodes)) { | 8417 if (nodes_added > Min(FLAG_max_inlined_nodes, kUnlimitedMaxInlinedNodes)) { |
(...skipping 5011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13433 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13429 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13434 } | 13430 } |
13435 | 13431 |
13436 #ifdef DEBUG | 13432 #ifdef DEBUG |
13437 graph_->Verify(false); // No full verify. | 13433 graph_->Verify(false); // No full verify. |
13438 #endif | 13434 #endif |
13439 } | 13435 } |
13440 | 13436 |
13441 } // namespace internal | 13437 } // namespace internal |
13442 } // namespace v8 | 13438 } // namespace v8 |
OLD | NEW |