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) { ...@@ -588,9 +588,9 @@ void ImplementationVisitor::Visit(Builtin* builtin) {
"UncheckedCast<RawPtrT>(LoadFramePointer());\n"; "UncheckedCast<RawPtrT>(LoadFramePointer());\n";
csa_ccfile() << " TorqueStructArguments " csa_ccfile() << " TorqueStructArguments "
"torque_arguments(GetFrameArguments(arguments_frame, " "torque_arguments(GetFrameArguments(arguments_frame, "
"arguments_length, FrameArgumentsArgcType::" "arguments_length, (kJSArgcIncludesReceiver ? "
<< (kJSArgcIncludesReceiver ? "kCountIncludesReceiver" "FrameArgumentsArgcType::kCountIncludesReceiver : "
: "kCountExcludesReceiver") "FrameArgumentsArgcType::kCountExcludesReceiver)"
<< "));\n"; << "));\n";
csa_ccfile() csa_ccfile()
<< " CodeStubArguments arguments(this, torque_arguments);\n"; << " CodeStubArguments arguments(this, torque_arguments);\n";
...@@ -3525,7 +3525,8 @@ void ImplementationVisitor::GenerateBuiltinDefinitionsAndInterfaceDescriptors( ...@@ -3525,7 +3525,8 @@ void ImplementationVisitor::GenerateBuiltinDefinitionsAndInterfaceDescriptors(
// count. // count.
int parameter_count = int parameter_count =
static_cast<int>(builtin->signature().ExplicitCount()); static_cast<int>(builtin->signature().ExplicitCount());
builtin_definitions << ", " << JSParameterCount(parameter_count); builtin_definitions << ", JSParameterCount(" << parameter_count
<< ")";
// And the receiver is explicitly declared. // And the receiver is explicitly declared.
builtin_definitions << ", kReceiver"; builtin_definitions << ", kReceiver";
for (size_t i = builtin->signature().implicit_count; 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