Revision: 23641
Author:   [email protected]
Date:     Wed Sep  3 11:30:05 2014 UTC
Log:      Fix missing visitation of effect inputs to loads and stores.

[email protected]

Review URL: https://codereview.chromium.org/533773002
https://code.google.com/p/v8/source/detail?r=23641

Modified:
 /branches/bleeding_edge/src/compiler/simplified-lowering.cc

=======================================
--- /branches/bleeding_edge/src/compiler/simplified-lowering.cc Tue Sep 2 13:36:35 2014 UTC +++ /branches/bleeding_edge/src/compiler/simplified-lowering.cc Wed Sep 3 11:30:05 2014 UTC
@@ -187,6 +187,19 @@
       }
     }
   }
+
+  void ProcessRemainingInputs(Node* node, int index) {
+    DCHECK_GE(index, NodeProperties::PastValueIndex(node));
+    DCHECK_GE(index, NodeProperties::PastContextIndex(node));
+    for (int i = std::max(index, NodeProperties::FirstEffectIndex(node));
+         i < NodeProperties::PastEffectIndex(node); ++i) {
+      Enqueue(node->InputAt(i));  // Effect inputs: just visit
+    }
+    for (int i = std::max(index, NodeProperties::FirstControlIndex(node));
+         i < NodeProperties::PastControlIndex(node); ++i) {
+      Enqueue(node->InputAt(i));  // Control inputs: just visit
+    }
+  }

// The default, most general visitation case. For {node}, process all value, // context, effect, and control inputs, assuming that value inputs should have
@@ -529,6 +542,7 @@
       case IrOpcode::kLoadField: {
         FieldAccess access = FieldAccessOf(node->op());
         ProcessInput(node, 0, changer_->TypeForBasePointer(access));
+        ProcessRemainingInputs(node, 1);
         SetOutput(node, access.machine_type);
         if (lower()) lowering->DoLoadField(node);
         break;
@@ -537,6 +551,7 @@
         FieldAccess access = FieldAccessOf(node->op());
         ProcessInput(node, 0, changer_->TypeForBasePointer(access));
         ProcessInput(node, 1, access.machine_type);
+        ProcessRemainingInputs(node, 2);
         SetOutput(node, 0);
         if (lower()) lowering->DoStoreField(node);
         break;
@@ -545,6 +560,7 @@
         ElementAccess access = ElementAccessOf(node->op());
         ProcessInput(node, 0, changer_->TypeForBasePointer(access));
         ProcessInput(node, 1, kMachInt32);  // element index
+        ProcessRemainingInputs(node, 2);
         SetOutput(node, access.machine_type);
         if (lower()) lowering->DoLoadElement(node);
         break;
@@ -554,6 +570,7 @@
         ProcessInput(node, 0, changer_->TypeForBasePointer(access));
         ProcessInput(node, 1, kMachInt32);  // element index
         ProcessInput(node, 2, access.machine_type);
+        ProcessRemainingInputs(node, 3);
         SetOutput(node, 0);
         if (lower()) lowering->DoStoreElement(node);
         break;
@@ -568,6 +585,7 @@
         MachineType machine_type = OpParameter<MachineType>(node);
         ProcessInput(node, 0, tBase);   // pointer or object
         ProcessInput(node, 1, kMachInt32);  // index
+        ProcessRemainingInputs(node, 2);
         SetOutput(node, machine_type);
         break;
       }
@@ -578,6 +596,7 @@
         ProcessInput(node, 0, tBase);   // pointer or object
         ProcessInput(node, 1, kMachInt32);  // index
         ProcessInput(node, 2, rep.machine_type);
+        ProcessRemainingInputs(node, 3);
         SetOutput(node, 0);
         break;
       }

--
--
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