Index: src/compiler/arm64/code-generator-arm64.cc |
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc |
index 2307d034e60509ca8adef91c2908d4b6a7e60ff6..8692732112708148b11c9d2824ef67ddf58f7435 100644 |
--- a/src/compiler/arm64/code-generator-arm64.cc |
+++ b/src/compiler/arm64/code-generator-arm64.cc |
@@ -1153,13 +1153,19 @@ void CodeGenerator::AssembleReturn() { |
__ Pop(fp, lr); |
__ Ret(); |
} else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
- __ Mov(jssp, fp); |
- __ Pop(fp, lr); |
- int pop_count = descriptor->IsJSFunctionCall() |
- ? static_cast<int>(descriptor->JSParameterCount()) |
- : 0; |
- __ Drop(pop_count); |
- __ Ret(); |
+ // Canonicalize JSFunction return sites for now. |
+ if (return_label_.is_bound()) { |
+ __ B(&return_label_); |
+ } else { |
+ __ Bind(&return_label_); |
+ __ Mov(jssp, fp); |
+ __ Pop(fp, lr); |
+ int pop_count = descriptor->IsJSFunctionCall() |
+ ? static_cast<int>(descriptor->JSParameterCount()) |
+ : 0; |
+ __ Drop(pop_count); |
+ __ Ret(); |
+ } |
} else { |
__ Ret(); |
} |