Index: src/compiler/raw-machine-assembler.cc |
diff --git a/src/compiler/raw-machine-assembler.cc b/src/compiler/raw-machine-assembler.cc |
index 0d4b8cb20079b0e28fd45fa435c6b48611e99709..aaba0456a91459d3b63a70d642aa7d2ef3d6a796 100644 |
--- a/src/compiler/raw-machine-assembler.cc |
+++ b/src/compiler/raw-machine-assembler.cc |
@@ -248,6 +248,29 @@ Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, Node* function, |
} |
+Node* RawMachineAssembler::TailCallRuntime0(Runtime::FunctionId function, |
+ Node* context) { |
+ const int kArity = 0; |
+ CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( |
+ zone(), function, kArity, Operator::kNoProperties, |
+ CallDescriptor::kSupportsTailCalls); |
+ int return_count = static_cast<int>(desc->ReturnCount()); |
+ |
+ Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode()); |
+ Node* ref = AddNode( |
+ common()->ExternalConstant(ExternalReference(function, isolate()))); |
+ Node* arity = Int32Constant(kArity); |
+ |
+ Node* nodes[] = {centry, ref, arity, context}; |
+ Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes); |
+ |
+ NodeProperties::MergeControlToEnd(graph(), common(), tail_call); |
+ schedule()->AddTailCall(CurrentBlock(), tail_call); |
+ current_block_ = nullptr; |
+ return tail_call; |
+} |
+ |
+ |
Node* RawMachineAssembler::TailCallRuntime1(Runtime::FunctionId function, |
Node* arg1, Node* context) { |
const int kArity = 1; |