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

Unified Diff: src/interface-descriptors.h

Issue 2002143002: [stubs] An easier way of defining a stub call interface descriptor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 b7c6c9db8450818000bed40c80726d8a15284fca..3239a55f5f367bbb9045f30c95f0a52402eefa19 100644
--- a/src/interface-descriptors.h
+++ b/src/interface-descriptors.h
@@ -109,7 +109,7 @@ class CallInterfaceDescriptorData {
// and register side by side (eg, RegRep(r1, Representation::Tagged()).
// The same should go for the CodeStubDescriptor class.
void InitializePlatformSpecific(
- int register_parameter_count, Register* registers,
+ int register_parameter_count, const Register* registers,
PlatformInterfaceDescriptor* platform_descriptor = NULL);
bool IsInitialized() const { return register_param_count_ >= 0; }
@@ -218,6 +218,12 @@ class CallInterfaceDescriptor {
}
}
+ // Initializes |data| using the platform dependent default set of registers.
+ // It is intended to be used for TurboFan stubs when particular set of
+ // registers does not matter.
+ static void DefaultInitializePlatformSpecific(
+ CallInterfaceDescriptorData* data, int register_parameter_count);
+
private:
const CallInterfaceDescriptorData* data_;
};
@@ -229,6 +235,17 @@ class CallInterfaceDescriptor {
} \
static inline CallDescriptors::Key key();
+#define DECLARE_DEFAULT_DESCRIPTOR(name, base, parameter_count) \
+ DECLARE_DESCRIPTOR_WITH_BASE(name, base) \
+ protected: \
+ void InitializePlatformSpecific(CallInterfaceDescriptorData* data) \
+ override { \
+ DefaultInitializePlatformSpecific(data, parameter_count); \
+ } \
+ name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \
+ \
+ public:
+
#define DECLARE_DESCRIPTOR(name, base) \
DECLARE_DESCRIPTOR_WITH_BASE(name, base) \
protected: \
@@ -424,10 +441,7 @@ class HasPropertyDescriptor final : public CallInterfaceDescriptor {
public:
enum ParameterIndices { kKeyIndex, kObjectIndex };
- DECLARE_DESCRIPTOR(HasPropertyDescriptor, CallInterfaceDescriptor)
-
- static const Register KeyRegister();
- static const Register ObjectRegister();
+ DECLARE_DEFAULT_DESCRIPTOR(HasPropertyDescriptor, CallInterfaceDescriptor, 2)
};
class TypeofDescriptor : public CallInterfaceDescriptor {
« 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