Commit c019d7f4 authored by danno's avatar danno Committed by Commit bot

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.

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

Cr-Commit-Position: refs/heads/master@{#29248}
parent b7f4981c
...@@ -62,106 +62,99 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return r0; } ...@@ -62,106 +62,99 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return r0; }
const Register GrowArrayElementsDescriptor::KeyRegister() { return r3; } const Register GrowArrayElementsDescriptor::KeyRegister() { return r3; }
void FastNewClosureDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewClosureDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r2}; Register registers[] = {cp, r2};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void FastNewContextDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r1}; Register registers[] = {cp, r1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void ToNumberDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ToNumberDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r0}; Register registers[] = {cp, r0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void NumberToStringDescriptor::Initialize(CallInterfaceDescriptorData* data) { void NumberToStringDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r0}; Register registers[] = {cp, r0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void TypeofDescriptor::Initialize(CallInterfaceDescriptorData* data) { void TypeofDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r3}; Register registers[] = {cp, r3};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void FastCloneShallowArrayDescriptor::Initialize( void FastCloneShallowArrayDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r3, r2, r1}; Register registers[] = {cp, r3, r2, r1};
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[] = {cp, r3, r2, r1, r0}; Register registers[] = {cp, r3, r2, r1, r0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CreateAllocationSiteDescriptor::Initialize( void CreateAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r2, r3}; Register registers[] = {cp, r2, r3};
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[] = {cp, r2, r3, r1}; Register registers[] = {cp, r2, r3, r1};
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[] = {cp, r3, r0}; Register registers[] = {cp, r3, r0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CallFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallFunctionDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r1}; Register registers[] = {cp, r1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CallFunctionWithFeedbackDescriptor::Initialize( void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r1, r3}; Register registers[] = {cp, r1, r3};
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[] = {cp, r1, r3, r2}; Register registers[] = {cp, r1, r3, r2};
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) {
// r0 : number of arguments // r0 : number of arguments
// r1 : the function to call // r1 : the function to call
// r2 : feedback vector // r2 : feedback vector
...@@ -170,34 +163,34 @@ void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -170,34 +163,34 @@ 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[] = {cp, r0, r1, r2}; Register registers[] = {cp, r0, r1, r2};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void RegExpConstructResultDescriptor::Initialize( void RegExpConstructResultDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r2, r1, r0}; Register registers[] = {cp, r2, r1, r0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void TransitionElementsKindDescriptor::Initialize( void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r0, r1}; Register registers[] = {cp, r0, r1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void AllocateHeapNumberDescriptor::Initialize( void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// register state // register state
// cp -- context // cp -- context
Register registers[] = {cp}; Register registers[] = {cp};
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
// cp -- context // cp -- context
...@@ -205,80 +198,81 @@ void ArrayConstructorConstantArgCountDescriptor::Initialize( ...@@ -205,80 +198,81 @@ void ArrayConstructorConstantArgCountDescriptor::Initialize(
// r1 -- function // r1 -- function
// r2 -- allocation site with elements kind // r2 -- allocation site with elements kind
Register registers[] = {cp, r1, r2}; Register registers[] = {cp, r1, r2};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
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[] = {cp, r1, r2, r0}; Register registers[] = {cp, r1, r2, r0};
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
// cp -- context // cp -- context
// r0 -- number of arguments // r0 -- number of arguments
// r1 -- constructor function // r1 -- constructor function
Register registers[] = {cp, r1}; Register registers[] = {cp, r1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
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[] = {cp, r1, r0}; Register registers[] = {cp, r1, r0};
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[] = {cp, r1, r0}; Register registers[] = {cp, r1, r0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CompareNilDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CompareNilDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r0}; Register registers[] = {cp, r0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void ToBooleanDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ToBooleanDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r0}; Register registers[] = {cp, r0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void BinaryOpDescriptor::Initialize(CallInterfaceDescriptorData* data) { void BinaryOpDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r1, r0}; Register registers[] = {cp, r1, r0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void BinaryOpWithAllocationSiteDescriptor::Initialize( void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r2, r1, r0}; Register registers[] = {cp, r2, r1, r0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void StringAddDescriptor::Initialize(CallInterfaceDescriptorData* data) { void StringAddDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, r1, r0}; Register registers[] = {cp, r1, r0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void KeyedDescriptor::Initialize(CallInterfaceDescriptorData* data) { void KeyedDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor noInlineDescriptor = static PlatformInterfaceDescriptor noInlineDescriptor =
PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
...@@ -286,16 +280,13 @@ void KeyedDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -286,16 +280,13 @@ void KeyedDescriptor::Initialize(CallInterfaceDescriptorData* data) {
cp, // context cp, // context
r2, // key r2, // key
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers,
Representation::Tagged(), // context
Representation::Tagged(), // key
};
data->Initialize(arraysize(registers), registers, representations,
&noInlineDescriptor); &noInlineDescriptor);
} }
void NamedDescriptor::Initialize(CallInterfaceDescriptorData* data) { void NamedDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor noInlineDescriptor = static PlatformInterfaceDescriptor noInlineDescriptor =
PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
...@@ -303,16 +294,13 @@ void NamedDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -303,16 +294,13 @@ void NamedDescriptor::Initialize(CallInterfaceDescriptorData* data) {
cp, // context cp, // context
r2, // name r2, // name
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers,
Representation::Tagged(), // context
Representation::Tagged(), // name
};
data->Initialize(arraysize(registers), registers, representations,
&noInlineDescriptor); &noInlineDescriptor);
} }
void CallHandlerDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallHandlerDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor default_descriptor = static PlatformInterfaceDescriptor default_descriptor =
PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
...@@ -320,16 +308,13 @@ void CallHandlerDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -320,16 +308,13 @@ void CallHandlerDescriptor::Initialize(CallInterfaceDescriptorData* data) {
cp, // context cp, // context
r0, // receiver r0, // receiver
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers,
Representation::Tagged(), // context
Representation::Tagged(), // receiver
};
data->Initialize(arraysize(registers), registers, representations,
&default_descriptor); &default_descriptor);
} }
void ArgumentAdaptorDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor default_descriptor = static PlatformInterfaceDescriptor default_descriptor =
PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
...@@ -339,18 +324,13 @@ void ArgumentAdaptorDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -339,18 +324,13 @@ void ArgumentAdaptorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
r0, // actual number of arguments r0, // actual number of arguments
r2, // expected number of arguments r2, // 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,
&default_descriptor); &default_descriptor);
} }
void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ApiFunctionDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor default_descriptor = static PlatformInterfaceDescriptor default_descriptor =
PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
...@@ -362,20 +342,13 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -362,20 +342,13 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) {
r1, // api_function_address r1, // api_function_address
r3, // actual number of arguments r3, // 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,
&default_descriptor); &default_descriptor);
} }
void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ApiAccessorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor default_descriptor = static PlatformInterfaceDescriptor default_descriptor =
PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
...@@ -386,30 +359,19 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -386,30 +359,19 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
r2, // holder r2, // holder
r1, // api_function_address r1, // 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,
&default_descriptor); &default_descriptor);
} }
void MathRoundVariantDescriptor::Initialize(CallInterfaceDescriptorData* data) { void MathRoundVariantDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = { Register registers[] = {
cp, // context cp, // context
r1, // math rounding function r1, // math rounding function
r3, // vector slot id r3, // 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
......
...@@ -68,59 +68,61 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return x0; } ...@@ -68,59 +68,61 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return x0; }
const Register GrowArrayElementsDescriptor::KeyRegister() { return x3; } const Register GrowArrayElementsDescriptor::KeyRegister() { return x3; }
void FastNewClosureDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewClosureDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x2: function info // x2: function info
Register registers[] = {cp, x2}; Register registers[] = {cp, x2};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void FastNewContextDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x1: function // x1: function
Register registers[] = {cp, x1}; Register registers[] = {cp, x1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void ToNumberDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ToNumberDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x0: value // x0: value
Register registers[] = {cp, x0}; Register registers[] = {cp, x0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void NumberToStringDescriptor::Initialize(CallInterfaceDescriptorData* data) { void NumberToStringDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x0: value // x0: value
Register registers[] = {cp, x0}; Register registers[] = {cp, x0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void TypeofDescriptor::Initialize(CallInterfaceDescriptorData* data) { void TypeofDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, x3}; Register registers[] = {cp, x3};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void FastCloneShallowArrayDescriptor::Initialize( void FastCloneShallowArrayDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x3: array literals array // x3: array literals array
// x2: array literal index // x2: array literal index
// x1: constant elements // x1: constant elements
Register registers[] = {cp, x3, x2, x1}; Register registers[] = {cp, x3, x2, x1};
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) {
// cp: context // cp: context
// x3: object literals array // x3: object literals array
...@@ -128,71 +130,62 @@ void FastCloneShallowObjectDescriptor::Initialize( ...@@ -128,71 +130,62 @@ void FastCloneShallowObjectDescriptor::Initialize(
// x1: constant properties // x1: constant properties
// x0: object literal flags // x0: object literal flags
Register registers[] = {cp, x3, x2, x1, x0}; Register registers[] = {cp, x3, x2, x1, x0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CreateAllocationSiteDescriptor::Initialize( void CreateAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x2: feedback vector // x2: feedback vector
// x3: call feedback slot // x3: call feedback slot
Register registers[] = {cp, x2, x3}; Register registers[] = {cp, x2, x3};
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) {
// cp: context // cp: context
// x2: feedback vector // x2: feedback vector
// x3: call feedback slot // x3: call feedback slot
// x1: tagged value to put in the weak cell // x1: tagged value to put in the weak cell
Register registers[] = {cp, x2, x3, x1}; Register registers[] = {cp, x2, x3, x1};
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[] = {cp, x3, x0}; Register registers[] = {cp, x3, x0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CallFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallFunctionDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// x1 function the function to call // x1 function the function to call
Register registers[] = {cp, x1}; Register registers[] = {cp, x1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CallFunctionWithFeedbackDescriptor::Initialize( void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, x1, x3}; Register registers[] = {cp, x1, x3};
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[] = {cp, x1, x3, x2}; Register registers[] = {cp, x1, x3, x2};
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) {
// x0 : number of arguments // x0 : number of arguments
// x1 : the function to call // x1 : the function to call
// x2 : feedback vector // x2 : feedback vector
...@@ -200,136 +193,137 @@ void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -200,136 +193,137 @@ 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[] = {cp, x0, x1, x2}; Register registers[] = {cp, x0, x1, x2};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void RegExpConstructResultDescriptor::Initialize( void RegExpConstructResultDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x2: length // x2: length
// x1: index (of last match) // x1: index (of last match)
// x0: string // x0: string
Register registers[] = {cp, x2, x1, x0}; Register registers[] = {cp, x2, x1, x0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void TransitionElementsKindDescriptor::Initialize( void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x0: value (js_array) // x0: value (js_array)
// x1: to_map // x1: to_map
Register registers[] = {cp, x0, x1}; Register registers[] = {cp, x0, x1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void AllocateHeapNumberDescriptor::Initialize( void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// cp: context // cp: context
Register registers[] = {cp}; Register registers[] = {cp};
data->Initialize(arraysize(registers), registers, nullptr); data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
} }
void ArrayConstructorConstantArgCountDescriptor::Initialize( void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x1: function // x1: function
// x2: allocation site with elements kind // x2: allocation site with elements kind
// x0: number of arguments to the constructor function // x0: number of arguments to the constructor function
Register registers[] = {cp, x1, x2}; Register registers[] = {cp, x1, x2};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
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[] = {cp, x1, x2, x0}; Register registers[] = {cp, x1, x2, x0};
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) {
// cp: context // cp: context
// x1: constructor function // x1: constructor function
// x0: number of arguments to the constructor function // x0: number of arguments to the constructor function
Register registers[] = {cp, x1}; Register registers[] = {cp, x1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
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[] = {cp, x1, x0}; Register registers[] = {cp, x1, x0};
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) {
// cp: context // cp: context
// x1: left operand // x1: left operand
// x0: right operand // x0: right operand
Register registers[] = {cp, x1, x0}; Register registers[] = {cp, x1, x0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CompareNilDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CompareNilDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x0: value to compare // x0: value to compare
Register registers[] = {cp, x0}; Register registers[] = {cp, x0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void ToBooleanDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ToBooleanDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x0: value // x0: value
Register registers[] = {cp, x0}; Register registers[] = {cp, x0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void BinaryOpDescriptor::Initialize(CallInterfaceDescriptorData* data) { void BinaryOpDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x1: left operand // x1: left operand
// x0: right operand // x0: right operand
Register registers[] = {cp, x1, x0}; Register registers[] = {cp, x1, x0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void BinaryOpWithAllocationSiteDescriptor::Initialize( void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x2: allocation site // x2: allocation site
// x1: left operand // x1: left operand
// x0: right operand // x0: right operand
Register registers[] = {cp, x2, x1, x0}; Register registers[] = {cp, x2, x1, x0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void StringAddDescriptor::Initialize(CallInterfaceDescriptorData* data) { void StringAddDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// cp: context // cp: context
// x1: left operand // x1: left operand
// x0: right operand // x0: right operand
Register registers[] = {cp, x1, x0}; Register registers[] = {cp, x1, x0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void KeyedDescriptor::Initialize(CallInterfaceDescriptorData* data) { void KeyedDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor noInlineDescriptor = static PlatformInterfaceDescriptor noInlineDescriptor =
PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
...@@ -337,16 +331,13 @@ void KeyedDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -337,16 +331,13 @@ void KeyedDescriptor::Initialize(CallInterfaceDescriptorData* data) {
cp, // context cp, // context
x2, // key x2, // key
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers,
Representation::Tagged(), // context
Representation::Tagged(), // key
};
data->Initialize(arraysize(registers), registers, representations,
&noInlineDescriptor); &noInlineDescriptor);
} }
void NamedDescriptor::Initialize(CallInterfaceDescriptorData* data) { void NamedDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor noInlineDescriptor = static PlatformInterfaceDescriptor noInlineDescriptor =
PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
...@@ -354,16 +345,13 @@ void NamedDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -354,16 +345,13 @@ void NamedDescriptor::Initialize(CallInterfaceDescriptorData* data) {
cp, // context cp, // context
x2, // name x2, // name
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers,
Representation::Tagged(), // context
Representation::Tagged(), // name
};
data->Initialize(arraysize(registers), registers, representations,
&noInlineDescriptor); &noInlineDescriptor);
} }
void CallHandlerDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallHandlerDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor default_descriptor = static PlatformInterfaceDescriptor default_descriptor =
PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
...@@ -371,16 +359,13 @@ void CallHandlerDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -371,16 +359,13 @@ void CallHandlerDescriptor::Initialize(CallInterfaceDescriptorData* data) {
cp, // context cp, // context
x0, // receiver x0, // receiver
}; };
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers,
Representation::Tagged(), // context
Representation::Tagged(), // receiver
};
data->Initialize(arraysize(registers), registers, representations,
&default_descriptor); &default_descriptor);
} }
void ArgumentAdaptorDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor default_descriptor = static PlatformInterfaceDescriptor default_descriptor =
PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
...@@ -390,18 +375,13 @@ void ArgumentAdaptorDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -390,18 +375,13 @@ void ArgumentAdaptorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
x0, // actual number of arguments x0, // actual number of arguments
x2, // expected number of arguments x2, // 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,
&default_descriptor); &default_descriptor);
} }
void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ApiFunctionDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor default_descriptor = static PlatformInterfaceDescriptor default_descriptor =
PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
...@@ -413,20 +393,13 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -413,20 +393,13 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) {
x1, // api_function_address x1, // api_function_address
x3, // actual number of arguments x3, // 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,
&default_descriptor); &default_descriptor);
} }
void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ApiAccessorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
static PlatformInterfaceDescriptor default_descriptor = static PlatformInterfaceDescriptor default_descriptor =
PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
...@@ -437,30 +410,19 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -437,30 +410,19 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
x2, // holder x2, // holder
x1, // api_function_address x1, // 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,
&default_descriptor); &default_descriptor);
} }
void MathRoundVariantDescriptor::Initialize(CallInterfaceDescriptorData* data) { void MathRoundVariantDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = { Register registers[] = {
cp, // context cp, // context
x1, // math rounding function x1, // math rounding function
x3, // vector slot id x3, // 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
......
...@@ -136,7 +136,8 @@ bool CodeStubGraphBuilderBase::BuildGraph() { ...@@ -136,7 +136,8 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
bool runtime_stack_params = descriptor_.stack_parameter_count().is_valid(); bool runtime_stack_params = descriptor_.stack_parameter_count().is_valid();
HInstruction* stack_parameter_count = NULL; HInstruction* stack_parameter_count = NULL;
for (int i = 0; i < param_count; ++i) { for (int i = 0; i < param_count; ++i) {
Representation r = descriptor_.GetEnvironmentParameterRepresentation(i); Representation r =
RepresentationFromType(descriptor_.GetEnvironmentParameterType(i));
HParameter* param = Add<HParameter>(i, HParameter* param = Add<HParameter>(i,
HParameter::REGISTER_PARAMETER, r); HParameter::REGISTER_PARAMETER, r);
start_environment->Bind(i, param); start_environment->Bind(i, param);
......
...@@ -502,6 +502,7 @@ Handle<Code> TurboFanCodeStub::GenerateCode() { ...@@ -502,6 +502,7 @@ Handle<Code> TurboFanCodeStub::GenerateCode() {
// Build a "hybrid" CompilationInfo for a JSFunction/CodeStub pair. // Build a "hybrid" CompilationInfo for a JSFunction/CodeStub pair.
ParseInfo parse_info(&zone, inner); ParseInfo parse_info(&zone, inner);
CompilationInfo info(&parse_info); CompilationInfo info(&parse_info);
info.SetFunctionType(GetCallInterfaceDescriptor().GetFunctionType());
info.SetStub(this); info.SetStub(this);
return info.GenerateCodeStub(); return info.GenerateCodeStub();
} }
...@@ -1046,5 +1047,21 @@ InternalArrayConstructorStub::InternalArrayConstructorStub( ...@@ -1046,5 +1047,21 @@ InternalArrayConstructorStub::InternalArrayConstructorStub(
} }
Representation RepresentationFromType(Type* type) {
if (type->Is(Type::UntaggedSigned()) || type->Is(Type::UntaggedUnsigned())) {
return Representation::Integer32();
}
if (type->Is(Type::TaggedSigned())) {
return Representation::Smi();
}
if (type->Is(Type::UntaggedPointer())) {
return Representation::External();
}
DCHECK(!type->Is(Type::Untagged()));
return Representation::Tagged();
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
...@@ -431,8 +431,8 @@ class CodeStubDescriptor { ...@@ -431,8 +431,8 @@ class CodeStubDescriptor {
return call_descriptor().GetEnvironmentParameterCount(); return call_descriptor().GetEnvironmentParameterCount();
} }
Representation GetEnvironmentParameterRepresentation(int index) const { Type* GetEnvironmentParameterType(int index) const {
return call_descriptor().GetEnvironmentParameterRepresentation(index); return call_descriptor().GetEnvironmentParameterType(index);
} }
ExternalReference miss_handler() const { ExternalReference miss_handler() const {
...@@ -2963,6 +2963,8 @@ class StringCompareStub : public PlatformCodeStub { ...@@ -2963,6 +2963,8 @@ class StringCompareStub : public PlatformCodeStub {
#undef DEFINE_HYDROGEN_CODE_STUB #undef DEFINE_HYDROGEN_CODE_STUB
#undef DEFINE_CODE_STUB #undef DEFINE_CODE_STUB
#undef DEFINE_CODE_STUB_BASE #undef DEFINE_CODE_STUB_BASE
extern Representation RepresentationFromType(Type* type);
} } // namespace v8::internal } } // namespace v8::internal
#endif // V8_CODE_STUBS_H_ #endif // V8_CODE_STUBS_H_
...@@ -153,7 +153,8 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info, CodeStub* code_stub, ...@@ -153,7 +153,8 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info, CodeStub* code_stub,
opt_count_(has_shared_info() ? shared_info()->opt_count() : 0), opt_count_(has_shared_info() ? shared_info()->opt_count() : 0),
parameter_count_(0), parameter_count_(0),
optimization_id_(-1), optimization_id_(-1),
osr_expr_stack_height_(0) {} osr_expr_stack_height_(0),
function_type_(nullptr) {}
CompilationInfo::~CompilationInfo() { CompilationInfo::~CompilationInfo() {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "src/ast.h" #include "src/ast.h"
#include "src/bailout-reason.h" #include "src/bailout-reason.h"
#include "src/compilation-dependencies.h" #include "src/compilation-dependencies.h"
#include "src/signature.h"
#include "src/zone.h" #include "src/zone.h"
namespace v8 { namespace v8 {
...@@ -288,6 +289,11 @@ class CompilationInfo { ...@@ -288,6 +289,11 @@ class CompilationInfo {
optimization_id_ = isolate()->NextOptimizationId(); optimization_id_ = isolate()->NextOptimizationId();
} }
void SetFunctionType(Type::FunctionType* function_type) {
function_type_ = function_type;
}
Type::FunctionType* function_type() const { return function_type_; }
void SetStub(CodeStub* code_stub) { void SetStub(CodeStub* code_stub) {
SetMode(STUB); SetMode(STUB);
code_stub_ = code_stub; code_stub_ = code_stub;
...@@ -479,6 +485,8 @@ class CompilationInfo { ...@@ -479,6 +485,8 @@ class CompilationInfo {
int osr_expr_stack_height_; int osr_expr_stack_height_;
Type::FunctionType* function_type_;
DISALLOW_COPY_AND_ASSIGN(CompilationInfo); DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
}; };
......
...@@ -165,7 +165,7 @@ class LinkageHelper { ...@@ -165,7 +165,7 @@ class LinkageHelper {
// The first parameters go in registers. // The first parameters go in registers.
Register reg = descriptor.GetEnvironmentParameterRegister(i); Register reg = descriptor.GetEnvironmentParameterRegister(i);
Representation rep = Representation rep =
descriptor.GetEnvironmentParameterRepresentation(i); RepresentationFromType(descriptor.GetEnvironmentParameterType(i));
locations.AddParam(regloc(reg)); locations.AddParam(regloc(reg));
types.AddParam(reptyp(rep)); types.AddParam(reptyp(rep));
} else { } else {
......
...@@ -1050,7 +1050,8 @@ Handle<Code> Pipeline::GenerateCode() { ...@@ -1050,7 +1050,8 @@ Handle<Code> Pipeline::GenerateCode() {
SmartPointer<Typer> typer; SmartPointer<Typer> typer;
if (info()->is_typing_enabled()) { if (info()->is_typing_enabled()) {
// Type the graph. // Type the graph.
typer.Reset(new Typer(isolate(), data.graph(), info()->context())); typer.Reset(new Typer(isolate(), data.graph(), info()->function_type(),
info()->context()));
Run<TyperPhase>(typer.get()); Run<TyperPhase>(typer.get());
RunPrintAndVerify("Typed"); RunPrintAndVerify("Typed");
} }
......
...@@ -176,9 +176,11 @@ class Typer::Decorator final : public GraphDecorator { ...@@ -176,9 +176,11 @@ class Typer::Decorator final : public GraphDecorator {
}; };
Typer::Typer(Isolate* isolate, Graph* graph, MaybeHandle<Context> context) Typer::Typer(Isolate* isolate, Graph* graph, Type::FunctionType* function_type,
MaybeHandle<Context> context)
: isolate_(isolate), : isolate_(isolate),
graph_(graph), graph_(graph),
function_type_(function_type),
context_(context), context_(context),
decorator_(NULL), decorator_(NULL),
cache_(new (graph->zone()) LazyTypeCache(isolate, graph->zone())) { cache_(new (graph->zone()) LazyTypeCache(isolate, graph->zone())) {
...@@ -634,6 +636,12 @@ Bounds Typer::Visitor::TypeIfException(Node* node) { ...@@ -634,6 +636,12 @@ Bounds Typer::Visitor::TypeIfException(Node* node) {
Bounds Typer::Visitor::TypeParameter(Node* node) { Bounds Typer::Visitor::TypeParameter(Node* node) {
int param = OpParameter<int>(node);
Type::FunctionType* function_type = typer_->function_type();
if (function_type != nullptr && param >= 0 &&
param < static_cast<int>(function_type->Arity())) {
return Bounds(Type::None(), function_type->Parameter(param));
}
return Bounds::Unbounded(zone()); return Bounds::Unbounded(zone());
} }
......
...@@ -18,7 +18,8 @@ class LazyTypeCache; ...@@ -18,7 +18,8 @@ class LazyTypeCache;
class Typer { class Typer {
public: public:
Typer(Isolate* isolate, Graph* graph, MaybeHandle<Context> context); Typer(Isolate* isolate, Graph* graph, Type::FunctionType* function_type,
MaybeHandle<Context> context);
~Typer(); ~Typer();
void Run(); void Run();
...@@ -33,9 +34,11 @@ class Typer { ...@@ -33,9 +34,11 @@ class Typer {
MaybeHandle<Context> context() const { return context_; } MaybeHandle<Context> context() const { return context_; }
Zone* zone() const { return graph()->zone(); } Zone* zone() const { return graph()->zone(); }
Isolate* isolate() const { return isolate_; } Isolate* isolate() const { return isolate_; }
Type::FunctionType* function_type() const { return function_type_; }
Isolate* const isolate_; Isolate* const isolate_;
Graph* const graph_; Graph* const graph_;
Type::FunctionType* function_type_;
MaybeHandle<Context> const context_; MaybeHandle<Context> const context_;
Decorator* decorator_; Decorator* decorator_;
......
...@@ -2276,7 +2276,7 @@ class HCallWithDescriptor final : public HInstruction { ...@@ -2276,7 +2276,7 @@ class HCallWithDescriptor final : public HInstruction {
} else { } else {
int par_index = index - 1; int par_index = index - 1;
DCHECK(par_index < descriptor_.GetEnvironmentLength()); DCHECK(par_index < descriptor_.GetEnvironmentLength());
return descriptor_.GetParameterRepresentation(par_index); return RepresentationFromType(descriptor_.GetParameterType(par_index));
} }
} }
......
...@@ -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
......
...@@ -9,9 +9,44 @@ ...@@ -9,9 +9,44 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
void CallInterfaceDescriptorData::Initialize( namespace {
// Constructors for common combined semantic and representation types.
Type* SmiType() {
return Type::Intersect(Type::SignedSmall(), Type::TaggedSigned());
}
Type* UntaggedSigned32() {
return Type::Intersect(Type::Signed32(), Type::UntaggedSigned32());
}
Type* AnyTagged() {
return Type::Intersect(
Type::Any(), Type::Union(Type::TaggedPointer(), Type::TaggedSigned()));
}
Type* ExternalPointer() {
return Type::Intersect(Type::Internal(), Type::UntaggedPointer());
}
}
Type::FunctionType* CallInterfaceDescriptor::BuildDefaultFunctionType(
Isolate* isolate, int parameter_count) {
Type::FunctionType* function =
Type::FunctionType::New(AnyTagged(), Type::Undefined(), parameter_count,
isolate->interface_descriptor_zone());
while (parameter_count-- != 0) {
function->InitParameter(parameter_count, AnyTagged());
}
return function;
}
void CallInterfaceDescriptorData::InitializePlatformSpecific(
int register_parameter_count, Register* registers, int register_parameter_count, Register* registers,
Representation* register_param_representations,
PlatformInterfaceDescriptor* platform_descriptor) { PlatformInterfaceDescriptor* platform_descriptor) {
platform_specific_descriptor_ = platform_descriptor; platform_specific_descriptor_ = platform_descriptor;
register_param_count_ = register_parameter_count; register_param_count_ = register_parameter_count;
...@@ -25,23 +60,8 @@ void CallInterfaceDescriptorData::Initialize( ...@@ -25,23 +60,8 @@ void CallInterfaceDescriptorData::Initialize(
for (int i = 0; i < register_parameter_count; i++) { for (int i = 0; i < register_parameter_count; i++) {
register_params_[i] = registers[i]; register_params_[i] = registers[i];
} }
// If a representations array is specified, then the descriptor owns that as
// well.
if (register_param_representations != NULL) {
register_param_representations_.Reset(
NewArray<Representation>(register_parameter_count));
for (int i = 0; i < register_parameter_count; i++) {
// If there is a context register, the representation must be tagged.
DCHECK(
i != 0 ||
register_param_representations[i].Equals(Representation::Tagged()));
register_param_representations_[i] = register_param_representations[i];
}
}
} }
const char* CallInterfaceDescriptor::DebugName(Isolate* isolate) const { const char* CallInterfaceDescriptor::DebugName(Isolate* isolate) const {
CallInterfaceDescriptorData* start = isolate->call_descriptor_data(0); CallInterfaceDescriptorData* start = isolate->call_descriptor_data(0);
size_t index = data_ - start; size_t index = data_ - start;
...@@ -60,116 +80,319 @@ const char* CallInterfaceDescriptor::DebugName(Isolate* isolate) const { ...@@ -60,116 +80,319 @@ const char* CallInterfaceDescriptor::DebugName(Isolate* isolate) const {
} }
void LoadDescriptor::Initialize(CallInterfaceDescriptorData* data) { Type::FunctionType* LoadDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 4, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, AnyTagged());
function->InitParameter(2, AnyTagged());
function->InitParameter(3, SmiType());
return function;
}
void LoadDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(),
SlotRegister()}; SlotRegister()};
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), Representation::Tagged(),
Representation::Tagged(), Representation::Smi()};
data->Initialize(arraysize(registers), registers, representations);
} }
void StoreDescriptor::Initialize(CallInterfaceDescriptorData* data) { void StoreDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(),
ValueRegister()}; ValueRegister()};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void StoreTransitionDescriptor::Initialize(CallInterfaceDescriptorData* data) { void StoreTransitionDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(),
ValueRegister(), MapRegister()}; ValueRegister(), MapRegister()};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void ElementTransitionAndStoreDescriptor::Initialize( void ElementTransitionAndStoreDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ValueRegister(), MapRegister(), Register registers[] = {ContextRegister(), ValueRegister(), MapRegister(),
NameRegister(), ReceiverRegister()}; NameRegister(), ReceiverRegister()};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void InstanceofDescriptor::Initialize(CallInterfaceDescriptorData* data) { void InstanceofDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), left(), right()}; Register registers[] = {ContextRegister(), left(), right()};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void MathPowTaggedDescriptor::Initialize(CallInterfaceDescriptorData* data) { void MathPowTaggedDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), exponent()}; Register registers[] = {ContextRegister(), exponent()};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void MathPowIntegerDescriptor::Initialize(CallInterfaceDescriptorData* data) { void MathPowIntegerDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), exponent()}; Register registers[] = {ContextRegister(), exponent()};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
}
Type::FunctionType*
LoadWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 5, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, AnyTagged());
function->InitParameter(2, AnyTagged());
function->InitParameter(3, SmiType());
function->InitParameter(4, AnyTagged());
return function;
} }
void LoadWithVectorDescriptor::Initialize(CallInterfaceDescriptorData* data) { void LoadWithVectorDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(),
SlotRegister(), VectorRegister()}; SlotRegister(), VectorRegister()};
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), Representation::Tagged(), }
Representation::Tagged(), Representation::Smi(),
Representation::Tagged()};
data->Initialize(arraysize(registers), registers, representations); Type::FunctionType*
VectorStoreICDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 6, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, AnyTagged());
function->InitParameter(2, AnyTagged());
function->InitParameter(3, AnyTagged());
function->InitParameter(4, SmiType());
function->InitParameter(5, AnyTagged());
return function;
} }
void VectorStoreICDescriptor::Initialize(CallInterfaceDescriptorData* data) { void VectorStoreICDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ReceiverRegister(), Register registers[] = {ContextRegister(), ReceiverRegister(),
NameRegister(), ValueRegister(), NameRegister(), ValueRegister(),
SlotRegister(), VectorRegister()}; SlotRegister(), VectorRegister()};
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), Representation::Tagged(), }
Representation::Tagged(), Representation::Tagged(),
Representation::Smi(), Representation::Tagged()};
data->Initialize(arraysize(registers), registers, representations); Type::FunctionType*
VectorStoreICTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 5, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, AnyTagged());
function->InitParameter(2, AnyTagged());
function->InitParameter(3, AnyTagged());
function->InitParameter(4, SmiType());
return function;
} }
void VectorStoreICTrampolineDescriptor::Initialize( void VectorStoreICTrampolineDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(),
ValueRegister(), SlotRegister()}; ValueRegister(), SlotRegister()};
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), Representation::Tagged(),
Representation::Tagged(), Representation::Tagged(),
Representation::Smi()};
data->Initialize(arraysize(registers), registers, representations);
} }
void ApiGetterDescriptor::Initialize(CallInterfaceDescriptorData* data) { Type::FunctionType*
ApiGetterDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 2, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, ExternalPointer());
return function;
}
void ApiGetterDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), function_address()}; Register registers[] = {ContextRegister(), function_address()};
Representation representations[] = {Representation::Tagged(), data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::External()};
data->Initialize(arraysize(registers), registers, representations);
} }
void ArgumentsAccessReadDescriptor::Initialize( void ArgumentsAccessReadDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), index(), parameter_count()}; Register registers[] = {ContextRegister(), index(), parameter_count()};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void ContextOnlyDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ContextOnlyDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister()}; Register registers[] = {ContextRegister()};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void GrowArrayElementsDescriptor::Initialize( void GrowArrayElementsDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ObjectRegister(), KeyRegister()}; Register registers[] = {ContextRegister(), ObjectRegister(), KeyRegister()};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
}
Type::FunctionType*
FastCloneShallowArrayDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 4, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, AnyTagged());
function->InitParameter(2, SmiType());
function->InitParameter(3, AnyTagged());
return function;
}
Type::FunctionType*
CreateAllocationSiteDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 3, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, AnyTagged());
function->InitParameter(2, SmiType());
return function;
}
Type::FunctionType*
CreateWeakCellDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 4, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, AnyTagged());
function->InitParameter(2, SmiType());
function->InitParameter(3, AnyTagged());
return function;
}
Type::FunctionType*
CallFunctionWithFeedbackDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 3, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, Type::Receiver()); // JSFunction
function->InitParameter(2, SmiType());
return function;
}
Type::FunctionType* CallFunctionWithFeedbackAndVectorDescriptor::
BuildCallInterfaceDescriptorFunctionType(Isolate* isolate,
int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 4, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, Type::Receiver()); // JSFunction
function->InitParameter(2, SmiType());
function->InitParameter(3, AnyTagged());
return function;
} }
Type::FunctionType*
ArrayConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 4, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, Type::Receiver()); // JSFunction
function->InitParameter(2, AnyTagged());
function->InitParameter(3, UntaggedSigned32());
return function;
}
Type::FunctionType*
InternalArrayConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 3, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged());
function->InitParameter(1, Type::Receiver()); // JSFunction
function->InitParameter(2, UntaggedSigned32());
return function;
}
Type::FunctionType*
ArgumentAdaptorDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 4, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged()); // context
function->InitParameter(1, Type::Receiver()); // JSFunction
function->InitParameter(2, UntaggedSigned32()); // actual number of arguments
function->InitParameter(3,
UntaggedSigned32()); // expected number of arguments
return function;
}
Type::FunctionType*
ApiFunctionDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 6, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged()); // context
function->InitParameter(1, AnyTagged()); // callee
function->InitParameter(2, AnyTagged()); // call_data
function->InitParameter(3, AnyTagged()); // holder
function->InitParameter(4, ExternalPointer()); // api_function_address
function->InitParameter(5, UntaggedSigned32()); // actual number of arguments
return function;
}
Type::FunctionType*
ApiAccessorDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 5, isolate->interface_descriptor_zone());
function->InitParameter(0, AnyTagged()); // context
function->InitParameter(1, AnyTagged()); // callee
function->InitParameter(2, AnyTagged()); // call_data
function->InitParameter(3, AnyTagged()); // holder
function->InitParameter(4, ExternalPointer()); // api_function_address
return function;
}
Type::FunctionType*
MathRoundVariantDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
AnyTagged(), Type::Undefined(), 3, isolate->interface_descriptor_zone());
function->InitParameter(0, Type::Receiver());
function->InitParameter(1, SmiType());
function->InitParameter(2, AnyTagged());
return function;
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
...@@ -59,24 +59,33 @@ class PlatformInterfaceDescriptor; ...@@ -59,24 +59,33 @@ class PlatformInterfaceDescriptor;
V(StoreArrayLiteralElement) \ V(StoreArrayLiteralElement) \
V(MathPowTagged) \ V(MathPowTagged) \
V(MathPowInteger) \ V(MathPowInteger) \
V(MathRoundVariant) \
V(ContextOnly) \ V(ContextOnly) \
V(GrowArrayElements) V(GrowArrayElements) \
V(MathRoundVariant)
class CallInterfaceDescriptorData { class CallInterfaceDescriptorData {
public: public:
CallInterfaceDescriptorData() : register_param_count_(-1) {} CallInterfaceDescriptorData()
: stack_paramater_count_(-1),
register_param_count_(-1),
function_type_(nullptr) {}
// A copy of the passed in registers and param_representations is made // A copy of the passed in registers and param_representations is made
// and owned by the CallInterfaceDescriptorData. // and owned by the CallInterfaceDescriptorData.
void InitializePlatformIndependent(int stack_paramater_count,
Type::FunctionType* function_type) {
function_type_ = function_type;
stack_paramater_count_ = stack_paramater_count;
}
// TODO(mvstanton): Instead of taking parallel arrays register and // TODO(mvstanton): Instead of taking parallel arrays register and
// param_representations, how about a struct that puts the representation // param_representations, how about a struct that puts the representation
// and register side by side (eg, RegRep(r1, Representation::Tagged()). // and register side by side (eg, RegRep(r1, Representation::Tagged()).
// The same should go for the CodeStubDescriptor class. // The same should go for the CodeStubDescriptor class.
void Initialize(int register_parameter_count, Register* registers, void InitializePlatformSpecific(
Representation* param_representations, int register_parameter_count, Register* registers,
PlatformInterfaceDescriptor* platform_descriptor = NULL); PlatformInterfaceDescriptor* platform_descriptor = NULL);
bool IsInitialized() const { return register_param_count_ >= 0; } bool IsInitialized() const { return register_param_count_ >= 0; }
...@@ -84,17 +93,17 @@ class CallInterfaceDescriptorData { ...@@ -84,17 +93,17 @@ class CallInterfaceDescriptorData {
int register_param_count() const { return register_param_count_; } int register_param_count() const { return register_param_count_; }
Register register_param(int index) const { return register_params_[index]; } Register register_param(int index) const { return register_params_[index]; }
Register* register_params() const { return register_params_.get(); } Register* register_params() const { return register_params_.get(); }
Representation register_param_representation(int index) const { Type* register_param_type(int index) const {
return register_param_representations_[index]; return function_type_->Parameter(index);
}
Representation* register_param_representations() const {
return register_param_representations_.get();
} }
PlatformInterfaceDescriptor* platform_specific_descriptor() const { PlatformInterfaceDescriptor* platform_specific_descriptor() const {
return platform_specific_descriptor_; return platform_specific_descriptor_;
} }
Type::FunctionType* function_type() const { return function_type_; }
private: private:
int stack_paramater_count_;
int register_param_count_; int register_param_count_;
// The Register params are allocated dynamically by the // The Register params are allocated dynamically by the
...@@ -102,11 +111,9 @@ class CallInterfaceDescriptorData { ...@@ -102,11 +111,9 @@ class CallInterfaceDescriptorData {
// arrays of Registers cause creation of runtime static initializers // arrays of Registers cause creation of runtime static initializers
// which we don't want. // which we don't want.
SmartArrayPointer<Register> register_params_; SmartArrayPointer<Register> register_params_;
// Specifies Representations for the stub's parameter. Points to an array of
// Representations of the same length of the numbers of parameters to the // Specifies types for parameters and return
// stub, or if NULL (the default value), Representation of each parameter Type::FunctionType* function_type_;
// assumed to be Tagged().
SmartArrayPointer<Representation> register_param_representations_;
PlatformInterfaceDescriptor* platform_specific_descriptor_; PlatformInterfaceDescriptor* platform_specific_descriptor_;
...@@ -128,6 +135,7 @@ class CallDescriptors { ...@@ -128,6 +135,7 @@ class CallDescriptors {
class CallInterfaceDescriptor { class CallInterfaceDescriptor {
public: public:
CallInterfaceDescriptor() : data_(NULL) {} CallInterfaceDescriptor() : data_(NULL) {}
virtual ~CallInterfaceDescriptor() {}
CallInterfaceDescriptor(Isolate* isolate, CallDescriptors::Key key) CallInterfaceDescriptor(Isolate* isolate, CallDescriptors::Key key)
: data_(isolate->call_descriptor_data(key)) {} : data_(isolate->call_descriptor_data(key)) {}
...@@ -142,13 +150,9 @@ class CallInterfaceDescriptor { ...@@ -142,13 +150,9 @@ class CallInterfaceDescriptor {
return data()->register_param(index); return data()->register_param(index);
} }
Representation GetParameterRepresentation(int index) const { Type* GetParameterType(int index) const {
DCHECK(index < data()->register_param_count()); DCHECK(index < data()->register_param_count());
if (data()->register_param_representations() == NULL) { return data()->register_param_type(index);
return Representation::Tagged();
}
return data()->register_param_representation(index);
} }
// "Environment" versions of parameter functions. The first register // "Environment" versions of parameter functions. The first register
...@@ -161,8 +165,8 @@ class CallInterfaceDescriptor { ...@@ -161,8 +165,8 @@ class CallInterfaceDescriptor {
return GetParameterRegister(index + 1); return GetParameterRegister(index + 1);
} }
Representation GetEnvironmentParameterRepresentation(int index) const { Type* GetEnvironmentParameterType(int index) const {
return GetParameterRepresentation(index + 1); return GetParameterType(index + 1);
} }
// Some platforms have extra information to associate with the descriptor. // Some platforms have extra information to associate with the descriptor.
...@@ -170,13 +174,40 @@ class CallInterfaceDescriptor { ...@@ -170,13 +174,40 @@ class CallInterfaceDescriptor {
return data()->platform_specific_descriptor(); return data()->platform_specific_descriptor();
} }
Type::FunctionType* GetFunctionType() const {
return data()->function_type();
}
static const Register ContextRegister(); static const Register ContextRegister();
const char* DebugName(Isolate* isolate) const; const char* DebugName(Isolate* isolate) const;
static Type::FunctionType* BuildDefaultFunctionType(Isolate* isolate,
int paramater_count);
protected: protected:
const CallInterfaceDescriptorData* data() const { return data_; } const CallInterfaceDescriptorData* data() const { return data_; }
virtual Type::FunctionType* BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int register_param_count) {
return BuildDefaultFunctionType(isolate, register_param_count);
}
virtual void InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
UNREACHABLE();
}
void Initialize(Isolate* isolate, CallDescriptors::Key key) {
if (!data()->IsInitialized()) {
CallInterfaceDescriptorData* d = isolate->call_descriptor_data(key);
InitializePlatformSpecific(d);
Type::FunctionType* function_type =
BuildCallInterfaceDescriptorFunctionType(isolate,
d->register_param_count());
d->InitializePlatformIndependent(0, function_type);
}
}
private: private:
const CallInterfaceDescriptorData* data_; const CallInterfaceDescriptorData* data_;
}; };
...@@ -184,22 +215,29 @@ class CallInterfaceDescriptor { ...@@ -184,22 +215,29 @@ class CallInterfaceDescriptor {
#define DECLARE_DESCRIPTOR(name, base) \ #define DECLARE_DESCRIPTOR(name, base) \
explicit name(Isolate* isolate) : base(isolate, key()) { \ explicit name(Isolate* isolate) : base(isolate, key()) { \
if (!data()->IsInitialized()) \ Initialize(isolate, key()); \
Initialize(isolate->call_descriptor_data(key())); \
} \ } \
\ \
protected: \ protected: \
void Initialize(CallInterfaceDescriptorData* data); \ void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \
name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \ name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \
\ \
public: \ public: \
static inline CallDescriptors::Key key(); static inline CallDescriptors::Key key();
#define DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(name, base) \
DECLARE_DESCRIPTOR(name, base) \
protected: \
virtual Type::FunctionType* BuildCallInterfaceDescriptorFunctionType( \
Isolate* isolate, int register_param_count) override; \
\
public:
// LoadDescriptor is used by all stubs that implement Load/KeyedLoad ICs. // LoadDescriptor is used by all stubs that implement Load/KeyedLoad ICs.
class LoadDescriptor : public CallInterfaceDescriptor { class LoadDescriptor : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(LoadDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadDescriptor,
CallInterfaceDescriptor)
enum ParameterIndices { kReceiverIndex, kNameIndex, kSlotIndex }; enum ParameterIndices { kReceiverIndex, kNameIndex, kSlotIndex };
static const Register ReceiverRegister(); static const Register ReceiverRegister();
...@@ -260,7 +298,8 @@ class InstanceofDescriptor : public CallInterfaceDescriptor { ...@@ -260,7 +298,8 @@ class InstanceofDescriptor : public CallInterfaceDescriptor {
class VectorStoreICTrampolineDescriptor : public StoreDescriptor { class VectorStoreICTrampolineDescriptor : public StoreDescriptor {
public: public:
DECLARE_DESCRIPTOR(VectorStoreICTrampolineDescriptor, StoreDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
VectorStoreICTrampolineDescriptor, StoreDescriptor)
enum ParameterIndices { kReceiverIndex, kNameIndex, kValueIndex, kSlotIndex }; enum ParameterIndices { kReceiverIndex, kNameIndex, kValueIndex, kSlotIndex };
...@@ -270,7 +309,8 @@ class VectorStoreICTrampolineDescriptor : public StoreDescriptor { ...@@ -270,7 +309,8 @@ class VectorStoreICTrampolineDescriptor : public StoreDescriptor {
class VectorStoreICDescriptor : public VectorStoreICTrampolineDescriptor { class VectorStoreICDescriptor : public VectorStoreICTrampolineDescriptor {
public: public:
DECLARE_DESCRIPTOR(VectorStoreICDescriptor, VectorStoreICTrampolineDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
VectorStoreICDescriptor, VectorStoreICTrampolineDescriptor)
enum ParameterIndices { enum ParameterIndices {
kReceiverIndex, kReceiverIndex,
...@@ -286,7 +326,8 @@ class VectorStoreICDescriptor : public VectorStoreICTrampolineDescriptor { ...@@ -286,7 +326,8 @@ class VectorStoreICDescriptor : public VectorStoreICTrampolineDescriptor {
class LoadWithVectorDescriptor : public LoadDescriptor { class LoadWithVectorDescriptor : public LoadDescriptor {
public: public:
DECLARE_DESCRIPTOR(LoadWithVectorDescriptor, LoadDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadWithVectorDescriptor,
LoadDescriptor)
enum ParameterIndices { enum ParameterIndices {
kReceiverIndex, kReceiverIndex,
...@@ -331,7 +372,8 @@ class TypeofDescriptor : public CallInterfaceDescriptor { ...@@ -331,7 +372,8 @@ class TypeofDescriptor : public CallInterfaceDescriptor {
class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor { class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(FastCloneShallowArrayDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneShallowArrayDescriptor,
CallInterfaceDescriptor)
}; };
...@@ -343,7 +385,8 @@ class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor { ...@@ -343,7 +385,8 @@ class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor {
class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor { class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(CreateAllocationSiteDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateAllocationSiteDescriptor,
CallInterfaceDescriptor)
}; };
...@@ -356,7 +399,8 @@ class CreateWeakCellDescriptor : public CallInterfaceDescriptor { ...@@ -356,7 +399,8 @@ class CreateWeakCellDescriptor : public CallInterfaceDescriptor {
kParameterCount kParameterCount
}; };
DECLARE_DESCRIPTOR(CreateWeakCellDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateWeakCellDescriptor,
CallInterfaceDescriptor)
}; };
...@@ -368,16 +412,16 @@ class CallFunctionDescriptor : public CallInterfaceDescriptor { ...@@ -368,16 +412,16 @@ class CallFunctionDescriptor : public CallInterfaceDescriptor {
class CallFunctionWithFeedbackDescriptor : public CallInterfaceDescriptor { class CallFunctionWithFeedbackDescriptor : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(CallFunctionWithFeedbackDescriptor, DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
CallInterfaceDescriptor) CallFunctionWithFeedbackDescriptor, CallInterfaceDescriptor)
}; };
class CallFunctionWithFeedbackAndVectorDescriptor class CallFunctionWithFeedbackAndVectorDescriptor
: public CallInterfaceDescriptor { : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(CallFunctionWithFeedbackAndVectorDescriptor, DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
CallInterfaceDescriptor) CallFunctionWithFeedbackAndVectorDescriptor, CallInterfaceDescriptor)
}; };
...@@ -415,7 +459,8 @@ class ArrayConstructorConstantArgCountDescriptor ...@@ -415,7 +459,8 @@ class ArrayConstructorConstantArgCountDescriptor
class ArrayConstructorDescriptor : public CallInterfaceDescriptor { class ArrayConstructorDescriptor : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(ArrayConstructorDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor,
CallInterfaceDescriptor)
}; };
...@@ -429,8 +474,8 @@ class InternalArrayConstructorConstantArgCountDescriptor ...@@ -429,8 +474,8 @@ class InternalArrayConstructorConstantArgCountDescriptor
class InternalArrayConstructorDescriptor : public CallInterfaceDescriptor { class InternalArrayConstructorDescriptor : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(InternalArrayConstructorDescriptor, DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
CallInterfaceDescriptor) InternalArrayConstructorDescriptor, CallInterfaceDescriptor)
}; };
...@@ -491,25 +536,29 @@ class CallHandlerDescriptor : public CallInterfaceDescriptor { ...@@ -491,25 +536,29 @@ class CallHandlerDescriptor : public CallInterfaceDescriptor {
class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor { class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(ArgumentAdaptorDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArgumentAdaptorDescriptor,
CallInterfaceDescriptor)
}; };
class ApiFunctionDescriptor : public CallInterfaceDescriptor { class ApiFunctionDescriptor : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(ApiFunctionDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiFunctionDescriptor,
CallInterfaceDescriptor)
}; };
class ApiAccessorDescriptor : public CallInterfaceDescriptor { class ApiAccessorDescriptor : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(ApiAccessorDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiAccessorDescriptor,
CallInterfaceDescriptor)
}; };
class ApiGetterDescriptor : public CallInterfaceDescriptor { class ApiGetterDescriptor : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(ApiGetterDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiGetterDescriptor,
CallInterfaceDescriptor)
static const Register function_address(); static const Register function_address();
}; };
...@@ -549,7 +598,8 @@ class MathPowIntegerDescriptor : public CallInterfaceDescriptor { ...@@ -549,7 +598,8 @@ class MathPowIntegerDescriptor : public CallInterfaceDescriptor {
class MathRoundVariantDescriptor : public CallInterfaceDescriptor { class MathRoundVariantDescriptor : public CallInterfaceDescriptor {
public: public:
DECLARE_DESCRIPTOR(MathRoundVariantDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(MathRoundVariantDescriptor,
CallInterfaceDescriptor)
}; };
......
...@@ -886,6 +886,7 @@ class Isolate { ...@@ -886,6 +886,7 @@ class Isolate {
return handle_scope_implementer_; return handle_scope_implementer_;
} }
Zone* runtime_zone() { return &runtime_zone_; } Zone* runtime_zone() { return &runtime_zone_; }
Zone* interface_descriptor_zone() { return &interface_descriptor_zone_; }
UnicodeCache* unicode_cache() { UnicodeCache* unicode_cache() {
return unicode_cache_; return unicode_cache_;
...@@ -1271,6 +1272,7 @@ class Isolate { ...@@ -1271,6 +1272,7 @@ class Isolate {
HandleScopeImplementer* handle_scope_implementer_; HandleScopeImplementer* handle_scope_implementer_;
UnicodeCache* unicode_cache_; UnicodeCache* unicode_cache_;
Zone runtime_zone_; Zone runtime_zone_;
Zone interface_descriptor_zone_;
InnerPointerToCodeCache* inner_pointer_to_code_cache_; InnerPointerToCodeCache* inner_pointer_to_code_cache_;
GlobalHandles* global_handles_; GlobalHandles* global_handles_;
EternalHandles* eternal_handles_; EternalHandles* eternal_handles_;
......
...@@ -62,106 +62,99 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return a0; } ...@@ -62,106 +62,99 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return a0; }
const Register GrowArrayElementsDescriptor::KeyRegister() { return a3; } const Register GrowArrayElementsDescriptor::KeyRegister() { return a3; }
void FastNewClosureDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewClosureDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a2}; Register registers[] = {cp, a2};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void FastNewContextDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a1}; Register registers[] = {cp, a1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void ToNumberDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ToNumberDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a0}; Register registers[] = {cp, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void NumberToStringDescriptor::Initialize(CallInterfaceDescriptorData* data) { void NumberToStringDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a0}; Register registers[] = {cp, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void TypeofDescriptor::Initialize(CallInterfaceDescriptorData* data) { void TypeofDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a3}; Register registers[] = {cp, a3};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void FastCloneShallowArrayDescriptor::Initialize( void FastCloneShallowArrayDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a3, a2, a1}; Register registers[] = {cp, a3, a2, a1};
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[] = {cp, a3, a2, a1, a0}; Register registers[] = {cp, a3, a2, a1, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CreateAllocationSiteDescriptor::Initialize( void CreateAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a2, a3}; Register registers[] = {cp, a2, a3};
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[] = {cp, a2, a3, a1}; Register registers[] = {cp, a2, a3, a1};
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[] = {cp, a3, a0}; Register registers[] = {cp, a3, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CallFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallFunctionDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a1}; Register registers[] = {cp, a1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CallFunctionWithFeedbackDescriptor::Initialize( void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a1, a3}; Register registers[] = {cp, a1, a3};
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[] = {cp, a1, a3, a2}; Register registers[] = {cp, a1, a3, a2};
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) {
// a0 : number of arguments // a0 : number of arguments
// a1 : the function to call // a1 : the function to call
// a2 : feedback vector // a2 : feedback vector
...@@ -170,34 +163,34 @@ void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -170,34 +163,34 @@ 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[] = {cp, a0, a1, a2}; Register registers[] = {cp, a0, a1, a2};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void RegExpConstructResultDescriptor::Initialize( void RegExpConstructResultDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a2, a1, a0}; Register registers[] = {cp, a2, a1, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void TransitionElementsKindDescriptor::Initialize( void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a0, a1}; Register registers[] = {cp, a0, a1};
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
// cp -- context // cp -- context
Register registers[] = {cp}; Register registers[] = {cp};
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
// cp -- context // cp -- context
...@@ -205,136 +198,123 @@ void ArrayConstructorConstantArgCountDescriptor::Initialize( ...@@ -205,136 +198,123 @@ void ArrayConstructorConstantArgCountDescriptor::Initialize(
// a1 -- function // a1 -- function
// a2 -- allocation site with elements kind // a2 -- allocation site with elements kind
Register registers[] = {cp, a1, a2}; Register registers[] = {cp, a1, a2};
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[] = {cp, a1, a2, a0}; Register registers[] = {cp, a1, a2, a0};
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
// cp -- context // cp -- context
// a0 -- number of arguments // a0 -- number of arguments
// a1 -- constructor function // a1 -- constructor function
Register registers[] = {cp, a1}; Register registers[] = {cp, a1};
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[] = {cp, a1, a0}; Register registers[] = {cp, a1, a0};
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[] = {cp, a1, a0}; Register registers[] = {cp, a1, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CompareNilDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CompareNilDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a0}; Register registers[] = {cp, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void ToBooleanDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ToBooleanDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a0}; Register registers[] = {cp, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void BinaryOpDescriptor::Initialize(CallInterfaceDescriptorData* data) { void BinaryOpDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a1, a0}; Register registers[] = {cp, a1, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void BinaryOpWithAllocationSiteDescriptor::Initialize( void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a2, a1, a0}; Register registers[] = {cp, a2, a1, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void StringAddDescriptor::Initialize(CallInterfaceDescriptorData* data) { void StringAddDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a1, a0}; Register registers[] = {cp, a1, a0};
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[] = {
cp, // context cp, // context
a2, // key a2, // 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[] = {
cp, // context cp, // context
a2, // name a2, // 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[] = {
cp, // context cp, // context
a0, // receiver a0, // receiver
}; };
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[] = {
cp, // context cp, // context
a1, // JSFunction a1, // JSFunction
a0, // actual number of arguments a0, // actual number of arguments
a2, // expected number of arguments a2, // 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[] = {
cp, // context cp, // context
a0, // callee a0, // callee
...@@ -343,19 +323,12 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -343,19 +323,12 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) {
a1, // api_function_address a1, // api_function_address
a3, // actual number of arguments a3, // 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[] = {
cp, // context cp, // context
a0, // callee a0, // callee
...@@ -363,29 +336,18 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -363,29 +336,18 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
a2, // holder a2, // holder
a1, // api_function_address a1, // 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[] = {
cp, // context cp, // context
a1, // math rounding function a1, // math rounding function
a3, // vector slot id a3, // 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
......
...@@ -62,106 +62,99 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return a0; } ...@@ -62,106 +62,99 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return a0; }
const Register GrowArrayElementsDescriptor::KeyRegister() { return a3; } const Register GrowArrayElementsDescriptor::KeyRegister() { return a3; }
void FastNewClosureDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewClosureDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a2}; Register registers[] = {cp, a2};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void FastNewContextDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a1}; Register registers[] = {cp, a1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void ToNumberDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ToNumberDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a0}; Register registers[] = {cp, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void NumberToStringDescriptor::Initialize(CallInterfaceDescriptorData* data) { void NumberToStringDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a0}; Register registers[] = {cp, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void TypeofDescriptor::Initialize(CallInterfaceDescriptorData* data) { void TypeofDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a3}; Register registers[] = {cp, a3};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void FastCloneShallowArrayDescriptor::Initialize( void FastCloneShallowArrayDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a3, a2, a1}; Register registers[] = {cp, a3, a2, a1};
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[] = {cp, a3, a2, a1, a0}; Register registers[] = {cp, a3, a2, a1, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CreateAllocationSiteDescriptor::Initialize( void CreateAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a2, a3}; Register registers[] = {cp, a2, a3};
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[] = {cp, a2, a3, a1}; Register registers[] = {cp, a2, a3, a1};
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[] = {cp, a3, a0}; Register registers[] = {cp, a3, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CallFunctionWithFeedbackDescriptor::Initialize( void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a1, a3}; Register registers[] = {cp, a1, a3};
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[] = {cp, a1, a3, a2}; Register registers[] = {cp, a1, a3, a2};
Representation representations[] = { data->InitializePlatformSpecific(arraysize(registers), registers);
Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
Representation::Tagged()};
data->Initialize(arraysize(registers), registers, representations);
} }
void CallFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallFunctionDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a1}; Register registers[] = {cp, a1};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallConstructDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// a0 : number of arguments // a0 : number of arguments
// a1 : the function to call // a1 : the function to call
// a2 : feedback vector // a2 : feedback vector
...@@ -170,34 +163,34 @@ void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -170,34 +163,34 @@ 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[] = {cp, a0, a1, a2}; Register registers[] = {cp, a0, a1, a2};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void RegExpConstructResultDescriptor::Initialize( void RegExpConstructResultDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a2, a1, a0}; Register registers[] = {cp, a2, a1, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void TransitionElementsKindDescriptor::Initialize( void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a0, a1}; Register registers[] = {cp, a0, a1};
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
// cp -- context // cp -- context
Register registers[] = {cp}; Register registers[] = {cp};
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
// cp -- context // cp -- context
...@@ -205,136 +198,123 @@ void ArrayConstructorConstantArgCountDescriptor::Initialize( ...@@ -205,136 +198,123 @@ void ArrayConstructorConstantArgCountDescriptor::Initialize(
// a1 -- function // a1 -- function
// a2 -- allocation site with elements kind // a2 -- allocation site with elements kind
Register registers[] = {cp, a1, a2}; Register registers[] = {cp, a1, a2};
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[] = {cp, a1, a2, a0}; Register registers[] = {cp, a1, a2, a0};
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
// cp -- context // cp -- context
// a0 -- number of arguments // a0 -- number of arguments
// a1 -- constructor function // a1 -- constructor function
Register registers[] = {cp, a1}; Register registers[] = {cp, a1};
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[] = {cp, a1, a0}; Register registers[] = {cp, a1, a0};
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[] = {cp, a1, a0}; Register registers[] = {cp, a1, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void CompareNilDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CompareNilDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a0}; Register registers[] = {cp, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void ToBooleanDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ToBooleanDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a0}; Register registers[] = {cp, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void BinaryOpDescriptor::Initialize(CallInterfaceDescriptorData* data) { void BinaryOpDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a1, a0}; Register registers[] = {cp, a1, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void BinaryOpWithAllocationSiteDescriptor::Initialize( void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a2, a1, a0}; Register registers[] = {cp, a2, a1, a0};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
} }
void StringAddDescriptor::Initialize(CallInterfaceDescriptorData* data) { void StringAddDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {cp, a1, a0}; Register registers[] = {cp, a1, a0};
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[] = {
cp, // context cp, // context
a2, // key a2, // 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[] = {
cp, // context cp, // context
a2, // name a2, // 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[] = {
cp, // context cp, // context
a0, // receiver a0, // receiver
}; };
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[] = {
cp, // context cp, // context
a1, // JSFunction a1, // JSFunction
a0, // actual number of arguments a0, // actual number of arguments
a2, // expected number of arguments a2, // 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[] = {
cp, // context cp, // context
a0, // callee a0, // callee
...@@ -343,19 +323,12 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -343,19 +323,12 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) {
a1, // api_function_address a1, // api_function_address
a3, // actual number of arguments a3, // 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[] = {
cp, // context cp, // context
a0, // callee a0, // callee
...@@ -363,29 +336,18 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -363,29 +336,18 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
a2, // holder a2, // holder
a1, // api_function_address a1, // 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[] = {
cp, // context cp, // context
a1, // math rounding function a1, // math rounding function
a3, // vector slot id a3, // 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
......
...@@ -64,107 +64,100 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return rax; } ...@@ -64,107 +64,100 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return rax; }
const Register GrowArrayElementsDescriptor::KeyRegister() { return rbx; } const Register GrowArrayElementsDescriptor::KeyRegister() { return rbx; }
void FastNewClosureDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewClosureDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rbx}; Register registers[] = {rsi, rbx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void FastNewContextDescriptor::Initialize(CallInterfaceDescriptorData* data) { void FastNewContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rdi}; Register registers[] = {rsi, rdi};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void TypeofDescriptor::Initialize(CallInterfaceDescriptorData* data) { void TypeofDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rbx}; Register registers[] = {rsi, rbx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
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[] = {rsi, rax}; Register registers[] = {rsi, rax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void NumberToStringDescriptor::Initialize(CallInterfaceDescriptorData* data) { void NumberToStringDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rax}; Register registers[] = {rsi, rax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void FastCloneShallowArrayDescriptor::Initialize( void FastCloneShallowArrayDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rax, rbx, rcx}; Register registers[] = {rsi, rax, rbx, rcx};
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[] = {rsi, rax, rbx, rcx, rdx}; Register registers[] = {rsi, rax, rbx, rcx, rdx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CreateAllocationSiteDescriptor::Initialize( void CreateAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rbx, rdx}; Register registers[] = {rsi, rbx, rdx};
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[] = {rsi, rbx, rdx, rdi}; Register registers[] = {rsi, rbx, rdx, rdi};
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[] = {rsi, rcx, rax}; Register registers[] = {rsi, rcx, rax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CallFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallFunctionDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rdi}; Register registers[] = {rsi, rdi};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CallFunctionWithFeedbackDescriptor::Initialize( void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rdi, rdx}; Register registers[] = {rsi, rdi, rdx};
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[] = {rsi, rdi, rdx, rbx}; Register registers[] = {rsi, rdi, rdx, rbx};
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) {
// rax : number of arguments // rax : number of arguments
// rbx : feedback vector // rbx : feedback vector
// rdx : (only if rbx is not the megamorphic symbol) slot in feedback // rdx : (only if rbx is not the megamorphic symbol) slot in feedback
...@@ -173,170 +166,157 @@ void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -173,170 +166,157 @@ 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[] = {rsi, rax, rdi, rbx}; Register registers[] = {rsi, rax, rdi, rbx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void RegExpConstructResultDescriptor::Initialize( void RegExpConstructResultDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rcx, rbx, rax}; Register registers[] = {rsi, rcx, rbx, rax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void TransitionElementsKindDescriptor::Initialize( void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rax, rbx}; Register registers[] = {rsi, rax, rbx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void AllocateHeapNumberDescriptor::Initialize( void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// register state // register state
// rsi -- context // rsi -- context
Register registers[] = {rsi}; Register registers[] = {rsi};
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
// rax -- number of arguments // rax -- number of arguments
// rdi -- function // rdi -- function
// rbx -- allocation site with elements kind // rbx -- allocation site with elements kind
Register registers[] = {rsi, rdi, rbx}; Register registers[] = {rsi, rdi, rbx};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
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[] = {rsi, rdi, rbx, rax}; Register registers[] = {rsi, rdi, rbx, rax};
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
// rsi -- context // rsi -- context
// rax -- number of arguments // rax -- number of arguments
// rdi -- constructor function // rdi -- constructor function
Register registers[] = {rsi, rdi}; Register registers[] = {rsi, rdi};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
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[] = {rsi, rdi, rax}; Register registers[] = {rsi, rdi, rax};
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[] = {rsi, rdx, rax}; Register registers[] = {rsi, rdx, rax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void CompareNilDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CompareNilDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rax}; Register registers[] = {rsi, rax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void ToBooleanDescriptor::Initialize(CallInterfaceDescriptorData* data) { void ToBooleanDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rax}; Register registers[] = {rsi, rax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void BinaryOpDescriptor::Initialize(CallInterfaceDescriptorData* data) { void BinaryOpDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rdx, rax}; Register registers[] = {rsi, rdx, rax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void BinaryOpWithAllocationSiteDescriptor::Initialize( void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rcx, rdx, rax}; Register registers[] = {rsi, rcx, rdx, rax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void StringAddDescriptor::Initialize(CallInterfaceDescriptorData* data) { void StringAddDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {rsi, rdx, rax}; Register registers[] = {rsi, rdx, rax};
data->Initialize(arraysize(registers), registers, NULL); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void KeyedDescriptor::Initialize(CallInterfaceDescriptorData* data) { void KeyedDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = { Register registers[] = {
rsi, // context rsi, // context
rcx, // key rcx, // 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[] = {
rsi, // context rsi, // context
rcx, // name rcx, // 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[] = {
rsi, // context rsi, // context
rdx, // receiver rdx, // receiver
}; };
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[] = {
rsi, // context rsi, // context
rdi, // JSFunction rdi, // JSFunction
rax, // actual number of arguments rax, // actual number of arguments
rbx, // expected number of arguments rbx, // 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[] = {
rsi, // context rsi, // context
rdi, // callee rdi, // callee
...@@ -345,19 +325,12 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -345,19 +325,12 @@ void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) {
rdx, // api_function_address rdx, // api_function_address
rax, // actual number of arguments rax, // 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[] = {
rsi, // context rsi, // context
rdi, // callee rdi, // callee
...@@ -365,29 +338,18 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { ...@@ -365,29 +338,18 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
rcx, // holder rcx, // holder
rdx, // api_function_address rdx, // 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[] = {
rsi, // context rsi, // context
rdi, // math rounding function rdi, // math rounding function
rdx, // vector slot id rdx, // 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
......
...@@ -126,7 +126,7 @@ class ChangesLoweringTester : public GraphBuilderTester<ReturnType> { ...@@ -126,7 +126,7 @@ class ChangesLoweringTester : public GraphBuilderTester<ReturnType> {
void LowerChange(Node* change) { void LowerChange(Node* change) {
// Run the graph reducer with changes lowering on a single node. // Run the graph reducer with changes lowering on a single node.
Typer typer(this->isolate(), this->graph(), Handle<Context>()); Typer typer(this->isolate(), this->graph(), nullptr, Handle<Context>());
typer.Run(); typer.Run();
ChangeLowering change_lowering(&jsgraph); ChangeLowering change_lowering(&jsgraph);
SelectLowering select_lowering(this->graph(), this->common()); SelectLowering select_lowering(this->graph(), this->common());
......
...@@ -21,7 +21,7 @@ class JSCacheTesterHelper { ...@@ -21,7 +21,7 @@ class JSCacheTesterHelper {
: main_graph_(zone), : main_graph_(zone),
main_common_(zone), main_common_(zone),
main_javascript_(zone), main_javascript_(zone),
main_typer_(isolate, &main_graph_, MaybeHandle<Context>()), main_typer_(isolate, &main_graph_, nullptr, MaybeHandle<Context>()),
main_machine_(zone) {} main_machine_(zone) {}
Graph main_graph_; Graph main_graph_;
CommonOperatorBuilder main_common_; CommonOperatorBuilder main_common_;
......
...@@ -38,7 +38,7 @@ class JSTypedLoweringTester : public HandleAndZoneScope { ...@@ -38,7 +38,7 @@ class JSTypedLoweringTester : public HandleAndZoneScope {
simplified(main_zone()), simplified(main_zone()),
common(main_zone()), common(main_zone()),
graph(main_zone()), graph(main_zone()),
typer(main_isolate(), &graph, MaybeHandle<Context>()), typer(main_isolate(), &graph, nullptr, MaybeHandle<Context>()),
context_node(NULL) { context_node(NULL) {
graph.SetStart(graph.NewNode(common.Start(num_parameters))); graph.SetStart(graph.NewNode(common.Start(num_parameters)));
graph.SetEnd(graph.NewNode(common.End(1))); graph.SetEnd(graph.NewNode(common.End(1)));
......
...@@ -60,7 +60,7 @@ class ReducerTester : public HandleAndZoneScope { ...@@ -60,7 +60,7 @@ class ReducerTester : public HandleAndZoneScope {
common(main_zone()), common(main_zone()),
graph(main_zone()), graph(main_zone()),
javascript(main_zone()), javascript(main_zone()),
typer(isolate, &graph, MaybeHandle<Context>()), typer(isolate, &graph, nullptr, MaybeHandle<Context>()),
jsgraph(isolate, &graph, &common, &javascript, &machine), jsgraph(isolate, &graph, &common, &javascript, &machine),
maxuint32(Constant<int32_t>(kMaxUInt32)) { maxuint32(Constant<int32_t>(kMaxUInt32)) {
Node* s = graph.NewNode(common.Start(num_parameters)); Node* s = graph.NewNode(common.Start(num_parameters));
......
...@@ -35,7 +35,7 @@ class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> { ...@@ -35,7 +35,7 @@ class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> {
SimplifiedLoweringTester(MachineType p0 = kMachNone, SimplifiedLoweringTester(MachineType p0 = kMachNone,
MachineType p1 = kMachNone) MachineType p1 = kMachNone)
: GraphBuilderTester<ReturnType>(p0, p1), : GraphBuilderTester<ReturnType>(p0, p1),
typer(this->isolate(), this->graph(), MaybeHandle<Context>()), typer(this->isolate(), this->graph(), nullptr, MaybeHandle<Context>()),
javascript(this->zone()), javascript(this->zone()),
jsgraph(this->isolate(), this->graph(), this->common(), &javascript, jsgraph(this->isolate(), this->graph(), this->common(), &javascript,
this->machine()), this->machine()),
...@@ -710,7 +710,7 @@ class TestingGraph : public HandleAndZoneScope, public GraphAndBuilders { ...@@ -710,7 +710,7 @@ class TestingGraph : public HandleAndZoneScope, public GraphAndBuilders {
explicit TestingGraph(Type* p0_type, Type* p1_type = Type::None(), explicit TestingGraph(Type* p0_type, Type* p1_type = Type::None(),
Type* p2_type = Type::None()) Type* p2_type = Type::None())
: GraphAndBuilders(main_zone()), : GraphAndBuilders(main_zone()),
typer(main_isolate(), graph(), MaybeHandle<Context>()), typer(main_isolate(), graph(), nullptr, MaybeHandle<Context>()),
javascript(main_zone()), javascript(main_zone()),
jsgraph(main_isolate(), graph(), common(), &javascript, machine()) { jsgraph(main_isolate(), graph(), common(), &javascript, machine()) {
start = graph()->NewNode(common()->Start(2)); start = graph()->NewNode(common()->Start(2));
......
...@@ -111,7 +111,7 @@ Matcher<Node*> GraphTest::IsUndefinedConstant() { ...@@ -111,7 +111,7 @@ Matcher<Node*> GraphTest::IsUndefinedConstant() {
TypedGraphTest::TypedGraphTest(int num_parameters) TypedGraphTest::TypedGraphTest(int num_parameters)
: GraphTest(num_parameters), : GraphTest(num_parameters),
typer_(isolate(), graph(), MaybeHandle<Context>()) {} typer_(isolate(), graph(), nullptr, MaybeHandle<Context>()) {}
TypedGraphTest::~TypedGraphTest() {} TypedGraphTest::~TypedGraphTest() {}
......
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