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

Unified Diff: src/builtins/builtins.cc

Issue 2803853005: Inline Array.prototype.forEach in TurboFan (Closed)
Patch Set: Review feedback and fix test cases 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
Index: src/builtins/builtins.cc
diff --git a/src/builtins/builtins.cc b/src/builtins/builtins.cc
index c11b8f57dceba3ace35c26e6875a08db227feaf5..83e706edd2f9915737c1e28fc76e696bdf281b21 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:
+ UNIMPLEMENTED();
Michael Starzinger 2017/06/07 09:47:04 nit: s/UNIMPLEMENTED/UNREACHABLE/
danno 2017/06/22 14:43:54 Done.
+ }
+}
+
+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:
+ UNIMPLEMENTED();
Michael Starzinger 2017/06/07 09:47:04 nit: s/UNIMPLEMENTED/UNREACHABLE/
danno 2017/06/22 14:43:54 Done.
+ }
+}
+
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)
+ BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, CASE_OTHER,
+ CASE_OTHER, CASE_OTHER, IGNORE_BUILTIN, IGNORE_BUILTIN)
#undef CASE
Michael Starzinger 2017/06/07 09:47:04 nit: s/CASE/CASE_OTHER/ in the #undef as well.
danno 2017/06/22 14:43:54 Done.
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, ...) \

Powered by Google App Engine
This is Rietveld 408576698