Index: src/builtins/builtins.cc |
diff --git a/src/builtins/builtins.cc b/src/builtins/builtins.cc |
index c11b8f57dceba3ace35c26e6875a08db227feaf5..a6295f472249150b55ace9d08255d6b9071a5eb3 100644 |
--- a/src/builtins/builtins.cc |
+++ b/src/builtins/builtins.cc |
@@ -26,6 +26,32 @@ Builtins::Builtins() : initialized_(false) { |
Builtins::~Builtins() {} |
+BailoutId Builtins::GetContinuationBailoutId(Name name) { |
+ switch (name) { |
+#define BAILOUT_ID(NAME, ...) \ |
+ case k##NAME: \ |
+ return BailoutId(BailoutId::kFirstBuiltinContinuationId + name); |
+ BUILTIN_LIST_TFJ(BAILOUT_ID); |
+ BUILTIN_LIST_TFC(BAILOUT_ID); |
+#undef BAILOUT_ID |
+ default: |
+ UNREACHABLE(); |
+ } |
+} |
+ |
+Builtins::Name Builtins::GetBuiltinFromBailoutId(BailoutId id) { |
+ switch (id.ToInt()) { |
+#define BAILOUT_ID(NAME, ...) \ |
+ case BailoutId::kFirstBuiltinContinuationId + k##NAME: \ |
+ return k##NAME; |
+ BUILTIN_LIST_TFJ(BAILOUT_ID) |
+ BUILTIN_LIST_TFC(BAILOUT_ID) |
+#undef BAILOUT_ID |
+ default: |
+ UNREACHABLE(); |
+ } |
+} |
+ |
void Builtins::TearDown() { initialized_ = false; } |
void Builtins::IterateBuiltins(RootVisitor* v) { |
@@ -114,17 +140,31 @@ Callable Builtins::CallableFor(Isolate* isolate, Name name) { |
switch (name) { |
// This macro is deliberately crafted so as to emit very little code, |
// in order to keep binary size of this function under control. |
-#define CASE(Name, ...) \ |
+#define CASE_OTHER(Name, ...) \ |
case k##Name: { \ |
key = Builtin_##Name##_InterfaceDescriptor::key(); \ |
break; \ |
} |
- BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, CASE, CASE, |
- CASE, IGNORE_BUILTIN, IGNORE_BUILTIN) |
-#undef CASE |
+ BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, CASE_OTHER, |
+ CASE_OTHER, CASE_OTHER, IGNORE_BUILTIN, IGNORE_BUILTIN) |
+#undef CASE_OTHER |
case kConsoleAssert: { |
return Callable(code, BuiltinDescriptor(isolate)); |
} |
+ case kArrayForEach: { |
+ Handle<Code> code = isolate->builtins()->ArrayForEach(); |
+ return Callable(code, BuiltinDescriptor(isolate)); |
+ } |
+ case kArrayForEachLoopEagerDeoptContinuation: { |
+ Handle<Code> code = |
+ isolate->builtins()->ArrayForEachLoopEagerDeoptContinuation(); |
+ return Callable(code, BuiltinDescriptor(isolate)); |
+ } |
+ case kArrayForEachLoopLazyDeoptContinuation: { |
+ Handle<Code> code = |
+ isolate->builtins()->ArrayForEachLoopLazyDeoptContinuation(); |
+ return Callable(code, BuiltinDescriptor(isolate)); |
+ } |
default: |
UNREACHABLE(); |
} |
@@ -133,6 +173,21 @@ Callable Builtins::CallableFor(Isolate* isolate, Name name) { |
} |
// static |
+int Builtins::GetStackParameterCount(Isolate* isolate, Name name) { |
+ switch (name) { |
+#define CASE(Name, Count, ...) \ |
+ case k##Name: { \ |
+ return Count; \ |
+ } |
+ BUILTIN_LIST_TFJ(CASE) |
+#undef CASE |
+ default: |
+ UNREACHABLE(); |
+ return 0; |
+ } |
+} |
+ |
+// static |
const char* Builtins::name(int index) { |
switch (index) { |
#define CASE(Name, ...) \ |