Commit 38ec29b4 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

[X87] [Ignition] Fix V8 x87 code generation bugs when Ingition was enabled.

  The CL #35926 (https://codereview.chromium.org/1804003002) exposed two hidden bugs in x87 code generation when Ignition was enabled.

  This CL fixed those bugs.

BUG=

Review-Url: https://codereview.chromium.org/1960993002
Cr-Commit-Position: refs/heads/master@{#36099}
parent a64b1d87
......@@ -201,6 +201,13 @@ void LCodeGen::GenerateOsrPrologue() {
osr_pc_offset_ = masm()->pc_offset();
// Interpreter is the first tier compiler now. It will run the code generated
// by TurboFan compiler which will always put "1" on x87 FPU stack.
// This behavior will affect crankshaft's x87 FPU stack depth check under
// debug mode.
// Need to reset the FPU stack here for this scenario.
__ fninit();
// Adjust the frame size, subsuming the unoptimized frame into the
// optimized frame.
int slots = GetStackSlotCount() - graph()->osr()->UnoptimizedFrameSlots();
......
......@@ -654,6 +654,10 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
// Interpreter handler is turbofanned code, need to reset the FPU before
// return
__ fninit();
// The return value is in accumulator, which is already in eax.
// Leave the frame (also dropping the register file).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment