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

Unified Diff: src/builtins/builtins.cc

Issue 2259883002: [turbofan] Inline calls to CPP builtins (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@builtin-descriptors
Patch Set: Address comments Created 4 years, 4 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/builtins/builtins.h ('k') | src/builtins/x64/builtins-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins.cc
diff --git a/src/builtins/builtins.cc b/src/builtins/builtins.cc
index 2188743fc5f5d5e40123d122ed0589bd52fb9f79..dd5b4333ce981db1cb13ae8dc6b59e7c259caa06 100644
--- a/src/builtins/builtins.cc
+++ b/src/builtins/builtins.cc
@@ -184,6 +184,7 @@ const char* Builtins::Lookup(byte* pc) {
return NULL;
}
+// static
const char* Builtins::name(int index) {
switch (index) {
#define CASE(Name, ...) \
@@ -198,6 +199,74 @@ const char* Builtins::name(int index) {
return "";
}
+// static
+Address Builtins::CppEntryOf(int index) {
+ DCHECK(0 <= index && index < builtin_count);
+ switch (index) {
+#define CASE(Name, ...) \
+ case k##Name: \
+ return FUNCTION_ADDR(Builtin_##Name);
+ BUILTIN_LIST_C(CASE)
+#undef CASE
+ default:
+ return nullptr;
+ }
+ UNREACHABLE();
+}
+
+// static
+bool Builtins::IsCpp(int index) {
+ DCHECK(0 <= index && index < builtin_count);
+ switch (index) {
+#define CASE(Name, ...) \
+ case k##Name: \
+ return true;
+#define BUILTIN_LIST_CPP(V) \
+ BUILTIN_LIST(V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
+ IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
+ BUILTIN_LIST_CPP(CASE)
+#undef BUILTIN_LIST_CPP
+#undef CASE
+ default:
+ return false;
+ }
+ UNREACHABLE();
+}
+
+// static
+bool Builtins::IsApi(int index) {
+ DCHECK(0 <= index && index < builtin_count);
+ switch (index) {
+#define CASE(Name, ...) \
+ case k##Name: \
+ return true;
+#define BUILTIN_LIST_API(V) \
+ BUILTIN_LIST(IGNORE_BUILTIN, V, IGNORE_BUILTIN, IGNORE_BUILTIN, \
+ IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
+ BUILTIN_LIST_API(CASE);
+#undef BUILTIN_LIST_API
+#undef CASE
+ default:
+ return false;
+ }
+ UNREACHABLE();
+}
+
+// static
+bool Builtins::HasCppImplementation(int index) {
+ DCHECK(0 <= index && index < builtin_count);
+ switch (index) {
+#define CASE(Name, ...) \
+ case k##Name: \
+ return true;
+ BUILTIN_LIST_C(CASE)
+#undef CASE
+ default:
+ return false;
+ }
+ UNREACHABLE();
+}
+
#define DEFINE_BUILTIN_ACCESSOR(Name, ...) \
Handle<Code> Builtins::Name() { \
Code** code_address = reinterpret_cast<Code**>(builtin_address(k##Name)); \
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698