2014-08-29 10:40:02 +00:00
|
|
|
// Copyright 2014 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.
|
|
|
|
|
|
|
|
#ifndef V8_CALL_INTERFACE_DESCRIPTOR_H_
|
|
|
|
#define V8_CALL_INTERFACE_DESCRIPTOR_H_
|
|
|
|
|
|
|
|
#include "src/assembler.h"
|
|
|
|
#include "src/macro-assembler.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
|
|
|
class PlatformInterfaceDescriptor;
|
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
#define INTERFACE_DESCRIPTOR_LIST(V) \
|
2015-12-02 12:35:12 +00:00
|
|
|
V(Void) \
|
2014-09-03 10:51:51 +00:00
|
|
|
V(Load) \
|
|
|
|
V(Store) \
|
2014-09-30 14:54:14 +00:00
|
|
|
V(StoreTransition) \
|
2015-08-21 09:04:43 +00:00
|
|
|
V(VectorStoreTransition) \
|
2015-05-22 14:36:48 +00:00
|
|
|
V(VectorStoreICTrampoline) \
|
|
|
|
V(VectorStoreIC) \
|
2015-08-25 04:48:36 +00:00
|
|
|
V(InstanceOf) \
|
2015-05-20 13:19:11 +00:00
|
|
|
V(LoadWithVector) \
|
2014-09-03 10:51:51 +00:00
|
|
|
V(FastNewClosure) \
|
|
|
|
V(FastNewContext) \
|
2016-02-19 07:12:18 +00:00
|
|
|
V(FastNewObject) \
|
[runtime] Optimize and unify rest parameters.
Replace the somewhat awkward RestParamAccessStub, which would always
call into the runtime anyway with a proper FastNewRestParameterStub,
which is basically based on the code that was already there for strict
arguments object materialization. But for rest parameters we could
optimize even further (leading to 8-10x improvements for functions with
rest parameters), by fixing the internal formal parameter count:
Every SharedFunctionInfo has a formal_parameter_count field, which
specifies the number of formal parameters, and is used to decide whether
we need to create an arguments adaptor frame when calling a function
(i.e. if there's a mismatch between the actual and expected parameters).
Previously the formal_parameter_count included the rest parameter, which
was sort of unfortunate, as that meant that calling a function with only
the non-rest parameters still required an arguments adaptor (plus some
other oddities). Now with this CL we fix, so that we do no longer
include the rest parameter in that count. Thereby checking for rest
parameters is very efficient, as we only need to check whether there is
an arguments adaptor frame, and if not create an empty array, otherwise
check whether the arguments adaptor frame has more parameters than
specified by the formal_parameter_count.
The FastNewRestParameterStub is written in a way that it can be directly
used by Ignition as well, and with some tweaks to the TurboFan backends
and the CodeStubAssembler, we should be able to rewrite it as
TurboFanCodeStub in the near future.
Drive-by-fix: Refactor and unify the CreateArgumentsType which was
different in TurboFan and Ignition; now we have a single enum class
which is used in both TurboFan and Ignition.
R=jarin@chromium.org, rmcilroy@chromium.org
TBR=rossberg@chromium.org
BUG=v8:2159
LOG=n
Review URL: https://codereview.chromium.org/1676883002
Cr-Commit-Position: refs/heads/master@{#33809}
2016-02-08 10:08:21 +00:00
|
|
|
V(FastNewRestParameter) \
|
2016-02-15 10:38:45 +00:00
|
|
|
V(FastNewSloppyArguments) \
|
|
|
|
V(FastNewStrictArguments) \
|
2016-03-21 06:02:17 +00:00
|
|
|
V(TypeConversion) \
|
2015-05-06 13:31:00 +00:00
|
|
|
V(Typeof) \
|
2015-11-25 09:22:39 +00:00
|
|
|
V(FastCloneRegExp) \
|
2014-09-03 10:51:51 +00:00
|
|
|
V(FastCloneShallowArray) \
|
|
|
|
V(FastCloneShallowObject) \
|
|
|
|
V(CreateAllocationSite) \
|
2015-02-04 09:46:05 +00:00
|
|
|
V(CreateWeakCell) \
|
2014-09-03 10:51:51 +00:00
|
|
|
V(CallFunction) \
|
2014-09-11 07:11:10 +00:00
|
|
|
V(CallFunctionWithFeedback) \
|
2015-01-27 11:23:51 +00:00
|
|
|
V(CallFunctionWithFeedbackAndVector) \
|
2015-12-04 07:33:44 +00:00
|
|
|
V(CallConstruct) \
|
2015-09-08 13:35:20 +00:00
|
|
|
V(CallTrampoline) \
|
2015-12-10 06:03:37 +00:00
|
|
|
V(ConstructStub) \
|
2015-11-23 10:34:04 +00:00
|
|
|
V(ConstructTrampoline) \
|
2014-09-03 10:51:51 +00:00
|
|
|
V(RegExpConstructResult) \
|
|
|
|
V(TransitionElementsKind) \
|
2014-11-04 12:58:17 +00:00
|
|
|
V(AllocateHeapNumber) \
|
2015-10-30 16:11:54 +00:00
|
|
|
V(AllocateMutableHeapNumber) \
|
2015-10-16 08:40:02 +00:00
|
|
|
V(AllocateInNewSpace) \
|
2014-09-03 10:51:51 +00:00
|
|
|
V(ArrayConstructorConstantArgCount) \
|
|
|
|
V(ArrayConstructor) \
|
|
|
|
V(InternalArrayConstructorConstantArgCount) \
|
|
|
|
V(InternalArrayConstructor) \
|
2015-03-19 13:09:26 +00:00
|
|
|
V(Compare) \
|
2014-09-03 10:51:51 +00:00
|
|
|
V(BinaryOp) \
|
|
|
|
V(BinaryOpWithAllocationSite) \
|
|
|
|
V(StringAdd) \
|
2015-09-18 08:30:22 +00:00
|
|
|
V(StringCompare) \
|
2014-09-03 10:51:51 +00:00
|
|
|
V(Keyed) \
|
|
|
|
V(Named) \
|
|
|
|
V(CallHandler) \
|
|
|
|
V(ArgumentAdaptor) \
|
2016-03-09 16:18:28 +00:00
|
|
|
V(ApiCallbackWith0Args) \
|
|
|
|
V(ApiCallbackWith1Args) \
|
|
|
|
V(ApiCallbackWith2Args) \
|
|
|
|
V(ApiCallbackWith3Args) \
|
|
|
|
V(ApiCallbackWith4Args) \
|
|
|
|
V(ApiCallbackWith5Args) \
|
|
|
|
V(ApiCallbackWith6Args) \
|
|
|
|
V(ApiCallbackWith7Args) \
|
2015-01-16 10:59:01 +00:00
|
|
|
V(ApiGetter) \
|
2015-07-13 09:18:44 +00:00
|
|
|
V(LoadGlobalViaContext) \
|
|
|
|
V(StoreGlobalViaContext) \
|
2014-09-11 07:11:10 +00:00
|
|
|
V(MathPowTagged) \
|
|
|
|
V(MathPowInteger) \
|
2015-04-30 12:34:02 +00:00
|
|
|
V(ContextOnly) \
|
2015-06-24 06:21:47 +00:00
|
|
|
V(GrowArrayElements) \
|
2016-02-10 16:38:49 +00:00
|
|
|
V(InterpreterDispatch) \
|
2015-10-02 18:13:41 +00:00
|
|
|
V(InterpreterPushArgsAndCall) \
|
2015-10-15 16:46:16 +00:00
|
|
|
V(InterpreterPushArgsAndConstruct) \
|
2015-10-02 18:13:41 +00:00
|
|
|
V(InterpreterCEntry)
|
2014-09-03 10:51:51 +00:00
|
|
|
|
|
|
|
class CallInterfaceDescriptorData {
|
2014-08-29 10:40:02 +00:00
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
CallInterfaceDescriptorData()
|
2015-07-23 14:00:02 +00:00
|
|
|
: register_param_count_(-1), function_type_(nullptr) {}
|
2014-09-01 12:15:25 +00:00
|
|
|
|
|
|
|
// A copy of the passed in registers and param_representations is made
|
2014-09-03 10:51:51 +00:00
|
|
|
// and owned by the CallInterfaceDescriptorData.
|
2014-09-01 12:15:25 +00:00
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
void InitializePlatformIndependent(FunctionType* function_type) {
|
2015-06-24 06:21:47 +00:00
|
|
|
function_type_ = function_type;
|
|
|
|
}
|
|
|
|
|
2014-09-01 12:15:25 +00:00
|
|
|
// TODO(mvstanton): Instead of taking parallel arrays register and
|
|
|
|
// param_representations, how about a struct that puts the representation
|
|
|
|
// and register side by side (eg, RegRep(r1, Representation::Tagged()).
|
2014-09-08 15:18:54 +00:00
|
|
|
// The same should go for the CodeStubDescriptor class.
|
2015-06-24 06:21:47 +00:00
|
|
|
void InitializePlatformSpecific(
|
|
|
|
int register_parameter_count, Register* registers,
|
|
|
|
PlatformInterfaceDescriptor* platform_descriptor = NULL);
|
2014-09-01 12:15:25 +00:00
|
|
|
|
2014-08-29 10:40:02 +00:00
|
|
|
bool IsInitialized() const { return register_param_count_ >= 0; }
|
|
|
|
|
2015-07-23 14:00:02 +00:00
|
|
|
int param_count() const { return function_type_->Arity(); }
|
2014-09-03 10:51:51 +00:00
|
|
|
int register_param_count() const { return register_param_count_; }
|
|
|
|
Register register_param(int index) const { return register_params_[index]; }
|
|
|
|
Register* register_params() const { return register_params_.get(); }
|
2015-07-23 14:00:02 +00:00
|
|
|
Type* param_type(int index) const { return function_type_->Parameter(index); }
|
2014-09-03 10:51:51 +00:00
|
|
|
PlatformInterfaceDescriptor* platform_specific_descriptor() const {
|
|
|
|
return platform_specific_descriptor_;
|
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function_type() const { return function_type_; }
|
2015-06-24 06:21:47 +00:00
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
private:
|
|
|
|
int register_param_count_;
|
|
|
|
|
|
|
|
// The Register params are allocated dynamically by the
|
|
|
|
// InterfaceDescriptor, and freed on destruction. This is because static
|
|
|
|
// arrays of Registers cause creation of runtime static initializers
|
|
|
|
// which we don't want.
|
2015-07-13 12:38:06 +00:00
|
|
|
base::SmartArrayPointer<Register> register_params_;
|
2015-06-24 06:21:47 +00:00
|
|
|
|
|
|
|
// Specifies types for parameters and return
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function_type_;
|
2014-08-29 10:40:02 +00:00
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
PlatformInterfaceDescriptor* platform_specific_descriptor_;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CallInterfaceDescriptorData);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CallDescriptors {
|
|
|
|
public:
|
|
|
|
enum Key {
|
|
|
|
#define DEF_ENUM(name) name,
|
|
|
|
INTERFACE_DESCRIPTOR_LIST(DEF_ENUM)
|
|
|
|
#undef DEF_ENUM
|
|
|
|
NUMBER_OF_DESCRIPTORS
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
CallInterfaceDescriptor() : data_(NULL) {}
|
2015-06-24 06:21:47 +00:00
|
|
|
virtual ~CallInterfaceDescriptor() {}
|
2014-09-03 10:51:51 +00:00
|
|
|
|
|
|
|
CallInterfaceDescriptor(Isolate* isolate, CallDescriptors::Key key)
|
|
|
|
: data_(isolate->call_descriptor_data(key)) {}
|
|
|
|
|
2015-07-23 14:00:02 +00:00
|
|
|
int GetParameterCount() const { return data()->param_count(); }
|
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
int GetRegisterParameterCount() const {
|
|
|
|
return data()->register_param_count();
|
|
|
|
}
|
2014-08-29 10:40:02 +00:00
|
|
|
|
2015-07-01 08:45:05 +00:00
|
|
|
int GetStackParameterCount() const {
|
|
|
|
return data()->function_type()->Arity() - data()->register_param_count();
|
|
|
|
}
|
|
|
|
|
|
|
|
Register GetRegisterParameter(int index) const {
|
2014-09-03 10:51:51 +00:00
|
|
|
return data()->register_param(index);
|
2014-08-29 10:40:02 +00:00
|
|
|
}
|
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
Type* GetParameterType(int index) const {
|
2015-07-23 14:00:02 +00:00
|
|
|
DCHECK(index < data()->param_count());
|
|
|
|
return data()->param_type(index);
|
2014-08-29 10:40:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Some platforms have extra information to associate with the descriptor.
|
|
|
|
PlatformInterfaceDescriptor* platform_specific_descriptor() const {
|
2014-09-03 10:51:51 +00:00
|
|
|
return data()->platform_specific_descriptor();
|
2014-08-29 10:40:02 +00:00
|
|
|
}
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* GetFunctionType() const { return data()->function_type(); }
|
2015-06-24 06:21:47 +00:00
|
|
|
|
2014-08-29 10:40:02 +00:00
|
|
|
static const Register ContextRegister();
|
|
|
|
|
2014-10-30 09:00:58 +00:00
|
|
|
const char* DebugName(Isolate* isolate) const;
|
2014-09-08 15:18:54 +00:00
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
static FunctionType* BuildDefaultFunctionType(Isolate* isolate,
|
|
|
|
int paramater_count);
|
2015-06-24 06:21:47 +00:00
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
protected:
|
|
|
|
const CallInterfaceDescriptorData* data() const { return data_; }
|
|
|
|
|
2016-02-02 07:25:30 +00:00
|
|
|
virtual FunctionType* BuildCallInterfaceDescriptorFunctionType(
|
2015-06-24 06:21:47 +00:00
|
|
|
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);
|
2016-03-09 16:18:28 +00:00
|
|
|
DCHECK(d == data()); // d should be a modifiable pointer to data().
|
2015-06-24 06:21:47 +00:00
|
|
|
InitializePlatformSpecific(d);
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* function_type = BuildCallInterfaceDescriptorFunctionType(
|
|
|
|
isolate, d->register_param_count());
|
2015-07-23 14:00:02 +00:00
|
|
|
d->InitializePlatformIndependent(function_type);
|
2015-06-24 06:21:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-29 10:40:02 +00:00
|
|
|
private:
|
2014-09-03 10:51:51 +00:00
|
|
|
const CallInterfaceDescriptorData* data_;
|
|
|
|
};
|
2014-08-29 10:40:02 +00:00
|
|
|
|
2016-03-09 16:18:28 +00:00
|
|
|
#define DECLARE_DESCRIPTOR_WITH_BASE(name, base) \
|
|
|
|
public: \
|
|
|
|
explicit name(Isolate* isolate) : base(isolate, key()) { \
|
|
|
|
Initialize(isolate, key()); \
|
|
|
|
} \
|
|
|
|
static inline CallDescriptors::Key key();
|
2014-08-29 10:40:02 +00:00
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
#define DECLARE_DESCRIPTOR(name, base) \
|
2016-03-09 16:18:28 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_BASE(name, base) \
|
2015-06-24 06:21:47 +00:00
|
|
|
protected: \
|
|
|
|
void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \
|
|
|
|
name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \
|
|
|
|
\
|
2016-03-09 16:18:28 +00:00
|
|
|
public:
|
2014-09-03 10:51:51 +00:00
|
|
|
|
2015-11-04 13:08:27 +00:00
|
|
|
#define DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(name, base) \
|
|
|
|
DECLARE_DESCRIPTOR(name, base) \
|
|
|
|
protected: \
|
2016-02-02 07:25:30 +00:00
|
|
|
FunctionType* BuildCallInterfaceDescriptorFunctionType( \
|
2015-11-04 13:08:27 +00:00
|
|
|
Isolate* isolate, int register_param_count) override; \
|
|
|
|
\
|
2015-06-24 06:21:47 +00:00
|
|
|
public:
|
2015-12-02 12:35:12 +00:00
|
|
|
|
2016-03-09 16:18:28 +00:00
|
|
|
#define DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(name, base, arg) \
|
|
|
|
DECLARE_DESCRIPTOR_WITH_BASE(name, base) \
|
|
|
|
protected: \
|
|
|
|
FunctionType* BuildCallInterfaceDescriptorFunctionType( \
|
|
|
|
Isolate* isolate, int register_param_count) override { \
|
|
|
|
return BuildCallInterfaceDescriptorFunctionTypeWithArg( \
|
|
|
|
isolate, register_param_count, arg); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
public:
|
|
|
|
|
2015-12-02 12:35:12 +00:00
|
|
|
class VoidDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(VoidDescriptor, CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-09-11 07:11:10 +00:00
|
|
|
// LoadDescriptor is used by all stubs that implement Load/KeyedLoad ICs.
|
2014-09-03 10:51:51 +00:00
|
|
|
class LoadDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
|
2015-05-20 13:19:11 +00:00
|
|
|
enum ParameterIndices { kReceiverIndex, kNameIndex, kSlotIndex };
|
2014-09-03 10:51:51 +00:00
|
|
|
static const Register ReceiverRegister();
|
|
|
|
static const Register NameRegister();
|
2015-05-20 13:19:11 +00:00
|
|
|
static const Register SlotRegister();
|
2014-08-29 10:40:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
class StoreDescriptor : public CallInterfaceDescriptor {
|
2014-08-29 10:40:02 +00:00
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(StoreDescriptor, CallInterfaceDescriptor)
|
2014-09-01 09:18:39 +00:00
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
enum ParameterIndices {
|
|
|
|
kReceiverIndex,
|
|
|
|
kNameIndex,
|
|
|
|
kValueIndex,
|
|
|
|
kParameterCount
|
|
|
|
};
|
|
|
|
static const Register ReceiverRegister();
|
|
|
|
static const Register NameRegister();
|
|
|
|
static const Register ValueRegister();
|
2014-08-29 10:40:02 +00:00
|
|
|
};
|
2014-09-03 10:51:51 +00:00
|
|
|
|
|
|
|
|
2014-09-30 14:54:14 +00:00
|
|
|
class StoreTransitionDescriptor : public StoreDescriptor {
|
2014-09-29 13:11:27 +00:00
|
|
|
public:
|
2015-07-23 14:00:02 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreTransitionDescriptor,
|
|
|
|
StoreDescriptor)
|
2014-09-29 13:11:27 +00:00
|
|
|
|
|
|
|
// Extends StoreDescriptor with Map parameter.
|
|
|
|
enum ParameterIndices {
|
|
|
|
kReceiverIndex,
|
|
|
|
kNameIndex,
|
|
|
|
kValueIndex,
|
|
|
|
kMapIndex,
|
|
|
|
kParameterCount
|
|
|
|
};
|
2015-07-23 14:00:02 +00:00
|
|
|
|
2015-08-21 09:04:43 +00:00
|
|
|
static const Register MapRegister();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class VectorStoreTransitionDescriptor : public StoreDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(VectorStoreTransitionDescriptor,
|
|
|
|
StoreDescriptor)
|
|
|
|
|
|
|
|
// Extends StoreDescriptor with Map parameter.
|
|
|
|
enum ParameterIndices {
|
2015-10-12 07:34:18 +00:00
|
|
|
kReceiverIndex = 0,
|
|
|
|
kNameIndex = 1,
|
|
|
|
kValueIndex = 2,
|
|
|
|
|
|
|
|
kMapIndex = 3,
|
|
|
|
|
|
|
|
kSlotIndex = 4, // not present on ia32.
|
|
|
|
kVirtualSlotVectorIndex = 4,
|
|
|
|
|
|
|
|
kVectorIndex = 5
|
2015-08-21 09:04:43 +00:00
|
|
|
};
|
|
|
|
|
2015-10-12 07:34:18 +00:00
|
|
|
static const Register MapRegister();
|
2015-08-21 09:04:43 +00:00
|
|
|
static const Register SlotRegister();
|
|
|
|
static const Register VectorRegister();
|
2014-09-29 13:11:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-08-25 04:48:36 +00:00
|
|
|
class InstanceOfDescriptor final : public CallInterfaceDescriptor {
|
2014-09-03 10:51:51 +00:00
|
|
|
public:
|
2015-08-25 04:48:36 +00:00
|
|
|
DECLARE_DESCRIPTOR(InstanceOfDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
|
|
|
|
enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount };
|
2015-08-25 04:48:36 +00:00
|
|
|
static const Register LeftRegister();
|
|
|
|
static const Register RightRegister();
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-05-22 14:36:48 +00:00
|
|
|
class VectorStoreICTrampolineDescriptor : public StoreDescriptor {
|
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
|
|
|
|
VectorStoreICTrampolineDescriptor, StoreDescriptor)
|
2015-05-22 14:36:48 +00:00
|
|
|
|
|
|
|
enum ParameterIndices { kReceiverIndex, kNameIndex, kValueIndex, kSlotIndex };
|
|
|
|
|
|
|
|
static const Register SlotRegister();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class VectorStoreICDescriptor : public VectorStoreICTrampolineDescriptor {
|
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
|
|
|
|
VectorStoreICDescriptor, VectorStoreICTrampolineDescriptor)
|
2015-05-22 14:36:48 +00:00
|
|
|
|
|
|
|
enum ParameterIndices {
|
|
|
|
kReceiverIndex,
|
|
|
|
kNameIndex,
|
|
|
|
kValueIndex,
|
|
|
|
kSlotIndex,
|
|
|
|
kVectorIndex
|
|
|
|
};
|
|
|
|
|
|
|
|
static const Register VectorRegister();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-05-20 13:19:11 +00:00
|
|
|
class LoadWithVectorDescriptor : public LoadDescriptor {
|
2014-09-03 10:51:51 +00:00
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadWithVectorDescriptor,
|
|
|
|
LoadDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
|
|
|
|
enum ParameterIndices {
|
|
|
|
kReceiverIndex,
|
|
|
|
kNameIndex,
|
|
|
|
kSlotIndex,
|
2014-09-11 07:11:10 +00:00
|
|
|
kVectorIndex
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const Register VectorRegister();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class FastNewClosureDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(FastNewClosureDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class FastNewContextDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(FastNewContextDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
2016-02-19 07:12:18 +00:00
|
|
|
class FastNewObjectDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(FastNewObjectDescriptor, CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
[runtime] Optimize and unify rest parameters.
Replace the somewhat awkward RestParamAccessStub, which would always
call into the runtime anyway with a proper FastNewRestParameterStub,
which is basically based on the code that was already there for strict
arguments object materialization. But for rest parameters we could
optimize even further (leading to 8-10x improvements for functions with
rest parameters), by fixing the internal formal parameter count:
Every SharedFunctionInfo has a formal_parameter_count field, which
specifies the number of formal parameters, and is used to decide whether
we need to create an arguments adaptor frame when calling a function
(i.e. if there's a mismatch between the actual and expected parameters).
Previously the formal_parameter_count included the rest parameter, which
was sort of unfortunate, as that meant that calling a function with only
the non-rest parameters still required an arguments adaptor (plus some
other oddities). Now with this CL we fix, so that we do no longer
include the rest parameter in that count. Thereby checking for rest
parameters is very efficient, as we only need to check whether there is
an arguments adaptor frame, and if not create an empty array, otherwise
check whether the arguments adaptor frame has more parameters than
specified by the formal_parameter_count.
The FastNewRestParameterStub is written in a way that it can be directly
used by Ignition as well, and with some tweaks to the TurboFan backends
and the CodeStubAssembler, we should be able to rewrite it as
TurboFanCodeStub in the near future.
Drive-by-fix: Refactor and unify the CreateArgumentsType which was
different in TurboFan and Ignition; now we have a single enum class
which is used in both TurboFan and Ignition.
R=jarin@chromium.org, rmcilroy@chromium.org
TBR=rossberg@chromium.org
BUG=v8:2159
LOG=n
Review URL: https://codereview.chromium.org/1676883002
Cr-Commit-Position: refs/heads/master@{#33809}
2016-02-08 10:08:21 +00:00
|
|
|
class FastNewRestParameterDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(FastNewRestParameterDescriptor, CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
2016-02-15 10:38:45 +00:00
|
|
|
class FastNewSloppyArgumentsDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(FastNewSloppyArgumentsDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
2016-02-12 05:10:38 +00:00
|
|
|
class FastNewStrictArgumentsDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(FastNewStrictArgumentsDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
2016-03-21 06:02:17 +00:00
|
|
|
class TypeConversionDescriptor final : public CallInterfaceDescriptor {
|
2015-08-28 12:59:51 +00:00
|
|
|
public:
|
2016-03-21 06:02:17 +00:00
|
|
|
enum ParameterIndices { kArgumentIndex };
|
2015-08-28 12:59:51 +00:00
|
|
|
|
2016-03-21 06:02:17 +00:00
|
|
|
DECLARE_DESCRIPTOR(TypeConversionDescriptor, CallInterfaceDescriptor)
|
2015-08-28 12:59:51 +00:00
|
|
|
|
2016-03-21 06:02:17 +00:00
|
|
|
static const Register ArgumentRegister();
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-05-06 13:31:00 +00:00
|
|
|
class TypeofDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(TypeofDescriptor, CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
2015-11-25 09:22:39 +00:00
|
|
|
|
|
|
|
class FastCloneRegExpDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneRegExpDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
2015-05-06 13:31:00 +00:00
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneShallowArrayDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(FastCloneShallowObjectDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateAllocationSiteDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-02-04 09:46:05 +00:00
|
|
|
class CreateWeakCellDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
enum ParameterIndices {
|
|
|
|
kVectorIndex,
|
|
|
|
kSlotIndex,
|
|
|
|
kValueIndex,
|
|
|
|
kParameterCount
|
|
|
|
};
|
|
|
|
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateWeakCellDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
2015-02-04 09:46:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-09-08 13:35:20 +00:00
|
|
|
class CallTrampolineDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CallTrampolineDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-12-10 06:03:37 +00:00
|
|
|
class ConstructStubDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ConstructStubDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-11-23 10:34:04 +00:00
|
|
|
class ConstructTrampolineDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ConstructTrampolineDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
class CallFunctionDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(CallFunctionDescriptor, CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CallFunctionWithFeedbackDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
|
|
|
|
CallFunctionWithFeedbackDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-01-27 11:23:51 +00:00
|
|
|
class CallFunctionWithFeedbackAndVectorDescriptor
|
|
|
|
: public CallInterfaceDescriptor {
|
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
|
|
|
|
CallFunctionWithFeedbackAndVectorDescriptor, CallInterfaceDescriptor)
|
2015-01-27 11:23:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-12-04 07:33:44 +00:00
|
|
|
class CallConstructDescriptor : public CallInterfaceDescriptor {
|
2014-09-03 10:51:51 +00:00
|
|
|
public:
|
2015-12-04 07:33:44 +00:00
|
|
|
DECLARE_DESCRIPTOR(CallConstructDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class RegExpConstructResultDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(RegExpConstructResultDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-07-13 09:18:44 +00:00
|
|
|
class LoadGlobalViaContextDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadGlobalViaContextDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
|
|
|
|
static const Register SlotRegister();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class StoreGlobalViaContextDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreGlobalViaContextDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
|
|
|
|
static const Register SlotRegister();
|
|
|
|
static const Register ValueRegister();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
class TransitionElementsKindDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(TransitionElementsKindDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-11-04 12:58:17 +00:00
|
|
|
class AllocateHeapNumberDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(AllocateHeapNumberDescriptor, CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-10-30 16:11:54 +00:00
|
|
|
class AllocateMutableHeapNumberDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(AllocateMutableHeapNumberDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-10-16 08:40:02 +00:00
|
|
|
class AllocateInNewSpaceDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(AllocateInNewSpaceDescriptor, CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
class ArrayConstructorConstantArgCountDescriptor
|
|
|
|
: public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(ArrayConstructorConstantArgCountDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ArrayConstructorDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class InternalArrayConstructorConstantArgCountDescriptor
|
|
|
|
: public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(InternalArrayConstructorConstantArgCountDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class InternalArrayConstructorDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
|
|
|
|
InternalArrayConstructorDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-03-19 13:09:26 +00:00
|
|
|
class CompareDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(CompareDescriptor, CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
class BinaryOpDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(BinaryOpDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class BinaryOpWithAllocationSiteDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(BinaryOpWithAllocationSiteDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class StringAddDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(StringAddDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-09-18 08:30:22 +00:00
|
|
|
class StringCompareDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(StringCompareDescriptor, CallInterfaceDescriptor)
|
|
|
|
|
|
|
|
enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount };
|
|
|
|
static const Register LeftRegister();
|
|
|
|
static const Register RightRegister();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
class KeyedDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(KeyedDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class NamedDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(NamedDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CallHandlerDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2014-09-11 07:11:10 +00:00
|
|
|
DECLARE_DESCRIPTOR(CallHandlerDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArgumentAdaptorDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
2016-03-09 16:18:28 +00:00
|
|
|
// The ApiCallback*Descriptors have a lot of boilerplate. The superclass
|
|
|
|
// ApiCallbackDescriptorBase contains all the logic, and the
|
|
|
|
// ApiCallbackWith*ArgsDescriptor merely instantiate these with a
|
|
|
|
// parameter for the number of args.
|
|
|
|
//
|
|
|
|
// The base class is not meant to be instantiated directly and has no
|
|
|
|
// public constructors to ensure this is so.
|
|
|
|
//
|
|
|
|
// The simplest usage for all the ApiCallback*Descriptors is probably
|
|
|
|
// ApiCallbackDescriptorBase::ForArgs(isolate, argc)
|
|
|
|
//
|
|
|
|
class ApiCallbackDescriptorBase : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
static CallInterfaceDescriptor ForArgs(Isolate* isolate, int argc);
|
2016-03-09 12:18:02 +00:00
|
|
|
|
2016-03-09 16:18:28 +00:00
|
|
|
protected:
|
|
|
|
ApiCallbackDescriptorBase(Isolate* isolate, CallDescriptors::Key key)
|
|
|
|
: CallInterfaceDescriptor(isolate, key) {}
|
|
|
|
void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override;
|
|
|
|
FunctionType* BuildCallInterfaceDescriptorFunctionTypeWithArg(
|
|
|
|
Isolate* isolate, int parameter_count, int argc);
|
|
|
|
};
|
|
|
|
|
|
|
|
class ApiCallbackWith0ArgsDescriptor : public ApiCallbackDescriptorBase {
|
2016-03-09 12:18:02 +00:00
|
|
|
public:
|
2016-03-09 16:18:28 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(
|
|
|
|
ApiCallbackWith0ArgsDescriptor, ApiCallbackDescriptorBase, 0)
|
2016-03-09 12:18:02 +00:00
|
|
|
};
|
|
|
|
|
2016-03-09 16:18:28 +00:00
|
|
|
class ApiCallbackWith1ArgsDescriptor : public ApiCallbackDescriptorBase {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(
|
|
|
|
ApiCallbackWith1ArgsDescriptor, ApiCallbackDescriptorBase, 1)
|
|
|
|
};
|
2016-03-09 12:18:02 +00:00
|
|
|
|
2016-03-09 16:18:28 +00:00
|
|
|
class ApiCallbackWith2ArgsDescriptor : public ApiCallbackDescriptorBase {
|
2016-03-09 12:18:02 +00:00
|
|
|
public:
|
2016-03-09 16:18:28 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(
|
|
|
|
ApiCallbackWith2ArgsDescriptor, ApiCallbackDescriptorBase, 2)
|
|
|
|
};
|
|
|
|
|
|
|
|
class ApiCallbackWith3ArgsDescriptor : public ApiCallbackDescriptorBase {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(
|
|
|
|
ApiCallbackWith3ArgsDescriptor, ApiCallbackDescriptorBase, 3)
|
|
|
|
};
|
|
|
|
|
|
|
|
class ApiCallbackWith4ArgsDescriptor : public ApiCallbackDescriptorBase {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(
|
|
|
|
ApiCallbackWith4ArgsDescriptor, ApiCallbackDescriptorBase, 4)
|
|
|
|
};
|
|
|
|
|
|
|
|
class ApiCallbackWith5ArgsDescriptor : public ApiCallbackDescriptorBase {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(
|
|
|
|
ApiCallbackWith5ArgsDescriptor, ApiCallbackDescriptorBase, 5)
|
|
|
|
};
|
|
|
|
|
|
|
|
class ApiCallbackWith6ArgsDescriptor : public ApiCallbackDescriptorBase {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(
|
|
|
|
ApiCallbackWith6ArgsDescriptor, ApiCallbackDescriptorBase, 6)
|
|
|
|
};
|
|
|
|
|
|
|
|
class ApiCallbackWith7ArgsDescriptor : public ApiCallbackDescriptorBase {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(
|
|
|
|
ApiCallbackWith7ArgsDescriptor, ApiCallbackDescriptorBase, 7)
|
2015-01-16 10:59:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-09-11 07:11:10 +00:00
|
|
|
class ApiGetterDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
2015-06-24 06:21:47 +00:00
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiGetterDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
2014-09-11 07:11:10 +00:00
|
|
|
|
|
|
|
static const Register function_address();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MathPowTaggedDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(MathPowTaggedDescriptor, CallInterfaceDescriptor)
|
|
|
|
|
|
|
|
static const Register exponent();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MathPowIntegerDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(MathPowIntegerDescriptor, CallInterfaceDescriptor)
|
|
|
|
|
|
|
|
static const Register exponent();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ContextOnlyDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(ContextOnlyDescriptor, CallInterfaceDescriptor)
|
2014-09-03 10:51:51 +00:00
|
|
|
};
|
|
|
|
|
2015-04-30 12:34:02 +00:00
|
|
|
|
|
|
|
class GrowArrayElementsDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(GrowArrayElementsDescriptor, CallInterfaceDescriptor)
|
|
|
|
|
2015-05-12 08:47:15 +00:00
|
|
|
enum RegisterInfo { kObjectIndex, kKeyIndex };
|
2015-04-30 12:34:02 +00:00
|
|
|
static const Register ObjectRegister();
|
|
|
|
static const Register KeyRegister();
|
|
|
|
};
|
|
|
|
|
2016-03-09 16:18:28 +00:00
|
|
|
class InterpreterDispatchDescriptor : public CallInterfaceDescriptor {
|
2016-02-10 16:38:49 +00:00
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(InterpreterDispatchDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
|
|
|
|
static const int kAccumulatorParameter = 0;
|
|
|
|
static const int kRegisterFileParameter = 1;
|
|
|
|
static const int kBytecodeOffsetParameter = 2;
|
|
|
|
static const int kBytecodeArrayParameter = 3;
|
|
|
|
static const int kDispatchTableParameter = 4;
|
|
|
|
static const int kContextParameter = 5;
|
|
|
|
};
|
2015-09-14 10:05:18 +00:00
|
|
|
|
2015-10-02 18:13:41 +00:00
|
|
|
class InterpreterPushArgsAndCallDescriptor : public CallInterfaceDescriptor {
|
2015-09-14 10:05:18 +00:00
|
|
|
public:
|
2015-10-02 18:13:41 +00:00
|
|
|
DECLARE_DESCRIPTOR(InterpreterPushArgsAndCallDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
2016-02-24 15:15:02 +00:00
|
|
|
|
2015-10-15 16:46:16 +00:00
|
|
|
class InterpreterPushArgsAndConstructDescriptor
|
|
|
|
: public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(InterpreterPushArgsAndConstructDescriptor,
|
|
|
|
CallInterfaceDescriptor)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-10-02 18:13:41 +00:00
|
|
|
class InterpreterCEntryDescriptor : public CallInterfaceDescriptor {
|
|
|
|
public:
|
|
|
|
DECLARE_DESCRIPTOR(InterpreterCEntryDescriptor, CallInterfaceDescriptor)
|
2015-09-14 10:05:18 +00:00
|
|
|
};
|
|
|
|
|
2016-03-09 16:18:28 +00:00
|
|
|
#undef DECLARE_DESCRIPTOR_WITH_BASE
|
2014-09-03 10:51:51 +00:00
|
|
|
#undef DECLARE_DESCRIPTOR
|
2016-03-09 16:18:28 +00:00
|
|
|
#undef DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE
|
|
|
|
#undef DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG
|
2014-09-03 10:51:51 +00:00
|
|
|
|
|
|
|
// We define the association between CallDescriptors::Key and the specialized
|
|
|
|
// descriptor here to reduce boilerplate and mistakes.
|
|
|
|
#define DEF_KEY(name) \
|
|
|
|
CallDescriptors::Key name##Descriptor::key() { return CallDescriptors::name; }
|
|
|
|
INTERFACE_DESCRIPTOR_LIST(DEF_KEY)
|
|
|
|
#undef DEF_KEY
|
2015-09-30 13:46:56 +00:00
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|
2014-08-29 10:40:02 +00:00
|
|
|
|
2014-09-03 10:51:51 +00:00
|
|
|
|
2014-08-29 10:40:02 +00:00
|
|
|
#if V8_TARGET_ARCH_ARM64
|
|
|
|
#include "src/arm64/interface-descriptors-arm64.h"
|
|
|
|
#elif V8_TARGET_ARCH_ARM
|
|
|
|
#include "src/arm/interface-descriptors-arm.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // V8_CALL_INTERFACE_DESCRIPTOR_H_
|