Commit 7b3a27b7 authored by Richard Townsend's avatar Richard Townsend Committed by Commit Bot

fix: correct calling convention for Windows on Arm

Corrects a "Check failed: kFPParamRegisterCount == kParamRegisterCount"
message when compiling v8_snapshot for Windows on Arm.

Unlike x64, Windows on Arm's calling convention does not alternate
between integer and float registers.

Bug: chromium:1052746
Change-Id: I4c9cdafcd6e43742b94613f85b2983761cc0891a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440717
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70257}
parent 487d512e
...@@ -139,7 +139,7 @@ namespace { ...@@ -139,7 +139,7 @@ namespace {
#endif #endif
} // namespace } // namespace
#ifdef V8_TARGET_OS_WIN #if defined(V8_TARGET_OS_WIN) && defined(V8_TARGET_ARCH_X64)
// As defined in // As defined in
// https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019#parameter-passing, // https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019#parameter-passing,
// Windows calling convention doesn't differentiate between GP and FP params // Windows calling convention doesn't differentiate between GP and FP params
...@@ -176,11 +176,12 @@ void BuildParameterLocations(const MachineSignature* msig, ...@@ -176,11 +176,12 @@ void BuildParameterLocations(const MachineSignature* msig,
} }
} }
} }
#else // V8_TARGET_OS_WIN #else // defined(V8_TARGET_OS_WIN) && defined(V8_TARGET_ARCH_X64)
// As defined in https://www.agner.org/optimize/calling_conventions.pdf, // As defined in https://www.agner.org/optimize/calling_conventions.pdf,
// Section 7, Linux and Mac place parameters in consecutive registers, // Section 7, Linux and Mac place parameters in consecutive registers,
// differentiating between GP and FP params. That's why we maintain two // differentiating between GP and FP params. That's why we maintain two
// separate counters here. // separate counters here. This also applies to Arm systems following
// the AAPCS and Windows on Arm.
void BuildParameterLocations(const MachineSignature* msig, void BuildParameterLocations(const MachineSignature* msig,
size_t kFPParamRegisterCount, size_t kFPParamRegisterCount,
size_t kParamRegisterCount, size_t kParamRegisterCount,
...@@ -216,7 +217,7 @@ void BuildParameterLocations(const MachineSignature* msig, ...@@ -216,7 +217,7 @@ void BuildParameterLocations(const MachineSignature* msig,
} }
} }
} }
#endif // V8_TARGET_OS_WIN #endif // defined(V8_TARGET_OS_WIN) && defined(V8_TARGET_ARCH_X64)
// General code uses the above configuration data. // General code uses the above configuration data.
CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone,
......
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