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

Unified Diff: src/ia32/builtins-ia32.cc

Issue 174600: Add allocation support to ia32 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/ia32/codegen-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/builtins-ia32.cc
===================================================================
--- src/ia32/builtins-ia32.cc (revision 2770)
+++ src/ia32/builtins-ia32.cc (working copy)
@@ -133,14 +133,7 @@
// problem here, because it is always greater than the maximum
// instance size that can be represented in a byte.
ASSERT(Heap::MaxObjectSizeInPagedSpace() >= JSObject::kMaxInstanceSize);
- ExternalReference new_space_allocation_top =
- ExternalReference::new_space_allocation_top_address();
- __ mov(ebx, Operand::StaticVariable(new_space_allocation_top));
- __ add(edi, Operand(ebx)); // Calculate new top
- ExternalReference new_space_allocation_limit =
- ExternalReference::new_space_allocation_limit_address();
- __ cmp(edi, Operand::StaticVariable(new_space_allocation_limit));
- __ j(above_equal, &rt_call);
+ __ AllocateObjectInNewSpace(edi, ebx, edi, no_reg, &rt_call, false);
// Allocated the JSObject, now initialize the fields.
// eax: initial map
// ebx: JSObject
@@ -173,7 +166,6 @@
// ebx: JSObject
// edi: start of next object
__ or_(Operand(ebx), Immediate(kHeapObjectTag));
- __ mov(Operand::StaticVariable(new_space_allocation_top), edi);
// Check if a non-empty properties array is needed.
// Allocate and initialize a FixedArray if it is.
@@ -198,10 +190,14 @@
// edx: number of elements in properties array
ASSERT(Heap::MaxObjectSizeInPagedSpace() >
(FixedArray::kHeaderSize + 255*kPointerSize));
- __ lea(ecx, Operand(edi, edx, times_pointer_size, FixedArray::kHeaderSize));
- __ cmp(ecx, Operand::StaticVariable(new_space_allocation_limit));
- __ j(above_equal, &undo_allocation);
- __ mov(Operand::StaticVariable(new_space_allocation_top), ecx);
+ __ AllocateObjectInNewSpace(FixedArray::kHeaderSize,
+ times_pointer_size,
+ edx,
+ edi,
+ ecx,
+ no_reg,
+ &undo_allocation,
+ true);
// Initialize the FixedArray.
// ebx: JSObject
@@ -245,8 +241,7 @@
// allocated objects unused properties.
// ebx: JSObject (previous new top)
__ bind(&undo_allocation);
- __ xor_(Operand(ebx), Immediate(kHeapObjectTag)); // clear the heap tag
- __ mov(Operand::StaticVariable(new_space_allocation_top), ebx);
+ __ UndoAllocationInNewSpace(ebx);
}
// Allocate the new receiver object using the runtime call.
« no previous file with comments | « no previous file | src/ia32/codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698