Index: src/compiler/raw-machine-assembler.cc |
diff --git a/src/compiler/raw-machine-assembler.cc b/src/compiler/raw-machine-assembler.cc |
index b88fe8c4f07486b9ed93668d603a8b891990c3b9..43a3aac2b5e91c518dcc48c08864d31e53448350 100644 |
--- a/src/compiler/raw-machine-assembler.cc |
+++ b/src/compiler/raw-machine-assembler.cc |
@@ -152,30 +152,10 @@ Node* RawMachineAssembler::CallNWithFrameState(CallDescriptor* desc, |
} |
-Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, Node* function, |
- Node** args) { |
- int param_count = |
- static_cast<int>(desc->GetMachineSignature()->parameter_count()); |
- int input_count = param_count + 3; |
- Node** buffer = zone()->NewArray<Node*>(input_count); |
- int index = 0; |
- buffer[index++] = function; |
- for (int i = 0; i < param_count; i++) { |
- buffer[index++] = args[i]; |
- } |
- buffer[index++] = graph()->start(); |
- buffer[index++] = graph()->start(); |
- Node* tail_call = MakeNode(common()->TailCall(desc), input_count, buffer); |
- schedule()->AddTailCall(CurrentBlock(), tail_call); |
- current_block_ = nullptr; |
- return tail_call; |
-} |
- |
- |
Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, |
Node* arg1, Node* context) { |
CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( |
- zone(), function, 1, Operator::kNoProperties, false); |
+ zone(), function, 1, Operator::kNoProperties, CallDescriptor::kNoFlags); |
Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); |
Node* ref = AddNode( |
@@ -190,7 +170,7 @@ Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, |
Node* RawMachineAssembler::CallRuntime2(Runtime::FunctionId function, |
Node* arg1, Node* arg2, Node* context) { |
CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( |
- zone(), function, 2, Operator::kNoProperties, false); |
+ zone(), function, 2, Operator::kNoProperties, CallDescriptor::kNoFlags); |
Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); |
Node* ref = AddNode( |
@@ -206,7 +186,7 @@ Node* RawMachineAssembler::CallRuntime4(Runtime::FunctionId function, |
Node* arg1, Node* arg2, Node* arg3, |
Node* arg4, Node* context) { |
CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( |
- zone(), function, 4, Operator::kNoProperties, false); |
+ zone(), function, 4, Operator::kNoProperties, CallDescriptor::kNoFlags); |
Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); |
Node* ref = AddNode( |
@@ -218,6 +198,72 @@ Node* RawMachineAssembler::CallRuntime4(Runtime::FunctionId function, |
} |
+Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, Node* function, |
+ Node** args) { |
+ int param_count = |
+ static_cast<int>(desc->GetMachineSignature()->parameter_count()); |
+ int input_count = param_count + 3; |
+ Node** buffer = zone()->NewArray<Node*>(input_count); |
+ int index = 0; |
+ buffer[index++] = function; |
+ for (int i = 0; i < param_count; i++) { |
+ buffer[index++] = args[i]; |
+ } |
+ buffer[index++] = graph()->start(); |
+ buffer[index++] = graph()->start(); |
+ Node* tail_call = MakeNode(common()->TailCall(desc), input_count, buffer); |
+ 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; |
+ CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( |
+ zone(), function, kArity, Operator::kNoProperties, |
+ CallDescriptor::kSupportsTailCalls); |
+ |
+ Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); |
+ Node* ref = AddNode( |
+ common()->ExternalConstant(ExternalReference(function, isolate()))); |
+ Node* arity = Int32Constant(kArity); |
+ |
+ Node* nodes[] = {centry, arg1, ref, arity, context, graph()->start(), |
+ graph()->start()}; |
+ Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes); |
+ |
+ schedule()->AddTailCall(CurrentBlock(), tail_call); |
+ current_block_ = nullptr; |
+ return tail_call; |
+} |
+ |
+ |
+Node* RawMachineAssembler::TailCallRuntime2(Runtime::FunctionId function, |
+ Node* arg1, Node* arg2, |
+ Node* context) { |
+ const int kArity = 2; |
+ CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( |
+ zone(), function, kArity, Operator::kNoProperties, |
+ CallDescriptor::kSupportsTailCalls); |
+ |
+ Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); |
+ Node* ref = AddNode( |
+ common()->ExternalConstant(ExternalReference(function, isolate()))); |
+ Node* arity = Int32Constant(kArity); |
+ |
+ Node* nodes[] = { |
+ centry, arg1, arg2, ref, arity, context, graph()->start(), |
+ graph()->start()}; |
+ Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes); |
+ |
+ schedule()->AddTailCall(CurrentBlock(), tail_call); |
+ current_block_ = nullptr; |
+ return tail_call; |
+} |
+ |
+ |
Node* RawMachineAssembler::CallCFunction0(MachineType return_type, |
Node* function) { |
MachineSignature::Builder builder(zone(), 1, 0); |