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/+/1925027
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#65052}
This commit is contained in:
Milad Farazmand 2019-11-19 18:26:08 +00:00 committed by Commit Bot
parent e927764216
commit c940bd89af
2 changed files with 6 additions and 4 deletions

View File

@ -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;
}

View File

@ -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);