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

Unified Diff: vm/intrinsifier_ia32.cc

Issue 9072011: - Add a size field to the header. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 8 years, 12 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
Index: vm/intrinsifier_ia32.cc
===================================================================
--- vm/intrinsifier_ia32.cc (revision 2918)
+++ vm/intrinsifier_ia32.cc (working copy)
@@ -98,7 +98,7 @@
__ movl(EDI, Address(ESP, kArrayLengthOffset)); // Array Length.
// Assert that length is a Smi.
__ testl(EDI, Immediate(kSmiTagSize));
- __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);
+ __ j(NOT_ZERO, &fall_through);
intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
__ leal(EDI, Address(EDI, TIMES_2, fixed_size)); // EDI is a Smi.
ASSERT(kSmiTagShift == 1);
@@ -114,7 +114,7 @@
// EAX: potential new object start.
// EBX: potential next object start.
__ cmpl(EBX, Address::Absolute(heap->EndAddress()));
- __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
+ __ j(ABOVE_EQUAL, &fall_through);
// Successfully allocated the object(s), now update top to point to
// next object start and initialize the object.
@@ -130,8 +130,26 @@
__ StoreIntoObject(EAX, FieldAddress(EAX, Array::class_offset()), EDI);
// Initialize the tags.
- __ movl(FieldAddress(EAX, Array::tags_offset()), Immediate(0));
+ // EAX: new object start as a tagged pointer.
+ // EBX: new object end address.
+ {
+ Label size_tag_overflow, done;
+ __ movl(EDI, Address(ESP, kArrayLengthOffset)); // Array length.
+ __ leal(EDI, Address(EDI, TIMES_2, fixed_size)); // EDX is Smi.
siva 2012/01/04 01:56:03 EDI is Smi? Also if you moved this block of code
Ivan Posva 2012/01/04 07:59:42 Rearranged setting of class and tags to avoid reca
+ ASSERT(kSmiTagShift == 1);
+ __ andl(EDI, Immediate(-kObjectAlignment));
+ __ cmpl(EDI,
+ Immediate(RawObject::SizeTag::kMaxSizeTag));
siva 2012/01/04 01:56:03 Can this fit in one line?
Ivan Posva 2012/01/04 07:59:42 Done.
+ __ j(ABOVE, &size_tag_overflow, Assembler::kNearJump);
+ __ shll(EDI, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2));
+ __ movl(FieldAddress(EAX, Array::tags_offset()), EDI); // Tags.
+ __ jmp(&done);
+ __ Bind(&size_tag_overflow);
+ __ movl(FieldAddress(EAX, Array::tags_offset()), Immediate(0));
+ __ Bind(&done);
+ }
+
// Store the type argument field.
__ movl(EDI, Address(ESP, kTypeArgumentsOffset)); // type argument.
__ StoreIntoObject(EAX,

Powered by Google App Engine
This is Rietveld 408576698