Revision: 5039
Author: [email protected]
Date: Thu Jul  8 06:50:13 2010
Log: Second half of number alloc change accidentally omitted from
last change.
Review URL: http://codereview.chromium.org/2919001
http://code.google.com/p/v8/source/detail?r=5039

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

=======================================
--- /branches/bleeding_edge/src/arm/codegen-arm.cc      Thu Jul  8 05:38:02 2010
+++ /branches/bleeding_edge/src/arm/codegen-arm.cc      Thu Jul  8 06:50:13 2010
@@ -4870,12 +4870,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/codegen-ia32.cc Tue Jul 6 05:56:55 2010 +++ /branches/bleeding_edge/src/ia32/codegen-ia32.cc Thu Jul 8 06:50:13 2010
@@ -6678,11 +6678,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.cc      Tue Jul  6 05:56:55 2010
+++ /branches/bleeding_edge/src/runtime.cc      Thu Jul  8 06:50:13 2010
@@ -5606,6 +5606,14 @@
   CONVERT_DOUBLE_CHECKED(x, args[0]);
   return Heap::NumberFromDouble(-x);
 }
+
+
+static Object* Runtime_NumberAlloc(Arguments args) {
+  NoHandleAllocation ha;
+  ASSERT(args.length() == 0);
+
+  return Heap::NumberFromDouble(9876543210.0);
+}


 static Object* Runtime_NumberDiv(Arguments args) {
=======================================
--- /branches/bleeding_edge/src/x64/codegen-x64.cc      Tue Jul  6 05:56:55 2010
+++ /branches/bleeding_edge/src/x64/codegen-x64.cc      Thu Jul  8 06:50:13 2010
@@ -4664,11 +4664,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