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

Unified Diff: src/arm/codegen-arm.cc

Issue 173625: Move object allocation in new space to macro assembler (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/codegen-arm.cc
===================================================================
--- src/arm/codegen-arm.cc (revision 2784)
+++ src/arm/codegen-arm.cc (working copy)
@@ -4945,36 +4945,21 @@
static void AllocateHeapNumber(
MacroAssembler* masm,
Label* need_gc, // Jump here if young space is full.
- Register result_reg, // The tagged address of the new heap number.
- Register allocation_top_addr_reg, // A scratch register.
+ Register result, // The tagged address of the new heap number.
+ Register scratch1, // A scratch register.
Register scratch2) { // Another scratch register.
- ExternalReference allocation_top =
- ExternalReference::new_space_allocation_top_address();
- ExternalReference allocation_limit =
- ExternalReference::new_space_allocation_limit_address();
+ // Allocate an object in the heap for the heap number and tag it as a heap
+ // object.
+ __ AllocateObjectInNewSpace(HeapNumber::kSize,
+ result,
+ scratch1,
+ scratch2,
+ need_gc,
+ true);
- // allocat := the address of the allocation top variable.
- __ mov(allocation_top_addr_reg, Operand(allocation_top));
- // result_reg := the old allocation top.
- __ ldr(result_reg, MemOperand(allocation_top_addr_reg));
- // scratch2 := the address of the allocation limit.
- __ mov(scratch2, Operand(allocation_limit));
- // scratch2 := the allocation limit.
- __ ldr(scratch2, MemOperand(scratch2));
- // result_reg := the new allocation top.
- __ add(result_reg, result_reg, Operand(HeapNumber::kSize));
- // Compare new new allocation top and limit.
- __ cmp(result_reg, Operand(scratch2));
- // Branch if out of space in young generation.
- __ b(hi, need_gc);
- // Store new allocation top.
- __ str(result_reg, MemOperand(allocation_top_addr_reg)); // store new top
- // Tag and adjust back to start of new object.
- __ sub(result_reg, result_reg, Operand(HeapNumber::kSize - kHeapObjectTag));
- // Get heap number map into scratch2.
- __ LoadRoot(scratch2, Heap::kHeapNumberMapRootIndex);
- // Store heap number map in new object.
- __ str(scratch2, FieldMemOperand(result_reg, HeapObject::kMapOffset));
+ // Get heap number map and store it in the allocated object.
+ __ LoadRoot(scratch1, Heap::kHeapNumberMapRootIndex);
+ __ str(scratch1, FieldMemOperand(result, HeapObject::kMapOffset));
}
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698