Skip to content

Commit

Permalink
[TurboFan] Fix error in FastApiCall simplified lowering
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Nico Hartmann <[email protected]>
Reviewed-by: Georg Neis <[email protected]>
Cr-Commit-Position: refs/heads/master@{#66425}
  • Loading branch information
ripsawridge authored and Commit Bot committed Feb 25, 2020
1 parent 347700c commit 8a49222
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/compiler/simplified-lowering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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);
}
Expand Down

0 comments on commit 8a49222

Please sign in to comment.