Index: src/compiler/x64/code-generator-x64.cc |
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc |
index 5de3ad1d38c20897c8547f2b4c485b7cdd124236..d86c50aa2f6a5c47d7b949fcdc6a7783892201fc 100644 |
--- a/src/compiler/x64/code-generator-x64.cc |
+++ b/src/compiler/x64/code-generator-x64.cc |
@@ -1538,12 +1538,18 @@ void CodeGenerator::AssembleReturn() { |
__ ret(0); |
} |
} else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
- __ movq(rsp, rbp); // Move stack pointer back to frame pointer. |
- __ popq(rbp); // Pop caller's frame pointer. |
- int pop_count = descriptor->IsJSFunctionCall() |
- ? static_cast<int>(descriptor->JSParameterCount()) |
- : 0; |
- __ Ret(pop_count * kPointerSize, rbx); |
+ // Canonicalize JSFunction return sites for now. |
+ if (return_label_.is_bound()) { |
+ __ jmp(&return_label_); |
+ } else { |
+ __ bind(&return_label_); |
+ __ movq(rsp, rbp); // Move stack pointer back to frame pointer. |
+ __ popq(rbp); // Pop caller's frame pointer. |
+ int pop_count = descriptor->IsJSFunctionCall() |
+ ? static_cast<int>(descriptor->JSParameterCount()) |
+ : 0; |
+ __ Ret(pop_count * kPointerSize, rbx); |
+ } |
} else { |
__ ret(0); |
} |