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) {
#if defined(_AIX)
// Highest misc_field bit is used on AIX to indicate if a CFunction call
// has function descriptor or not.
misc_field |= call_descriptor->HasFunctionDescriptor()
<< kHasFunctionDescriptorBitShift;
if (!call_descriptor->NoFunctionDescriptor()) {
misc_field |= 1 << kHasFunctionDescriptorBitShift;
}
#endif
opcode = kArchCallCFunction | MiscField::encode(misc_field);
break;
......
......@@ -215,9 +215,9 @@ class V8_EXPORT_PRIVATE CallDescriptor final
// The kCallerSavedFPRegisters only matters (and set) when the more general
// flag for kCallerSavedRegisters above is also set.
kCallerSavedFPRegisters = 1u << 10,
// AIX has a function descriptor which we will set to true by default
// for all CFunction calls (only used for Kind::kCallAddress).
kHasFunctionDescriptor = 1u << 11,
// AIX has a function descriptor by default but it can be disabled for a
// certain CFunction call (only used for Kind::kCallAddress).
kNoFunctionDescriptor = 1u << 11,
};
using Flags = base::Flags<Flag>;
......@@ -302,9 +302,7 @@ class V8_EXPORT_PRIVATE CallDescriptor final
bool NeedsCallerSavedFPRegisters() const {
return flags() & kCallerSavedFPRegisters;
}
bool HasFunctionDescriptor() const {
return flags() & kHasFunctionDescriptor;
}
bool NoFunctionDescriptor() const { return flags() & kNoFunctionDescriptor; }
LinkageLocation GetReturnLocation(size_t index) const {
return location_sig_->GetReturn(index);
......
......@@ -702,13 +702,13 @@ void RawMachineAssembler::TailCallN(CallDescriptor* call_descriptor,
namespace {
enum FunctionDescriptorMode { kNoFunctionDescriptor, kHasFunctionDescriptor };
enum FunctionDescriptorMode { kHasFunctionDescriptor, kNoFunctionDescriptor };
Node* CallCFunctionImpl(
RawMachineAssembler* rasm, Node* function, MachineType return_type,
std::initializer_list<RawMachineAssembler::CFunctionArg> args,
bool caller_saved_regs, SaveFPRegsMode mode,
FunctionDescriptorMode has_function_descriptor) {
FunctionDescriptorMode no_function_descriptor) {
static constexpr std::size_t kNumCArgs = 10;
MachineSignature::Builder builder(rasm->zone(), 1, args.size());
......@@ -719,7 +719,7 @@ Node* CallCFunctionImpl(
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
if (caller_saved_regs) flags |= CallDescriptor::kCallerSavedRegisters;
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 =
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