Commit aaa92726 authored by chunyang.dai's avatar chunyang.dai Committed by Commit bot

X87: Use big-boy Types to annotate interface descriptor parameters.

port c019d7f4 (r29248).

original commit message:

    Use big-boy Types to annotate interface descriptor parameters

    - Thread Type::FunctionType through stubs and the TF pipeline.
    - Augment Typer to decorate parameter nodes with types from
      a Type::FunctionType associated with interface descriptors.
    - Factor interface descriptors into platform-specific and
      platform-independent components so that all descriptors share
      a common Type::FunctionType for all platforms.

BUG=

Review URL: https://codereview.chromium.org/1210463002

Cr-Commit-Position: refs/heads/master@{#29406}
parent 649544d4
...@@ -63,107 +63,100 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return eax; } ...@@ -63,107 +63,100 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return eax; }
const Register GrowArrayElementsDescriptor::KeyRegister() { return ebx; } const Register GrowArrayElementsDescriptor::KeyRegister() { return ebx; }
void FastNewClosureDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewClosureDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, ebx}; Register registers[] = {esi, ebx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void FastNewContextDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, edi}; Register registers[] = {esi, edi};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void ToNumberDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ToNumberDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// ToNumberStub invokes a function, and therefore needs a context. // ToNumberStub invokes a function, and therefore needs a context.
Register registers[] = {esi, eax}; Register registers[] = {esi, eax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void NumberToStringDescriptor::Initialize(CallInterfaceDescriptorData* data) { void NumberToStringDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, eax}; Register registers[] = {esi, eax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void TypeofDescriptor::Initialize(CallInterfaceDescriptorData* data) { void TypeofDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, ebx}; Register registers[] = {esi, ebx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void FastCloneShallowArrayDescriptor::Initialize( void FastCloneShallowArrayDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {esi, eax, ebx, ecx}; Register registers[] = {esi, eax, ebx, ecx};
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
Representation::Tagged()};
data->Initialize(arraysize(registers), registers, representations);
} }
void FastCloneShallowObjectDescriptor::Initialize( void FastCloneShallowObjectDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {esi, eax, ebx, ecx, edx}; Register registers[] = {esi, eax, ebx, ecx, edx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CreateAllocationSiteDescriptor::Initialize( void CreateAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {esi, ebx, edx}; Register registers[] = {esi, ebx, edx};
Representation representations[] = {Representation::Tagged(), data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(),
Representation::Smi()};
data->Initialize(arraysize(registers), registers, representations);
} }
void CreateWeakCellDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CreateWeakCellDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, ebx, edx, edi}; Register registers[] = {esi, ebx, edx, edi};
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
Representation::Tagged()};
data->Initialize(arraysize(registers), registers, representations);
} }
void StoreArrayLiteralElementDescriptor::Initialize( void StoreArrayLiteralElementDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {esi, ecx, eax}; Register registers[] = {esi, ecx, eax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CallFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallFunctionDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, edi}; Register registers[] = {esi, edi};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CallFunctionWithFeedbackDescriptor::Initialize( void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {esi, edi, edx}; Register registers[] = {esi, edi, edx};
Representation representations[] = {Representation::Tagged(), data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(),
Representation::Smi()};
data->Initialize(arraysize(registers), registers, representations);
} }
void CallFunctionWithFeedbackAndVectorDescriptor::Initialize( void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {esi, edi, edx, ebx}; Register registers[] = {esi, edi, edx, ebx};
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
Representation::Tagged()};
data->Initialize(arraysize(registers), registers, representations);
} }
void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallConstructDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// eax : number of arguments // eax : number of arguments
// ebx : feedback vector // ebx : feedback vector
// edx : (only if ebx is not the megamorphic symbol) slot in feedback // edx : (only if ebx is not the megamorphic symbol) slot in feedback
...@@ -172,169 +165,156 @@ void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -172,169 +165,156 @@ void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) {
// TODO(turbofan): So far we don't gather type feedback and hence skip the // TODO(turbofan): So far we don't gather type feedback and hence skip the
// slot parameter, but ArrayConstructStub needs the vector to be undefined. // slot parameter, but ArrayConstructStub needs the vector to be undefined.
Register registers[] = {esi, eax, edi, ebx}; Register registers[] = {esi, eax, edi, ebx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void RegExpConstructResultDescriptor::Initialize( void RegExpConstructResultDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {esi, ecx, ebx, eax}; Register registers[] = {esi, ecx, ebx, eax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void TransitionElementsKindDescriptor::Initialize( void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {esi, eax, ebx}; Register registers[] = {esi, eax, ebx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void AllocateHeapNumberDescriptor::Initialize( void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// register state // register state
// esi -- context // esi -- context
Register registers[] = {esi}; Register registers[] = {esi};
data->Initialize(arraysize(registers), registers, nullptr); data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
} }
void ArrayConstructorConstantArgCountDescriptor::Initialize( void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// register state // register state
// eax -- number of arguments // eax -- number of arguments
// edi -- function // edi -- function
// ebx -- allocation site with elements kind // ebx -- allocation site with elements kind
Register registers[] = {esi, edi, ebx}; Register registers[] = {esi, edi, ebx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void ArrayConstructorDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ArrayConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// stack param count needs (constructor pointer, and single argument) // stack param count needs (constructor pointer, and single argument)
Register registers[] = {esi, edi, ebx, eax}; Register registers[] = {esi, edi, ebx, eax};
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), Representation::Tagged(),
Representation::Tagged(), Representation::Integer32()};
data->Initialize(arraysize(registers), registers, representations);
} }
void InternalArrayConstructorConstantArgCountDescriptor::Initialize( void InternalArrayConstructorConstantArgCountDescriptor::
CallInterfaceDescriptorData* data) { InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
// register state // register state
// eax -- number of arguments // eax -- number of arguments
// edi -- function // edi -- function
Register registers[] = {esi, edi}; Register registers[] = {esi, edi};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void InternalArrayConstructorDescriptor::Initialize( void InternalArrayConstructorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// stack param count needs (constructor pointer, and single argument) // stack param count needs (constructor pointer, and single argument)
Register registers[] = {esi, edi, eax}; Register registers[] = {esi, edi, eax};
Representation representations[] = {Representation::Tagged(), data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(),
Representation::Integer32()};
data->Initialize(arraysize(registers), registers, representations);
} }
void CompareDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CompareDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, edx, eax}; Register registers[] = {esi, edx, eax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CompareNilDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CompareNilDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, eax}; Register registers[] = {esi, eax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void ToBooleanDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ToBooleanDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, eax}; Register registers[] = {esi, eax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void BinaryOpDescriptor::Initialize(CallInterfaceDescriptorData* data) { void BinaryOpDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, edx, eax}; Register registers[] = {esi, edx, eax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void BinaryOpWithAllocationSiteDescriptor::Initialize( void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {esi, ecx, edx, eax}; Register registers[] = {esi, ecx, edx, eax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void StringAddDescriptor::Initialize(CallInterfaceDescriptorData* data) { void StringAddDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, edx, eax}; Register registers[] = {esi, edx, eax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void KeyedDescriptor::Initialize(CallInterfaceDescriptorData* data) { void KeyedDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = { Register registers[] = {
esi, // context esi, // context
ecx, // key ecx, // key
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), // context
Representation::Tagged(), // key
};
data->Initialize(arraysize(registers), registers, representations);
} }
void NamedDescriptor::Initialize(CallInterfaceDescriptorData* data) { void NamedDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = { Register registers[] = {
esi, // context esi, // context
ecx, // name ecx, // name
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), // context
Representation::Tagged(), // name
};
data->Initialize(arraysize(registers), registers, representations);
} }
void CallHandlerDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallHandlerDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = { Register registers[] = {
esi, // context esi, // context
edx, // name edx, // name
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), // context
Representation::Tagged(), // receiver
};
data->Initialize(arraysize(registers), registers, representations);
} }
void ArgumentAdaptorDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = { Register registers[] = {
esi, // context esi, // context
edi, // JSFunction edi, // JSFunction
eax, // actual number of arguments eax, // actual number of arguments
ebx, // expected number of arguments ebx, // expected number of arguments
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), // context
Representation::Tagged(), // JSFunction
Representation::Integer32(), // actual number of arguments
Representation::Integer32(), // expected number of arguments
};
data->Initialize(arraysize(registers), registers, representations);
} }
void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ApiFunctionDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = { Register registers[] = {
esi, // context esi, // context
edi, // callee edi, // callee
...@@ -343,19 +323,12 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -343,19 +323,12 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) {
edx, // api_function_address edx, // api_function_address
eax, // actual number of arguments eax, // actual number of arguments
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), // context
Representation::Tagged(), // callee
Representation::Tagged(), // call_data
Representation::Tagged(), // holder
Representation::External(), // api_function_address
Representation::Integer32(), // actual number of arguments
};
data->Initialize(arraysize(registers), registers, representations);
} }
void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ApiAccessorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = { Register registers[] = {
esi, // context esi, // context
edi, // callee edi, // callee
...@@ -363,29 +336,18 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -363,29 +336,18 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
ecx, // holder ecx, // holder
edx, // api_function_address edx, // api_function_address
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), // context
Representation::Tagged(), // callee
Representation::Tagged(), // call_data
Representation::Tagged(), // holder
Representation::External(), // api_function_address
};
data->Initialize(arraysize(registers), registers, representations);
} }
void MathRoundVariantDescriptor::Initialize(CallInterfaceDescriptorData* data) { void MathRoundVariantDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = { Register registers[] = {
esi, // context esi, // context
edi, // math rounding function edi, // math rounding function
edx, // vector slot id edx, // vector slot id
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), //
Representation::Tagged(), //
Representation::Tagged(), //
};
data->Initialize(arraysize(registers), registers, representations);
} }
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
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