Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1191243003: [turbofan] Factor out the function specific part from the frame state operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/ast-loop-assignment-analyzer.h" 8 #include "src/compiler/ast-loop-assignment-analyzer.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/js-type-feedback.h" 10 #include "src/compiler/js-type-feedback.h"
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 execution_context_(nullptr), 441 execution_context_(nullptr),
442 try_catch_nesting_level_(0), 442 try_catch_nesting_level_(0),
443 try_nesting_level_(0), 443 try_nesting_level_(0),
444 input_buffer_size_(0), 444 input_buffer_size_(0),
445 input_buffer_(nullptr), 445 input_buffer_(nullptr),
446 exit_controls_(local_zone), 446 exit_controls_(local_zone),
447 loop_assignment_analysis_(loop), 447 loop_assignment_analysis_(loop),
448 state_values_cache_(jsgraph), 448 state_values_cache_(jsgraph),
449 liveness_analyzer_(static_cast<size_t>(info->scope()->num_stack_slots()), 449 liveness_analyzer_(static_cast<size_t>(info->scope()->num_stack_slots()),
450 local_zone), 450 local_zone),
451 frame_state_function_info_(common()->CreateFrameStateFunctionInfo(
452 FrameStateType::kJavaScriptFunction,
453 info->num_parameters_including_this(),
454 info->scope()->num_stack_slots(), info->shared_info())),
451 js_type_feedback_(js_type_feedback) { 455 js_type_feedback_(js_type_feedback) {
452 InitializeAstVisitor(info->isolate(), local_zone); 456 InitializeAstVisitor(info->isolate(), local_zone);
453 } 457 }
454 458
455 459
456 Node* AstGraphBuilder::GetFunctionClosureForContext() { 460 Node* AstGraphBuilder::GetFunctionClosureForContext() {
457 Scope* declaration_scope = current_scope()->DeclarationScope(); 461 Scope* declaration_scope = current_scope()->DeclarationScope();
458 if (declaration_scope->is_script_scope() || 462 if (declaration_scope->is_script_scope() ||
459 declaration_scope->is_module_scope()) { 463 declaration_scope->is_module_scope()) {
460 // Contexts nested in the native context have a canonical empty function as 464 // Contexts nested in the native context have a canonical empty function as
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 BailoutId ast_id, OutputFrameStateCombine combine) { 866 BailoutId ast_id, OutputFrameStateCombine combine) {
863 if (!builder()->info()->is_deoptimization_enabled()) { 867 if (!builder()->info()->is_deoptimization_enabled()) {
864 return builder()->jsgraph()->EmptyFrameState(); 868 return builder()->jsgraph()->EmptyFrameState();
865 } 869 }
866 870
867 UpdateStateValues(&parameters_node_, 0, parameters_count()); 871 UpdateStateValues(&parameters_node_, 0, parameters_count());
868 UpdateStateValuesWithCache(&locals_node_, parameters_count(), locals_count()); 872 UpdateStateValuesWithCache(&locals_node_, parameters_count(), locals_count());
869 UpdateStateValues(&stack_node_, parameters_count() + locals_count(), 873 UpdateStateValues(&stack_node_, parameters_count() + locals_count(),
870 stack_height()); 874 stack_height());
871 875
872 const Operator* op = common()->FrameState(JS_FRAME, ast_id, combine, 876 const Operator* op = common()->FrameState(
873 builder()->info()->shared_info()); 877 ast_id, combine, builder()->frame_state_function_info());
874 878
875 Node* result = graph()->NewNode(op, parameters_node_, locals_node_, 879 Node* result = graph()->NewNode(op, parameters_node_, locals_node_,
876 stack_node_, builder()->current_context(), 880 stack_node_, builder()->current_context(),
877 builder()->GetFunctionClosure(), 881 builder()->GetFunctionClosure(),
878 builder()->graph()->start()); 882 builder()->graph()->start());
879 883
880 DCHECK(IsLivenessBlockConsistent()); 884 DCHECK(IsLivenessBlockConsistent());
881 if (liveness_block() != nullptr) { 885 if (liveness_block() != nullptr) {
882 liveness_block()->Checkpoint(result); 886 liveness_block()->Checkpoint(result);
883 } 887 }
(...skipping 3231 matching lines...) Expand 10 before | Expand all | Expand 10 after
4115 // Phi does not exist yet, introduce one. 4119 // Phi does not exist yet, introduce one.
4116 value = NewPhi(inputs, value, control); 4120 value = NewPhi(inputs, value, control);
4117 value->ReplaceInput(inputs - 1, other); 4121 value->ReplaceInput(inputs - 1, other);
4118 } 4122 }
4119 return value; 4123 return value;
4120 } 4124 }
4121 4125
4122 } // namespace compiler 4126 } // namespace compiler
4123 } // namespace internal 4127 } // namespace internal
4124 } // namespace v8 4128 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698