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

Update comments about argument count in interface descriptors

Comments in interface-descriptors stated that the argument count is
without the receiver, which is no longer true (see [1]).

[1] https://crrev.com/c/3140608

Bug: v8:11112
Change-Id: I75277bd4044a49a5a668f602501ad229bc44720b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3234491
Commit-Queue: Patrick Thier <pthier@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Patrick Thier <pthier@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77494}
parent 121601a4
......@@ -117,7 +117,7 @@ constexpr auto CallTrampolineDescriptor::registers() {
// static
constexpr auto CallVarargsDescriptor::registers() {
// r0 : number of arguments (on the stack, not including receiver)
// r0 : number of arguments (on the stack)
// r1 : the target to call
// r4 : arguments list length (untagged)
// r2 : arguments list (FixedArray)
......@@ -135,13 +135,13 @@ constexpr auto CallForwardVarargsDescriptor::registers() {
// static
constexpr auto CallFunctionTemplateDescriptor::registers() {
// r1 : function template info
// r2 : number of arguments (on the stack, not including receiver)
// r2 : number of arguments (on the stack)
return RegisterArray(r1, r2);
}
// static
constexpr auto CallWithSpreadDescriptor::registers() {
// r0 : number of arguments (on the stack, not including receiver)
// r0 : number of arguments (on the stack)
// r1 : the target to call
// r2 : the object to spread
return RegisterArray(r1, r0, r2);
......@@ -156,7 +156,7 @@ constexpr auto CallWithArrayLikeDescriptor::registers() {
// static
constexpr auto ConstructVarargsDescriptor::registers() {
// r0 : number of arguments (on the stack, not including receiver)
// r0 : number of arguments (on the stack)
// r1 : the target to call
// r3 : the new target
// r4 : arguments list length (untagged)
......@@ -175,7 +175,7 @@ constexpr auto ConstructForwardVarargsDescriptor::registers() {
// static
constexpr auto ConstructWithSpreadDescriptor::registers() {
// r0 : number of arguments (on the stack, not including receiver)
// r0 : number of arguments (on the stack)
// r1 : the target to call
// r3 : the new target
// r2 : the object to spread
......@@ -241,7 +241,7 @@ constexpr auto InterpreterDispatchDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
return RegisterArray(r0, // argument count (not including receiver)
return RegisterArray(r0, // argument count
r2, // address of first argument
r1); // the target callable to be call
}
......@@ -249,7 +249,7 @@ constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenConstructDescriptor::registers() {
return RegisterArray(
r0, // argument count (not including receiver)
r0, // argument count
r4, // address of the first argument
r1, // constructor to call
r3, // new target
......
......@@ -117,7 +117,7 @@ constexpr auto CallTrampolineDescriptor::registers() {
// static
constexpr auto CallVarargsDescriptor::registers() {
// x0 : number of arguments (on the stack, not including receiver)
// x0 : number of arguments (on the stack)
// x1 : the target to call
// x4 : arguments list length (untagged)
// x2 : arguments list (FixedArray)
......@@ -135,13 +135,13 @@ constexpr auto CallForwardVarargsDescriptor::registers() {
// static
constexpr auto CallFunctionTemplateDescriptor::registers() {
// x1 : function template info
// x2 : number of arguments (on the stack, not including receiver)
// x2 : number of arguments (on the stack)
return RegisterArray(x1, x2);
}
// static
constexpr auto CallWithSpreadDescriptor::registers() {
// x0 : number of arguments (on the stack, not including receiver)
// x0 : number of arguments (on the stack)
// x1 : the target to call
// x2 : the object to spread
return RegisterArray(x1, x0, x2);
......@@ -156,7 +156,7 @@ constexpr auto CallWithArrayLikeDescriptor::registers() {
// static
constexpr auto ConstructVarargsDescriptor::registers() {
// x0 : number of arguments (on the stack, not including receiver)
// x0 : number of arguments (on the stack)
// x1 : the target to call
// x3 : the new target
// x4 : arguments list length (untagged)
......@@ -175,7 +175,7 @@ constexpr auto ConstructForwardVarargsDescriptor::registers() {
// static
constexpr auto ConstructWithSpreadDescriptor::registers() {
// x0 : number of arguments (on the stack, not including receiver)
// x0 : number of arguments (on the stack)
// x1 : the target to call
// x3 : the new target
// x2 : the object to spread
......@@ -249,7 +249,7 @@ constexpr auto InterpreterDispatchDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
return RegisterArray(x0, // argument count (not including receiver)
return RegisterArray(x0, // argument count
x2, // address of first argument
x1); // the target callable to be call
}
......@@ -257,7 +257,7 @@ constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenConstructDescriptor::registers() {
return RegisterArray(
x0, // argument count (not including receiver)
x0, // argument count
x4, // address of the first argument
x1, // constructor to call
x3, // new target
......
......@@ -116,7 +116,7 @@ constexpr auto CallTrampolineDescriptor::registers() {
// static
constexpr auto CallVarargsDescriptor::registers() {
// eax : number of arguments (on the stack, not including receiver)
// eax : number of arguments (on the stack)
// edi : the target to call
// ecx : arguments list length (untagged)
// On the stack : arguments list (FixedArray)
......@@ -134,13 +134,13 @@ constexpr auto CallForwardVarargsDescriptor::registers() {
// static
constexpr auto CallFunctionTemplateDescriptor::registers() {
// edx : function template info
// ecx : number of arguments (on the stack, not including receiver)
// ecx : number of arguments (on the stack)
return RegisterArray(edx, ecx);
}
// static
constexpr auto CallWithSpreadDescriptor::registers() {
// eax : number of arguments (on the stack, not including receiver)
// eax : number of arguments (on the stack)
// edi : the target to call
// ecx : the object to spread
return RegisterArray(edi, eax, ecx);
......@@ -155,7 +155,7 @@ constexpr auto CallWithArrayLikeDescriptor::registers() {
// static
constexpr auto ConstructVarargsDescriptor::registers() {
// eax : number of arguments (on the stack, not including receiver)
// eax : number of arguments (on the stack)
// edi : the target to call
// edx : the new target
// ecx : arguments list length (untagged)
......@@ -174,7 +174,7 @@ constexpr auto ConstructForwardVarargsDescriptor::registers() {
// static
constexpr auto ConstructWithSpreadDescriptor::registers() {
// eax : number of arguments (on the stack, not including receiver)
// eax : number of arguments (on the stack)
// edi : the target to call
// edx : the new target
// ecx : the object to spread
......@@ -239,14 +239,14 @@ constexpr auto InterpreterDispatchDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
return RegisterArray(eax, // argument count (not including receiver)
return RegisterArray(eax, // argument count
ecx, // address of first argument
edi); // the target callable to be call
}
// static
constexpr auto InterpreterPushArgsThenConstructDescriptor::registers() {
return RegisterArray(eax, // argument count (not including receiver)
return RegisterArray(eax, // argument count
ecx); // address of first argument
}
......
......@@ -694,9 +694,8 @@ class AllocateDescriptor
};
// This descriptor defines the JavaScript calling convention that can be used
// by stubs: target, new.target, argc (not including the receiver) and context
// are passed in registers while receiver and the rest of the JS arguments are
// passed on the stack.
// by stubs: target, new.target, argc and context are passed in registers while
// receiver and the rest of the JS arguments are passed on the stack.
class JSTrampolineDescriptor
: public StaticJSCallInterfaceDescriptor<JSTrampolineDescriptor> {
public:
......
......@@ -117,7 +117,7 @@ constexpr auto CallTrampolineDescriptor::registers() {
// static
constexpr auto CallVarargsDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a4 : arguments list length (untagged)
// a2 : arguments list (FixedArray)
......@@ -135,13 +135,13 @@ constexpr auto CallForwardVarargsDescriptor::registers() {
// static
constexpr auto CallFunctionTemplateDescriptor::registers() {
// a1 : function template info
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
return RegisterArray(a1, a0);
}
// static
constexpr auto CallWithSpreadDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a2 : the object to spread
return RegisterArray(a1, a0, a2);
......@@ -156,7 +156,7 @@ constexpr auto CallWithArrayLikeDescriptor::registers() {
// static
constexpr auto ConstructVarargsDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a3 : the new target
// a4 : arguments list length (untagged)
......@@ -175,7 +175,7 @@ constexpr auto ConstructForwardVarargsDescriptor::registers() {
// static
constexpr auto ConstructWithSpreadDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a3 : the new target
// a2 : the object to spread
......@@ -250,7 +250,7 @@ constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenConstructDescriptor::registers() {
// a0 : argument count (not including receiver)
// a0 : argument count
// a4 : address of the first argument
// a1 : constructor to call
// a3 : new target
......
......@@ -116,7 +116,7 @@ constexpr auto CallTrampolineDescriptor::registers() {
// static
constexpr auto CallVarargsDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// t0 : arguments list length (untagged)
// a2 : arguments list (FixedArray)
......@@ -134,13 +134,13 @@ constexpr auto CallForwardVarargsDescriptor::registers() {
// static
constexpr auto CallFunctionTemplateDescriptor::registers() {
// a1 : function template info
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
return RegisterArray(a1, a0);
}
// static
constexpr auto CallWithSpreadDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a2 : the object to spread
return RegisterArray(a1, a0, a2);
......@@ -155,7 +155,7 @@ constexpr auto CallWithArrayLikeDescriptor::registers() {
// static
constexpr auto ConstructVarargsDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a3 : the new target
// t0 : arguments list length (untagged)
......@@ -174,7 +174,7 @@ constexpr auto ConstructForwardVarargsDescriptor::registers() {
// static
constexpr auto ConstructWithSpreadDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a3 : the new target
// a2 : the object to spread
......@@ -239,7 +239,7 @@ constexpr auto InterpreterDispatchDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
// a0 : argument count (not including receiver
// a0 : argument count
// a2 : address of first argument
// a1 : the target callable to be call
return RegisterArray(a0, a2, a1);
......@@ -247,7 +247,7 @@ constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenConstructDescriptor::registers() {
// a0 : argument count (not including receiver)
// a0 : argument count
// t4 : address of the first argument
// a1 : constructor to call
// a3 : new target
......
......@@ -117,7 +117,7 @@ constexpr auto CallTrampolineDescriptor::registers() {
// static
constexpr auto CallVarargsDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a4 : arguments list length (untagged)
// a2 : arguments list (FixedArray)
......@@ -135,13 +135,13 @@ constexpr auto CallForwardVarargsDescriptor::registers() {
// static
constexpr auto CallFunctionTemplateDescriptor::registers() {
// a1 : function template info
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
return RegisterArray(a1, a0);
}
// static
constexpr auto CallWithSpreadDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a2 : the object to spread
return RegisterArray(a1, a0, a2);
......@@ -156,7 +156,7 @@ constexpr auto CallWithArrayLikeDescriptor::registers() {
// static
constexpr auto ConstructVarargsDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a3 : the new target
// a4 : arguments list length (untagged)
......@@ -175,7 +175,7 @@ constexpr auto ConstructForwardVarargsDescriptor::registers() {
// static
constexpr auto ConstructWithSpreadDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a3 : the new target
// a2 : the object to spread
......@@ -242,7 +242,7 @@ constexpr auto InterpreterDispatchDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
// a0 : argument count (not including receiver)
// a0 : argument count
// a2 : address of first argument
// a1 : the target callable to be call
return RegisterArray(a0, a2, a1);
......@@ -250,7 +250,7 @@ constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenConstructDescriptor::registers() {
// a0 : argument count (not including receiver)
// a0 : argument count
// a4 : address of the first argument
// a1 : constructor to call
// a3 : new target
......
......@@ -118,7 +118,7 @@ constexpr auto CallTrampolineDescriptor::registers() {
// static
constexpr auto CallVarargsDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a4 : arguments list length (untagged)
// a2 : arguments list (FixedArray)
......@@ -136,13 +136,13 @@ constexpr auto CallForwardVarargsDescriptor::registers() {
// static
constexpr auto CallFunctionTemplateDescriptor::registers() {
// a1 : function template info
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
return RegisterArray(a1, a0);
}
// static
constexpr auto CallWithSpreadDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a2 : the object to spread
return RegisterArray(a1, a0, a2);
......@@ -157,7 +157,7 @@ constexpr auto CallWithArrayLikeDescriptor::registers() {
// static
constexpr auto ConstructVarargsDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a3 : the new target
// a4 : arguments list length (untagged)
......@@ -176,7 +176,7 @@ constexpr auto ConstructForwardVarargsDescriptor::registers() {
// static
constexpr auto ConstructWithSpreadDescriptor::registers() {
// a0 : number of arguments (on the stack, not including receiver)
// a0 : number of arguments (on the stack)
// a1 : the target to call
// a3 : the new target
// a2 : the object to spread
......@@ -250,7 +250,7 @@ constexpr auto InterpreterDispatchDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
return RegisterArray(a0, // argument count (not including receiver)
return RegisterArray(a0, // argument count
a2, // address of first argument
a1); // the target callable to be call
}
......@@ -258,7 +258,7 @@ constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenConstructDescriptor::registers() {
return RegisterArray(
a0, // argument count (not including receiver)
a0, // argument count
a4, // address of the first argument
a1, // constructor to call
a3, // new target
......
......@@ -142,7 +142,7 @@ constexpr auto CallTrampolineDescriptor::registers() {
// static
constexpr auto CallVarargsDescriptor::registers() {
// rax : number of arguments (on the stack, not including receiver)
// rax : number of arguments (on the stack)
// rdi : the target to call
// rcx : arguments list length (untagged)
// rbx : arguments list (FixedArray)
......@@ -160,13 +160,13 @@ constexpr auto CallForwardVarargsDescriptor::registers() {
// static
constexpr auto CallFunctionTemplateDescriptor::registers() {
// rdx: the function template info
// rcx: number of arguments (on the stack, not including receiver)
// rcx: number of arguments (on the stack)
return RegisterArray(rdx, rcx);
}
// static
constexpr auto CallWithSpreadDescriptor::registers() {
// rax : number of arguments (on the stack, not including receiver)
// rax : number of arguments (on the stack)
// rdi : the target to call
// rbx : the object to spread
return RegisterArray(rdi, rax, rbx);
......@@ -181,7 +181,7 @@ constexpr auto CallWithArrayLikeDescriptor::registers() {
// static
constexpr auto ConstructVarargsDescriptor::registers() {
// rax : number of arguments (on the stack, not including receiver)
// rax : number of arguments (on the stack)
// rdi : the target to call
// rdx : the new target
// rcx : arguments list length (untagged)
......@@ -200,7 +200,7 @@ constexpr auto ConstructForwardVarargsDescriptor::registers() {
// static
constexpr auto ConstructWithSpreadDescriptor::registers() {
// rax : number of arguments (on the stack, not including receiver)
// rax : number of arguments (on the stack)
// rdi : the target to call
// rdx : the new target
// rbx : the object to spread
......@@ -264,7 +264,7 @@ constexpr auto InterpreterDispatchDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
return RegisterArray(rax, // argument count (not including receiver)
return RegisterArray(rax, // argument count
rbx, // address of first argument
rdi); // the target callable to be call
}
......@@ -272,7 +272,7 @@ constexpr auto InterpreterPushArgsThenCallDescriptor::registers() {
// static
constexpr auto InterpreterPushArgsThenConstructDescriptor::registers() {
return RegisterArray(
rax, // argument count (not including receiver)
rax, // argument count
rcx, // address of first argument
rdi, // constructor to call
rdx, // new target
......
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