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

Unified Diff: src/builtins/builtins.cc

Issue 2803853005: Inline Array.prototype.forEach in TurboFan (Closed)
Patch Set: Disable new array builtins by default Created 3 years, 6 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-array-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 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, ...) \
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-array-gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698