Reviewers: Kevin Millikin,

Message:
A tiny change for you.

Description:
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.

Please review this at http://codereview.chromium.org/5996001/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/ia32/code-stubs-ia32.cc


Index: src/ia32/code-stubs-ia32.cc
===================================================================
--- src/ia32/code-stubs-ia32.cc (revision 6062)
+++ src/ia32/code-stubs-ia32.cc (working copy)
@@ -2779,6 +2779,7 @@
   __ Ret();

   __ bind(&skip_cache);
+  // Do not allocate an answer to put it in the cache
   __ sub(Operand(esp), Immediate(kDoubleSize));
   __ movdbl(Operand(esp, 0), xmm1);
   __ fld_d(Operand(esp, 0));
@@ -2786,6 +2787,12 @@
   __ 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();
+  __ push(Immediate(Smi::FromInt(kDoubleSize)));  // Unused aligned object.
+  __ CallRuntimeSaveDoubles(Runtime::kAllocateInNewSpace);
+  __ LeaveInternalFrame();
   __ Ret();

   __ bind(&call_runtime);


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

Reply via email to