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

Unified Diff: src/builtins/builtins.cc

Issue 2246333003: Store information about builtins in descriptors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Convert to static Builtin accessors 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') | no next file » | 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..5e6e5c038dfdc85f3698b66a780ca1129e5814f8 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,68 @@ 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;
+ BUILTIN_LIST(CASE, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN,
+ IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
+#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;
+ BUILTIN_LIST(IGNORE_BUILTIN, CASE, IGNORE_BUILTIN, IGNORE_BUILTIN,
+ IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
+#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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698