Check that FPU TOP register is zero and clear all exceptions instead of using fninit,

which causes performance regression on Windows.

BUG=168370
R=danno@chromium.org

Review URL: https://chromiumcodereview.appspot.com/11962015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13401 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ulan@chromium.org 2013-01-16 14:54:19 +00:00
parent a8d59243b9
commit 07c60c2dac

View File

@ -1148,7 +1148,16 @@ void Deoptimizer::EntryGenerator::Generate() {
__ movdbl(Operand(ebx, dst_offset), xmm0);
}
}
__ fninit();
// Check that the TOP register is zero and clear all exceptions.
const int kTopMask = 0x3800;
__ push(eax);
__ fwait();
__ fnstsw_ax();
__ test(eax, Immediate(kTopMask));
__ Check(zero, "FPU TOP is not zero in deoptimizer.");
__ fnclex();
__ pop(eax);
// Remove the bailout id and the double registers from the stack.
if (type() == EAGER) {