Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(723)

Unified Diff: src/interface-descriptors.h

Issue 2663033003: [builtins] TurboFan version of Array.prototype.forEach including fast path for FAST_ELEMENTS (Closed)
Patch Set: Review feedback Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | src/js/array.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interface-descriptors.h
diff --git a/src/interface-descriptors.h b/src/interface-descriptors.h
index 886491a41e8e396bf1c896cb6eaad5a13e3a308f..91c46da0ab5eabb2e797fc161c500a6d745c928e 100644
--- a/src/interface-descriptors.h
+++ b/src/interface-descriptors.h
@@ -67,6 +67,7 @@ class PlatformInterfaceDescriptor;
V(AllocateBool8x16) \
V(Builtin) \
V(ArrayConstructor) \
+ V(ForEach) \
V(ArrayNoArgumentConstructor) \
V(ArraySingleArgumentConstructor) \
V(ArrayNArgumentsConstructor) \
@@ -292,6 +293,41 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptor {
kContext = kParameterCount /* implicit parameter */ \
};
+#define DECLARE_BUILTIN_DESCRIPTOR(name) \
+ DECLARE_DESCRIPTOR_WITH_BASE(name, BuiltinDescriptor) \
+ protected: \
+ void InitializePlatformIndependent(CallInterfaceDescriptorData* data) \
+ override { \
+ MachineType machine_types[] = {MachineType::AnyTagged(), \
+ MachineType::AnyTagged(), \
+ MachineType::Int32()}; \
+ int argc = kStackParameterCount + 1 - arraysize(machine_types); \
+ data->InitializePlatformIndependent(arraysize(machine_types), argc, \
+ machine_types); \
+ } \
+ void InitializePlatformSpecific(CallInterfaceDescriptorData* data) \
+ override { \
+ Register registers[] = {TargetRegister(), NewTargetRegister(), \
+ ArgumentsCountRegister()}; \
+ data->InitializePlatformSpecific(arraysize(registers), registers); \
+ } \
+ \
+ public:
+
+#define DEFINE_BUILTIN_PARAMETERS(...) \
+ enum ParameterIndices { \
+ kReceiver, \
+ kBeforeFirstStackParameter = kReceiver, \
+ __VA_ARGS__, \
+ kAfterLastStackParameter, \
+ kNewTarget = kAfterLastStackParameter, \
+ kArgumentsCount, \
+ kContext, /* implicit parameter */ \
+ kParameterCount = kContext, \
+ kStackParameterCount = \
+ kAfterLastStackParameter - kBeforeFirstStackParameter - 1, \
+ };
+
class VoidDescriptor : public CallInterfaceDescriptor {
public:
DECLARE_DESCRIPTOR(VoidDescriptor, CallInterfaceDescriptor)
@@ -657,6 +693,12 @@ class BuiltinDescriptor : public CallInterfaceDescriptor {
static const Register TargetRegister();
};
+class ForEachDescriptor : public BuiltinDescriptor {
+ public:
+ DEFINE_BUILTIN_PARAMETERS(kCallback, kThisArg)
+ DECLARE_BUILTIN_DESCRIPTOR(ForEachDescriptor)
+};
+
class ArrayConstructorDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS(kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite)
« no previous file with comments | « src/flag-definitions.h ('k') | src/js/array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698