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

Unified Diff: src/compiler/instruction-selector.cc

Issue 851263002: [turbofan] Initial attempt to cleanup Node and related classes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/js-inlining.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index 4b07194c87be3b195062f35afb2a9b4b9b95ec8d..22a74d292aea8e57a3891d6d9a1c93783362b791 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -337,8 +337,14 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
if (buffer->descriptor->ReturnCount() == 1) {
buffer->output_nodes.push_back(call);
} else {
- buffer->output_nodes.resize(buffer->descriptor->ReturnCount(), NULL);
- call->CollectProjections(&buffer->output_nodes);
+ buffer->output_nodes.resize(buffer->descriptor->ReturnCount(), nullptr);
+ for (auto use : call->uses()) {
+ if (use->opcode() != IrOpcode::kProjection) continue;
+ size_t const index = ProjectionIndexOf(use->op());
+ DCHECK_LT(index, buffer->output_nodes.size());
+ DCHECK_EQ(nullptr, buffer->output_nodes[index]);
+ buffer->output_nodes[index] = use;
+ }
}
// Filter out the outputs that aren't live because no projection uses them.
@@ -997,10 +1003,10 @@ void InstructionSelector::VisitProjection(Node* node) {
switch (value->opcode()) {
case IrOpcode::kInt32AddWithOverflow:
case IrOpcode::kInt32SubWithOverflow:
- if (OpParameter<size_t>(node) == 0) {
+ if (ProjectionIndexOf(node->op()) == 0u) {
Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value));
} else {
- DCHECK(OpParameter<size_t>(node) == 1u);
+ DCHECK(ProjectionIndexOf(node->op()) == 1u);
MarkAsUsed(value);
}
break;
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/js-inlining.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698