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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 } | 834 } |
835 } | 835 } |
836 } | 836 } |
837 if (should_update) { | 837 if (should_update) { |
838 const Operator* op = common()->StateValues(count); | 838 const Operator* op = common()->StateValues(count); |
839 (*state_values) = graph()->NewNode(op, count, env_values); | 839 (*state_values) = graph()->NewNode(op, count, env_values); |
840 } | 840 } |
841 } | 841 } |
842 | 842 |
843 | 843 |
844 void AstGraphBuilder::Environment::UpdateStateValuesWithCache( | |
845 Node** state_values, int offset, int count) { | |
846 Node** env_values = (count == 0) ? nullptr : &values()->at(offset); | |
847 *state_values = builder_->state_values_cache_.GetNodeForValues( | |
848 env_values, static_cast<size_t>(count)); | |
849 } | |
850 | |
851 Node* AstGraphBuilder::Environment::Checkpoint(BailoutId ast_id, | 844 Node* AstGraphBuilder::Environment::Checkpoint(BailoutId ast_id, |
852 OutputFrameStateCombine combine, | 845 OutputFrameStateCombine combine, |
853 bool owner_has_exception) { | 846 bool owner_has_exception) { |
854 if (!builder()->info()->is_deoptimization_enabled()) { | 847 if (!builder()->info()->is_deoptimization_enabled()) { |
855 return builder()->GetEmptyFrameState(); | 848 return builder()->GetEmptyFrameState(); |
856 } | 849 } |
857 | 850 |
858 UpdateStateValues(¶meters_node_, 0, parameters_count()); | 851 UpdateStateValues(¶meters_node_, 0, parameters_count()); |
859 UpdateStateValuesWithCache(&locals_node_, parameters_count(), locals_count()); | 852 UpdateStateValues(&locals_node_, parameters_count(), locals_count()); |
860 UpdateStateValues(&stack_node_, parameters_count() + locals_count(), | 853 UpdateStateValues(&stack_node_, parameters_count() + locals_count(), |
861 stack_height()); | 854 stack_height()); |
862 | 855 |
863 const Operator* op = common()->FrameState( | 856 const Operator* op = common()->FrameState( |
864 ast_id, combine, builder()->frame_state_function_info()); | 857 ast_id, combine, builder()->frame_state_function_info()); |
865 | 858 |
866 Node* result = graph()->NewNode(op, parameters_node_, locals_node_, | 859 Node* result = graph()->NewNode(op, parameters_node_, locals_node_, |
867 stack_node_, builder()->current_context(), | 860 stack_node_, builder()->current_context(), |
868 builder()->GetFunctionClosure(), | 861 builder()->GetFunctionClosure(), |
869 builder()->graph()->start()); | 862 builder()->graph()->start()); |
(...skipping 3503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4373 TypeHintAnalysis* type_hint_analysis, SourcePositionTable* source_positions, | 4366 TypeHintAnalysis* type_hint_analysis, SourcePositionTable* source_positions, |
4374 int inlining_id) | 4367 int inlining_id) |
4375 : AstGraphBuilder(local_zone, info, jsgraph, invocation_frequency, | 4368 : AstGraphBuilder(local_zone, info, jsgraph, invocation_frequency, |
4376 loop_assignment, type_hint_analysis), | 4369 loop_assignment, type_hint_analysis), |
4377 source_positions_(source_positions), | 4370 source_positions_(source_positions), |
4378 start_position_(info->shared_info()->start_position(), inlining_id) {} | 4371 start_position_(info->shared_info()->start_position(), inlining_id) {} |
4379 | 4372 |
4380 } // namespace compiler | 4373 } // namespace compiler |
4381 } // namespace internal | 4374 } // namespace internal |
4382 } // namespace v8 | 4375 } // namespace v8 |
OLD | NEW |