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

Unified Diff: src/builtins/builtins.cc

Issue 2777203007: [builtins] Introduce new TFC macro and auto-generate TFS descriptors (Closed)
Patch Set: Format Created 3 years, 9 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
Index: src/builtins/builtins.cc
diff --git a/src/builtins/builtins.cc b/src/builtins/builtins.cc
index e9528319bde577f7a811a2ec3b4188e46049a535..6405ea6754738d6fd84ce44937e39827f3b3f7ec 100644
--- a/src/builtins/builtins.cc
+++ b/src/builtins/builtins.cc
@@ -142,12 +142,18 @@ void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) {
code = BuildWithCodeStubAssemblerJS(isolate, &Generate_##Name, Argc, \
kBuiltinFlags, #Name); \
builtins_[index++] = code;
-#define BUILD_TFS(Name, InterfaceDescriptor, result_size) \
+#define BUILD_TFC(Name, InterfaceDescriptor, result_size) \
{ InterfaceDescriptor##Descriptor descriptor(isolate); } \
code = BuildWithCodeStubAssemblerCS(isolate, &Generate_##Name, \
CallDescriptors::InterfaceDescriptor, \
kBuiltinFlags, #Name, result_size); \
builtins_[index++] = code;
+#define BUILD_TFS(Name, ...) \
+ /* Return size for generic TF builtins (stub linkage) is always 1. */ \
+ code = BuildWithCodeStubAssemblerCS(isolate, &Generate_##Name, \
+ CallDescriptors::Name, kBuiltinFlags, \
+ #Name, 1); \
+ builtins_[index++] = code;
#define BUILD_TFH(Name, Kind, Extra, InterfaceDescriptor) \
{ InterfaceDescriptor##Descriptor descriptor(isolate); } \
/* Return size for IC builtins/handlers is always 1. */ \
@@ -160,12 +166,13 @@ void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) {
BuildWithMacroAssembler(isolate, Generate_##Name, kBuiltinFlags, #Name); \
builtins_[index++] = code;
- BUILTIN_LIST(BUILD_CPP, BUILD_API, BUILD_TFJ, BUILD_TFS, BUILD_TFH,
- BUILD_ASM, BUILD_ASM);
+ BUILTIN_LIST(BUILD_CPP, BUILD_API, BUILD_TFJ, BUILD_TFC, BUILD_TFS,
+ BUILD_TFH, BUILD_ASM, BUILD_ASM);
#undef BUILD_CPP
#undef BUILD_API
#undef BUILD_TFJ
+#undef BUILD_TFC
#undef BUILD_TFS
#undef BUILD_TFH
#undef BUILD_ASM
@@ -294,7 +301,7 @@ Callable Builtins::CallableFor(Isolate* isolate, Name name) {
return Callable(code, descriptor); \
}
BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, CASE, CASE,
- IGNORE_BUILTIN, IGNORE_BUILTIN)
+ CASE, IGNORE_BUILTIN, IGNORE_BUILTIN)
#undef CASE
default:
UNREACHABLE();
@@ -341,7 +348,7 @@ bool Builtins::IsCpp(int index) {
return true;
#define BUILTIN_LIST_CPP(V) \
BUILTIN_LIST(V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
- IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
+ IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
BUILTIN_LIST_CPP(CASE)
#undef BUILTIN_LIST_CPP
#undef CASE
@@ -360,7 +367,7 @@ bool Builtins::IsApi(int index) {
return true;
#define BUILTIN_LIST_API(V) \
BUILTIN_LIST(IGNORE_BUILTIN, V, IGNORE_BUILTIN, IGNORE_BUILTIN, \
- IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
+ IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
BUILTIN_LIST_API(CASE);
#undef BUILTIN_LIST_API
#undef CASE

Powered by Google App Engine
This is Rietveld 408576698