From aaa92726f0ee079dcdcfd9b340a424b60610121a Mon Sep 17 00:00:00 2001 From: "chunyang.dai" Date: Wed, 1 Jul 2015 04:27:54 -0700 Subject: [PATCH] X87: Use big-boy Types to annotate interface descriptor parameters. port c019d7f498ce6fbac6659924e20ddb6c59aebeb8 (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} --- src/x87/interface-descriptors-x87.cc | 218 +++++++++++++++-------------------- 1 file changed, 90 insertions(+), 128 deletions(-) diff --git a/src/x87/interface-descriptors-x87.cc b/src/x87/interface-descriptors-x87.cc index 702369a..3e6f09c 100644 --- a/src/x87/interface-descriptors-x87.cc +++ b/src/x87/interface-descriptors-x87.cc @@ -63,107 +63,100 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return eax; } const Register GrowArrayElementsDescriptor::KeyRegister() { return ebx; } -void FastNewClosureDescriptor::Initialize(CallInterfaceDescriptorData* data) { +void FastNewClosureDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { 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}; - 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. 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}; - 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}; - data->Initialize(arraysize(registers), registers, NULL); + data->InitializePlatformSpecific(arraysize(registers), registers, NULL); } -void FastCloneShallowArrayDescriptor::Initialize( +void FastCloneShallowArrayDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { Register registers[] = {esi, eax, ebx, ecx}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), Representation::Smi(), - Representation::Tagged()}; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void FastCloneShallowObjectDescriptor::Initialize( +void FastCloneShallowObjectDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { 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) { Register registers[] = {esi, ebx, edx}; - Representation representations[] = {Representation::Tagged(), - Representation::Tagged(), - Representation::Smi()}; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void CreateWeakCellDescriptor::Initialize(CallInterfaceDescriptorData* data) { +void CreateWeakCellDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { Register registers[] = {esi, ebx, edx, edi}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), Representation::Smi(), - Representation::Tagged()}; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void StoreArrayLiteralElementDescriptor::Initialize( +void StoreArrayLiteralElementDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { 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}; - data->Initialize(arraysize(registers), registers, NULL); + data->InitializePlatformSpecific(arraysize(registers), registers, NULL); } -void CallFunctionWithFeedbackDescriptor::Initialize( +void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { Register registers[] = {esi, edi, edx}; - Representation representations[] = {Representation::Tagged(), - Representation::Tagged(), - Representation::Smi()}; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void CallFunctionWithFeedbackAndVectorDescriptor::Initialize( +void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { Register registers[] = {esi, edi, edx, ebx}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), Representation::Smi(), - Representation::Tagged()}; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { +void CallConstructDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { // eax : number of arguments // ebx : feedback vector // edx : (only if ebx is not the megamorphic symbol) slot in feedback @@ -172,169 +165,156 @@ void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { // TODO(turbofan): So far we don't gather type feedback and hence skip the // slot parameter, but ArrayConstructStub needs the vector to be undefined. 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) { 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) { 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) { // register state // esi -- context Register registers[] = {esi}; - data->Initialize(arraysize(registers), registers, nullptr); + data->InitializePlatformSpecific(arraysize(registers), registers, nullptr); } -void ArrayConstructorConstantArgCountDescriptor::Initialize( +void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { // register state // eax -- number of arguments // edi -- function // ebx -- allocation site with elements kind 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) Register registers[] = {esi, edi, ebx, eax}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), - Representation::Tagged(), Representation::Integer32()}; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void InternalArrayConstructorConstantArgCountDescriptor::Initialize( - CallInterfaceDescriptorData* data) { +void InternalArrayConstructorConstantArgCountDescriptor:: + InitializePlatformSpecific(CallInterfaceDescriptorData* data) { // register state // eax -- number of arguments // edi -- function Register registers[] = {esi, edi}; - data->Initialize(arraysize(registers), registers, NULL); + data->InitializePlatformSpecific(arraysize(registers), registers, NULL); } -void InternalArrayConstructorDescriptor::Initialize( +void InternalArrayConstructorDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { // stack param count needs (constructor pointer, and single argument) Register registers[] = {esi, edi, eax}; - Representation representations[] = {Representation::Tagged(), - Representation::Tagged(), - Representation::Integer32()}; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void CompareDescriptor::Initialize(CallInterfaceDescriptorData* data) { +void CompareDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { 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}; - 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}; - 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}; - data->Initialize(arraysize(registers), registers, NULL); + data->InitializePlatformSpecific(arraysize(registers), registers, NULL); } -void BinaryOpWithAllocationSiteDescriptor::Initialize( +void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { 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}; - data->Initialize(arraysize(registers), registers, NULL); + data->InitializePlatformSpecific(arraysize(registers), registers, NULL); } -void KeyedDescriptor::Initialize(CallInterfaceDescriptorData* data) { +void KeyedDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { Register registers[] = { esi, // context ecx, // key }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // key - }; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void NamedDescriptor::Initialize(CallInterfaceDescriptorData* data) { +void NamedDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { Register registers[] = { esi, // context ecx, // name }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // name - }; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void CallHandlerDescriptor::Initialize(CallInterfaceDescriptorData* data) { +void CallHandlerDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { Register registers[] = { esi, // context edx, // name }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // receiver - }; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void ArgumentAdaptorDescriptor::Initialize(CallInterfaceDescriptorData* data) { +void ArgumentAdaptorDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { Register registers[] = { esi, // context edi, // JSFunction eax, // actual number of arguments ebx, // expected number of arguments }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // JSFunction - Representation::Integer32(), // actual number of arguments - Representation::Integer32(), // expected number of arguments - }; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { +void ApiFunctionDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { Register registers[] = { esi, // context edi, // callee @@ -343,19 +323,12 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { edx, // api_function_address eax, // actual number of arguments }; - Representation representations[] = { - 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); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { +void ApiAccessorDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { Register registers[] = { esi, // context edi, // callee @@ -363,29 +336,18 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { ecx, // holder edx, // api_function_address }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // callee - Representation::Tagged(), // call_data - Representation::Tagged(), // holder - Representation::External(), // api_function_address - }; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } -void MathRoundVariantDescriptor::Initialize(CallInterfaceDescriptorData* data) { +void MathRoundVariantDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { Register registers[] = { esi, // context edi, // math rounding function edx, // vector slot id }; - Representation representations[] = { - Representation::Tagged(), // - Representation::Tagged(), // - Representation::Tagged(), // - }; - data->Initialize(arraysize(registers), registers, representations); + data->InitializePlatformSpecific(arraysize(registers), registers); } } // namespace internal } // namespace v8 -- 2.7.4