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

Unified Diff: src/code-factory.h

Issue 2187603004: [stubs] Using template magic to get the call interface descriptor type from callable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@code-factory-cleanup
Patch Set: Created 4 years, 5 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 | « no previous file | src/code-factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-factory.h
diff --git a/src/code-factory.h b/src/code-factory.h
index 7e96a7f395336fbe1556039cae4baa2f5ccb517f..81b1997f2a37c948457c7d5715a2334f18b39bac 100644
--- a/src/code-factory.h
+++ b/src/code-factory.h
@@ -15,7 +15,7 @@ namespace v8 {
namespace internal {
// Associates a body of code with an interface descriptor.
-class Callable final BASE_EMBEDDED {
+class Callable BASE_EMBEDDED {
public:
Callable(Handle<Code> code, CallInterfaceDescriptor descriptor)
: code_(code), descriptor_(descriptor) {}
@@ -28,17 +28,27 @@ class Callable final BASE_EMBEDDED {
const CallInterfaceDescriptor descriptor_;
};
+template <typename DescriptorT>
+class CallableD final : public Callable {
+ public:
+ typedef DescriptorT Descriptor;
+
+ CallableD(Handle<Code> code, Isolate* isolate)
+ : Callable(code, Descriptor(isolate)) {}
+};
class CodeFactory final {
public:
// Initial states for ICs.
static Callable LoadIC(Isolate* isolate);
- static Callable LoadICInOptimizedCode(Isolate* isolate);
+ static CallableD<LoadWithVectorDescriptor> LoadICInOptimizedCode(
+ Isolate* isolate);
static Callable LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode);
- static Callable LoadGlobalICInOptimizedCode(Isolate* isolate,
- TypeofMode typeof_mode);
+ static CallableD<LoadGlobalWithVectorDescriptor> LoadGlobalICInOptimizedCode(
+ Isolate* isolate, TypeofMode typeof_mode);
static Callable KeyedLoadIC(Isolate* isolate);
- static Callable KeyedLoadICInOptimizedCode(Isolate* isolate);
+ static CallableD<LoadWithVectorDescriptor> KeyedLoadICInOptimizedCode(
+ Isolate* isolate);
static Callable KeyedLoadIC_Megamorphic(Isolate* isolate);
static Callable CallIC(Isolate* isolate, int argc,
ConvertReceiverMode mode = ConvertReceiverMode::kAny,
@@ -48,10 +58,11 @@ class CodeFactory final {
ConvertReceiverMode mode = ConvertReceiverMode::kAny,
TailCallMode tail_call_mode = TailCallMode::kDisallow);
static Callable StoreIC(Isolate* isolate, LanguageMode mode);
- static Callable StoreICInOptimizedCode(Isolate* isolate, LanguageMode mode);
+ static CallableD<StoreWithVectorDescriptor> StoreICInOptimizedCode(
+ Isolate* isolate, LanguageMode mode);
static Callable KeyedStoreIC(Isolate* isolate, LanguageMode mode);
- static Callable KeyedStoreICInOptimizedCode(Isolate* isolate,
- LanguageMode mode);
+ static CallableD<StoreWithVectorDescriptor> KeyedStoreICInOptimizedCode(
+ Isolate* isolate, LanguageMode mode);
static Callable ResumeGenerator(Isolate* isolate);
« no previous file with comments | « no previous file | src/code-factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698