summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc')
-rw-r--r--deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc b/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc
index dde1804adb..964f888816 100644
--- a/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc
+++ b/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc
@@ -1019,13 +1019,20 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
#endif
break;
case kArchCallCFunction: {
- int const num_parameters = MiscField::decode(instr->opcode());
+ int misc_field = MiscField::decode(instr->opcode());
+ int num_parameters = misc_field;
+ bool has_function_descriptor = false;
Label start_call;
bool isWasmCapiFunction =
linkage()->GetIncomingDescriptor()->IsWasmCapiFunction();
#if defined(_AIX)
// AIX/PPC64BE Linux uses a function descriptor
- // and emits 2 extra Load instrcutions under CallCFunctionHelper.
+ int kNumParametersMask = kHasFunctionDescriptorBitMask - 1;
+ num_parameters = kNumParametersMask & misc_field;
+ has_function_descriptor =
+ (misc_field & kHasFunctionDescriptorBitMask) != 0;
+ // AIX emits 2 extra Load instructions under CallCFunctionHelper
+ // due to having function descriptor.
constexpr int offset = 11 * kInstrSize;
#else
constexpr int offset = 9 * kInstrSize;
@@ -1041,10 +1048,10 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
if (instr->InputAt(0)->IsImmediate()) {
ExternalReference ref = i.InputExternalReference(0);
- __ CallCFunction(ref, num_parameters);
+ __ CallCFunction(ref, num_parameters, has_function_descriptor);
} else {
Register func = i.InputRegister(0);
- __ CallCFunction(func, num_parameters);
+ __ CallCFunction(func, num_parameters, has_function_descriptor);
}
// TODO(miladfar): In the above block, kScratchReg must be populated with
// the strictly-correct PC, which is the return address at this spot. The