Index: src/crankshaft/arm64/lithium-arm64.cc |
diff --git a/src/crankshaft/arm64/lithium-arm64.cc b/src/crankshaft/arm64/lithium-arm64.cc |
index b25d3c3aac92bb8ea8520ae4ac5986787039af40..85ce459f8d8c8c0deead64adf8a499342cd13429 100644 |
--- a/src/crankshaft/arm64/lithium-arm64.cc |
+++ b/src/crankshaft/arm64/lithium-arm64.cc |
@@ -720,10 +720,12 @@ void LChunkBuilder::AddInstruction(LInstruction* instr, |
DCHECK_NOT_NULL(hydrogen_env); |
if (instr->IsSyntacticTailCall()) { |
// If it was a syntactic tail call we need to drop the current frame and |
- // an arguments adaptor frame on top of it (if the latter is present). |
+ // all the frames on top of it that are either an arguments adaptor frame |
+ // or a tail caller frame. |
hydrogen_env = hydrogen_env->outer(); |
- if (hydrogen_env != nullptr && |
- hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { |
+ while (hydrogen_env != nullptr && |
+ (hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR || |
+ hydrogen_env->frame_type() == TAIL_CALLER_FUNCTION)) { |
hydrogen_env = hydrogen_env->outer(); |
} |
if (hydrogen_env != nullptr) { |