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

Unified Diff: src/crankshaft/lithium.cc

Issue 1782743003: [crankshaft] Support inlining of function calls in tail position (in ES6 sense). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@tco-crank-4
Patch Set: ppc, s390 and x87 ports Created 4 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/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/lithium-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/lithium.cc
diff --git a/src/crankshaft/lithium.cc b/src/crankshaft/lithium.cc
index a1a73e4beb84042075fdf72be63a93ea8b170a06..3b25081f5527eb4bfe7fd2bd4c57c504b2252cbe 100644
--- a/src/crankshaft/lithium.cc
+++ b/src/crankshaft/lithium.cc
@@ -522,12 +522,28 @@ LEnvironment* LChunkBuilderBase::CreateEnvironment(
ZoneList<HValue*>* objects_to_materialize) {
if (hydrogen_env == NULL) return NULL;
+ BailoutId ast_id = hydrogen_env->ast_id();
+ DCHECK(!ast_id.IsNone() ||
+ (hydrogen_env->frame_type() != JS_FUNCTION &&
+ hydrogen_env->frame_type() != TAIL_CALLER_FUNCTION));
+
+ if (hydrogen_env->frame_type() == TAIL_CALLER_FUNCTION) {
+ // Skip potential outer arguments adaptor frame.
+ HEnvironment* outer_hydrogen_env = hydrogen_env->outer();
+ if (outer_hydrogen_env != nullptr &&
+ outer_hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) {
+ outer_hydrogen_env = outer_hydrogen_env->outer();
+ }
+ LEnvironment* outer = CreateEnvironment(
+ outer_hydrogen_env, argument_index_accumulator, objects_to_materialize);
+ return new (zone())
+ LEnvironment(hydrogen_env->closure(), hydrogen_env->frame_type(),
+ ast_id, 0, 0, 0, outer, hydrogen_env->entry(), zone());
+ }
+
LEnvironment* outer =
CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator,
objects_to_materialize);
- BailoutId ast_id = hydrogen_env->ast_id();
- DCHECK(!ast_id.IsNone() ||
- hydrogen_env->frame_type() != JS_FUNCTION);
int omitted_count = (hydrogen_env->frame_type() == JS_FUNCTION)
? 0
« no previous file with comments | « src/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/lithium-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698