5 #ifndef V8_COMPILER_LINKAGE_IMPL_H_
6 #define V8_COMPILER_LINKAGE_IMPL_H_
13 template <
typename LinkageTraits>
30 int js_parameter_count) {
31 const size_t return_count = 1;
32 const size_t context_count = 1;
33 const size_t parameter_count = js_parameter_count + context_count;
40 for (
size_t i = 0;
i < return_count;
i++) {
45 for (
int i = 0;
i < js_parameter_count;
i++) {
46 int spill_slot_index =
i - js_parameter_count;
57 return new (zone) CallDescriptor(CallDescriptor::kCallJSFunction,
65 CallDescriptor::kNeedsFrameState,
74 const size_t function_count = 1;
75 const size_t num_args_count = 1;
76 const size_t context_count = 1;
77 const size_t parameter_count = function_count +
78 static_cast<size_t>(js_parameter_count) +
79 num_args_count + context_count;
82 const size_t return_count =
static_cast<size_t>(
function->result_size);
89 for (
size_t i = 0;
i < return_count;
i++) {
94 for (
int i = 0;
i < js_parameter_count;
i++) {
99 locations.
AddParam(
regloc(LinkageTraits::RuntimeCallFunctionReg()));
103 locations.
AddParam(
regloc(LinkageTraits::RuntimeCallArgCountReg()));
111 ? CallDescriptor::kNeedsFrameState
112 : CallDescriptor::kNoFlags;
117 return new (zone) CallDescriptor(CallDescriptor::kCallCodeObject,
133 CallDescriptor::Flags
flags) {
134 const int register_parameter_count =
136 const int js_parameter_count =
137 register_parameter_count + stack_parameter_count;
138 const int context_count = 1;
139 const size_t return_count = 1;
140 const size_t parameter_count =
141 static_cast<size_t>(js_parameter_count + context_count);
151 for (
int i = 0;
i < js_parameter_count;
i++) {
152 if (
i < register_parameter_count) {
158 int stack_slot =
i - register_parameter_count - stack_parameter_count;
170 return new (zone) CallDescriptor(CallDescriptor::kCallCodeObject,
191 for (
int i = 0;
i < parameter_count;
i++) {
192 if (
i < LinkageTraits::CRegisterParametersLength()) {
202 return new (zone) CallDescriptor(CallDescriptor::kCallAddress,
209 LinkageTraits::CCalleeSaveRegisters(),
210 CallDescriptor::kNoFlags,
"c-call");
const char * DebugName(Isolate *isolate)
Register GetEnvironmentParameterRegister(int index) const
int GetEnvironmentParameterCount() const
static const Function * FunctionForId(FunctionId id)
Isolate * isolate() const
static LinkageLocation stackloc(int i)
static LinkageLocation regloc(Register reg)
static CallDescriptor * GetStubCallDescriptor(Zone *zone, CallInterfaceDescriptor descriptor, int stack_parameter_count, CallDescriptor::Flags flags)
static CallDescriptor * GetRuntimeCallDescriptor(Zone *zone, Runtime::FunctionId function_id, int js_parameter_count, Operator::Properties properties)
static CallDescriptor * GetSimplifiedCDescriptor(Zone *zone, MachineSignature *msig)
static void AddReturnLocations(LocationSignature::Builder *locations)
static const RegList kNoCalleeSaved
static CallDescriptor * GetJSCallDescriptor(Zone *zone, int js_parameter_count)
static LinkageLocation AnyRegister()
static bool NeedsFrameState(Runtime::FunctionId function)
base::Flags< Property, uint8_t > Properties
const size_t return_count_
size_t return_count() const
size_t parameter_count() const
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
Debugger support for the V8 JavaScript engine.
static int ToAllocationIndex(Register reg)
const char * name() const