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

Side by Side Diff: src/compiler/js-inlining.cc

Issue 1155683004: [turbofan] Connect loops to end via Terminate during graph building. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Also remove redundant EffectPhis now. Created 5 years, 7 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/control-reducer.cc ('k') | test/cctest/compiler/test-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/js-inlining.h" 5 #include "src/compiler/js-inlining.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/compiler/all-nodes.h" 9 #include "src/compiler/all-nodes.h"
10 #include "src/compiler/ast-graph-builder.h" 10 #include "src/compiler/ast-graph-builder.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 NodeVector values(local_zone_); 168 NodeVector values(local_zone_);
169 NodeVector effects(local_zone_); 169 NodeVector effects(local_zone_);
170 NodeVector controls(local_zone_); 170 NodeVector controls(local_zone_);
171 for (Node* const input : end->inputs()) { 171 for (Node* const input : end->inputs()) {
172 switch (input->opcode()) { 172 switch (input->opcode()) {
173 case IrOpcode::kReturn: 173 case IrOpcode::kReturn:
174 values.push_back(NodeProperties::GetValueInput(input, 0)); 174 values.push_back(NodeProperties::GetValueInput(input, 0));
175 effects.push_back(NodeProperties::GetEffectInput(input)); 175 effects.push_back(NodeProperties::GetEffectInput(input));
176 controls.push_back(NodeProperties::GetControlInput(input)); 176 controls.push_back(NodeProperties::GetControlInput(input));
177 break; 177 break;
178 case IrOpcode::kDeoptimize:
179 case IrOpcode::kTerminate:
180 case IrOpcode::kThrow:
181 jsgraph_->graph()->end()->AppendInput(jsgraph_->zone(), input);
182 jsgraph_->graph()->end()->set_op(
183 jsgraph_->common()->End(jsgraph_->graph()->end()->InputCount()));
184 break;
178 default: 185 default:
179 // TODO(turbofan): Handle Throw, Terminate and Deoptimize here.
180 UNREACHABLE(); 186 UNREACHABLE();
181 break; 187 break;
182 } 188 }
183 } 189 }
184 DCHECK_NE(0u, values.size()); 190 DCHECK_NE(0u, values.size());
185 DCHECK_EQ(values.size(), effects.size()); 191 DCHECK_EQ(values.size(), effects.size());
186 DCHECK_EQ(values.size(), controls.size()); 192 DCHECK_EQ(values.size(), controls.size());
187 int const input_count = static_cast<int>(controls.size()); 193 int const input_count = static_cast<int>(controls.size());
188 Node* control_output = jsgraph_->graph()->NewNode( 194 Node* control_output = jsgraph_->graph()->NewNode(
189 jsgraph_->common()->Merge(input_count), input_count, &controls.front()); 195 jsgraph_->common()->Merge(input_count), input_count, &controls.front());
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 308 }
303 } 309 }
304 } 310 }
305 311
306 return InlineCall(node, start, end); 312 return InlineCall(node, start, end);
307 } 313 }
308 314
309 } // namespace compiler 315 } // namespace compiler
310 } // namespace internal 316 } // namespace internal
311 } // namespace v8 317 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | test/cctest/compiler/test-control-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698