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 3583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3594 next_block_id_(0), | 3594 next_block_id_(0), |
3595 entry_block_(NULL), | 3595 entry_block_(NULL), |
3596 blocks_(8, info->zone()), | 3596 blocks_(8, info->zone()), |
3597 values_(16, info->zone()), | 3597 values_(16, info->zone()), |
3598 phi_list_(NULL), | 3598 phi_list_(NULL), |
3599 uint32_instructions_(NULL), | 3599 uint32_instructions_(NULL), |
3600 osr_(NULL), | 3600 osr_(NULL), |
3601 info_(info), | 3601 info_(info), |
3602 descriptor_(descriptor), | 3602 descriptor_(descriptor), |
3603 zone_(info->zone()), | 3603 zone_(info->zone()), |
3604 is_recursive_(false), | |
3605 use_optimistic_licm_(false), | 3604 use_optimistic_licm_(false), |
3606 depends_on_empty_array_proto_elements_(false), | 3605 depends_on_empty_array_proto_elements_(false), |
3607 type_change_checksum_(0), | 3606 type_change_checksum_(0), |
3608 maximum_environment_size_(0), | 3607 maximum_environment_size_(0), |
3609 no_side_effects_scope_count_(0), | 3608 no_side_effects_scope_count_(0), |
3610 disallow_adding_new_values_(false) { | 3609 disallow_adding_new_values_(false) { |
3611 if (info->IsStub()) { | 3610 if (info->IsStub()) { |
3612 // For stubs, explicitly add the context to the environment. | 3611 // For stubs, explicitly add the context to the environment. |
3613 start_environment_ = new (zone_) | 3612 start_environment_ = new (zone_) |
3614 HEnvironment(zone_, descriptor.GetRegisterParameterCount() + 1); | 3613 HEnvironment(zone_, descriptor.GetRegisterParameterCount() + 1); |
(...skipping 4434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8049 // argument adaptor and instead call the function directly | 8048 // argument adaptor and instead call the function directly |
8050 int formal_parameter_count = | 8049 int formal_parameter_count = |
8051 jsfun->shared()->internal_formal_parameter_count(); | 8050 jsfun->shared()->internal_formal_parameter_count(); |
8052 bool dont_adapt_arguments = | 8051 bool dont_adapt_arguments = |
8053 (formal_parameter_count == | 8052 (formal_parameter_count == |
8054 SharedFunctionInfo::kDontAdaptArgumentsSentinel); | 8053 SharedFunctionInfo::kDontAdaptArgumentsSentinel); |
8055 int arity = argument_count - 1; | 8054 int arity = argument_count - 1; |
8056 bool can_invoke_directly = | 8055 bool can_invoke_directly = |
8057 dont_adapt_arguments || formal_parameter_count == arity; | 8056 dont_adapt_arguments || formal_parameter_count == arity; |
8058 if (can_invoke_directly) { | 8057 if (can_invoke_directly) { |
8059 if (jsfun.is_identical_to(current_info()->closure())) { | |
8060 graph()->MarkRecursive(); | |
8061 } | |
8062 return NewPlainFunctionCall(target, argument_count); | 8058 return NewPlainFunctionCall(target, argument_count); |
8063 } else { | 8059 } else { |
8064 HValue* param_count_value = Add<HConstant>(formal_parameter_count); | 8060 HValue* param_count_value = Add<HConstant>(formal_parameter_count); |
8065 return NewArgumentAdaptorCall(target, argument_count, param_count_value); | 8061 return NewArgumentAdaptorCall(target, argument_count, param_count_value); |
8066 } | 8062 } |
8067 UNREACHABLE(); | 8063 UNREACHABLE(); |
8068 return NULL; | 8064 return NULL; |
8069 } | 8065 } |
8070 | 8066 |
8071 | 8067 |
(...skipping 5425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13497 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13493 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13498 } | 13494 } |
13499 | 13495 |
13500 #ifdef DEBUG | 13496 #ifdef DEBUG |
13501 graph_->Verify(false); // No full verify. | 13497 graph_->Verify(false); // No full verify. |
13502 #endif | 13498 #endif |
13503 } | 13499 } |
13504 | 13500 |
13505 } // namespace internal | 13501 } // namespace internal |
13506 } // namespace v8 | 13502 } // namespace v8 |
OLD | NEW |