blob: 2814daeded396cca73cf07fab6ce37a1196c2e3b [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_CALL_INTERFACE_DESCRIPTOR_H_
6#define V8_CALL_INTERFACE_DESCRIPTOR_H_
7
8#include "src/assembler.h"
9#include "src/macro-assembler.h"
10
11namespace v8 {
12namespace internal {
13
14class PlatformInterfaceDescriptor;
15
16#define INTERFACE_DESCRIPTOR_LIST(V) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000017 V(Void) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000018 V(Load) \
19 V(Store) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040020 V(StoreTransition) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000021 V(VectorStoreTransition) \
22 V(VectorStoreICTrampoline) \
23 V(VectorStoreIC) \
24 V(InstanceOf) \
25 V(LoadWithVector) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000026 V(FastNewClosure) \
27 V(FastNewContext) \
28 V(ToNumber) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000029 V(ToLength) \
30 V(ToString) \
31 V(ToObject) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000032 V(NumberToString) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000033 V(Typeof) \
34 V(FastCloneRegExp) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000035 V(FastCloneShallowArray) \
36 V(FastCloneShallowObject) \
37 V(CreateAllocationSite) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000038 V(CreateWeakCell) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000039 V(CallFunction) \
40 V(CallFunctionWithFeedback) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000041 V(CallFunctionWithFeedbackAndVector) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000042 V(CallConstruct) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000043 V(CallTrampoline) \
44 V(ConstructStub) \
45 V(ConstructTrampoline) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000046 V(RegExpConstructResult) \
47 V(TransitionElementsKind) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040048 V(AllocateHeapNumber) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000049 V(AllocateMutableHeapNumber) \
50 V(AllocateInNewSpace) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000051 V(ArrayConstructorConstantArgCount) \
52 V(ArrayConstructor) \
53 V(InternalArrayConstructorConstantArgCount) \
54 V(InternalArrayConstructor) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000055 V(Compare) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000056 V(CompareNil) \
57 V(ToBoolean) \
58 V(BinaryOp) \
59 V(BinaryOpWithAllocationSite) \
60 V(StringAdd) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000061 V(StringCompare) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000062 V(Keyed) \
63 V(Named) \
64 V(CallHandler) \
65 V(ArgumentAdaptor) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000066 V(ApiFunction) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000067 V(ApiAccessor) \
68 V(ApiGetter) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000069 V(ArgumentsAccessRead) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000070 V(ArgumentsAccessNew) \
71 V(RestParamAccess) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000072 V(StoreArrayLiteralElement) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000073 V(LoadGlobalViaContext) \
74 V(StoreGlobalViaContext) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000075 V(MathPowTagged) \
76 V(MathPowInteger) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000077 V(ContextOnly) \
78 V(GrowArrayElements) \
79 V(InterpreterPushArgsAndCall) \
80 V(InterpreterPushArgsAndConstruct) \
81 V(InterpreterCEntry)
Ben Murdochb8a8cc12014-11-26 15:28:44 +000082
83
84class CallInterfaceDescriptorData {
85 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000086 CallInterfaceDescriptorData()
87 : register_param_count_(-1), function_type_(nullptr) {}
Ben Murdochb8a8cc12014-11-26 15:28:44 +000088
89 // A copy of the passed in registers and param_representations is made
90 // and owned by the CallInterfaceDescriptorData.
91
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000092 void InitializePlatformIndependent(Type::FunctionType* function_type) {
93 function_type_ = function_type;
94 }
95
Ben Murdochb8a8cc12014-11-26 15:28:44 +000096 // TODO(mvstanton): Instead of taking parallel arrays register and
97 // param_representations, how about a struct that puts the representation
98 // and register side by side (eg, RegRep(r1, Representation::Tagged()).
99 // The same should go for the CodeStubDescriptor class.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000100 void InitializePlatformSpecific(
101 int register_parameter_count, Register* registers,
102 PlatformInterfaceDescriptor* platform_descriptor = NULL);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000103
104 bool IsInitialized() const { return register_param_count_ >= 0; }
105
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000106 int param_count() const { return function_type_->Arity(); }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000107 int register_param_count() const { return register_param_count_; }
108 Register register_param(int index) const { return register_params_[index]; }
109 Register* register_params() const { return register_params_.get(); }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000110 Type* param_type(int index) const { return function_type_->Parameter(index); }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000111 PlatformInterfaceDescriptor* platform_specific_descriptor() const {
112 return platform_specific_descriptor_;
113 }
114
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000115 Type::FunctionType* function_type() const { return function_type_; }
116
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000117 private:
118 int register_param_count_;
119
120 // The Register params are allocated dynamically by the
121 // InterfaceDescriptor, and freed on destruction. This is because static
122 // arrays of Registers cause creation of runtime static initializers
123 // which we don't want.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000124 base::SmartArrayPointer<Register> register_params_;
125
126 // Specifies types for parameters and return
127 Type::FunctionType* function_type_;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000128
129 PlatformInterfaceDescriptor* platform_specific_descriptor_;
130
131 DISALLOW_COPY_AND_ASSIGN(CallInterfaceDescriptorData);
132};
133
134
135class CallDescriptors {
136 public:
137 enum Key {
138#define DEF_ENUM(name) name,
139 INTERFACE_DESCRIPTOR_LIST(DEF_ENUM)
140#undef DEF_ENUM
141 NUMBER_OF_DESCRIPTORS
142 };
143};
144
145
146class CallInterfaceDescriptor {
147 public:
148 CallInterfaceDescriptor() : data_(NULL) {}
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000149 virtual ~CallInterfaceDescriptor() {}
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000150
151 CallInterfaceDescriptor(Isolate* isolate, CallDescriptors::Key key)
152 : data_(isolate->call_descriptor_data(key)) {}
153
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000154 int GetParameterCount() const { return data()->param_count(); }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000155
156 int GetRegisterParameterCount() const {
157 return data()->register_param_count();
158 }
159
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000160 int GetStackParameterCount() const {
161 return data()->function_type()->Arity() - data()->register_param_count();
162 }
163
164 Register GetRegisterParameter(int index) const {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000165 return data()->register_param(index);
166 }
167
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000168 Type* GetParameterType(int index) const {
169 DCHECK(index < data()->param_count());
170 return data()->param_type(index);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000171 }
172
173 // Some platforms have extra information to associate with the descriptor.
174 PlatformInterfaceDescriptor* platform_specific_descriptor() const {
175 return data()->platform_specific_descriptor();
176 }
177
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000178 Type::FunctionType* GetFunctionType() const {
179 return data()->function_type();
180 }
181
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000182 static const Register ContextRegister();
183
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400184 const char* DebugName(Isolate* isolate) const;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000185
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000186 static Type::FunctionType* BuildDefaultFunctionType(Isolate* isolate,
187 int paramater_count);
188
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000189 protected:
190 const CallInterfaceDescriptorData* data() const { return data_; }
191
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000192 virtual Type::FunctionType* BuildCallInterfaceDescriptorFunctionType(
193 Isolate* isolate, int register_param_count) {
194 return BuildDefaultFunctionType(isolate, register_param_count);
195 }
196
197 virtual void InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
198 UNREACHABLE();
199 }
200
201 void Initialize(Isolate* isolate, CallDescriptors::Key key) {
202 if (!data()->IsInitialized()) {
203 CallInterfaceDescriptorData* d = isolate->call_descriptor_data(key);
204 InitializePlatformSpecific(d);
205 Type::FunctionType* function_type =
206 BuildCallInterfaceDescriptorFunctionType(isolate,
207 d->register_param_count());
208 d->InitializePlatformIndependent(function_type);
209 }
210 }
211
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000212 private:
213 const CallInterfaceDescriptorData* data_;
214};
215
216
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000217#define DECLARE_DESCRIPTOR(name, base) \
218 explicit name(Isolate* isolate) : base(isolate, key()) { \
219 Initialize(isolate, key()); \
220 } \
221 \
222 protected: \
223 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \
224 name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \
225 \
226 public: \
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000227 static inline CallDescriptors::Key key();
228
229
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000230#define DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(name, base) \
231 DECLARE_DESCRIPTOR(name, base) \
232 protected: \
233 Type::FunctionType* BuildCallInterfaceDescriptorFunctionType( \
234 Isolate* isolate, int register_param_count) override; \
235 \
236 public:
237
238
239class VoidDescriptor : public CallInterfaceDescriptor {
240 public:
241 DECLARE_DESCRIPTOR(VoidDescriptor, CallInterfaceDescriptor)
242};
243
244
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000245// LoadDescriptor is used by all stubs that implement Load/KeyedLoad ICs.
246class LoadDescriptor : public CallInterfaceDescriptor {
247 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000248 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadDescriptor,
249 CallInterfaceDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000250
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000251 enum ParameterIndices { kReceiverIndex, kNameIndex, kSlotIndex };
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000252 static const Register ReceiverRegister();
253 static const Register NameRegister();
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000254 static const Register SlotRegister();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000255};
256
257
258class StoreDescriptor : public CallInterfaceDescriptor {
259 public:
260 DECLARE_DESCRIPTOR(StoreDescriptor, CallInterfaceDescriptor)
261
262 enum ParameterIndices {
263 kReceiverIndex,
264 kNameIndex,
265 kValueIndex,
266 kParameterCount
267 };
268 static const Register ReceiverRegister();
269 static const Register NameRegister();
270 static const Register ValueRegister();
271};
272
273
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400274class StoreTransitionDescriptor : public StoreDescriptor {
275 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000276 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreTransitionDescriptor,
277 StoreDescriptor)
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400278
279 // Extends StoreDescriptor with Map parameter.
280 enum ParameterIndices {
281 kReceiverIndex,
282 kNameIndex,
283 kValueIndex,
284 kMapIndex,
285 kParameterCount
286 };
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000287
288 static const Register MapRegister();
289};
290
291
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000292class VectorStoreTransitionDescriptor : public StoreDescriptor {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000293 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000294 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(VectorStoreTransitionDescriptor,
295 StoreDescriptor)
296
297 // Extends StoreDescriptor with Map parameter.
298 enum ParameterIndices {
299 kReceiverIndex = 0,
300 kNameIndex = 1,
301 kValueIndex = 2,
302
303 kMapIndex = 3,
304
305 kSlotIndex = 4, // not present on ia32.
306 kVirtualSlotVectorIndex = 4,
307
308 kVectorIndex = 5
309 };
310
311 static const Register MapRegister();
312 static const Register SlotRegister();
313 static const Register VectorRegister();
314};
315
316
317class InstanceOfDescriptor final : public CallInterfaceDescriptor {
318 public:
319 DECLARE_DESCRIPTOR(InstanceOfDescriptor, CallInterfaceDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000320
321 enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount };
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000322 static const Register LeftRegister();
323 static const Register RightRegister();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000324};
325
326
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000327class VectorStoreICTrampolineDescriptor : public StoreDescriptor {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000328 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000329 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
330 VectorStoreICTrampolineDescriptor, StoreDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000331
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000332 enum ParameterIndices { kReceiverIndex, kNameIndex, kValueIndex, kSlotIndex };
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000333
334 static const Register SlotRegister();
335};
336
337
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000338class VectorStoreICDescriptor : public VectorStoreICTrampolineDescriptor {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000339 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000340 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
341 VectorStoreICDescriptor, VectorStoreICTrampolineDescriptor)
342
343 enum ParameterIndices {
344 kReceiverIndex,
345 kNameIndex,
346 kValueIndex,
347 kSlotIndex,
348 kVectorIndex
349 };
350
351 static const Register VectorRegister();
352};
353
354
355class LoadWithVectorDescriptor : public LoadDescriptor {
356 public:
357 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadWithVectorDescriptor,
358 LoadDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000359
360 enum ParameterIndices {
361 kReceiverIndex,
362 kNameIndex,
363 kSlotIndex,
364 kVectorIndex
365 };
366
367 static const Register VectorRegister();
368};
369
370
371class FastNewClosureDescriptor : public CallInterfaceDescriptor {
372 public:
373 DECLARE_DESCRIPTOR(FastNewClosureDescriptor, CallInterfaceDescriptor)
374};
375
376
377class FastNewContextDescriptor : public CallInterfaceDescriptor {
378 public:
379 DECLARE_DESCRIPTOR(FastNewContextDescriptor, CallInterfaceDescriptor)
380};
381
382
383class ToNumberDescriptor : public CallInterfaceDescriptor {
384 public:
385 DECLARE_DESCRIPTOR(ToNumberDescriptor, CallInterfaceDescriptor)
386};
387
388
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000389class ToLengthDescriptor : public CallInterfaceDescriptor {
390 public:
391 enum ParameterIndices { kReceiverIndex };
392
393 DECLARE_DESCRIPTOR(ToLengthDescriptor, CallInterfaceDescriptor)
394
395 static const Register ReceiverRegister();
396};
397
398
399class ToStringDescriptor : public CallInterfaceDescriptor {
400 public:
401 enum ParameterIndices { kReceiverIndex };
402
403 DECLARE_DESCRIPTOR(ToStringDescriptor, CallInterfaceDescriptor)
404
405 static const Register ReceiverRegister();
406};
407
408
409class ToObjectDescriptor : public CallInterfaceDescriptor {
410 public:
411 enum ParameterIndices { kReceiverIndex };
412
413 DECLARE_DESCRIPTOR(ToObjectDescriptor, CallInterfaceDescriptor)
414
415 static const Register ReceiverRegister();
416};
417
418
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000419class NumberToStringDescriptor : public CallInterfaceDescriptor {
420 public:
421 DECLARE_DESCRIPTOR(NumberToStringDescriptor, CallInterfaceDescriptor)
422};
423
424
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000425class TypeofDescriptor : public CallInterfaceDescriptor {
426 public:
427 DECLARE_DESCRIPTOR(TypeofDescriptor, CallInterfaceDescriptor)
428};
429
430
431class FastCloneRegExpDescriptor : public CallInterfaceDescriptor {
432 public:
433 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneRegExpDescriptor,
434 CallInterfaceDescriptor)
435};
436
437
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000438class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor {
439 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000440 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneShallowArrayDescriptor,
441 CallInterfaceDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000442};
443
444
445class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor {
446 public:
447 DECLARE_DESCRIPTOR(FastCloneShallowObjectDescriptor, CallInterfaceDescriptor)
448};
449
450
451class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor {
452 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000453 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateAllocationSiteDescriptor,
454 CallInterfaceDescriptor)
455};
456
457
458class CreateWeakCellDescriptor : public CallInterfaceDescriptor {
459 public:
460 enum ParameterIndices {
461 kVectorIndex,
462 kSlotIndex,
463 kValueIndex,
464 kParameterCount
465 };
466
467 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateWeakCellDescriptor,
468 CallInterfaceDescriptor)
469};
470
471
472class CallTrampolineDescriptor : public CallInterfaceDescriptor {
473 public:
474 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CallTrampolineDescriptor,
475 CallInterfaceDescriptor)
476};
477
478
479class ConstructStubDescriptor : public CallInterfaceDescriptor {
480 public:
481 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ConstructStubDescriptor,
482 CallInterfaceDescriptor)
483};
484
485
486class ConstructTrampolineDescriptor : public CallInterfaceDescriptor {
487 public:
488 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ConstructTrampolineDescriptor,
489 CallInterfaceDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000490};
491
492
493class CallFunctionDescriptor : public CallInterfaceDescriptor {
494 public:
495 DECLARE_DESCRIPTOR(CallFunctionDescriptor, CallInterfaceDescriptor)
496};
497
498
499class CallFunctionWithFeedbackDescriptor : public CallInterfaceDescriptor {
500 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000501 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
502 CallFunctionWithFeedbackDescriptor, CallInterfaceDescriptor)
503};
504
505
506class CallFunctionWithFeedbackAndVectorDescriptor
507 : public CallInterfaceDescriptor {
508 public:
509 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
510 CallFunctionWithFeedbackAndVectorDescriptor, CallInterfaceDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000511};
512
513
514class CallConstructDescriptor : public CallInterfaceDescriptor {
515 public:
516 DECLARE_DESCRIPTOR(CallConstructDescriptor, CallInterfaceDescriptor)
517};
518
519
520class RegExpConstructResultDescriptor : public CallInterfaceDescriptor {
521 public:
522 DECLARE_DESCRIPTOR(RegExpConstructResultDescriptor, CallInterfaceDescriptor)
523};
524
525
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000526class LoadGlobalViaContextDescriptor : public CallInterfaceDescriptor {
527 public:
528 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadGlobalViaContextDescriptor,
529 CallInterfaceDescriptor)
530
531 static const Register SlotRegister();
532};
533
534
535class StoreGlobalViaContextDescriptor : public CallInterfaceDescriptor {
536 public:
537 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreGlobalViaContextDescriptor,
538 CallInterfaceDescriptor)
539
540 static const Register SlotRegister();
541 static const Register ValueRegister();
542};
543
544
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000545class TransitionElementsKindDescriptor : public CallInterfaceDescriptor {
546 public:
547 DECLARE_DESCRIPTOR(TransitionElementsKindDescriptor, CallInterfaceDescriptor)
548};
549
550
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400551class AllocateHeapNumberDescriptor : public CallInterfaceDescriptor {
552 public:
553 DECLARE_DESCRIPTOR(AllocateHeapNumberDescriptor, CallInterfaceDescriptor)
554};
555
556
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000557class AllocateMutableHeapNumberDescriptor : public CallInterfaceDescriptor {
558 public:
559 DECLARE_DESCRIPTOR(AllocateMutableHeapNumberDescriptor,
560 CallInterfaceDescriptor)
561};
562
563
564class AllocateInNewSpaceDescriptor : public CallInterfaceDescriptor {
565 public:
566 DECLARE_DESCRIPTOR(AllocateInNewSpaceDescriptor, CallInterfaceDescriptor)
567};
568
569
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000570class ArrayConstructorConstantArgCountDescriptor
571 : public CallInterfaceDescriptor {
572 public:
573 DECLARE_DESCRIPTOR(ArrayConstructorConstantArgCountDescriptor,
574 CallInterfaceDescriptor)
575};
576
577
578class ArrayConstructorDescriptor : public CallInterfaceDescriptor {
579 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000580 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor,
581 CallInterfaceDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000582};
583
584
585class InternalArrayConstructorConstantArgCountDescriptor
586 : public CallInterfaceDescriptor {
587 public:
588 DECLARE_DESCRIPTOR(InternalArrayConstructorConstantArgCountDescriptor,
589 CallInterfaceDescriptor)
590};
591
592
593class InternalArrayConstructorDescriptor : public CallInterfaceDescriptor {
594 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000595 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
596 InternalArrayConstructorDescriptor, CallInterfaceDescriptor)
597};
598
599
600class CompareDescriptor : public CallInterfaceDescriptor {
601 public:
602 DECLARE_DESCRIPTOR(CompareDescriptor, CallInterfaceDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000603};
604
605
606class CompareNilDescriptor : public CallInterfaceDescriptor {
607 public:
608 DECLARE_DESCRIPTOR(CompareNilDescriptor, CallInterfaceDescriptor)
609};
610
611
612class ToBooleanDescriptor : public CallInterfaceDescriptor {
613 public:
614 DECLARE_DESCRIPTOR(ToBooleanDescriptor, CallInterfaceDescriptor)
615};
616
617
618class BinaryOpDescriptor : public CallInterfaceDescriptor {
619 public:
620 DECLARE_DESCRIPTOR(BinaryOpDescriptor, CallInterfaceDescriptor)
621};
622
623
624class BinaryOpWithAllocationSiteDescriptor : public CallInterfaceDescriptor {
625 public:
626 DECLARE_DESCRIPTOR(BinaryOpWithAllocationSiteDescriptor,
627 CallInterfaceDescriptor)
628};
629
630
631class StringAddDescriptor : public CallInterfaceDescriptor {
632 public:
633 DECLARE_DESCRIPTOR(StringAddDescriptor, CallInterfaceDescriptor)
634};
635
636
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000637class StringCompareDescriptor : public CallInterfaceDescriptor {
638 public:
639 DECLARE_DESCRIPTOR(StringCompareDescriptor, CallInterfaceDescriptor)
640
641 enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount };
642 static const Register LeftRegister();
643 static const Register RightRegister();
644};
645
646
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000647class KeyedDescriptor : public CallInterfaceDescriptor {
648 public:
649 DECLARE_DESCRIPTOR(KeyedDescriptor, CallInterfaceDescriptor)
650};
651
652
653class NamedDescriptor : public CallInterfaceDescriptor {
654 public:
655 DECLARE_DESCRIPTOR(NamedDescriptor, CallInterfaceDescriptor)
656};
657
658
659class CallHandlerDescriptor : public CallInterfaceDescriptor {
660 public:
661 DECLARE_DESCRIPTOR(CallHandlerDescriptor, CallInterfaceDescriptor)
662};
663
664
665class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor {
666 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000667 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArgumentAdaptorDescriptor,
668 CallInterfaceDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000669};
670
671
672class ApiFunctionDescriptor : public CallInterfaceDescriptor {
673 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000674 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiFunctionDescriptor,
675 CallInterfaceDescriptor)
676};
677
678
679class ApiAccessorDescriptor : public CallInterfaceDescriptor {
680 public:
681 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiAccessorDescriptor,
682 CallInterfaceDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000683};
684
685
686class ApiGetterDescriptor : public CallInterfaceDescriptor {
687 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000688 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiGetterDescriptor,
689 CallInterfaceDescriptor)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000690
691 static const Register function_address();
692};
693
694
695class ArgumentsAccessReadDescriptor : public CallInterfaceDescriptor {
696 public:
697 DECLARE_DESCRIPTOR(ArgumentsAccessReadDescriptor, CallInterfaceDescriptor)
698
699 static const Register index();
700 static const Register parameter_count();
701};
702
703
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000704class ArgumentsAccessNewDescriptor : public CallInterfaceDescriptor {
705 public:
706 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArgumentsAccessNewDescriptor,
707 CallInterfaceDescriptor)
708
709 static const Register function();
710 static const Register parameter_count();
711 static const Register parameter_pointer();
712};
713
714
715class RestParamAccessDescriptor : public CallInterfaceDescriptor {
716 public:
717 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(RestParamAccessDescriptor,
718 CallInterfaceDescriptor)
719 static const Register parameter_count();
720 static const Register parameter_pointer();
721 static const Register rest_parameter_index();
722};
723
724
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000725class StoreArrayLiteralElementDescriptor : public CallInterfaceDescriptor {
726 public:
727 DECLARE_DESCRIPTOR(StoreArrayLiteralElementDescriptor,
728 CallInterfaceDescriptor)
729};
730
731
732class MathPowTaggedDescriptor : public CallInterfaceDescriptor {
733 public:
734 DECLARE_DESCRIPTOR(MathPowTaggedDescriptor, CallInterfaceDescriptor)
735
736 static const Register exponent();
737};
738
739
740class MathPowIntegerDescriptor : public CallInterfaceDescriptor {
741 public:
742 DECLARE_DESCRIPTOR(MathPowIntegerDescriptor, CallInterfaceDescriptor)
743
744 static const Register exponent();
745};
746
747
748class ContextOnlyDescriptor : public CallInterfaceDescriptor {
749 public:
750 DECLARE_DESCRIPTOR(ContextOnlyDescriptor, CallInterfaceDescriptor)
751};
752
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000753
754class GrowArrayElementsDescriptor : public CallInterfaceDescriptor {
755 public:
756 DECLARE_DESCRIPTOR(GrowArrayElementsDescriptor, CallInterfaceDescriptor)
757
758 enum RegisterInfo { kObjectIndex, kKeyIndex };
759 static const Register ObjectRegister();
760 static const Register KeyRegister();
761};
762
763
764class InterpreterPushArgsAndCallDescriptor : public CallInterfaceDescriptor {
765 public:
766 DECLARE_DESCRIPTOR(InterpreterPushArgsAndCallDescriptor,
767 CallInterfaceDescriptor)
768};
769
770
771class InterpreterPushArgsAndConstructDescriptor
772 : public CallInterfaceDescriptor {
773 public:
774 DECLARE_DESCRIPTOR(InterpreterPushArgsAndConstructDescriptor,
775 CallInterfaceDescriptor)
776};
777
778
779class InterpreterCEntryDescriptor : public CallInterfaceDescriptor {
780 public:
781 DECLARE_DESCRIPTOR(InterpreterCEntryDescriptor, CallInterfaceDescriptor)
782};
783
784
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000785#undef DECLARE_DESCRIPTOR
786
787
788// We define the association between CallDescriptors::Key and the specialized
789// descriptor here to reduce boilerplate and mistakes.
790#define DEF_KEY(name) \
791 CallDescriptors::Key name##Descriptor::key() { return CallDescriptors::name; }
792INTERFACE_DESCRIPTOR_LIST(DEF_KEY)
793#undef DEF_KEY
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000794} // namespace internal
795} // namespace v8
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000796
797
798#if V8_TARGET_ARCH_ARM64
799#include "src/arm64/interface-descriptors-arm64.h"
800#elif V8_TARGET_ARCH_ARM
801#include "src/arm/interface-descriptors-arm.h"
802#endif
803
804#endif // V8_CALL_INTERFACE_DESCRIPTOR_H_