Revision: 6090
Author: [email protected]
Date: Tue Dec 21 02:25:51 2010
Log: Ensure that the SSE2 TranscendentalCache stub calls GC if it runs out of memory in new space. Previously, it would just use an alternate algorithm, that did not cache the result.
Review URL: http://codereview.chromium.org/5996001
http://code.google.com/p/v8/source/detail?r=6090

Modified:
 /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc

=======================================
--- /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Mon Dec 20 06:42:05 2010 +++ /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Tue Dec 21 02:25:51 2010
@@ -2624,6 +2624,13 @@
     __ fstp_d(Operand(esp, 0));
     __ movdbl(xmm1, Operand(esp, 0));
     __ add(Operand(esp), Immediate(kDoubleSize));
+    // We return the value in xmm1 without adding it to the cache, but
+    // we cause a scavenging GC so that future allocations will succeed.
+    __ EnterInternalFrame();
+    // Allocate an unused object bigger than a HeapNumber.
+    __ push(Immediate(Smi::FromInt(2 * kDoubleSize)));
+    __ CallRuntimeSaveDoubles(Runtime::kAllocateInNewSpace);
+    __ LeaveInternalFrame();
     __ Ret();
   }

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

Reply via email to