Bug 1657820 - Part 1: Add support for ArgumentKind::Arg3. r=jandem

The next patch requires to have support for four arguments.

Differential Revision: https://phabricator.services.mozilla.com/D86298
This commit is contained in:
André Bargull 2020-08-11 06:40:06 +00:00
Родитель 3c0a965bd5
Коммит e8c9163853
1 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -367,7 +367,15 @@ enum class AttachDecision {
// Set of arguments supported by GetIndexOfArgument.
// Support for higher argument indices can be added easily, but is currently
// unneeded.
enum class ArgumentKind : uint8_t { Callee, This, NewTarget, Arg0, Arg1, Arg2 };
enum class ArgumentKind : uint8_t {
Callee,
This,
NewTarget,
Arg0,
Arg1,
Arg2,
Arg3
};
// This function calculates the index of an argument based on the call flags.
// addArgc is an out-parameter, indicating whether the value of argc should
@ -418,6 +426,8 @@ inline int32_t GetIndexOfArgument(ArgumentKind kind, CallFlags flags,
return flags.isConstructing() + hasArgumentArray - 2;
case ArgumentKind::Arg2:
return flags.isConstructing() + hasArgumentArray - 3;
case ArgumentKind::Arg3:
return flags.isConstructing() + hasArgumentArray - 4;
case ArgumentKind::NewTarget:
MOZ_ASSERT(flags.isConstructing());
*addArgc = false;