Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: src/interface-descriptors.cc

Issue 2301883002: CallInterfaceDescriptor should use MachineType (Closed)
Patch Set: Remove unneeded zone in the isolate. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interface-descriptors.h ('k') | src/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interface-descriptors.cc
diff --git a/src/interface-descriptors.cc b/src/interface-descriptors.cc
index a16cae7d61cc68062f2f9b8926eb2573f5405dd7..88d4164f6a25b3f33def10777f4b608621eb4763 100644
--- a/src/interface-descriptors.cc
+++ b/src/interface-descriptors.cc
@@ -7,41 +7,6 @@
namespace v8 {
namespace internal {
-namespace {
-// Constructors for common combined semantic and representation types.
-Type* SmiType(Zone* zone) {
- return Type::Intersect(Type::SignedSmall(), Type::TaggedSigned(), zone);
-}
-
-
-Type* UntaggedIntegral32(Zone* zone) {
- return Type::Intersect(Type::Signed32(), Type::UntaggedIntegral32(), zone);
-}
-
-
-Type* AnyTagged(Zone* zone) {
- return Type::Intersect(
- Type::Any(),
- Type::Union(Type::TaggedPointer(), Type::TaggedSigned(), zone), zone);
-}
-
-
-Type* ExternalPointer(Zone* zone) {
- return Type::Intersect(Type::Internal(), Type::UntaggedPointer(), zone);
-}
-} // namespace
-
-FunctionType* CallInterfaceDescriptor::BuildDefaultFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), parameter_count, zone)
- ->AsFunction();
- while (parameter_count-- != 0) {
- function->InitParameter(parameter_count, AnyTagged(zone));
- }
- return function;
-}
void CallInterfaceDescriptorData::InitializePlatformSpecific(
int register_parameter_count, const Register* registers,
@@ -56,6 +21,22 @@ void CallInterfaceDescriptorData::InitializePlatformSpecific(
}
}
+void CallInterfaceDescriptorData::InitializePlatformIndependent(
+ int parameter_count, int extra_parameter_count,
+ const MachineType* machine_types) {
+ // InterfaceDescriptor owns a copy of the MachineType array.
+ // We only care about parameters, not receiver and result.
+ param_count_ = parameter_count + extra_parameter_count;
+ machine_types_.reset(NewArray<MachineType>(param_count_));
+ for (int i = 0; i < param_count_; i++) {
+ if (machine_types == NULL || i >= parameter_count) {
+ machine_types_[i] = MachineType::AnyTagged();
+ } else {
+ machine_types_[i] = machine_types[i];
+ }
+ }
+}
+
const char* CallInterfaceDescriptor::DebugName(Isolate* isolate) const {
CallInterfaceDescriptorData* start = isolate->call_descriptor_data(0);
size_t index = data_ - start;
@@ -79,15 +60,12 @@ void VoidDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(0, nullptr);
}
-FunctionType*
-FastNewFunctionContextDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction();
- function->InitParameter(0, AnyTagged(zone));
- function->InitParameter(1, UntaggedIntegral32(zone));
- return function;
+void FastNewFunctionContextDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ MachineType machine_types[] = {MachineType::AnyTagged(),
+ MachineType::Int32()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
void FastNewFunctionContextDescriptor::InitializePlatformSpecific(
@@ -96,33 +74,28 @@ void FastNewFunctionContextDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
-FunctionType* LoadDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kReceiver, AnyTagged(zone));
- function->InitParameter(kName, AnyTagged(zone));
- function->InitParameter(kSlot, SmiType(zone));
- return function;
+void LoadDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kReceiver, kName, kSlot
+ MachineType machine_types[] = {MachineType::AnyTagged(),
+ MachineType::AnyTagged(),
+ MachineType::TaggedSigned()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
-
void LoadDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ReceiverRegister(), NameRegister(), SlotRegister()};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
-FunctionType* LoadGlobalDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kSlot, SmiType(zone));
- return function;
+void LoadGlobalDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kSlot
+ MachineType machine_types[] = {MachineType::TaggedSigned()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
void LoadGlobalDescriptor::InitializePlatformSpecific(
@@ -131,16 +104,13 @@ void LoadGlobalDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
-FunctionType*
-LoadGlobalWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kSlot, SmiType(zone));
- function->InitParameter(kVector, AnyTagged(zone));
- return function;
+void LoadGlobalWithVectorDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kSlot, kVector
+ MachineType machine_types[] = {MachineType::TaggedSigned(),
+ MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
void LoadGlobalWithVectorDescriptor::InitializePlatformSpecific(
@@ -150,17 +120,14 @@ void LoadGlobalWithVectorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
-FunctionType* StoreDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kReceiver, AnyTagged(zone));
- function->InitParameter(kName, AnyTagged(zone));
- function->InitParameter(kValue, AnyTagged(zone));
- function->InitParameter(kSlot, SmiType(zone));
- return function;
+void StoreDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kReceiver, kName, kValue, kSlot
+ MachineType machine_types[] = {
+ MachineType::AnyTagged(), MachineType::AnyTagged(),
+ MachineType::AnyTagged(), MachineType::TaggedSigned()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
void StoreDescriptor::InitializePlatformSpecific(
@@ -194,32 +161,24 @@ void VectorStoreTransitionDescriptor::InitializePlatformSpecific(
}
}
-FunctionType*
-StoreTransitionDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kReceiver, AnyTagged(zone));
- function->InitParameter(kName, AnyTagged(zone));
- function->InitParameter(kValue, AnyTagged(zone));
- function->InitParameter(kMap, AnyTagged(zone));
- return function;
-}
-
-FunctionType*
-StoreGlobalViaContextDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kSlot, UntaggedIntegral32(zone));
- function->InitParameter(kValue, AnyTagged(zone));
- return function;
+void StoreTransitionDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kReceiver, kName, kValue, kMap
+ MachineType machine_types[] = {
+ MachineType::AnyTagged(), MachineType::AnyTagged(),
+ MachineType::AnyTagged(), MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
+void StoreGlobalViaContextDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kSlot, kValue
+ MachineType machine_types[] = {MachineType::Int32(),
+ MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+}
void StoreGlobalViaContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
@@ -252,18 +211,14 @@ void MathPowIntegerDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
-FunctionType*
-LoadWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kReceiver, AnyTagged(zone));
- function->InitParameter(kName, AnyTagged(zone));
- function->InitParameter(kSlot, SmiType(zone));
- function->InitParameter(kVector, AnyTagged(zone));
- return function;
+void LoadWithVectorDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kReceiver, kName, kSlot, kVector
+ MachineType machine_types[] = {
+ MachineType::AnyTagged(), MachineType::AnyTagged(),
+ MachineType::TaggedSigned(), MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
@@ -274,41 +229,38 @@ void LoadWithVectorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
-FunctionType*
-VectorStoreTransitionDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
+void VectorStoreTransitionDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
bool has_slot = !VectorStoreTransitionDescriptor::SlotRegister().is(no_reg);
- int arg_count = has_slot ? 6 : 5;
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), arg_count, zone)
- ->AsFunction();
- int index = 0;
- // TODO(ishell): use ParameterIndices here
- function->InitParameter(index++, AnyTagged(zone)); // receiver
- function->InitParameter(index++, AnyTagged(zone)); // name
- function->InitParameter(index++, AnyTagged(zone)); // value
- function->InitParameter(index++, AnyTagged(zone)); // map
+
if (has_slot) {
- function->InitParameter(index++, SmiType(zone)); // slot
+ // kReceiver, kName, kValue, kMap, kSlot, kVector
+ MachineType machine_types[] = {
+ MachineType::AnyTagged(), MachineType::AnyTagged(),
+ MachineType::AnyTagged(), MachineType::AnyTagged(),
+ MachineType::TaggedSigned(), MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+ } else {
+ // kReceiver, kName, kValue, kMap, kVector
+ MachineType machine_types[] = {
+ MachineType::AnyTagged(), MachineType::AnyTagged(),
+ MachineType::AnyTagged(), MachineType::AnyTagged(),
+ MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
- function->InitParameter(index++, AnyTagged(zone)); // vector
- return function;
}
-FunctionType*
-StoreWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kReceiver, AnyTagged(zone));
- function->InitParameter(kName, AnyTagged(zone));
- function->InitParameter(kValue, AnyTagged(zone));
- function->InitParameter(kSlot, SmiType(zone));
- function->InitParameter(kVector, AnyTagged(zone));
- return function;
+void StoreWithVectorDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kReceiver, kName, kValue, kSlot, kVector
+ MachineType machine_types[] = {
+ MachineType::AnyTagged(), MachineType::AnyTagged(),
+ MachineType::AnyTagged(), MachineType::TaggedSigned(),
+ MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
void StoreWithVectorDescriptor::InitializePlatformSpecific(
@@ -318,19 +270,14 @@ void StoreWithVectorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
-FunctionType*
-BinaryOpWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- DCHECK_EQ(parameter_count, kParameterCount);
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kLeft, AnyTagged(zone));
- function->InitParameter(kRight, AnyTagged(zone));
- function->InitParameter(kSlot, UntaggedIntegral32(zone));
- function->InitParameter(kVector, AnyTagged(zone));
- return function;
+void BinaryOpWithVectorDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kLeft, kRight, kSlot, kVector
+ MachineType machine_types[] = {MachineType::AnyTagged(),
+ MachineType::AnyTagged(), MachineType::Int32(),
+ MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
const Register ApiGetterDescriptor::ReceiverRegister() {
@@ -372,19 +319,9 @@ CallInterfaceDescriptor OnStackArgsDescriptorBase::ForArgs(
}
}
-FunctionType*
-OnStackArgsDescriptorBase::BuildCallInterfaceDescriptorFunctionTypeWithArg(
- Isolate* isolate, int register_parameter_count, int parameter_count) {
- DCHECK_EQ(0, register_parameter_count);
- DCHECK_GT(parameter_count, 0);
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), AnyTagged(zone), parameter_count, zone)
- ->AsFunction();
- for (int i = 0; i < parameter_count; i++) {
- function->InitParameter(i, AnyTagged(zone));
- }
- return function;
+void OnStackArgsDescriptorBase::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ data->InitializePlatformIndependent(0, extra_args(), NULL);
}
void OnStackArgsDescriptorBase::InitializePlatformSpecific(
@@ -398,186 +335,139 @@ void GrowArrayElementsDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
-FunctionType*
-VarArgFunctionDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), AnyTagged(zone), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone));
- return function;
+void VarArgFunctionDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kActualArgumentsCount
+ MachineType machine_types[] = {MachineType::Int32()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
-FunctionType*
-FastCloneRegExpDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kClosure, AnyTagged(zone));
- function->InitParameter(kLiteralIndex, SmiType(zone));
- function->InitParameter(kPattern, AnyTagged(zone));
- function->InitParameter(kFlags, AnyTagged(zone));
- return function;
-}
-
-FunctionType*
-FastCloneShallowArrayDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kClosure, AnyTagged(zone));
- function->InitParameter(kLiteralIndex, SmiType(zone));
- function->InitParameter(kConstantElements, AnyTagged(zone));
- return function;
-}
-
-FunctionType*
-CreateAllocationSiteDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kVector, AnyTagged(zone));
- function->InitParameter(kSlot, SmiType(zone));
- return function;
+void FastCloneRegExpDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kClosure, kLiteralIndex, kPattern, kFlags
+ MachineType machine_types[] = {
+ MachineType::AnyTagged(), MachineType::TaggedSigned(),
+ MachineType::AnyTagged(), MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
-FunctionType*
-CreateWeakCellDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kVector, AnyTagged(zone));
- function->InitParameter(kSlot, SmiType(zone));
- function->InitParameter(kValue, AnyTagged(zone));
- return function;
-}
-
-FunctionType*
-CallTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kFunction, AnyTagged(zone));
- function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone));
- return function;
+void FastCloneShallowArrayDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kClosure, kLiteralIndex, kConstantElements
+ MachineType machine_types[] = {MachineType::AnyTagged(),
+ MachineType::TaggedSigned(),
+ MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
-FunctionType* ConstructStubDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kFunction, AnyTagged(zone));
- function->InitParameter(kNewTarget, AnyTagged(zone));
- function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone));
- function->InitParameter(kAllocationSite, AnyTagged(zone));
- return function;
-}
-
-FunctionType*
-ConstructTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kFunction, AnyTagged(zone));
- function->InitParameter(kNewTarget, AnyTagged(zone));
- function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone));
- return function;
-}
-
-FunctionType*
-CallFunctionWithFeedbackDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kFunction, Type::Receiver());
- function->InitParameter(kSlot, SmiType(zone));
- return function;
-}
-
-FunctionType* CallFunctionWithFeedbackAndVectorDescriptor::
- BuildCallInterfaceDescriptorFunctionType(Isolate* isolate,
- int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kFunction, Type::Receiver());
- function->InitParameter(kSlot, SmiType(zone));
- function->InitParameter(kVector, AnyTagged(zone));
- return function;
-}
-
-FunctionType*
-ArrayNoArgumentConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kFunction, Type::Receiver());
- function->InitParameter(kAllocationSite, AnyTagged(zone));
- function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone));
- function->InitParameter(kFunctionParameter, AnyTagged(zone));
- return function;
-}
-
-FunctionType* ArraySingleArgumentConstructorDescriptor::
- BuildCallInterfaceDescriptorFunctionType(Isolate* isolate,
- int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kFunction, Type::Receiver());
- function->InitParameter(kAllocationSite, AnyTagged(zone));
- function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone));
- function->InitParameter(kFunctionParameter, AnyTagged(zone));
- function->InitParameter(kArraySizeSmiParameter, AnyTagged(zone));
- return function;
-}
-
-FunctionType*
-ArrayNArgumentsConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kFunction, Type::Receiver());
- function->InitParameter(kAllocationSite, AnyTagged(zone));
- function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone));
- return function;
-}
-
-FunctionType*
-ArgumentAdaptorDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kFunction, Type::Receiver());
- function->InitParameter(kNewTarget, AnyTagged(zone));
- function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone));
- function->InitParameter(kExpectedArgumentsCount, UntaggedIntegral32(zone));
- return function;
+void CreateAllocationSiteDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kVector, kSlot
+ MachineType machine_types[] = {MachineType::AnyTagged(),
+ MachineType::TaggedSigned()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+}
+
+void CreateWeakCellDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kVector, kSlot, kValue
+ MachineType machine_types[] = {MachineType::AnyTagged(),
+ MachineType::TaggedSigned(),
+ MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+}
+
+void CallTrampolineDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kFunction, kActualArgumentsCount
+ MachineType machine_types[] = {MachineType::AnyTagged(),
+ MachineType::Int32()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+}
+
+void ConstructStubDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kFunction, kNewTarget, kActualArgumentsCount, kAllocationSite
+ MachineType machine_types[] = {MachineType::AnyTagged(),
+ MachineType::AnyTagged(), MachineType::Int32(),
+ MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+}
+
+void ConstructTrampolineDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kFunction, kNewTarget, kActualArgumentsCount
+ MachineType machine_types[] = {
+ MachineType::AnyTagged(), MachineType::AnyTagged(), MachineType::Int32()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+}
+
+void CallFunctionWithFeedbackDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kFunction, kSlot
+ MachineType machine_types[] = {MachineType::AnyTagged(),
+ MachineType::TaggedSigned()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+}
+
+void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kFunction, kSlot, kVector
+ MachineType machine_types[] = {MachineType::TaggedPointer(),
+ MachineType::TaggedSigned(),
+ MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+}
+
+void ArrayNoArgumentConstructorDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kFunction, kAllocationSite, kActualArgumentsCount, kFunctionParameter
+ MachineType machine_types[] = {MachineType::TaggedPointer(),
+ MachineType::AnyTagged(), MachineType::Int32(),
+ MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+}
+
+void ArraySingleArgumentConstructorDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kFunction, kAllocationSite, kActualArgumentsCount, kFunctionParameter,
+ // kArraySizeSmiParameter
+ MachineType machine_types[] = {
+ MachineType::TaggedPointer(), MachineType::AnyTagged(),
+ MachineType::Int32(), MachineType::AnyTagged(), MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+}
+
+void ArrayNArgumentsConstructorDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kFunction, kAllocationSite, kActualArgumentsCount
+ MachineType machine_types[] = {MachineType::TaggedPointer(),
+ MachineType::AnyTagged(),
+ MachineType::Int32()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
+}
+
+void ArgumentAdaptorDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kFunction, kNewTarget, kActualArgumentsCount, kExpectedArgumentsCount
+ MachineType machine_types[] = {MachineType::TaggedPointer(),
+ MachineType::AnyTagged(), MachineType::Int32(),
+ MachineType::Int32()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
CallInterfaceDescriptor ApiCallbackDescriptorBase::ForArgs(Isolate* isolate,
@@ -605,35 +495,24 @@ CallInterfaceDescriptor ApiCallbackDescriptorBase::ForArgs(Isolate* isolate,
}
}
-FunctionType*
-ApiCallbackDescriptorBase::BuildCallInterfaceDescriptorFunctionTypeWithArg(
- Isolate* isolate, int parameter_count, int argc) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function = Type::Function(AnyTagged(zone), Type::Undefined(),
- kParameterCount + argc, zone)
- ->AsFunction();
- function->InitParameter(kFunction, AnyTagged(zone));
- function->InitParameter(kCallData, AnyTagged(zone));
- function->InitParameter(kHolder, AnyTagged(zone));
- function->InitParameter(kApiFunctionAddress, ExternalPointer(zone));
- for (int i = 0; i < argc; i++) {
- function->InitParameter(i, AnyTagged(zone));
- }
- return function;
+void ApiCallbackDescriptorBase::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kFunction, kCallData, kHolder, kApiFunctionAddress
+ MachineType machine_types[] = {
+ MachineType::AnyTagged(), MachineType::AnyTagged(),
+ MachineType::AnyTagged(), MachineType::Pointer()};
+ data->InitializePlatformIndependent(arraysize(machine_types), extra_args(),
+ machine_types);
}
-FunctionType*
-InterpreterDispatchDescriptor::BuildCallInterfaceDescriptorFunctionType(
- Isolate* isolate, int parameter_count) {
- Zone* zone = isolate->interface_descriptor_zone();
- FunctionType* function =
- Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone)
- ->AsFunction();
- function->InitParameter(kAccumulator, AnyTagged(zone));
- function->InitParameter(kBytecodeOffset, UntaggedIntegral32(zone));
- function->InitParameter(kBytecodeArray, AnyTagged(zone));
- function->InitParameter(kDispatchTable, AnyTagged(zone));
- return function;
+void InterpreterDispatchDescriptor::InitializePlatformIndependent(
+ CallInterfaceDescriptorData* data) {
+ // kAccumulator, kBytecodeOffset, kBytecodeArray, kDispatchTable
+ MachineType machine_types[] = {MachineType::AnyTagged(), MachineType::Int32(),
+ MachineType::AnyTagged(),
+ MachineType::AnyTagged()};
+ data->InitializePlatformIndependent(arraysize(machine_types), 0,
+ machine_types);
}
} // namespace internal
« no previous file with comments | « src/interface-descriptors.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698