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 2752213002: [csa] Add CSA::CallBuiltin and Builtins::CallableFor (Closed)
Patch Set: Remove unused variables 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 c7021029ec5a30a28d04bea03f5baec457a7773a..c43045104f7a2d90b4620e6a637cd17040a596ff 100644
--- a/src/builtins/builtins.cc
+++ b/src/builtins/builtins.cc
@@ -5,6 +5,7 @@
#include "src/builtins/builtins.h"
#include "src/api.h"
#include "src/assembler-inl.h"
+#include "src/callable.h"
#include "src/code-events.h"
#include "src/compiler/code-assembler.h"
#include "src/ic/ic-state.h"
@@ -204,6 +205,23 @@ const char* Builtins::Lookup(byte* pc) {
}
// static
+Callable Builtins::CallableFor(Isolate* isolate, Name name) {
+ switch (name) {
+#define CASE(Name, _, __, InterfaceDescriptor, ...) \
+ case k##Name: { \
+ Handle<Code> code(Code::cast(isolate->builtins()->builtins_[name])); \
+ auto descriptor = InterfaceDescriptor##Descriptor(isolate); \
+ return Callable(code, descriptor); \
+ }
+ BUILTIN_LIST_TFS(CASE)
+#undef CASE
+ default:
+ UNREACHABLE();
+ return Callable(Handle<Code>::null(), VoidDescriptor(isolate));
+ }
+}
+
+// static
const char* Builtins::name(int index) {
switch (index) {
#define CASE(Name, ...) \

Powered by Google App Engine
This is Rietveld 408576698