Revision: 5038
Author: [email protected]
Date: Thu Jul  8 06:16:51 2010
Log: Add number allocation call to runtime.cc instead of misusing
UnaryMinus.
Review URL: http://codereview.chromium.org/2899004
http://code.google.com/p/v8/source/detail?r=5038

Modified:
 /branches/bleeding_edge/src/arm/full-codegen-arm.cc
 /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc
 /branches/bleeding_edge/src/runtime.h
 /branches/bleeding_edge/src/x64/full-codegen-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/full-codegen-arm.cc Mon Jul 5 04:03:16 2010 +++ /branches/bleeding_edge/src/arm/full-codegen-arm.cc Thu Jul 8 06:16:51 2010
@@ -2161,12 +2161,8 @@
   __ jmp(&heapnumber_allocated);

   __ bind(&slow_allocate_heapnumber);
-  // To allocate a heap number, and ensure that it is not a smi, we
-  // call the runtime function FUnaryMinus on 0, returning the double
-  // -0.0. A new, distinct heap number is returned each time.
-  __ mov(r0, Operand(Smi::FromInt(0)));
-  __ push(r0);
-  __ CallRuntime(Runtime::kNumberUnaryMinus, 1);
+  // Allocate a heap number.
+  __ CallRuntime(Runtime::kNumberAlloc, 0);
   __ mov(r4, Operand(r0));

   __ bind(&heapnumber_allocated);
=======================================
--- /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Mon Jul 5 04:03:16 2010 +++ /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Thu Jul 8 06:16:51 2010
@@ -2242,11 +2242,8 @@
   __ jmp(&heapnumber_allocated);

   __ bind(&slow_allocate_heapnumber);
-  // To allocate a heap number, and ensure that it is not a smi, we
-  // call the runtime function FUnaryMinus on 0, returning the double
-  // -0.0.  A new, distinct heap number is returned each time.
-  __ push(Immediate(Smi::FromInt(0)));
-  __ CallRuntime(Runtime::kNumberUnaryMinus, 1);
+  // Allocate a heap number.
+  __ CallRuntime(Runtime::kNumberAlloc, 0);
   __ mov(edi, eax);

   __ bind(&heapnumber_allocated);
=======================================
--- /branches/bleeding_edge/src/runtime.h       Fri Jul  2 07:36:34 2010
+++ /branches/bleeding_edge/src/runtime.h       Thu Jul  8 06:16:51 2010
@@ -115,6 +115,7 @@
   F(NumberDiv, 2, 1) \
   F(NumberMod, 2, 1) \
   F(NumberUnaryMinus, 1, 1) \
+  F(NumberAlloc, 0, 1) \
   \
   F(StringAdd, 2, 1) \
   F(StringBuilderConcat, 3, 1) \
=======================================
--- /branches/bleeding_edge/src/x64/full-codegen-x64.cc Mon Jul 5 04:03:16 2010 +++ /branches/bleeding_edge/src/x64/full-codegen-x64.cc Thu Jul 8 06:16:51 2010
@@ -2243,11 +2243,8 @@
   __ jmp(&heapnumber_allocated);

   __ bind(&slow_allocate_heapnumber);
-  // To allocate a heap number, and ensure that it is not a smi, we
-  // call the runtime function FUnaryMinus on 0, returning the double
-  // -0.0.  A new, distinct heap number is returned each time.
-  __ Push(Smi::FromInt(0));
-  __ CallRuntime(Runtime::kNumberUnaryMinus, 1);
+  // Allocate a heap number.
+  __ CallRuntime(Runtime::kNumberAlloc, 0);
   __ movq(rbx, rax);

   __ bind(&heapnumber_allocated);

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

Reply via email to