[maglev] Use precalculated indices before TryInlineBuiltin

Bug: v8:7700
Change-Id: I4316ff51401c8dae5ef0345936e66211d1466f44
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3978010
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83910}
This commit is contained in:
Victor Gomes 2022-10-25 16:38:40 +02:00 committed by V8 LUCI CQ
parent 5537dc9c20
commit 51bcc50fca

View File

@ -2613,17 +2613,13 @@ void MaglevGraphBuilder::BuildCallFromRegisters(
compiler::SharedFunctionInfoRef shared = target.AsJSFunction().shared();
if (shared.HasBuiltinId()) {
base::Optional<int> receiver_index;
int first_arg_index;
if (receiver_mode != ConvertReceiverMode::kNullOrUndefined) {
receiver_index = 1;
first_arg_index = 2;
} else {
receiver_index = {};
first_arg_index = 1;
}
if (TryInlineBuiltin(receiver_index, first_arg_index, argc_count,
shared.builtin_id())) {
base::Optional<int> receiver_index =
(kReceiverOperandCount == 0 ? base::Optional<int>()
: kFirstArgumentOperandIndex);
int first_arg_not_receiver_index =
kReceiverOperandCount + kFirstArgumentOperandIndex;
if (TryInlineBuiltin(receiver_index, first_arg_not_receiver_index,
argc_count, shared.builtin_id())) {
return;
}
}