Commit 8a492221 authored by Mike Stanton's avatar Mike Stanton Committed by Commit Bot

[TurboFan] Fix error in FastApiCall simplified lowering

CL Reland "[turbofan] Fast API calls from TurboFan
https://chromium-review.googlesource.com/c/v8/v8/+/2066971
had an off-by-one error in simplified lowering for fast
api calls.

Bug: chromium:1052746

Change-Id: I31bed7d1bb9564c6991521e84fd1a8edad6d0e32
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2071259
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66425}
parent 347700c7
......@@ -1759,13 +1759,13 @@ class RepresentationSelector {
CHECK_EQ(c_arg_count + 1, value_input_count);
base::SmallVector<UseInfo, kInitialArgumentsCount> arg_use_info(
value_input_count);
arg_use_info[0] = UseInfo::Word();
c_arg_count);
ProcessInput(node, 0, UseInfo::Word());
// Propagate representation information from TypeInfo.
for (int i = 0; i < value_input_count; i++) {
for (int i = 0; i < c_arg_count; i++) {
arg_use_info[i] = UseInfoForFastApiCallArgument(
c_signature->ArgumentInfo()[i - 1].GetType(), params.feedback());
ProcessInput(node, i, arg_use_info[i]);
c_signature->ArgumentInfo()[i].GetType(), params.feedback());
ProcessInput(node, i + 1, arg_use_info[i]);
}
MachineType return_type =
......@@ -1780,7 +1780,7 @@ class RepresentationSelector {
MachineTypeFor(c_signature->ArgumentInfo()[i].GetType());
// Here the arg_use_info are indexed starting from 1 because of the
// function input, while this loop is only over the actual arguments.
DCHECK_EQ(arg_use_info[i + 1].representation(),
DCHECK_EQ(arg_use_info[i].representation(),
machine_type.representation());
builder.AddParam(machine_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