OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
6 | 6 |
7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.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/compiler-source-position-table.h" | 10 #include "src/compiler/compiler-source-position-table.h" |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 bailout_id, combine, builder()->frame_state_function_info()); | 436 bailout_id, combine, builder()->frame_state_function_info()); |
437 Node* result = graph()->NewNode( | 437 Node* result = graph()->NewNode( |
438 op, parameters_state_values_, registers_state_values_, | 438 op, parameters_state_values_, registers_state_values_, |
439 accumulator_state_values_, Context(), builder()->GetFunctionClosure(), | 439 accumulator_state_values_, Context(), builder()->GetFunctionClosure(), |
440 builder()->graph()->start()); | 440 builder()->graph()->start()); |
441 | 441 |
442 return result; | 442 return result; |
443 } | 443 } |
444 | 444 |
445 BytecodeGraphBuilder::BytecodeGraphBuilder( | 445 BytecodeGraphBuilder::BytecodeGraphBuilder( |
446 Zone* local_zone, CompilationInfo* info, JSGraph* jsgraph, | 446 Zone* local_zone, Handle<SharedFunctionInfo> shared_info, |
447 float invocation_frequency, SourcePositionTable* source_positions, | 447 Handle<TypeFeedbackVector> feedback_vector, BailoutId osr_ast_id, |
448 int inlining_id) | 448 JSGraph* jsgraph, float invocation_frequency, |
| 449 SourcePositionTable* source_positions, int inlining_id) |
449 : local_zone_(local_zone), | 450 : local_zone_(local_zone), |
450 jsgraph_(jsgraph), | 451 jsgraph_(jsgraph), |
451 invocation_frequency_(invocation_frequency), | 452 invocation_frequency_(invocation_frequency), |
452 bytecode_array_(handle(info->shared_info()->bytecode_array())), | 453 bytecode_array_(handle(shared_info->bytecode_array())), |
453 exception_handler_table_( | 454 exception_handler_table_( |
454 handle(HandlerTable::cast(bytecode_array()->handler_table()))), | 455 handle(HandlerTable::cast(bytecode_array()->handler_table()))), |
455 feedback_vector_(handle(info->closure()->feedback_vector())), | 456 feedback_vector_(feedback_vector), |
456 frame_state_function_info_(common()->CreateFrameStateFunctionInfo( | 457 frame_state_function_info_(common()->CreateFrameStateFunctionInfo( |
457 FrameStateType::kInterpretedFunction, | 458 FrameStateType::kInterpretedFunction, |
458 bytecode_array()->parameter_count(), | 459 bytecode_array()->parameter_count(), |
459 bytecode_array()->register_count(), info->shared_info())), | 460 bytecode_array()->register_count(), shared_info)), |
460 osr_ast_id_(info->osr_ast_id()), | 461 bytecode_iterator_(nullptr), |
| 462 bytecode_analysis_(nullptr), |
| 463 environment_(nullptr), |
| 464 osr_ast_id_(osr_ast_id), |
461 osr_loop_offset_(-1), | 465 osr_loop_offset_(-1), |
462 merge_environments_(local_zone), | 466 merge_environments_(local_zone), |
463 exception_handlers_(local_zone), | 467 exception_handlers_(local_zone), |
464 current_exception_handler_(0), | 468 current_exception_handler_(0), |
465 input_buffer_size_(0), | 469 input_buffer_size_(0), |
466 input_buffer_(nullptr), | 470 input_buffer_(nullptr), |
467 exit_controls_(local_zone), | 471 exit_controls_(local_zone), |
468 is_liveness_analysis_enabled_(FLAG_analyze_environment_liveness), | 472 is_liveness_analysis_enabled_(FLAG_analyze_environment_liveness), |
469 state_values_cache_(jsgraph), | 473 state_values_cache_(jsgraph), |
470 source_positions_(source_positions), | 474 source_positions_(source_positions), |
471 start_position_(info->shared_info()->start_position(), inlining_id) { | 475 start_position_(shared_info->start_position(), inlining_id) {} |
472 // Bytecode graph builder assumes deoptimziation is enabled. | |
473 DCHECK(info->is_deoptimization_enabled()); | |
474 } | |
475 | 476 |
476 Node* BytecodeGraphBuilder::GetNewTarget() { | 477 Node* BytecodeGraphBuilder::GetNewTarget() { |
477 if (!new_target_.is_set()) { | 478 if (!new_target_.is_set()) { |
478 int params = bytecode_array()->parameter_count(); | 479 int params = bytecode_array()->parameter_count(); |
479 int index = Linkage::GetJSCallNewTargetParamIndex(params); | 480 int index = Linkage::GetJSCallNewTargetParamIndex(params); |
480 const Operator* op = common()->Parameter(index, "%new.target"); | 481 const Operator* op = common()->Parameter(index, "%new.target"); |
481 Node* node = NewNode(op, graph()->start()); | 482 Node* node = NewNode(op, graph()->start()); |
482 new_target_.set(node); | 483 new_target_.set(node); |
483 } | 484 } |
484 return new_target_.get(); | 485 return new_target_.get(); |
(...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2268 it->source_position().ScriptOffset(), start_position_.InliningId())); | 2269 it->source_position().ScriptOffset(), start_position_.InliningId())); |
2269 it->Advance(); | 2270 it->Advance(); |
2270 } else { | 2271 } else { |
2271 DCHECK_GT(it->code_offset(), offset); | 2272 DCHECK_GT(it->code_offset(), offset); |
2272 } | 2273 } |
2273 } | 2274 } |
2274 | 2275 |
2275 } // namespace compiler | 2276 } // namespace compiler |
2276 } // namespace internal | 2277 } // namespace internal |
2277 } // namespace v8 | 2278 } // namespace v8 |
OLD | NEW |