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

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

Issue 490673006: [turbofan] Add support for Finish to the InstructionSelector. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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/instruction-selector.h ('k') | test/compiler-unittests/instruction-selector-unittest.h » ('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 bec9f5dd39e2638705b9dc633c68aaf05b6c08ea..78bcc96cc67177e778eb19c7eae9b624e6a40887 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -199,12 +199,18 @@ void InstructionSelector::MarkAsDouble(Node* node) {
DCHECK(!IsReference(node));
sequence()->MarkAsDouble(node->id());
- // Propagate "doubleness" throughout phis.
+ // Propagate "doubleness" throughout Finish/Phi nodes.
for (UseIter i = node->uses().begin(); i != node->uses().end(); ++i) {
Node* user = *i;
- if (user->opcode() != IrOpcode::kPhi) continue;
- if (IsDouble(user)) continue;
- MarkAsDouble(user);
+ switch (user->opcode()) {
+ case IrOpcode::kFinish:
+ case IrOpcode::kPhi:
+ if (IsDouble(user)) continue;
+ MarkAsDouble(user);
+ break;
+ default:
+ break;
+ }
}
}
@@ -220,12 +226,18 @@ void InstructionSelector::MarkAsReference(Node* node) {
DCHECK(!IsDouble(node));
sequence()->MarkAsReference(node->id());
- // Propagate "referenceness" throughout phis.
+ // Propagate "referenceness" throughout Finish/Phi nodes.
for (UseIter i = node->uses().begin(); i != node->uses().end(); ++i) {
Node* user = *i;
- if (user->opcode() != IrOpcode::kPhi) continue;
- if (IsReference(user)) continue;
- MarkAsReference(user);
+ switch (user->opcode()) {
+ case IrOpcode::kFinish:
+ case IrOpcode::kPhi:
+ if (IsReference(user)) continue;
+ MarkAsReference(user);
+ break;
+ default:
+ break;
+ }
}
}
@@ -464,13 +476,12 @@ void InstructionSelector::VisitNode(Node* node) {
case IrOpcode::kContinuation:
// No code needed for these graph artifacts.
return;
+ case IrOpcode::kFinish:
+ return VisitFinish(node);
case IrOpcode::kParameter: {
- int index = OpParameter<int>(node);
- MachineType rep = linkage()
- ->GetIncomingDescriptor()
- ->GetInputLocation(index)
- .representation();
- MarkAsRepresentation(rep, node);
+ LinkageLocation location =
+ linkage()->GetParameterLocation(OpParameter<int>(node));
+ MarkAsRepresentation(location.representation(), node);
return VisitParameter(node);
}
case IrOpcode::kPhi:
@@ -797,6 +808,13 @@ void InstructionSelector::VisitWord64Compare(Node* node,
#endif // V8_TARGET_ARCH_32_BIT || !V8_TURBOFAN_BACKEND
+void InstructionSelector::VisitFinish(Node* node) {
+ OperandGenerator g(this);
+ Node* value = node->InputAt(0);
+ Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value));
+}
+
+
void InstructionSelector::VisitParameter(Node* node) {
OperandGenerator g(this);
Emit(kArchNop, g.DefineAsLocation(node, linkage()->GetParameterLocation(
« no previous file with comments | « src/compiler/instruction-selector.h ('k') | test/compiler-unittests/instruction-selector-unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698