summaryrefslogtreecommitdiff
path: root/deps/v8/src/codegen/interface-descriptors.h
diff options
context:
space:
mode:
authorMatheus Marchini <mmarchini@netflix.com>2020-03-05 10:49:19 -0800
committerMatheus Marchini <mmarchini@netflix.com>2020-03-18 16:23:22 -0700
commit2883c855e0105b51e5c8020d21458af109ffe3d4 (patch)
tree26777aad0a398e9f7755c8b65ac76827fe352a81 /deps/v8/src/codegen/interface-descriptors.h
parent5f0af2af2a67216e00fe07ccda11e889d14abfcd (diff)
downloadnode-new-2883c855e0105b51e5c8020d21458af109ffe3d4.tar.gz
deps: update V8 to 8.1.307.20
PR-URL: https://github.com/nodejs/node/pull/32116 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'deps/v8/src/codegen/interface-descriptors.h')
-rw-r--r--deps/v8/src/codegen/interface-descriptors.h108
1 files changed, 79 insertions, 29 deletions
diff --git a/deps/v8/src/codegen/interface-descriptors.h b/deps/v8/src/codegen/interface-descriptors.h
index e305d666a3..0701c66be5 100644
--- a/deps/v8/src/codegen/interface-descriptors.h
+++ b/deps/v8/src/codegen/interface-descriptors.h
@@ -68,6 +68,8 @@ namespace internal {
V(JSTrampoline) \
V(Load) \
V(LoadGlobal) \
+ V(LoadGlobalNoFeedback) \
+ V(LoadNoFeedback) \
V(LoadGlobalWithVector) \
V(LoadWithVector) \
V(NewArgumentsElements) \
@@ -103,11 +105,14 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData {
enum Flag {
kNoFlags = 0u,
kNoContext = 1u << 0,
-
// This indicates that the code uses a special frame that does not scan the
// stack arguments, e.g. EntryFrame. And this allows the code to use
// untagged stack arguments.
kNoStackScan = 1u << 1,
+ // In addition to the specified parameters, additional arguments can be
+ // passed on the stack.
+ // This does not indicate if arguments adaption is used or not.
+ kAllowVarArgs = 1u << 2,
};
using Flags = base::Flags<Flag>;
@@ -249,6 +254,10 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptor {
return (flags() & CallInterfaceDescriptorData::kNoContext) == 0;
}
+ bool AllowVarArgs() const {
+ return flags() & CallInterfaceDescriptorData::kAllowVarArgs;
+ }
+
int GetReturnCount() const { return data()->return_count(); }
MachineType GetReturnType(int index) const {
@@ -283,6 +292,10 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptor {
const char* DebugName() const;
+ bool operator==(const CallInterfaceDescriptor& other) const {
+ return data() == other.data();
+ }
+
protected:
const CallInterfaceDescriptorData* data() const { return data_; }
@@ -400,28 +413,20 @@ STATIC_ASSERT(kMaxTFSBuiltinRegisterParams <= kMaxBuiltinRegisterParams);
\
public:
-#define DEFINE_RESULT_AND_PARAMETERS(return_count, ...) \
- static constexpr int kDescriptorFlags = \
- CallInterfaceDescriptorData::kNoFlags; \
- static constexpr int kReturnCount = return_count; \
- enum ParameterIndices { \
- __dummy = -1, /* to be able to pass zero arguments */ \
- ##__VA_ARGS__, \
- \
- kParameterCount, \
- kContext = kParameterCount /* implicit parameter */ \
+#define DEFINE_FLAGS_AND_RESULT_AND_PARAMETERS(flags, return_count, ...) \
+ static constexpr int kDescriptorFlags = flags; \
+ static constexpr int kReturnCount = return_count; \
+ enum ParameterIndices { \
+ __dummy = -1, /* to be able to pass zero arguments */ \
+ ##__VA_ARGS__, \
+ \
+ kParameterCount, \
+ kContext = kParameterCount /* implicit parameter */ \
};
-#define DEFINE_RESULT_AND_PARAMETERS_NO_CONTEXT(return_count, ...) \
- static constexpr int kDescriptorFlags = \
- CallInterfaceDescriptorData::kNoContext; \
- static constexpr int kReturnCount = return_count; \
- enum ParameterIndices { \
- __dummy = -1, /* to be able to pass zero arguments */ \
- ##__VA_ARGS__, \
- \
- kParameterCount \
- };
+#define DEFINE_RESULT_AND_PARAMETERS(return_count, ...) \
+ DEFINE_FLAGS_AND_RESULT_AND_PARAMETERS( \
+ CallInterfaceDescriptorData::kNoFlags, return_count, ##__VA_ARGS__)
// This is valid only for builtins that use EntryFrame, which does not scan
// stack arguments on GC.
@@ -437,10 +442,17 @@ STATIC_ASSERT(kMaxTFSBuiltinRegisterParams <= kMaxBuiltinRegisterParams);
kParameterCount \
};
-#define DEFINE_PARAMETERS(...) DEFINE_RESULT_AND_PARAMETERS(1, ##__VA_ARGS__)
+#define DEFINE_PARAMETERS(...) \
+ DEFINE_FLAGS_AND_RESULT_AND_PARAMETERS( \
+ CallInterfaceDescriptorData::kNoFlags, 1, ##__VA_ARGS__)
#define DEFINE_PARAMETERS_NO_CONTEXT(...) \
- DEFINE_RESULT_AND_PARAMETERS_NO_CONTEXT(1, ##__VA_ARGS__)
+ DEFINE_FLAGS_AND_RESULT_AND_PARAMETERS( \
+ CallInterfaceDescriptorData::kNoContext, 1, ##__VA_ARGS__)
+
+#define DEFINE_PARAMETERS_VARARGS(...) \
+ DEFINE_FLAGS_AND_RESULT_AND_PARAMETERS( \
+ CallInterfaceDescriptorData::kAllowVarArgs, 1, ##__VA_ARGS__)
#define DEFINE_RESULT_AND_PARAMETER_TYPES(...) \
void InitializePlatformIndependent(CallInterfaceDescriptorData* data) \
@@ -460,7 +472,7 @@ STATIC_ASSERT(kMaxTFSBuiltinRegisterParams <= kMaxBuiltinRegisterParams);
#define DEFINE_JS_PARAMETERS(...) \
static constexpr int kDescriptorFlags = \
- CallInterfaceDescriptorData::kNoFlags; \
+ CallInterfaceDescriptorData::kAllowVarArgs; \
static constexpr int kReturnCount = 1; \
enum ParameterIndices { \
kTarget, \
@@ -589,6 +601,43 @@ class LoadDescriptor : public CallInterfaceDescriptor {
static const Register SlotRegister();
};
+class LoadGlobalNoFeedbackDescriptor : public CallInterfaceDescriptor {
+ public:
+ DEFINE_PARAMETERS(kName, kICKind)
+ DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kName
+ MachineType::TaggedSigned()) // kICKind
+ DECLARE_DESCRIPTOR(LoadGlobalNoFeedbackDescriptor, CallInterfaceDescriptor)
+
+ static const Register NameRegister() {
+ return LoadDescriptor::NameRegister();
+ }
+
+ static const Register ICKindRegister() {
+ return LoadDescriptor::SlotRegister();
+ }
+};
+
+class LoadNoFeedbackDescriptor : public LoadGlobalNoFeedbackDescriptor {
+ public:
+ DEFINE_PARAMETERS(kReceiver, kName, kICKind)
+ DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kReceiver
+ MachineType::AnyTagged(), // kName
+ MachineType::TaggedSigned()) // kICKind
+ DECLARE_DESCRIPTOR(LoadNoFeedbackDescriptor, LoadGlobalNoFeedbackDescriptor)
+
+ static const Register ReceiverRegister() {
+ return LoadDescriptor::ReceiverRegister();
+ }
+
+ static const Register NameRegister() {
+ return LoadGlobalNoFeedbackDescriptor::NameRegister();
+ }
+
+ static const Register ICKindRegister() {
+ return LoadGlobalNoFeedbackDescriptor::ICKindRegister();
+ }
+};
+
class LoadGlobalDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS(kName, kSlot)
@@ -843,7 +892,7 @@ class TypeofDescriptor : public CallInterfaceDescriptor {
class CallTrampolineDescriptor : public CallInterfaceDescriptor {
public:
- DEFINE_PARAMETERS(kFunction, kActualArgumentsCount)
+ DEFINE_PARAMETERS_VARARGS(kFunction, kActualArgumentsCount)
DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kFunction
MachineType::Int32()) // kActualArgumentsCount
DECLARE_DESCRIPTOR(CallTrampolineDescriptor, CallInterfaceDescriptor)
@@ -871,7 +920,7 @@ class CallForwardVarargsDescriptor : public CallInterfaceDescriptor {
class CallFunctionTemplateDescriptor : public CallInterfaceDescriptor {
public:
- DEFINE_PARAMETERS(kFunctionTemplateInfo, kArgumentsCount)
+ DEFINE_PARAMETERS_VARARGS(kFunctionTemplateInfo, kArgumentsCount)
DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kFunctionTemplateInfo
MachineType::IntPtr()) // kArgumentsCount
DECLARE_DESCRIPTOR(CallFunctionTemplateDescriptor, CallInterfaceDescriptor)
@@ -1087,8 +1136,8 @@ class CEntry1ArgvOnStackDescriptor : public CallInterfaceDescriptor {
class ApiCallbackDescriptor : public CallInterfaceDescriptor {
public:
- DEFINE_PARAMETERS(kApiFunctionAddress, kActualArgumentsCount, kCallData,
- kHolder)
+ DEFINE_PARAMETERS_VARARGS(kApiFunctionAddress, kActualArgumentsCount,
+ kCallData, kHolder)
// receiver is implicit stack argument 1
// argv are implicit stack arguments [2, 2 + kArgc[
DEFINE_PARAMETER_TYPES(MachineType::Pointer(), // kApiFunctionAddress
@@ -1364,9 +1413,10 @@ BUILTIN_LIST_TFS(DEFINE_TFS_BUILTIN_DESCRIPTOR)
#undef DECLARE_DESCRIPTOR_WITH_BASE
#undef DECLARE_DESCRIPTOR
#undef DECLARE_JS_COMPATIBLE_DESCRIPTOR
+#undef DEFINE_FLAGS_AND_RESULT_AND_PARAMETERS
#undef DEFINE_RESULT_AND_PARAMETERS
-#undef DEFINE_RESULT_AND_PARAMETERS_NO_CONTEXT
#undef DEFINE_PARAMETERS
+#undef DEFINE_PARAMETERS_VARARGS
#undef DEFINE_PARAMETERS_NO_CONTEXT
#undef DEFINE_RESULT_AND_PARAMETER_TYPES
#undef DEFINE_PARAMETER_TYPES