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

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

Issue 929123002: Move DeadControl into the JSGraph so that it can be reused. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/control-reducer.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/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after
2963 if (has_control) ++input_count_with_deps; 2963 if (has_control) ++input_count_with_deps;
2964 if (has_effect) ++input_count_with_deps; 2964 if (has_effect) ++input_count_with_deps;
2965 Node** buffer = EnsureInputBufferSize(input_count_with_deps); 2965 Node** buffer = EnsureInputBufferSize(input_count_with_deps);
2966 memcpy(buffer, value_inputs, kPointerSize * value_input_count); 2966 memcpy(buffer, value_inputs, kPointerSize * value_input_count);
2967 Node** current_input = buffer + value_input_count; 2967 Node** current_input = buffer + value_input_count;
2968 if (has_context) { 2968 if (has_context) {
2969 *current_input++ = current_context(); 2969 *current_input++ = current_context();
2970 } 2970 }
2971 if (has_framestate) { 2971 if (has_framestate) {
2972 // The frame state will be inserted later. Here we misuse 2972 // The frame state will be inserted later. Here we misuse
2973 // the dead_control node as a sentinel to be later overwritten 2973 // the {DeadControl} node as a sentinel to be later overwritten
2974 // with the real frame state. 2974 // with the real frame state.
2975 *current_input++ = dead_control(); 2975 *current_input++ = jsgraph()->DeadControl();
2976 } 2976 }
2977 if (has_effect) { 2977 if (has_effect) {
2978 *current_input++ = environment_->GetEffectDependency(); 2978 *current_input++ = environment_->GetEffectDependency();
2979 } 2979 }
2980 if (has_control) { 2980 if (has_control) {
2981 *current_input++ = environment_->GetControlDependency(); 2981 *current_input++ = environment_->GetControlDependency();
2982 } 2982 }
2983 result = graph()->NewNode(op, input_count_with_deps, buffer, incomplete); 2983 result = graph()->NewNode(op, input_count_with_deps, buffer, incomplete);
2984 if (has_effect) { 2984 if (has_effect) {
2985 environment_->UpdateEffectDependency(result); 2985 environment_->UpdateEffectDependency(result);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
3150 value->set_op(common()->Phi(kMachAnyTagged, inputs)); 3150 value->set_op(common()->Phi(kMachAnyTagged, inputs));
3151 value->InsertInput(graph_zone(), inputs - 1, other); 3151 value->InsertInput(graph_zone(), inputs - 1, other);
3152 } else if (value != other) { 3152 } else if (value != other) {
3153 // Phi does not exist yet, introduce one. 3153 // Phi does not exist yet, introduce one.
3154 value = NewPhi(inputs, value, control); 3154 value = NewPhi(inputs, value, control);
3155 value->ReplaceInput(inputs - 1, other); 3155 value->ReplaceInput(inputs - 1, other);
3156 } 3156 }
3157 return value; 3157 return value;
3158 } 3158 }
3159 3159
3160
3161 Node* AstGraphBuilder::dead_control() {
3162 if (!dead_control_.is_set()) {
3163 Node* dead_node = graph()->NewNode(common()->Dead());
3164 dead_control_.set(dead_node);
3165 return dead_node;
3166 }
3167 return dead_control_.get();
3168 }
3169
3170 } // namespace compiler 3160 } // namespace compiler
3171 } // namespace internal 3161 } // namespace internal
3172 } // namespace v8 3162 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/control-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698