Commit 8491ca60 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[fuzzer][arm64] Consider alignment in the multi-return fuzzer

On arm64, the stack pointer has to be aligned all the time. This
alignment was not considered in the creation of the CallDescriptor in
the fuzzer and thereby caused a mismatch between the CallDescriptor and
code generator. In other words, a callee put return values in a stack
slot which was different than the stack slot where the caller expected
the return value.

With this CL we consider this alignment in the fuzzer.

R=clemensh@chromium.org

Change-Id: I8c78c24c682b7b8678c0d4d112bae99cf405b184
Reviewed-on: https://chromium-review.googlesource.com/864682Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50574}
parent df008d4b
......@@ -181,6 +181,11 @@ CallDescriptor* CreateRandomCallDescriptor(Zone* zone, size_t return_count,
input->NextInt8(1);
int stack_params = stack_slots;
#if V8_TARGET_ARCH_ARM64
// Align the stack slots.
stack_slots = stack_slots + (stack_slots % 2);
#endif
int aligned_stack_params = stack_slots;
int int_returns = 0;
int float_returns = 0;
for (size_t i = 0; i < return_count; i++) {
......@@ -189,7 +194,7 @@ CallDescriptor* CreateRandomCallDescriptor(Zone* zone, size_t return_count,
AllocateLocation(type, &int_returns, &float_returns, &stack_slots);
locations.AddReturn(location);
}
int stack_returns = stack_slots - stack_params;
int stack_returns = stack_slots - aligned_stack_params;
MachineType target_type = MachineType::AnyTagged();
LinkageLocation target_loc = LinkageLocation::ForAnyRegister(target_type);
......
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