Reviewers: Michael Starzinger,

Description:
[turbofan] Finish nodes are always marked as references.

TEST=compiler-unittests,cctest
[email protected]

Please review this at https://codereview.chromium.org/533083002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+6, -42 lines):
  M src/compiler/instruction-selector.cc
  M src/compiler/instruction-selector-unittest.cc


Index: src/compiler/instruction-selector-unittest.cc
diff --git a/src/compiler/instruction-selector-unittest.cc b/src/compiler/instruction-selector-unittest.cc index ad47ba6c220d6f9b798188fd626d6eb12140fddb..36951a426ec9a49cb7b5ee18985fcd6e1eca6d17 100644
--- a/src/compiler/instruction-selector-unittest.cc
+++ b/src/compiler/instruction-selector-unittest.cc
@@ -178,13 +178,8 @@ TARGET_TEST_F(InstructionSelectorTest, ReferenceParameter) {
 // Finish.


-typedef InstructionSelectorTestWithParam<MachineType>
-    InstructionSelectorFinishTest;
-
-
-TARGET_TEST_P(InstructionSelectorFinishTest, Parameter) {
-  const MachineType type = GetParam();
-  StreamBuilder m(this, type, type);
+TARGET_TEST_F(InstructionSelectorTest, Parameter) {
+  StreamBuilder m(this, kMachAnyTagged, kMachAnyTagged);
   Node* param = m.Parameter(0);
Node* finish = m.NewNode(m.common()->Finish(1), param, m.graph()->start());
   m.Return(finish);
@@ -205,37 +200,8 @@ TARGET_TEST_P(InstructionSelectorFinishTest, Parameter) {
 }


-TARGET_TEST_P(InstructionSelectorFinishTest, PropagateDoubleness) {
-  const MachineType type = GetParam();
-  StreamBuilder m(this, type, type);
-  Node* param = m.Parameter(0);
- Node* finish = m.NewNode(m.common()->Finish(1), param, m.graph()->start());
-  m.Return(finish);
-  Stream s = m.Build(kAllInstructions);
-  EXPECT_EQ(s.IsDouble(param->id()), s.IsDouble(finish->id()));
-}
-
-
-TARGET_TEST_P(InstructionSelectorFinishTest, PropagateReferenceness) {
-  const MachineType type = GetParam();
-  StreamBuilder m(this, type, type);
-  Node* param = m.Parameter(0);
- Node* finish = m.NewNode(m.common()->Finish(1), param, m.graph()->start());
-  m.Return(finish);
-  Stream s = m.Build(kAllInstructions);
-  EXPECT_EQ(s.IsReference(param->id()), s.IsReference(finish->id()));
-}
-
-
-INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, InstructionSelectorFinishTest, - ::testing::Values(kMachFloat64, kMachInt8, kMachUint8, - kMachInt16, kMachUint16, kMachInt32, - kMachUint32, kMachInt64, kMachUint64,
-                                          kMachPtr, kMachAnyTagged));
-
-
// -----------------------------------------------------------------------------
-// Finish.
+// Phi.


 typedef InstructionSelectorTestWithParam<MachineType>
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc index 0e3f341f4f2a1c16d88e4deece82138e7dc4bc27..a530824f956199345d08a846f109c4fad79f70e1 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -199,11 +199,10 @@ void InstructionSelector::MarkAsDouble(Node* node) {
   DCHECK(!IsReference(node));
   sequence()->MarkAsDouble(node->id());

-  // Propagate "doubleness" throughout Finish/Phi nodes.
+  // Propagate "doubleness" throughout Phi nodes.
   for (UseIter i = node->uses().begin(); i != node->uses().end(); ++i) {
     Node* user = *i;
     switch (user->opcode()) {
-      case IrOpcode::kFinish:
       case IrOpcode::kPhi:
         if (IsDouble(user)) continue;
         MarkAsDouble(user);
@@ -226,11 +225,10 @@ void InstructionSelector::MarkAsReference(Node* node) {
   DCHECK(!IsDouble(node));
   sequence()->MarkAsReference(node->id());

-  // Propagate "referenceness" throughout Finish/Phi nodes.
+  // Propagate "referenceness" throughout Phi nodes.
   for (UseIter i = node->uses().begin(); i != node->uses().end(); ++i) {
     Node* user = *i;
     switch (user->opcode()) {
-      case IrOpcode::kFinish:
       case IrOpcode::kPhi:
         if (IsReference(user)) continue;
         MarkAsReference(user);
@@ -482,7 +480,7 @@ void InstructionSelector::VisitNode(Node* node) {
       // No code needed for these graph artifacts.
       return;
     case IrOpcode::kFinish:
-      return VisitFinish(node);
+      return MarkAsReference(node), VisitFinish(node);
     case IrOpcode::kParameter: {
       LinkageLocation location =
           linkage()->GetParameterLocation(OpParameter<int>(node));


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to