Revision: 6332
Author: [email protected]
Date: Fri Jan 14 07:39:18 2011
Log: Avoid trashing the FPSCR when calculating Math.floor

The restoring of FPSCR could restore a random value as the restore point could be jumped to from before FPSCR was loaded.
Review URL: http://codereview.chromium.org/6344002
http://code.google.com/p/v8/source/detail?r=6332

Modified:
 /branches/bleeding_edge/src/arm/stub-cache-arm.cc

=======================================
--- /branches/bleeding_edge/src/arm/stub-cache-arm.cc Wed Jan 12 03:56:41 2011 +++ /branches/bleeding_edge/src/arm/stub-cache-arm.cc Fri Jan 14 07:39:18 2011
@@ -1952,7 +1952,7 @@
   __ cmp(r7, Operand(HeapNumber::kMantissaBits));
   // If greater or equal, the argument is already round and in r0.
   __ b(&restore_fpscr_and_return, ge);
-  __ b(&slow);
+  __ b(&wont_fit_smi);

   __ bind(&no_vfp_exception);
   // Move the result back to general purpose register r0.
@@ -1980,10 +1980,10 @@
   __ Ret();

   __ bind(&wont_fit_smi);
-  __ bind(&slow);
   // Restore FPCSR and fall to slow case.
   __ vmsr(r3);

+  __ bind(&slow);
   // Tail call the full function. We do not have to patch the receiver
   // because the function makes no use of it.
   __ InvokeFunction(function, arguments(), JUMP_FUNCTION);

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to