Commit c940bd89 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

PPC: Fix offset calculation on AIX when not using a

function descriptor

Change-Id: I439bac759cb363f35f6aa23a699b6ef1d9079684
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1925027Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#65052}
parent e9277642
......@@ -1940,6 +1940,7 @@ void TurboAssembler::CallCFunctionHelper(Register function,
LoadP(ip, MemOperand(function, 0));
dest = ip;
} else if (ABI_CALL_VIA_IP) {
// pLinux and Simualtor, not AIX
Move(ip, function);
dest = ip;
}
......
......@@ -1031,17 +1031,18 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
Label start_call;
bool isWasmCapiFunction =
linkage()->GetIncomingDescriptor()->IsWasmCapiFunction();
int offset = 9 * kInstrSize;
#if defined(_AIX)
// AIX/PPC64BE Linux uses a function descriptor
int kNumParametersMask = kHasFunctionDescriptorBitMask - 1;
num_parameters = kNumParametersMask & misc_field;
has_function_descriptor =
(misc_field & kHasFunctionDescriptorBitMask) != 0;
// AIX emits 2 extra Load instructions under CallCFunctionHelper
// AIX may emit 2 extra Load instructions under CallCFunctionHelper
// due to having function descriptor.
constexpr int offset = 11 * kInstrSize;
#else
constexpr int offset = 9 * kInstrSize;
if (has_function_descriptor) {
offset = 11 * kInstrSize;
}
#endif
if (isWasmCapiFunction) {
__ mflr(r0);
......
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