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

[torque] Fix argument count consistency for cross-compilation

Don't evaluate the (currently) arch dependent constants
kJSArgcIncludesReceiver and kJSArgcReceiverSlots at Torque build time.

Bug: v8:11112
Change-Id: If955f7f2c02bfd88c791797a8ef3f94184d4a1fd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160519Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76836}
parent 9d0b3cd8
......@@ -588,9 +588,9 @@ void ImplementationVisitor::Visit(Builtin* builtin) {
"UncheckedCast<RawPtrT>(LoadFramePointer());\n";
csa_ccfile() << " TorqueStructArguments "
"torque_arguments(GetFrameArguments(arguments_frame, "
"arguments_length, FrameArgumentsArgcType::"
<< (kJSArgcIncludesReceiver ? "kCountIncludesReceiver"
: "kCountExcludesReceiver")
"arguments_length, (kJSArgcIncludesReceiver ? "
"FrameArgumentsArgcType::kCountIncludesReceiver : "
"FrameArgumentsArgcType::kCountExcludesReceiver)"
<< "));\n";
csa_ccfile()
<< " CodeStubArguments arguments(this, torque_arguments);\n";
......@@ -3525,7 +3525,8 @@ void ImplementationVisitor::GenerateBuiltinDefinitionsAndInterfaceDescriptors(
// count.
int parameter_count =
static_cast<int>(builtin->signature().ExplicitCount());
builtin_definitions << ", " << JSParameterCount(parameter_count);
builtin_definitions << ", JSParameterCount(" << parameter_count
<< ")";
// And the receiver is explicitly declared.
builtin_definitions << ", kReceiver";
for (size_t i = builtin->signature().implicit_count;
......
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