[PATCH] Fix crashes on Linux/PPC64 ELFv1
authorMarcus Comstedt <marcus@mc.pp.se>
Sat, 13 Jun 2020 18:49:35 +0000 (20:49 +0200)
committerJérémy Lal <kapouer@melix.org>
Sat, 8 Aug 2020 12:09:43 +0000 (13:09 +0100)
Origin: https://github.com/nodejs/node/pull/33866

Gbp-Pq: Name ppc64.patch

deps/v8/src/compiler/backend/instruction-selector.cc
deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc
deps/v8/src/execution/simulator.h

index d565a4696395dbe44f7ca3bbd16c2d62ad3ec743..7b643494ce4730d1bf4fb41e0fa0f501508c843b 100644 (file)
@@ -2788,7 +2788,7 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
   switch (call_descriptor->kind()) {
     case CallDescriptor::kCallAddress: {
       int misc_field = static_cast<int>(call_descriptor->ParameterCount());
-#if defined(_AIX)
+#if ABI_USES_FUNCTION_DESCRIPTORS
       // Highest misc_field bit is used on AIX to indicate if a CFunction call
       // has function descriptor or not.
       misc_field |= call_descriptor->HasFunctionDescriptor()
index 7147448e210bfbe263d7310fe024b71ca4fe33f0..e0f06e608a130c2e4d986ee573af62178853e563 100644 (file)
@@ -1026,7 +1026,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
       Label start_call;
       bool isWasmCapiFunction =
           linkage()->GetIncomingDescriptor()->IsWasmCapiFunction();
-#if defined(_AIX)
+#if ABI_USES_FUNCTION_DESCRIPTORS
       // AIX/PPC64BE Linux uses a function descriptor
       int kNumParametersMask = kHasFunctionDescriptorBitMask - 1;
       num_parameters = kNumParametersMask & misc_field;
index 58b173694fc441f65a8ef5c9f2c8b4c72d1d3ff9..761603bd60cb8192b5e9d314a3840af381a718a0 100644 (file)
@@ -122,7 +122,7 @@ class GeneratedCode {
 
   DISABLE_CFI_ICALL Return Call(Args... args) {
     // When running without a simulator we call the entry directly.
-#if V8_OS_AIX
+#if ABI_USES_FUNCTION_DESCRIPTORS
     // AIX ABI requires function descriptors (FD).  Artificially create a pseudo
     // FD to ensure correct dispatch to generated code.  The 'volatile'
     // declaration is required to avoid the compiler from not observing the
@@ -134,7 +134,7 @@ class GeneratedCode {
     return fn(args...);
 #else
     return fn_ptr_(args...);
-#endif  // V8_OS_AIX
+#endif  // ABI_USES_FUNCTION_DESCRIPTORS
   }
 #endif  // USE_SIMULATOR