Index: src/compiler/js-intrinsic-lowering.cc |
diff --git a/src/compiler/js-intrinsic-lowering.cc b/src/compiler/js-intrinsic-lowering.cc |
index 0039d1d4c3ee9f89ca80dc6d6be8abdc1b8eb9de..01552559ea39b83a7c4f62f41ecb743eb2fccb90 100644 |
--- a/src/compiler/js-intrinsic-lowering.cc |
+++ b/src/compiler/js-intrinsic-lowering.cc |
@@ -94,6 +94,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) { |
return ReduceGetCallerJSFunction(node); |
case Runtime::kInlineThrowNotDateError: |
return ReduceThrowNotDateError(node); |
+ case Runtime::kInlineCallFunction: |
+ return ReduceCallFunction(node); |
default: |
break; |
} |
@@ -513,6 +515,21 @@ Reduction JSIntrinsicLowering::ReduceThrowNotDateError(Node* node) { |
} |
+Reduction JSIntrinsicLowering::ReduceCallFunction(Node* node) { |
+ CallRuntimeParameters params = OpParameter<CallRuntimeParameters>(node->op()); |
+ size_t arity = params.arity(); |
+ node->set_op(javascript()->CallFunction(arity, NO_CALL_FUNCTION_FLAGS, STRICT, |
+ VectorSlotPair(), ALLOW_TAIL_CALLS)); |
+ Node* function = node->InputAt(static_cast<int>(arity - 1)); |
+ while (--arity != 0) { |
+ node->ReplaceInput(static_cast<int>(arity), |
+ node->InputAt(static_cast<int>(arity - 1))); |
+ } |
+ node->ReplaceInput(0, function); |
+ return Changed(node); |
+} |
+ |
+ |
Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, |
Node* b) { |
node->set_op(op); |
@@ -549,6 +566,10 @@ CommonOperatorBuilder* JSIntrinsicLowering::common() const { |
return jsgraph()->common(); |
} |
+JSOperatorBuilder* JSIntrinsicLowering::javascript() const { |
+ return jsgraph_->javascript(); |
+} |
+ |
MachineOperatorBuilder* JSIntrinsicLowering::machine() const { |
return jsgraph()->machine(); |