Index: src/arm/codegen-arm.cc |
=================================================================== |
--- src/arm/codegen-arm.cc (revision 4353) |
+++ src/arm/codegen-arm.cc (working copy) |
@@ -3624,10 +3624,24 @@ |
} |
-void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args) { |
+void CodeGenerator::GenerateRandomHeapNumber( |
+ ZoneList<Expression*>* args) { |
VirtualFrame::SpilledScope spilled_scope; |
ASSERT(args->length() == 0); |
- __ Call(ExternalReference::random_positive_smi_function().address(), |
+ |
+ Label slow_allocate_heapnumber; |
+ Label heapnumber_allocated; |
+ |
+ __ AllocateHeapNumber(r0, r1, r2, &slow_allocate_heapnumber); |
+ __ jmp(&heapnumber_allocated); |
+ |
+ __ bind(&slow_allocate_heapnumber); |
+ __ mov(r0, Operand(Smi::FromInt(0))); |
+ __ push(r0); |
+ __ CallRuntime(Runtime::kNumberUnaryMinus, 1); |
+ |
+ __ bind(&heapnumber_allocated); |
+ __ Call(ExternalReference::fill_heap_number_with_random_function().address(), |
RelocInfo::RUNTIME_ENTRY); |
frame_->EmitPush(r0); |
} |