2014-08-29 10:40:02 +00:00
|
|
|
// Copyright 2012 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "src/interface-descriptors.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
namespace {
|
|
|
|
// Constructors for common combined semantic and representation types.
|
2015-09-03 12:53:19 +00:00
|
|
|
Type* SmiType(Zone* zone) {
|
|
|
|
return Type::Intersect(Type::SignedSmall(), Type::TaggedSigned(), zone);
|
2015-06-24 06:21:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-11-04 08:05:37 +00:00
|
|
|
Type* UntaggedIntegral32(Zone* zone) {
|
|
|
|
return Type::Intersect(Type::Signed32(), Type::UntaggedIntegral32(), zone);
|
2015-06-24 06:21:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-09-03 12:53:19 +00:00
|
|
|
Type* AnyTagged(Zone* zone) {
|
2015-06-24 06:21:47 +00:00
|
|
|
return Type::Intersect(
|
2015-09-03 12:53:19 +00:00
|
|
|
Type::Any(),
|
|
|
|
Type::Union(Type::TaggedPointer(), Type::TaggedSigned(), zone), zone);
|
2015-06-24 06:21:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-09-03 12:53:19 +00:00
|
|
|
Type* ExternalPointer(Zone* zone) {
|
|
|
|
return Type::Intersect(Type::Internal(), Type::UntaggedPointer(), zone);
|
2015-06-24 06:21:47 +00:00
|
|
|
}
|
2015-09-30 13:46:56 +00:00
|
|
|
} // namespace
|
2015-06-24 06:21:47 +00:00
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* CallInterfaceDescriptor::BuildDefaultFunctionType(
|
2015-06-24 06:21:47 +00:00
|
|
|
Isolate* isolate, int parameter_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), parameter_count, zone)
|
|
|
|
->AsFunction();
|
2015-06-24 06:21:47 +00:00
|
|
|
while (parameter_count-- != 0) {
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(parameter_count, AnyTagged(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
}
|
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CallInterfaceDescriptorData::InitializePlatformSpecific(
|
2014-08-29 10:40:02 +00:00
|
|
|
int register_parameter_count, Register* registers,
|
|
|
|
PlatformInterfaceDescriptor* platform_descriptor) {
|
|
|
|
platform_specific_descriptor_ = platform_descriptor;
|
|
|
|
register_param_count_ = register_parameter_count;
|
|
|
|
|
|
|
|
// InterfaceDescriptor owns a copy of the registers array.
|
|
|
|
register_params_.Reset(NewArray<Register>(register_parameter_count));
|
|
|
|
for (int i = 0; i < register_parameter_count; i++) {
|
|
|
|
register_params_[i] = registers[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-30 09:00:58 +00:00
|
|
|
const char* CallInterfaceDescriptor::DebugName(Isolate* isolate) const {
|
2014-09-08 15:18:54 +00:00
|
|
|
CallInterfaceDescriptorData* start = isolate->call_descriptor_data(0);
|
2014-09-08 16:18:37 +00:00
|
|
|
size_t index = data_ - start;
|
2014-09-08 15:18:54 +00:00
|
|
|
DCHECK(index < CallDescriptors::NUMBER_OF_DESCRIPTORS);
|
|
|
|
CallDescriptors::Key key = static_cast<CallDescriptors::Key>(index);
|
|
|
|
switch (key) {
|
|
|
|
#define DEF_CASE(NAME) \
|
|
|
|
case CallDescriptors::NAME: \
|
|
|
|
return #NAME " Descriptor";
|
|
|
|
INTERFACE_DESCRIPTOR_LIST(DEF_CASE)
|
|
|
|
#undef DEF_CASE
|
|
|
|
case CallDescriptors::NUMBER_OF_DESCRIPTORS:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-02 12:35:12 +00:00
|
|
|
void VoidDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
|
|
|
data->InitializePlatformSpecific(0, nullptr);
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* LoadDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
2015-06-24 06:21:47 +00:00
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction();
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone));
|
|
|
|
function->InitParameter(1, AnyTagged(zone));
|
|
|
|
function->InitParameter(2, SmiType(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2015-12-02 12:35:12 +00:00
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
void LoadDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
2015-07-01 08:45:05 +00:00
|
|
|
Register registers[] = {ReceiverRegister(), NameRegister(), SlotRegister()};
|
2015-06-24 06:21:47 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
2014-09-03 10:51:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
void StoreDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
2015-07-01 08:45:05 +00:00
|
|
|
Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister()};
|
2015-06-24 06:21:47 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
2014-09-03 10:51:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-08-21 09:04:43 +00:00
|
|
|
void StoreTransitionDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
|
|
|
Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(),
|
|
|
|
MapRegister()};
|
|
|
|
|
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-10-12 07:34:18 +00:00
|
|
|
void VectorStoreTransitionDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
|
|
|
if (SlotRegister().is(no_reg)) {
|
|
|
|
Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(),
|
|
|
|
MapRegister(), VectorRegister()};
|
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
|
|
|
} else {
|
|
|
|
Register registers[] = {ReceiverRegister(), NameRegister(),
|
|
|
|
ValueRegister(), MapRegister(),
|
|
|
|
SlotRegister(), VectorRegister()};
|
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-07-23 14:00:02 +00:00
|
|
|
StoreTransitionDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction();
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone)); // Receiver
|
|
|
|
function->InitParameter(1, AnyTagged(zone)); // Name
|
|
|
|
function->InitParameter(2, AnyTagged(zone)); // Value
|
|
|
|
function->InitParameter(3, AnyTagged(zone)); // Map
|
2015-07-23 14:00:02 +00:00
|
|
|
return function;
|
2014-09-29 13:11:27 +00:00
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-07-13 09:18:44 +00:00
|
|
|
LoadGlobalViaContextDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 1, zone)->AsFunction();
|
2015-11-04 08:05:37 +00:00
|
|
|
function->InitParameter(0, UntaggedIntegral32(zone));
|
2015-07-13 09:18:44 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LoadGlobalViaContextDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
2015-07-28 06:04:04 +00:00
|
|
|
Register registers[] = {SlotRegister()};
|
2015-07-13 09:18:44 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-07-13 09:18:44 +00:00
|
|
|
StoreGlobalViaContextDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction();
|
2015-11-04 08:05:37 +00:00
|
|
|
function->InitParameter(0, UntaggedIntegral32(zone));
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(1, AnyTagged(zone));
|
2015-07-13 09:18:44 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void StoreGlobalViaContextDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
2015-07-28 06:04:04 +00:00
|
|
|
Register registers[] = {SlotRegister(), ValueRegister()};
|
2015-07-13 09:18:44 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-09-18 08:30:22 +00:00
|
|
|
void StringCompareDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
|
|
|
Register registers[] = {LeftRegister(), RightRegister()};
|
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
|
|
|
}
|
|
|
|
|
2016-03-21 06:02:17 +00:00
|
|
|
void TypeConversionDescriptor::InitializePlatformSpecific(
|
2015-07-31 12:25:28 +00:00
|
|
|
CallInterfaceDescriptorData* data) {
|
2016-03-21 06:02:17 +00:00
|
|
|
Register registers[] = {ArgumentRegister()};
|
2015-07-31 12:25:28 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
|
|
|
}
|
|
|
|
|
2016-05-03 11:11:27 +00:00
|
|
|
void HasPropertyDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
|
|
|
Register registers[] = {KeyRegister(), ObjectRegister()};
|
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
|
|
|
}
|
2015-07-31 12:25:28 +00:00
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
void MathPowTaggedDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
2015-07-01 08:45:05 +00:00
|
|
|
Register registers[] = {exponent()};
|
2015-06-24 06:21:47 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
2014-09-11 07:11:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
void MathPowIntegerDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
2015-07-01 08:45:05 +00:00
|
|
|
Register registers[] = {exponent()};
|
2015-06-24 06:21:47 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-06-24 06:21:47 +00:00
|
|
|
LoadWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction();
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone));
|
|
|
|
function->InitParameter(1, AnyTagged(zone));
|
|
|
|
function->InitParameter(2, SmiType(zone));
|
|
|
|
function->InitParameter(3, AnyTagged(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
2014-09-11 07:11:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
void LoadWithVectorDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
2015-07-01 08:45:05 +00:00
|
|
|
Register registers[] = {ReceiverRegister(), NameRegister(), SlotRegister(),
|
|
|
|
VectorRegister()};
|
2015-06-24 06:21:47 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-08-21 09:04:43 +00:00
|
|
|
VectorStoreTransitionDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2015-10-12 07:34:18 +00:00
|
|
|
bool has_slot = !VectorStoreTransitionDescriptor::SlotRegister().is(no_reg);
|
|
|
|
int arg_count = has_slot ? 6 : 5;
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), arg_count, zone)
|
|
|
|
->AsFunction();
|
2015-10-12 07:34:18 +00:00
|
|
|
int index = 0;
|
|
|
|
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
|
|
|
|
}
|
|
|
|
function->InitParameter(index++, AnyTagged(zone)); // vector
|
2015-08-21 09:04:43 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* VectorStoreICDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
2015-06-24 06:21:47 +00:00
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 5, zone)->AsFunction();
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone));
|
|
|
|
function->InitParameter(1, AnyTagged(zone));
|
|
|
|
function->InitParameter(2, AnyTagged(zone));
|
|
|
|
function->InitParameter(3, SmiType(zone));
|
|
|
|
function->InitParameter(4, AnyTagged(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
2015-05-22 14:36:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
void VectorStoreICDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
2015-07-01 08:45:05 +00:00
|
|
|
Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(),
|
|
|
|
SlotRegister(), VectorRegister()};
|
2015-06-24 06:21:47 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
2015-05-22 14:36:48 +00:00
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-06-24 06:21:47 +00:00
|
|
|
VectorStoreICTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction();
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone));
|
|
|
|
function->InitParameter(1, AnyTagged(zone));
|
|
|
|
function->InitParameter(2, AnyTagged(zone));
|
|
|
|
function->InitParameter(3, SmiType(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void VectorStoreICTrampolineDescriptor::InitializePlatformSpecific(
|
2015-05-22 14:36:48 +00:00
|
|
|
CallInterfaceDescriptorData* data) {
|
2015-07-01 08:45:05 +00:00
|
|
|
Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(),
|
|
|
|
SlotRegister()};
|
2015-06-24 06:21:47 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
2014-09-11 07:11:10 +00:00
|
|
|
}
|
|
|
|
|
2016-04-20 08:01:08 +00:00
|
|
|
const Register ApiGetterDescriptor::ReceiverRegister() {
|
|
|
|
return LoadDescriptor::ReceiverRegister();
|
2015-06-24 06:21:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ApiGetterDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
2016-04-20 08:01:08 +00:00
|
|
|
Register registers[] = {ReceiverRegister(), HolderRegister(),
|
|
|
|
CallbackRegister()};
|
2015-06-24 06:21:47 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
2014-09-11 07:11:10 +00:00
|
|
|
}
|
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
void ContextOnlyDescriptor::InitializePlatformSpecific(
|
|
|
|
CallInterfaceDescriptorData* data) {
|
2015-07-01 08:45:05 +00:00
|
|
|
data->InitializePlatformSpecific(0, nullptr);
|
2014-09-03 10:51:51 +00:00
|
|
|
}
|
|
|
|
|
2015-04-30 12:34:02 +00:00
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
void GrowArrayElementsDescriptor::InitializePlatformSpecific(
|
2015-04-30 12:34:02 +00:00
|
|
|
CallInterfaceDescriptorData* data) {
|
2015-07-01 08:45:05 +00:00
|
|
|
Register registers[] = {ObjectRegister(), KeyRegister()};
|
2015-06-24 06:21:47 +00:00
|
|
|
data->InitializePlatformSpecific(arraysize(registers), registers);
|
|
|
|
}
|
|
|
|
|
2016-03-22 12:50:49 +00:00
|
|
|
FunctionType* FastArrayPushDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), AnyTagged(zone), 1, zone)->AsFunction();
|
|
|
|
function->InitParameter(0, UntaggedIntegral32(zone)); // actual #arguments
|
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-11-25 09:22:39 +00:00
|
|
|
FastCloneRegExpDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction();
|
2015-11-25 09:22:39 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone)); // closure
|
|
|
|
function->InitParameter(1, SmiType(zone)); // literal_index
|
|
|
|
function->InitParameter(2, AnyTagged(zone)); // pattern
|
|
|
|
function->InitParameter(3, AnyTagged(zone)); // flags
|
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-06-24 06:21:47 +00:00
|
|
|
FastCloneShallowArrayDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction();
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone));
|
|
|
|
function->InitParameter(1, SmiType(zone));
|
|
|
|
function->InitParameter(2, AnyTagged(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-06-24 06:21:47 +00:00
|
|
|
CreateAllocationSiteDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction();
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone));
|
|
|
|
function->InitParameter(1, SmiType(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
2015-04-30 12:34:02 +00:00
|
|
|
}
|
2015-06-24 06:21:47 +00:00
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-06-24 06:21:47 +00:00
|
|
|
CreateWeakCellDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction();
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone));
|
|
|
|
function->InitParameter(1, SmiType(zone));
|
|
|
|
function->InitParameter(2, AnyTagged(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-09-08 13:35:20 +00:00
|
|
|
CallTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction();
|
2015-11-19 14:36:40 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone)); // target
|
|
|
|
function->InitParameter(1, UntaggedIntegral32(zone)); // actual #arguments
|
2015-09-08 13:35:20 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* ConstructStubDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
2015-12-10 06:03:37 +00:00
|
|
|
Isolate* isolate, int paramater_count) {
|
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction();
|
2015-12-10 06:03:37 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone)); // target
|
|
|
|
function->InitParameter(1, AnyTagged(zone)); // new.target
|
|
|
|
function->InitParameter(2, UntaggedIntegral32(zone)); // actual #arguments
|
|
|
|
function->InitParameter(3, AnyTagged(zone)); // opt. allocation site
|
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-11-23 10:34:04 +00:00
|
|
|
ConstructTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction();
|
2015-11-23 10:34:04 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone)); // target
|
|
|
|
function->InitParameter(1, AnyTagged(zone)); // new.target
|
|
|
|
function->InitParameter(2, UntaggedIntegral32(zone)); // actual #arguments
|
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-06-24 06:21:47 +00:00
|
|
|
CallFunctionWithFeedbackDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction();
|
2015-07-01 08:45:05 +00:00
|
|
|
function->InitParameter(0, Type::Receiver()); // JSFunction
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(1, SmiType(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* CallFunctionWithFeedbackAndVectorDescriptor::
|
2015-06-24 06:21:47 +00:00
|
|
|
BuildCallInterfaceDescriptorFunctionType(Isolate* isolate,
|
|
|
|
int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction();
|
2015-07-01 08:45:05 +00:00
|
|
|
function->InitParameter(0, Type::Receiver()); // JSFunction
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(1, SmiType(zone));
|
|
|
|
function->InitParameter(2, AnyTagged(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-05-03 07:58:58 +00:00
|
|
|
FunctionType*
|
|
|
|
ArrayNoArgumentConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction();
|
|
|
|
function->InitParameter(0, Type::Receiver()); // JSFunction
|
|
|
|
function->InitParameter(1, AnyTagged(zone));
|
|
|
|
function->InitParameter(2, UntaggedIntegral32(zone));
|
|
|
|
function->InitParameter(3, AnyTagged(zone));
|
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-06-24 06:21:47 +00:00
|
|
|
ArrayConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction();
|
2015-07-01 08:45:05 +00:00
|
|
|
function->InitParameter(0, Type::Receiver()); // JSFunction
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(1, AnyTagged(zone));
|
2015-11-04 08:05:37 +00:00
|
|
|
function->InitParameter(2, UntaggedIntegral32(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-06-24 06:21:47 +00:00
|
|
|
InternalArrayConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction();
|
2015-07-01 08:45:05 +00:00
|
|
|
function->InitParameter(0, Type::Receiver()); // JSFunction
|
2015-11-04 08:05:37 +00:00
|
|
|
function->InitParameter(1, UntaggedIntegral32(zone));
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType*
|
2015-06-24 06:21:47 +00:00
|
|
|
ArgumentAdaptorDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int paramater_count) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction();
|
2015-11-19 14:36:40 +00:00
|
|
|
function->InitParameter(0, Type::Receiver()); // JSFunction
|
|
|
|
function->InitParameter(1, AnyTagged(zone)); // the new target
|
|
|
|
function->InitParameter(2, UntaggedIntegral32(zone)); // actual #arguments
|
|
|
|
function->InitParameter(3, UntaggedIntegral32(zone)); // expected #arguments
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-03-09 16:18:28 +00:00
|
|
|
CallInterfaceDescriptor ApiCallbackDescriptorBase::ForArgs(Isolate* isolate,
|
|
|
|
int argc) {
|
|
|
|
switch (argc) {
|
|
|
|
case 0:
|
|
|
|
return ApiCallbackWith0ArgsDescriptor(isolate);
|
|
|
|
case 1:
|
|
|
|
return ApiCallbackWith1ArgsDescriptor(isolate);
|
|
|
|
case 2:
|
|
|
|
return ApiCallbackWith2ArgsDescriptor(isolate);
|
|
|
|
case 3:
|
|
|
|
return ApiCallbackWith3ArgsDescriptor(isolate);
|
|
|
|
case 4:
|
|
|
|
return ApiCallbackWith4ArgsDescriptor(isolate);
|
|
|
|
case 5:
|
|
|
|
return ApiCallbackWith5ArgsDescriptor(isolate);
|
|
|
|
case 6:
|
|
|
|
return ApiCallbackWith6ArgsDescriptor(isolate);
|
|
|
|
case 7:
|
|
|
|
return ApiCallbackWith7ArgsDescriptor(isolate);
|
|
|
|
default:
|
|
|
|
UNREACHABLE();
|
|
|
|
return VoidDescriptor(isolate);
|
|
|
|
}
|
2015-06-24 06:21:47 +00:00
|
|
|
}
|
|
|
|
|
2016-03-09 16:18:28 +00:00
|
|
|
FunctionType*
|
|
|
|
ApiCallbackDescriptorBase::BuildCallInterfaceDescriptorFunctionTypeWithArg(
|
|
|
|
Isolate* isolate, int parameter_count, int argc) {
|
2015-09-03 12:53:19 +00:00
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function =
|
2016-03-09 16:18:28 +00:00
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 4 + argc, zone)
|
|
|
|
->AsFunction();
|
2015-09-03 12:53:19 +00:00
|
|
|
function->InitParameter(0, AnyTagged(zone)); // callee
|
|
|
|
function->InitParameter(1, AnyTagged(zone)); // call_data
|
|
|
|
function->InitParameter(2, AnyTagged(zone)); // holder
|
|
|
|
function->InitParameter(3, ExternalPointer(zone)); // api_function_address
|
2016-03-09 16:18:28 +00:00
|
|
|
for (int i = 0; i < argc; i++) {
|
|
|
|
function->InitParameter(i, AnyTagged(zone));
|
|
|
|
}
|
2015-06-24 06:21:47 +00:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2016-02-10 16:38:49 +00:00
|
|
|
FunctionType*
|
|
|
|
InterpreterDispatchDescriptor::BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
Isolate* isolate, int parameter_count) {
|
|
|
|
Zone* zone = isolate->interface_descriptor_zone();
|
|
|
|
FunctionType* function =
|
2016-04-19 12:47:25 +00:00
|
|
|
Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction();
|
2016-02-10 16:38:49 +00:00
|
|
|
function->InitParameter(kAccumulatorParameter, AnyTagged(zone));
|
|
|
|
function->InitParameter(kBytecodeOffsetParameter, UntaggedIntegral32(zone));
|
|
|
|
function->InitParameter(kBytecodeArrayParameter, AnyTagged(zone));
|
|
|
|
function->InitParameter(kDispatchTableParameter, AnyTagged(zone));
|
|
|
|
return function;
|
|
|
|
}
|
2015-06-24 06:21:47 +00:00
|
|
|
|
2015-06-01 22:46:54 +00:00
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|