| 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/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/compiler/ast-loop-assignment-analyzer.h" | 9 #include "src/compiler/ast-loop-assignment-analyzer.h" |
| 10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 input_buffer_(nullptr), | 494 input_buffer_(nullptr), |
| 495 exit_controls_(local_zone), | 495 exit_controls_(local_zone), |
| 496 loop_assignment_analysis_(loop), | 496 loop_assignment_analysis_(loop), |
| 497 type_hint_analysis_(type_hint_analysis), | 497 type_hint_analysis_(type_hint_analysis), |
| 498 state_values_cache_(jsgraph), | 498 state_values_cache_(jsgraph), |
| 499 liveness_analyzer_(static_cast<size_t>(info->scope()->num_stack_slots()), | 499 liveness_analyzer_(static_cast<size_t>(info->scope()->num_stack_slots()), |
| 500 local_zone), | 500 local_zone), |
| 501 frame_state_function_info_(common()->CreateFrameStateFunctionInfo( | 501 frame_state_function_info_(common()->CreateFrameStateFunctionInfo( |
| 502 FrameStateType::kJavaScriptFunction, info->num_parameters() + 1, | 502 FrameStateType::kJavaScriptFunction, info->num_parameters() + 1, |
| 503 info->scope()->num_stack_slots(), info->shared_info())) { | 503 info->scope()->num_stack_slots(), info->shared_info())) { |
| 504 // If --turbo-from-bytecode is enabled we should never construct a graph using |
| 505 // the ASTGraphBuilder, except for functions which are never compiled to |
| 506 // bytecode. |
| 507 DCHECK(!(FLAG_turbo_from_bytecode && Compiler::ShouldUseIgnition(info))); |
| 504 InitializeAstVisitor(info->isolate()); | 508 InitializeAstVisitor(info->isolate()); |
| 505 } | 509 } |
| 506 | 510 |
| 507 | 511 |
| 508 Node* AstGraphBuilder::GetFunctionClosureForContext() { | 512 Node* AstGraphBuilder::GetFunctionClosureForContext() { |
| 509 Scope* closure_scope = current_scope()->ClosureScope(); | 513 Scope* closure_scope = current_scope()->ClosureScope(); |
| 510 if (closure_scope->is_script_scope() || | 514 if (closure_scope->is_script_scope() || |
| 511 closure_scope->is_module_scope()) { | 515 closure_scope->is_module_scope()) { |
| 512 // Contexts nested in the native context have a canonical empty function as | 516 // Contexts nested in the native context have a canonical empty function as |
| 513 // their closure, not the anonymous closure containing the global code. | 517 // their closure, not the anonymous closure containing the global code. |
| (...skipping 3902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4416 // Phi does not exist yet, introduce one. | 4420 // Phi does not exist yet, introduce one. |
| 4417 value = NewPhi(inputs, value, control); | 4421 value = NewPhi(inputs, value, control); |
| 4418 value->ReplaceInput(inputs - 1, other); | 4422 value->ReplaceInput(inputs - 1, other); |
| 4419 } | 4423 } |
| 4420 return value; | 4424 return value; |
| 4421 } | 4425 } |
| 4422 | 4426 |
| 4423 } // namespace compiler | 4427 } // namespace compiler |
| 4424 } // namespace internal | 4428 } // namespace internal |
| 4425 } // namespace v8 | 4429 } // namespace v8 |
| OLD | NEW |