summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/backend
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/backend')
-rw-r--r--deps/v8/src/compiler/backend/instruction-selector.cc13
-rw-r--r--deps/v8/src/compiler/backend/instruction.h3
-rw-r--r--deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc15
3 files changed, 23 insertions, 8 deletions
diff --git a/deps/v8/src/compiler/backend/instruction-selector.cc b/deps/v8/src/compiler/backend/instruction-selector.cc
index 22d81c0c55..e165c6c6a9 100644
--- a/deps/v8/src/compiler/backend/instruction-selector.cc
+++ b/deps/v8/src/compiler/backend/instruction-selector.cc
@@ -2810,10 +2810,17 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
// Select the appropriate opcode based on the call type.
InstructionCode opcode = kArchNop;
switch (call_descriptor->kind()) {
- case CallDescriptor::kCallAddress:
- opcode = kArchCallCFunction | MiscField::encode(static_cast<int>(
- call_descriptor->ParameterCount()));
+ case CallDescriptor::kCallAddress: {
+ int misc_field = static_cast<int>(call_descriptor->ParameterCount());
+#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;
+#endif
+ opcode = kArchCallCFunction | MiscField::encode(misc_field);
break;
+ }
case CallDescriptor::kCallCodeObject:
opcode = kArchCallCodeObject | MiscField::encode(flags);
break;
diff --git a/deps/v8/src/compiler/backend/instruction.h b/deps/v8/src/compiler/backend/instruction.h
index 321f069531..462b0daf6b 100644
--- a/deps/v8/src/compiler/backend/instruction.h
+++ b/deps/v8/src/compiler/backend/instruction.h
@@ -807,7 +807,8 @@ class V8_EXPORT_PRIVATE Instruction final {
size_t output_count, InstructionOperand* outputs,
size_t input_count, InstructionOperand* inputs,
size_t temp_count, InstructionOperand* temps) {
- DCHECK_LE(0, opcode);
+ // TODO(9872)
+ // DCHECK_LE(0, opcode);
DCHECK(output_count == 0 || outputs != nullptr);
DCHECK(input_count == 0 || inputs != nullptr);
DCHECK(temp_count == 0 || temps != nullptr);
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