Commit b454e999 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[turbofan][ppc] Fix CallDescriptor::NoFunctionDescriptor.

R=miladfar@ca.ibm.com

Change-Id: I42963b089243c45a3d065fb00e2864500bd33afb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1879934Reviewed-by: 's avatarMilad Farazmand <miladfar@ca.ibm.com>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64563}
parent 1a04ec33
...@@ -2830,8 +2830,9 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { ...@@ -2830,8 +2830,9 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
#if defined(_AIX) #if defined(_AIX)
// Highest misc_field bit is used on AIX to indicate if a CFunction call // Highest misc_field bit is used on AIX to indicate if a CFunction call
// has function descriptor or not. // has function descriptor or not.
misc_field |= call_descriptor->HasFunctionDescriptor() if (!call_descriptor->NoFunctionDescriptor()) {
<< kHasFunctionDescriptorBitShift; misc_field |= 1 << kHasFunctionDescriptorBitShift;
}
#endif #endif
opcode = kArchCallCFunction | MiscField::encode(misc_field); opcode = kArchCallCFunction | MiscField::encode(misc_field);
break; break;
......
...@@ -215,9 +215,9 @@ class V8_EXPORT_PRIVATE CallDescriptor final ...@@ -215,9 +215,9 @@ class V8_EXPORT_PRIVATE CallDescriptor final
// The kCallerSavedFPRegisters only matters (and set) when the more general // The kCallerSavedFPRegisters only matters (and set) when the more general
// flag for kCallerSavedRegisters above is also set. // flag for kCallerSavedRegisters above is also set.
kCallerSavedFPRegisters = 1u << 10, kCallerSavedFPRegisters = 1u << 10,
// AIX has a function descriptor which we will set to true by default // AIX has a function descriptor by default but it can be disabled for a
// for all CFunction calls (only used for Kind::kCallAddress). // certain CFunction call (only used for Kind::kCallAddress).
kHasFunctionDescriptor = 1u << 11, kNoFunctionDescriptor = 1u << 11,
}; };
using Flags = base::Flags<Flag>; using Flags = base::Flags<Flag>;
...@@ -302,9 +302,7 @@ class V8_EXPORT_PRIVATE CallDescriptor final ...@@ -302,9 +302,7 @@ class V8_EXPORT_PRIVATE CallDescriptor final
bool NeedsCallerSavedFPRegisters() const { bool NeedsCallerSavedFPRegisters() const {
return flags() & kCallerSavedFPRegisters; return flags() & kCallerSavedFPRegisters;
} }
bool HasFunctionDescriptor() const { bool NoFunctionDescriptor() const { return flags() & kNoFunctionDescriptor; }
return flags() & kHasFunctionDescriptor;
}
LinkageLocation GetReturnLocation(size_t index) const { LinkageLocation GetReturnLocation(size_t index) const {
return location_sig_->GetReturn(index); return location_sig_->GetReturn(index);
......
...@@ -702,13 +702,13 @@ void RawMachineAssembler::TailCallN(CallDescriptor* call_descriptor, ...@@ -702,13 +702,13 @@ void RawMachineAssembler::TailCallN(CallDescriptor* call_descriptor,
namespace { namespace {
enum FunctionDescriptorMode { kNoFunctionDescriptor, kHasFunctionDescriptor }; enum FunctionDescriptorMode { kHasFunctionDescriptor, kNoFunctionDescriptor };
Node* CallCFunctionImpl( Node* CallCFunctionImpl(
RawMachineAssembler* rasm, Node* function, MachineType return_type, RawMachineAssembler* rasm, Node* function, MachineType return_type,
std::initializer_list<RawMachineAssembler::CFunctionArg> args, std::initializer_list<RawMachineAssembler::CFunctionArg> args,
bool caller_saved_regs, SaveFPRegsMode mode, bool caller_saved_regs, SaveFPRegsMode mode,
FunctionDescriptorMode has_function_descriptor) { FunctionDescriptorMode no_function_descriptor) {
static constexpr std::size_t kNumCArgs = 10; static constexpr std::size_t kNumCArgs = 10;
MachineSignature::Builder builder(rasm->zone(), 1, args.size()); MachineSignature::Builder builder(rasm->zone(), 1, args.size());
...@@ -719,7 +719,7 @@ Node* CallCFunctionImpl( ...@@ -719,7 +719,7 @@ Node* CallCFunctionImpl(
CallDescriptor::Flags flags = CallDescriptor::kNoFlags; CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
if (caller_saved_regs) flags |= CallDescriptor::kCallerSavedRegisters; if (caller_saved_regs) flags |= CallDescriptor::kCallerSavedRegisters;
if (caller_saved_fp_regs) flags |= CallDescriptor::kCallerSavedFPRegisters; if (caller_saved_fp_regs) flags |= CallDescriptor::kCallerSavedFPRegisters;
if (has_function_descriptor) flags |= CallDescriptor::kHasFunctionDescriptor; if (no_function_descriptor) flags |= CallDescriptor::kNoFunctionDescriptor;
auto call_descriptor = auto call_descriptor =
Linkage::GetSimplifiedCDescriptor(rasm->zone(), builder.Build(), flags); Linkage::GetSimplifiedCDescriptor(rasm->zone(), builder.Build(), flags);
......
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