Commit 466306e9 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

ppc64: fix c linkage issue on c to wasm entry

Drive-by: also cleanup ppc 32-bit support

R=joransiu@ca.ibm.com

Change-Id: I0596405ae59a0f18db7eb0f480944b8530a31113
Reviewed-on: https://chromium-review.googlesource.com/c/1262936Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#56419}
parent 88c5da04
...@@ -99,10 +99,15 @@ namespace { ...@@ -99,10 +99,15 @@ namespace {
#define CALLEE_SAVE_FP_REGISTERS \ #define CALLEE_SAVE_FP_REGISTERS \
f20.bit() | f22.bit() | f24.bit() | f26.bit() | f28.bit() | f30.bit() f20.bit() | f22.bit() | f24.bit() | f26.bit() | f28.bit() | f30.bit()
#elif V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64 #elif V8_TARGET_ARCH_PPC64
// =========================================================================== // ===========================================================================
// == ppc & ppc64 ============================================================ // == ppc & ppc64 ============================================================
// =========================================================================== // ===========================================================================
#ifdef V8_TARGET_LITTLE_ENDIAN // ppc64le linux
#define STACK_SHADOW_WORDS 12
#else // AIX
#define STACK_SHADOW_WORDS 14
#endif
#define PARAM_REGISTERS r3, r4, r5, r6, r7, r8, r9, r10 #define PARAM_REGISTERS r3, r4, r5, r6, r7, r8, r9, r10
#define CALLEE_SAVE_REGISTERS \ #define CALLEE_SAVE_REGISTERS \
r14.bit() | r15.bit() | r16.bit() | r17.bit() | r18.bit() | r19.bit() | \ r14.bit() | r15.bit() | r16.bit() | r17.bit() | r18.bit() | r19.bit() | \
......
...@@ -1866,6 +1866,7 @@ void InstructionSelector::EmitPrepareArguments( ...@@ -1866,6 +1866,7 @@ void InstructionSelector::EmitPrepareArguments(
// Poke any stack arguments. // Poke any stack arguments.
int slot = kStackFrameExtraParamSlot; int slot = kStackFrameExtraParamSlot;
for (PushParameter input : (*arguments)) { for (PushParameter input : (*arguments)) {
if (input.node == nullptr) continue;
Emit(kPPC_StoreToStackSlot, g.NoOutput(), g.UseRegister(input.node), Emit(kPPC_StoreToStackSlot, g.NoOutput(), g.UseRegister(input.node),
g.TempImmediate(slot)); g.TempImmediate(slot));
++slot; ++slot;
......
...@@ -217,7 +217,7 @@ const int kNumSafepointRegisters = 32; ...@@ -217,7 +217,7 @@ const int kNumSafepointRegisters = 32;
// The following constants describe the stack frame linkage area as // The following constants describe the stack frame linkage area as
// defined by the ABI. Note that kNumRequiredStackFrameSlots must // defined by the ABI. Note that kNumRequiredStackFrameSlots must
// satisfy alignment requirements (rounding up if required). // satisfy alignment requirements (rounding up if required).
#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN #if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN // ppc64le linux
// [0] back chain // [0] back chain
// [1] condition register save area // [1] condition register save area
// [2] link register save area // [2] link register save area
...@@ -230,7 +230,7 @@ const int kNumSafepointRegisters = 32; ...@@ -230,7 +230,7 @@ const int kNumSafepointRegisters = 32;
const int kNumRequiredStackFrameSlots = 12; const int kNumRequiredStackFrameSlots = 12;
const int kStackFrameLRSlot = 2; const int kStackFrameLRSlot = 2;
const int kStackFrameExtraParamSlot = 12; const int kStackFrameExtraParamSlot = 12;
#elif V8_OS_AIX || V8_TARGET_ARCH_PPC64 #else // AIX
// [0] back chain // [0] back chain
// [1] condition register save area // [1] condition register save area
// [2] link register save area // [2] link register save area
...@@ -242,21 +242,9 @@ const int kStackFrameExtraParamSlot = 12; ...@@ -242,21 +242,9 @@ const int kStackFrameExtraParamSlot = 12;
// [13] Parameter8 save area // [13] Parameter8 save area
// [14] Parameter9 slot (if necessary) // [14] Parameter9 slot (if necessary)
// ... // ...
#if V8_TARGET_ARCH_PPC64
const int kNumRequiredStackFrameSlots = 14; const int kNumRequiredStackFrameSlots = 14;
#else
const int kNumRequiredStackFrameSlots = 16;
#endif
const int kStackFrameLRSlot = 2; const int kStackFrameLRSlot = 2;
const int kStackFrameExtraParamSlot = 14; const int kStackFrameExtraParamSlot = 14;
#else
// [0] back chain
// [1] link register save area
// [2] Parameter9 slot (if necessary)
// ...
const int kNumRequiredStackFrameSlots = 4;
const int kStackFrameLRSlot = 1;
const int kStackFrameExtraParamSlot = 2;
#endif #endif
// Define the list of registers actually saved at safepoints. // Define the list of registers actually saved at safepoints.
......
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