Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: src/arm/codegen-arm.cc

Issue 1599019: Change Math.random() to return 32 bits of random goodness, instead of 30 rand... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/codegen-arm.h ('k') | src/assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3606 matching lines...) Expand 10 before | Expand all | Expand 10 after
3617 frame_->EmitPop(r1); 3617 frame_->EmitPop(r1);
3618 __ mov(r0, Operand(Smi::FromInt(scope()->num_parameters()))); 3618 __ mov(r0, Operand(Smi::FromInt(scope()->num_parameters())));
3619 3619
3620 // Call the shared stub to get to arguments[key]. 3620 // Call the shared stub to get to arguments[key].
3621 ArgumentsAccessStub stub(ArgumentsAccessStub::READ_ELEMENT); 3621 ArgumentsAccessStub stub(ArgumentsAccessStub::READ_ELEMENT);
3622 frame_->CallStub(&stub, 0); 3622 frame_->CallStub(&stub, 0);
3623 frame_->EmitPush(r0); 3623 frame_->EmitPush(r0);
3624 } 3624 }
3625 3625
3626 3626
3627 void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args) { 3627 void CodeGenerator::GenerateRandomHeapNumber(
3628 ZoneList<Expression*>* args) {
3628 VirtualFrame::SpilledScope spilled_scope; 3629 VirtualFrame::SpilledScope spilled_scope;
3629 ASSERT(args->length() == 0); 3630 ASSERT(args->length() == 0);
3630 __ Call(ExternalReference::random_positive_smi_function().address(), 3631
3632 Label slow_allocate_heapnumber;
3633 Label heapnumber_allocated;
3634
3635 __ AllocateHeapNumber(r0, r1, r2, &slow_allocate_heapnumber);
3636 __ jmp(&heapnumber_allocated);
3637
3638 __ bind(&slow_allocate_heapnumber);
3639 __ mov(r0, Operand(Smi::FromInt(0)));
3640 __ push(r0);
3641 __ CallRuntime(Runtime::kNumberUnaryMinus, 1);
3642
3643 __ bind(&heapnumber_allocated);
3644 __ Call(ExternalReference::fill_heap_number_with_random_function().address(),
3631 RelocInfo::RUNTIME_ENTRY); 3645 RelocInfo::RUNTIME_ENTRY);
3632 frame_->EmitPush(r0); 3646 frame_->EmitPush(r0);
3633 } 3647 }
3634 3648
3635 3649
3636 void CodeGenerator::GenerateStringAdd(ZoneList<Expression*>* args) { 3650 void CodeGenerator::GenerateStringAdd(ZoneList<Expression*>* args) {
3637 ASSERT_EQ(2, args->length()); 3651 ASSERT_EQ(2, args->length());
3638 3652
3639 Load(args->at(0)); 3653 Load(args->at(0));
3640 Load(args->at(1)); 3654 Load(args->at(1));
(...skipping 4302 matching lines...) Expand 10 before | Expand all | Expand 10 after
7943 7957
7944 // Just jump to runtime to add the two strings. 7958 // Just jump to runtime to add the two strings.
7945 __ bind(&string_add_runtime); 7959 __ bind(&string_add_runtime);
7946 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); 7960 __ TailCallRuntime(Runtime::kStringAdd, 2, 1);
7947 } 7961 }
7948 7962
7949 7963
7950 #undef __ 7964 #undef __
7951 7965
7952 } } // namespace v8::internal 7966 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.h ('k') | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698