Commit fb450de7 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[builtins] Cleanup Array[No,Single,N]ArgumentsConstructorDescriptor.

This is a necessary cleanup before porting Array[No,Single,N]ArgumentsConstructor
builtins to CSA.

Bug: v8:5269, v8:7703
Change-Id: I40a2dd83faab1f8c3c180d461ef62fa4d8578f5e
Reviewed-on: https://chromium-review.googlesource.com/1097079
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53671}
parent af526117
......@@ -190,30 +190,13 @@ void ArrayConstructorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// r0 -- number of arguments
// r1 -- function
// r2 -- allocation site with elements kind
Register registers[] = {r1, r2, r0};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// r0 -- number of arguments
// r1 -- function
// r2 -- allocation site with elements kind
Register registers[] = {r1, r2, r0};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// stack param count needs (constructor pointer, and single argument)
Register registers[] = {r1, r2, r0};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
......
......@@ -191,30 +191,13 @@ void ArrayConstructorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// x1: function
// x2: allocation site with elements kind
// x0: number of arguments to the constructor function
Register registers[] = {x1, x2, x0};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// x0: number of arguments
// x1: function
// x2: allocation site with elements kind
Register registers[] = {x1, x2, x0};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// stack param count needs (constructor pointer, and single argument)
Register registers[] = {x1, x2, x0};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
......
......@@ -190,26 +190,6 @@ void ArrayConstructorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// eax -- number of arguments
// edi -- function
// ebx -- allocation site with elements kind
Register registers[] = {edi, ebx, eax};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// eax -- number of arguments
// edi -- function
// ebx -- allocation site with elements kind
Register registers[] = {edi, ebx, eax};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
......
......@@ -506,24 +506,38 @@ void ArrayConstructorDescriptor::InitializePlatformIndependent(
void ArrayNoArgumentConstructorDescriptor::InitializePlatformIndependent(
CallInterfaceDescriptorData* data) {
// kFunction, kAllocationSite, kActualArgumentsCount, kFunctionParameter
MachineType machine_types[] = {MachineType::TaggedPointer(),
MachineType machine_types[] = {MachineType::AnyTagged(),
MachineType::AnyTagged(), MachineType::Int32(),
MachineType::AnyTagged()};
data->InitializePlatformIndependent(arraysize(machine_types), 0,
machine_types);
}
void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// This descriptor must use the same set of registers as the
// ArrayNArgumentsConstructorDescriptor.
ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(data);
}
void ArraySingleArgumentConstructorDescriptor::InitializePlatformIndependent(
CallInterfaceDescriptorData* data) {
// kFunction, kAllocationSite, kActualArgumentsCount, kFunctionParameter,
// kArraySizeSmiParameter
MachineType machine_types[] = {
MachineType::TaggedPointer(), MachineType::AnyTagged(),
MachineType::Int32(), MachineType::AnyTagged(), MachineType::AnyTagged()};
MachineType::AnyTagged(), MachineType::AnyTagged(), MachineType::Int32(),
MachineType::AnyTagged(), MachineType::AnyTagged()};
data->InitializePlatformIndependent(arraysize(machine_types), 0,
machine_types);
}
void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// This descriptor must use the same set of registers as the
// ArrayNArgumentsConstructorDescriptor.
ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(data);
}
void ArrayNArgumentsConstructorDescriptor::InitializePlatformIndependent(
CallInterfaceDescriptorData* data) {
// kFunction, kAllocationSite, kActualArgumentsCount
......
......@@ -652,28 +652,41 @@ class ArrayConstructorDescriptor : public CallInterfaceDescriptor {
CallInterfaceDescriptor)
};
class ArrayNoArgumentConstructorDescriptor : public CallInterfaceDescriptor {
class ArrayNArgumentsConstructorDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount,
kFunctionParameter)
// This descriptor declares only register arguments while respective number
// of JS arguments stay on the expression stack.
// The ArrayNArgumentsConstructor builtin does not access stack arguments
// directly it just forwards them to the runtime function.
DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount)
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
ArrayNoArgumentConstructorDescriptor, CallInterfaceDescriptor)
ArrayNArgumentsConstructorDescriptor, CallInterfaceDescriptor)
};
class ArraySingleArgumentConstructorDescriptor
: public CallInterfaceDescriptor {
class ArrayNoArgumentConstructorDescriptor
: public ArrayNArgumentsConstructorDescriptor {
public:
// This descriptor declares same register arguments as the parent
// ArrayNArgumentsConstructorDescriptor and it declares indices for
// JS arguments passed on the expression stack.
DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount,
kFunctionParameter, kArraySizeSmiParameter)
kFunctionParameter)
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
ArraySingleArgumentConstructorDescriptor, CallInterfaceDescriptor)
ArrayNoArgumentConstructorDescriptor,
ArrayNArgumentsConstructorDescriptor)
};
class ArrayNArgumentsConstructorDescriptor : public CallInterfaceDescriptor {
class ArraySingleArgumentConstructorDescriptor
: public ArrayNArgumentsConstructorDescriptor {
public:
DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount)
// This descriptor declares same register arguments as the parent
// ArrayNArgumentsConstructorDescriptor and it declares indices for
// JS arguments passed on the expression stack.
DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount,
kFunctionParameter, kArraySizeSmiParameter)
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
ArrayNArgumentsConstructorDescriptor, CallInterfaceDescriptor)
ArraySingleArgumentConstructorDescriptor,
ArrayNArgumentsConstructorDescriptor)
};
class CompareDescriptor : public CallInterfaceDescriptor {
......
......@@ -189,30 +189,13 @@ void ArrayConstructorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// a0 -- number of arguments
// a1 -- function
// a2 -- allocation site with elements kind
Register registers[] = {a1, a2, a0};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// a0 -- number of arguments
// a1 -- function
// a2 -- allocation site with elements kind
Register registers[] = {a1, a2, a0};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// stack param count needs (constructor pointer, and single argument)
Register registers[] = {a1, a2, a0};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
......
......@@ -189,30 +189,13 @@ void ArrayConstructorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// a0 -- number of arguments
// a1 -- function
// a2 -- allocation site with elements kind
Register registers[] = {a1, a2, a0};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// a0 -- number of arguments
// a1 -- function
// a2 -- allocation site with elements kind
Register registers[] = {a1, a2, a0};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// stack param count needs (constructor pointer, and single argument)
Register registers[] = {a1, a2, a0};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
......
......@@ -188,31 +188,13 @@ void ArrayConstructorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// r3 -- number of arguments
// r4 -- function
// r5 -- allocation site with elements kind
Register registers[] = {r4, r5, r3};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// r3 -- number of arguments
// r4 -- function
// r5 -- allocation site with elements kind
Register registers[] = {r4, r5, r3};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// stack param count needs (constructor pointer, and single argument)
Register registers[] = {r4, r5, r3};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
......
......@@ -187,30 +187,13 @@ void ArrayConstructorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// r2 -- number of arguments
// r3 -- function
// r4 -- allocation site with elements kind
Register registers[] = {r3, r4, r2};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// r2 -- number of arguments
// r3 -- function
// r4 -- allocation site with elements kind
Register registers[] = {r3, r4, r2};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// stack param count needs (constructor pointer, and single argument)
Register registers[] = {r3, r4, r2};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
......
......@@ -190,26 +190,6 @@ void ArrayConstructorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// rax -- number of arguments
// rdi -- function
// rbx -- allocation site with elements kind
Register registers[] = {rdi, rbx, rax};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
// rax -- number of arguments
// rdi -- function
// rbx -- allocation site with elements kind
Register registers[] = {rdi, rbx, rax};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// register state
......
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