Commit 1362f935 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Fix RawMachineAssembler for multiple return values.

This fixes runtime calls emitted by the RawMachineAssembler to use the
correct CEntryStub depending on the return count of runtime functions.
Note that this only affects WIN64 and PPC, where the ABI is different.

R=mythria@chromium.org

Review URL: https://codereview.chromium.org/1528643004

Cr-Commit-Position: refs/heads/master@{#32864}
parent a227a6b6
...@@ -154,8 +154,9 @@ Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, ...@@ -154,8 +154,9 @@ Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function,
Node* arg1, Node* context) { Node* arg1, Node* context) {
CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor(
zone(), function, 1, Operator::kNoProperties, CallDescriptor::kNoFlags); zone(), function, 1, Operator::kNoProperties, CallDescriptor::kNoFlags);
int return_count = static_cast<int>(descriptor->ReturnCount());
Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode());
Node* ref = AddNode( Node* ref = AddNode(
common()->ExternalConstant(ExternalReference(function, isolate()))); common()->ExternalConstant(ExternalReference(function, isolate())));
Node* arity = Int32Constant(1); Node* arity = Int32Constant(1);
...@@ -168,8 +169,9 @@ Node* RawMachineAssembler::CallRuntime2(Runtime::FunctionId function, ...@@ -168,8 +169,9 @@ Node* RawMachineAssembler::CallRuntime2(Runtime::FunctionId function,
Node* arg1, Node* arg2, Node* context) { Node* arg1, Node* arg2, Node* context) {
CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor(
zone(), function, 2, Operator::kNoProperties, CallDescriptor::kNoFlags); zone(), function, 2, Operator::kNoProperties, CallDescriptor::kNoFlags);
int return_count = static_cast<int>(descriptor->ReturnCount());
Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode());
Node* ref = AddNode( Node* ref = AddNode(
common()->ExternalConstant(ExternalReference(function, isolate()))); common()->ExternalConstant(ExternalReference(function, isolate())));
Node* arity = Int32Constant(2); Node* arity = Int32Constant(2);
...@@ -184,8 +186,9 @@ Node* RawMachineAssembler::CallRuntime4(Runtime::FunctionId function, ...@@ -184,8 +186,9 @@ Node* RawMachineAssembler::CallRuntime4(Runtime::FunctionId function,
Node* arg4, Node* context) { Node* arg4, Node* context) {
CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor(
zone(), function, 4, Operator::kNoProperties, CallDescriptor::kNoFlags); zone(), function, 4, Operator::kNoProperties, CallDescriptor::kNoFlags);
int return_count = static_cast<int>(descriptor->ReturnCount());
Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode());
Node* ref = AddNode( Node* ref = AddNode(
common()->ExternalConstant(ExternalReference(function, isolate()))); common()->ExternalConstant(ExternalReference(function, isolate())));
Node* arity = Int32Constant(4); Node* arity = Int32Constant(4);
...@@ -220,8 +223,9 @@ Node* RawMachineAssembler::TailCallRuntime1(Runtime::FunctionId function, ...@@ -220,8 +223,9 @@ Node* RawMachineAssembler::TailCallRuntime1(Runtime::FunctionId function,
CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor(
zone(), function, kArity, Operator::kNoProperties, zone(), function, kArity, Operator::kNoProperties,
CallDescriptor::kSupportsTailCalls); CallDescriptor::kSupportsTailCalls);
int return_count = static_cast<int>(desc->ReturnCount());
Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode());
Node* ref = AddNode( Node* ref = AddNode(
common()->ExternalConstant(ExternalReference(function, isolate()))); common()->ExternalConstant(ExternalReference(function, isolate())));
Node* arity = Int32Constant(kArity); Node* arity = Int32Constant(kArity);
...@@ -243,8 +247,9 @@ Node* RawMachineAssembler::TailCallRuntime2(Runtime::FunctionId function, ...@@ -243,8 +247,9 @@ Node* RawMachineAssembler::TailCallRuntime2(Runtime::FunctionId function,
CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor(
zone(), function, kArity, Operator::kNoProperties, zone(), function, kArity, Operator::kNoProperties,
CallDescriptor::kSupportsTailCalls); CallDescriptor::kSupportsTailCalls);
int return_count = static_cast<int>(desc->ReturnCount());
Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode());
Node* ref = AddNode( Node* ref = AddNode(
common()->ExternalConstant(ExternalReference(function, isolate()))); common()->ExternalConstant(ExternalReference(function, isolate())));
Node* arity = Int32Constant(kArity); Node* arity = Int32Constant(kArity);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment