Chromium Code Reviews

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

Issue 173568: Add allocation support to x64 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.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/x64/codegen-x64.h ('k') | src/x64/codegen-x64-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/codegen-x64.cc
===================================================================
--- src/x64/codegen-x64.cc (revision 2773)
+++ src/x64/codegen-x64.cc (working copy)
@@ -7142,24 +7142,20 @@
Label* need_gc,
Register scratch,
Register result) {
- ExternalReference allocation_top =
- ExternalReference::new_space_allocation_top_address();
- ExternalReference allocation_limit =
- ExternalReference::new_space_allocation_limit_address();
- __ movq(scratch, allocation_top); // scratch: address of allocation top.
- __ movq(result, Operand(scratch, 0));
- __ addq(result, Immediate(HeapNumber::kSize)); // New top.
- __ movq(kScratchRegister, allocation_limit);
- __ cmpq(result, Operand(kScratchRegister, 0));
- __ j(above, need_gc);
+ // Allocate heap number in new space.
+ __ AllocateObjectInNewSpace(HeapNumber::kSize,
+ result,
+ scratch,
+ no_reg,
+ need_gc,
+ false);
- __ movq(Operand(scratch, 0), result); // store new top
- __ addq(result, Immediate(kHeapObjectTag - HeapNumber::kSize));
+ // Set the map and tag the result.
+ __ addq(result, Immediate(kHeapObjectTag));
__ movq(kScratchRegister,
Factory::heap_number_map(),
RelocInfo::EMBEDDED_OBJECT);
__ movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister);
- // Tag old top and use as result.
}
Property changes on: src\x64\codegen-x64.cc
___________________________________________________________________
Added: svn:eol-style
+ native
« no previous file with comments | « src/x64/codegen-x64.h ('k') | src/x64/codegen-x64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine