Index: src/compiler/x87/code-generator-x87.cc |
diff --git a/src/compiler/x87/code-generator-x87.cc b/src/compiler/x87/code-generator-x87.cc |
index 87d4e3ddfbac18150f5433e47be01b6b0a9ef18f..22de06f13b614a1b8be726b58196f6ae22c00d65 100644 |
--- a/src/compiler/x87/code-generator-x87.cc |
+++ b/src/compiler/x87/code-generator-x87.cc |
@@ -1599,12 +1599,18 @@ void CodeGenerator::AssembleReturn() { |
__ ret(0); |
} |
} else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
- __ mov(esp, ebp); // Move stack pointer back to frame pointer. |
- __ pop(ebp); // Pop caller's frame pointer. |
- int pop_count = descriptor->IsJSFunctionCall() |
- ? static_cast<int>(descriptor->JSParameterCount()) |
- : 0; |
- __ Ret(pop_count * kPointerSize, ebx); |
+ // Canonicalize JSFunction return sites for now. |
+ if (return_label_.is_bound()) { |
+ __ jmp(&return_label_); |
+ } else { |
+ __ bind(&return_label_); |
+ __ mov(esp, ebp); // Move stack pointer back to frame pointer. |
+ __ pop(ebp); // Pop caller's frame pointer. |
+ int pop_count = descriptor->IsJSFunctionCall() |
+ ? static_cast<int>(descriptor->JSParameterCount()) |
+ : 0; |
+ __ Ret(pop_count * kPointerSize, ebx); |
+ } |
} else { |
__ ret(0); |
} |