Commit aa259e30 authored by Patrick Thier's avatar Patrick Thier Committed by V8 LUCI CQ

Omit check against kDontAdaptArgumentsSentinel

When kDontAdaptArgumentsSentinel is 0 (the receiver is included in the
argument count), we don't need a dedicated check against the sentinel
before comparing the formal parameter count to the actual argument count
when calling a JS function.

Bug: v8:11112
Change-Id: I8c9f64a538984cb3de9e35f16bc6adbd3c92d24f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3173671Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Auto-Submit: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76993}
parent 48a8489d
......@@ -1642,8 +1642,10 @@ void MacroAssembler::InvokePrologue(Register expected_parameter_count,
// If the expected parameter count is equal to the adaptor sentinel, no need
// to push undefined value as arguments.
cmp(expected_parameter_count, Operand(kDontAdaptArgumentsSentinel));
b(eq, &regular_invoke);
if (kDontAdaptArgumentsSentinel != 0) {
cmp(expected_parameter_count, Operand(kDontAdaptArgumentsSentinel));
b(eq, &regular_invoke);
}
// If overapplication or if the actual argument count is equal to the
// formal parameter count, no need to push extra undefined values.
......
......@@ -2266,8 +2266,10 @@ void MacroAssembler::InvokePrologue(Register formal_parameter_count,
// If the formal parameter count is equal to the adaptor sentinel, no need
// to push undefined value as arguments.
Cmp(formal_parameter_count, Operand(kDontAdaptArgumentsSentinel));
B(eq, &regular_invoke);
if (kDontAdaptArgumentsSentinel != 0) {
Cmp(formal_parameter_count, Operand(kDontAdaptArgumentsSentinel));
B(eq, &regular_invoke);
}
// If overapplication or if the actual argument count is equal to the
// formal parameter count, no need to push extra undefined values.
......
......@@ -1247,8 +1247,10 @@ void MacroAssembler::InvokePrologue(Register expected_parameter_count,
// If the expected parameter count is equal to the adaptor sentinel, no need
// to push undefined value as arguments.
cmp(expected_parameter_count, Immediate(kDontAdaptArgumentsSentinel));
j(equal, &regular_invoke, Label::kFar);
if (kDontAdaptArgumentsSentinel != 0) {
cmp(expected_parameter_count, Immediate(kDontAdaptArgumentsSentinel));
j(equal, &regular_invoke, Label::kFar);
}
// If overapplication or if the actual argument count is equal to the
// formal parameter count, no need to push extra undefined values.
......
......@@ -2618,8 +2618,10 @@ void MacroAssembler::InvokePrologue(Register expected_parameter_count,
Label regular_invoke;
// If the expected parameter count is equal to the adaptor sentinel, no need
// to push undefined value as arguments.
cmpl(expected_parameter_count, Immediate(kDontAdaptArgumentsSentinel));
j(equal, &regular_invoke, Label::kFar);
if (kDontAdaptArgumentsSentinel != 0) {
cmpl(expected_parameter_count, Immediate(kDontAdaptArgumentsSentinel));
j(equal, &regular_invoke, Label::kFar);
}
// If overapplication or if the actual argument count is equal to the
// formal parameter count, no need to push extra undefined values.
......
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