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, ...) \ |