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 <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
(...skipping 4665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4676 | 4676 |
4677 AddInstruction(arguments_object); | 4677 AddInstruction(arguments_object); |
4678 graph()->SetArgumentsObject(arguments_object); | 4678 graph()->SetArgumentsObject(arguments_object); |
4679 | 4679 |
4680 // Handle the arguments and arguments shadow variables specially (they do | 4680 // Handle the arguments and arguments shadow variables specially (they do |
4681 // not have declarations). | 4681 // not have declarations). |
4682 if (scope->arguments() != NULL) { | 4682 if (scope->arguments() != NULL) { |
4683 environment()->Bind(scope->arguments(), graph()->GetArgumentsObject()); | 4683 environment()->Bind(scope->arguments(), graph()->GetArgumentsObject()); |
4684 } | 4684 } |
4685 | 4685 |
| 4686 int rest_index; |
| 4687 Variable* rest = scope->rest_parameter(&rest_index); |
| 4688 if (rest) { |
| 4689 return Bailout(kRestParameter); |
| 4690 } |
| 4691 |
4686 if (scope->this_function_var() != nullptr || | 4692 if (scope->this_function_var() != nullptr || |
4687 scope->new_target_var() != nullptr) { | 4693 scope->new_target_var() != nullptr) { |
4688 return Bailout(kSuperReference); | 4694 return Bailout(kSuperReference); |
4689 } | 4695 } |
4690 | 4696 |
4691 // Trace the call. | 4697 // Trace the call. |
4692 if (FLAG_trace && top_info()->IsOptimizing()) { | 4698 if (FLAG_trace && top_info()->IsOptimizing()) { |
4693 Add<HCallRuntime>(Runtime::FunctionForId(Runtime::kTraceEnter), 0); | 4699 Add<HCallRuntime>(Runtime::FunctionForId(Runtime::kTraceEnter), 0); |
4694 } | 4700 } |
4695 } | 4701 } |
(...skipping 3654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8350 target_shared->DisableOptimization(kParseScopeError); | 8356 target_shared->DisableOptimization(kParseScopeError); |
8351 } | 8357 } |
8352 TraceInline(target, caller, "parse failure"); | 8358 TraceInline(target, caller, "parse failure"); |
8353 return false; | 8359 return false; |
8354 } | 8360 } |
8355 | 8361 |
8356 if (target_info.scope()->num_heap_slots() > 0) { | 8362 if (target_info.scope()->num_heap_slots() > 0) { |
8357 TraceInline(target, caller, "target has context-allocated variables"); | 8363 TraceInline(target, caller, "target has context-allocated variables"); |
8358 return false; | 8364 return false; |
8359 } | 8365 } |
| 8366 |
| 8367 int rest_index; |
| 8368 Variable* rest = target_info.scope()->rest_parameter(&rest_index); |
| 8369 if (rest) { |
| 8370 TraceInline(target, caller, "target uses rest parameters"); |
| 8371 return false; |
| 8372 } |
| 8373 |
8360 FunctionLiteral* function = target_info.literal(); | 8374 FunctionLiteral* function = target_info.literal(); |
8361 | 8375 |
8362 // The following conditions must be checked again after re-parsing, because | 8376 // The following conditions must be checked again after re-parsing, because |
8363 // earlier the information might not have been complete due to lazy parsing. | 8377 // earlier the information might not have been complete due to lazy parsing. |
8364 nodes_added = function->ast_node_count(); | 8378 nodes_added = function->ast_node_count(); |
8365 if (nodes_added > Min(FLAG_max_inlined_nodes, kUnlimitedMaxInlinedNodes)) { | 8379 if (nodes_added > Min(FLAG_max_inlined_nodes, kUnlimitedMaxInlinedNodes)) { |
8366 TraceInline(target, caller, "target AST is too large [late]"); | 8380 TraceInline(target, caller, "target AST is too large [late]"); |
8367 return false; | 8381 return false; |
8368 } | 8382 } |
8369 if (function->dont_optimize()) { | 8383 if (function->dont_optimize()) { |
(...skipping 5236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13606 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13620 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13607 } | 13621 } |
13608 | 13622 |
13609 #ifdef DEBUG | 13623 #ifdef DEBUG |
13610 graph_->Verify(false); // No full verify. | 13624 graph_->Verify(false); // No full verify. |
13611 #endif | 13625 #endif |
13612 } | 13626 } |
13613 | 13627 |
13614 } // namespace internal | 13628 } // namespace internal |
13615 } // namespace v8 | 13629 } // namespace v8 |
OLD | NEW |