Reviewers: Jarin,

Description:
[turbofan] Propagate representation information from call descriptors in
SimplifiedLowering.

[email protected]
BUG=

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

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+21, -0 lines):
  M src/compiler/simplified-lowering.cc


Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc index 5ecd30c761a55318d68c83dfc3d84ac2908ba0d7..119c6f0a94bb61b98ae568e4ad6bb4e5c70b32e2 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -414,6 +414,25 @@ class RepresentationSelector {
     }
   }

+  void VisitCall(Node* node, SimplifiedLowering* lowering) {
+ const CallDescriptor* desc = OpParameter<const CallDescriptor*>(node->op());
+    const MachineSignature* sig = desc->GetMachineSignature();
+    int params = static_cast<int>(sig->parameter_count());
+    // Propagate representation information from call descriptor.
+    for (int i = 0; i < node->InputCount(); i++) {
+      if (i == 0) {
+        // The target of the call.
+        ProcessInput(node, i, 0);
+      } else if ((i - 1) < params) {
+        ProcessInput(node, i, sig->GetParam(i - 1));
+      } else {
+        ProcessInput(node, i, 0);
+      }
+    }
+
+    SetOutput(node, desc->GetMachineSignature()->GetReturn());
+  }
+
   void VisitStateValues(Node* node) {
     if (phase_ == PROPAGATE) {
       for (int i = 0; i < node->InputCount(); i++) {
@@ -533,6 +552,8 @@ class RepresentationSelector {
         return VisitSelect(node, use, lowering);
       case IrOpcode::kPhi:
         return VisitPhi(node, use, lowering);
+      case IrOpcode::kCall:
+        return VisitCall(node, lowering);

 //------------------------------------------------------------------
 // JavaScript operators.


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