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

Unified Diff: src/builtins/builtins.cc

Issue 2752213002: [csa] Add CSA::CallBuiltin and Builtins::CallableFor (Closed)
Patch Set: Remove unused variable again 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
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-regexp-gen.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 d642f20882d577e176118cafd1705ba0c71bb20e..e05556862ac0418cafff4bdaaf8773c221d38a0b 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"
@@ -275,6 +276,23 @@ Handle<Code> Builtins::OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint) {
}
// 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])); \
caitp 2017/03/16 13:30:06 Is there any way we could push args in excess of 4
+ 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, ...) \
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-regexp-gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698