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

Unified Diff: src/interface-descriptors.h

Issue 2352163004: [stubs] ApiCallbackDescriptor cleanup - make it independent on the number of JS parameters. (Closed)
Patch Set: Created 4 years, 3 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/ia32/interface-descriptors-ia32.cc ('k') | src/interface-descriptors.cc » ('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 5ad99ec731f863ac03838cf2cf7bca7104d606c6..8b210c84cfd8b3c96de7a70012494e418903aeda 100644
--- a/src/interface-descriptors.h
+++ b/src/interface-descriptors.h
@@ -84,14 +84,7 @@ class PlatformInterfaceDescriptor;
V(GetProperty) \
V(CallHandler) \
V(ArgumentAdaptor) \
- V(ApiCallbackWith0Args) \
- V(ApiCallbackWith1Args) \
- V(ApiCallbackWith2Args) \
- V(ApiCallbackWith3Args) \
- V(ApiCallbackWith4Args) \
- V(ApiCallbackWith5Args) \
- V(ApiCallbackWith6Args) \
- V(ApiCallbackWith7Args) \
+ V(ApiCallback) \
V(ApiGetter) \
V(StoreGlobalViaContext) \
V(MathPowTagged) \
@@ -751,80 +744,13 @@ class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor {
CallInterfaceDescriptor)
};
-// 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 {
+class ApiCallbackDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS(kFunction, kCallData, kHolder, kApiFunctionAddress)
- static CallInterfaceDescriptor ForArgs(Isolate* isolate, int argc);
-
- protected:
- virtual int extra_args() const { return 0; }
- ApiCallbackDescriptorBase(Isolate* isolate, CallDescriptors::Key key)
- : CallInterfaceDescriptor(isolate, key) {}
- void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override;
- void InitializePlatformIndependent(
- CallInterfaceDescriptorData* data) override;
-};
-
-class ApiCallbackWith0ArgsDescriptor : public ApiCallbackDescriptorBase {
- public:
- DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(
- ApiCallbackWith0ArgsDescriptor, ApiCallbackDescriptorBase, 0)
-};
-
-class ApiCallbackWith1ArgsDescriptor : public ApiCallbackDescriptorBase {
- public:
- DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(
- ApiCallbackWith1ArgsDescriptor, ApiCallbackDescriptorBase, 1)
-};
-
-class ApiCallbackWith2ArgsDescriptor : public ApiCallbackDescriptorBase {
- public:
- 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)
+ DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiCallbackDescriptor,
+ CallInterfaceDescriptor)
};
-
class ApiGetterDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS(kReceiver, kHolder, kCallback)
« no previous file with comments | « src/ia32/interface-descriptors-ia32.cc ('k') | src/interface-descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698