| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
| 6 | 6 |
| 7 #include "src/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 execution_control_(nullptr), | 426 execution_control_(nullptr), |
| 427 execution_context_(nullptr), | 427 execution_context_(nullptr), |
| 428 try_nesting_level_(0), | 428 try_nesting_level_(0), |
| 429 input_buffer_size_(0), | 429 input_buffer_size_(0), |
| 430 input_buffer_(nullptr), | 430 input_buffer_(nullptr), |
| 431 exit_controls_(local_zone), | 431 exit_controls_(local_zone), |
| 432 loop_assignment_analysis_(loop), | 432 loop_assignment_analysis_(loop), |
| 433 type_hint_analysis_(type_hint_analysis), | 433 type_hint_analysis_(type_hint_analysis), |
| 434 state_values_cache_(jsgraph), | 434 state_values_cache_(jsgraph), |
| 435 liveness_analyzer_(static_cast<size_t>(info->scope()->num_stack_slots()), | 435 liveness_analyzer_(static_cast<size_t>(info->scope()->num_stack_slots()), |
| 436 local_zone), | 436 false, local_zone), |
| 437 frame_state_function_info_(common()->CreateFrameStateFunctionInfo( | 437 frame_state_function_info_(common()->CreateFrameStateFunctionInfo( |
| 438 FrameStateType::kJavaScriptFunction, info->num_parameters() + 1, | 438 FrameStateType::kJavaScriptFunction, info->num_parameters() + 1, |
| 439 info->scope()->num_stack_slots(), info->shared_info())) { | 439 info->scope()->num_stack_slots(), info->shared_info())) { |
| 440 InitializeAstVisitor(info->isolate()); | 440 InitializeAstVisitor(info->isolate()); |
| 441 } | 441 } |
| 442 | 442 |
| 443 | 443 |
| 444 Node* AstGraphBuilder::GetFunctionClosureForContext() { | 444 Node* AstGraphBuilder::GetFunctionClosureForContext() { |
| 445 DeclarationScope* closure_scope = current_scope()->GetClosureScope(); | 445 DeclarationScope* closure_scope = current_scope()->GetClosureScope(); |
| 446 if (closure_scope->is_script_scope() || | 446 if (closure_scope->is_script_scope() || |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 | 606 |
| 607 | 607 |
| 608 void AstGraphBuilder::ClearNonLiveSlotsInFrameStates() { | 608 void AstGraphBuilder::ClearNonLiveSlotsInFrameStates() { |
| 609 if (!FLAG_analyze_environment_liveness || | 609 if (!FLAG_analyze_environment_liveness || |
| 610 !info()->is_deoptimization_enabled()) { | 610 !info()->is_deoptimization_enabled()) { |
| 611 return; | 611 return; |
| 612 } | 612 } |
| 613 | 613 |
| 614 NonLiveFrameStateSlotReplacer replacer( | 614 NonLiveFrameStateSlotReplacer replacer( |
| 615 &state_values_cache_, jsgraph()->OptimizedOutConstant(), | 615 &state_values_cache_, jsgraph()->OptimizedOutConstant(), |
| 616 liveness_analyzer()->local_count(), local_zone()); | 616 liveness_analyzer()->local_count(), false, local_zone()); |
| 617 Variable* arguments = info()->scope()->arguments(); | 617 Variable* arguments = info()->scope()->arguments(); |
| 618 if (arguments != nullptr && arguments->IsStackAllocated()) { | 618 if (arguments != nullptr && arguments->IsStackAllocated()) { |
| 619 replacer.MarkPermanentlyLive(arguments->index()); | 619 replacer.MarkPermanentlyLive(arguments->index()); |
| 620 } | 620 } |
| 621 liveness_analyzer()->Run(&replacer); | 621 liveness_analyzer()->Run(&replacer); |
| 622 if (FLAG_trace_environment_liveness) { | 622 if (FLAG_trace_environment_liveness) { |
| 623 OFStream os(stdout); | 623 OFStream os(stdout); |
| 624 liveness_analyzer()->Print(os); | 624 liveness_analyzer()->Print(os); |
| 625 } | 625 } |
| 626 } | 626 } |
| (...skipping 3728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4355 // Phi does not exist yet, introduce one. | 4355 // Phi does not exist yet, introduce one. |
| 4356 value = NewPhi(inputs, value, control); | 4356 value = NewPhi(inputs, value, control); |
| 4357 value->ReplaceInput(inputs - 1, other); | 4357 value->ReplaceInput(inputs - 1, other); |
| 4358 } | 4358 } |
| 4359 return value; | 4359 return value; |
| 4360 } | 4360 } |
| 4361 | 4361 |
| 4362 } // namespace compiler | 4362 } // namespace compiler |
| 4363 } // namespace internal | 4363 } // namespace internal |
| 4364 } // namespace v8 | 4364 } // namespace v8 |
| OLD | NEW |