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

Unified Diff: src/compiler/simplified-lowering.cc

Issue 1029843002: [turbofan] Address minor TODOs in simplified lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index 00ebd13fcf26deefa6de0ced34a6ca3f5fc429d7..d216009e4e563d68b2c1b84aee3776c832c36a53 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -250,28 +250,21 @@ class RepresentationSelector {
}
// The default, most general visitation case. For {node}, process all value,
- // context, effect, and control inputs, assuming that value inputs should have
- // {kRepTagged} representation and can observe all output values {kTypeAny}.
+ // context, frame state, effect, and control inputs, assuming that value
+ // inputs should have {kRepTagged} representation and can observe all output
+ // values {kTypeAny}.
void VisitInputs(Node* node) {
- auto i = node->input_edges().begin();
- for (int j = node->op()->ValueInputCount(); j > 0; ++i, j--) {
- ProcessInput(node, (*i).index(), kMachAnyTagged); // Value inputs
+ int tagged_count = node->op()->ValueInputCount() +
+ OperatorProperties::GetContextInputCount(node->op());
+ // Visit value and context inputs as tagged.
+ for (int i = 0; i < tagged_count; i++) {
+ ProcessInput(node, i, kMachAnyTagged);
}
- for (int j = OperatorProperties::GetContextInputCount(node->op()); j > 0;
- ++i, j--) {
- ProcessInput(node, (*i).index(), kMachAnyTagged); // Context inputs
+ // Only enqueue other inputs (framestates, effects, control).
+ for (int i = tagged_count; i < node->InputCount(); i++) {
+ Enqueue(node->InputAt(i));
}
- for (int j = OperatorProperties::GetFrameStateInputCount(node->op()); j > 0;
- ++i, j--) {
- Enqueue((*i).to()); // FrameState inputs: just visit
- }
- for (int j = node->op()->EffectInputCount(); j > 0; ++i, j--) {
- Enqueue((*i).to()); // Effect inputs: just visit
- }
- for (int j = node->op()->ControlInputCount(); j > 0; ++i, j--) {
- Enqueue((*i).to()); // Control inputs: just visit
- }
- DCHECK(i == node->input_edges().end());
+ // Assume the output is tagged.
SetOutput(node, kMachAnyTagged);
}
@@ -407,19 +400,15 @@ class RepresentationSelector {
}
// Convert inputs to the output representation of this phi.
- for (Edge const edge : node->input_edges()) {
- // TODO(titzer): it'd be nice to have distinguished edge kinds here.
- ProcessInput(node, edge.index(), values > 0 ? output_type : 0);
- values--;
+ for (int i = 0; i < node->InputCount(); i++) {
+ ProcessInput(node, i, i < values ? output_type : 0);
}
} else {
// Propagate {use} of the phi to value inputs, and 0 to control.
MachineType use_type =
static_cast<MachineType>((use & kTypeMask) | output);
- for (Edge const edge : node->input_edges()) {
- // TODO(titzer): it'd be nice to have distinguished edge kinds here.
- ProcessInput(node, edge.index(), values > 0 ? use_type : 0);
- values--;
+ for (int i = 0; i < node->InputCount(); i++) {
+ ProcessInput(node, i, i < values ? use_type : 0);
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698