Index: src/crankshaft/mips64/lithium-mips64.cc |
diff --git a/src/crankshaft/mips64/lithium-mips64.cc b/src/crankshaft/mips64/lithium-mips64.cc |
index 9ad878aaed9c13ad8bcaaba36f3ef870703de1ac..5c1ab618bd2c2997d570cbcdd6124354ef3f1641 100644 |
--- a/src/crankshaft/mips64/lithium-mips64.cc |
+++ b/src/crankshaft/mips64/lithium-mips64.cc |
@@ -887,10 +887,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) { |