| Index: vm/object.cc
|
| ===================================================================
|
| --- vm/object.cc (revision 2918)
|
| +++ vm/object.cc (working copy)
|
| @@ -703,6 +703,8 @@
|
|
|
|
|
| void Object::InitializeObject(uword address, intptr_t size) {
|
| + // TODO(iposva): Get a proper halt instruction from the assembler which
|
| + // would be needed here for code objects.
|
| uword initial_value = reinterpret_cast<uword>(null_);
|
| uword cur = address;
|
| uword end = address + size;
|
| @@ -716,16 +718,18 @@
|
| RawObject* Object::Allocate(const Class& cls,
|
| intptr_t size,
|
| Heap::Space space) {
|
| + ASSERT(Utils::IsAligned(size, kObjectAlignment));
|
| Isolate* isolate = Isolate::Current();
|
| Heap* heap = isolate->heap();
|
|
|
| - // TODO(iposva): Get a proper halt instruction from the assembler.
|
| uword address = heap->Allocate(size, space);
|
| NoGCScope no_gc;
|
| InitializeObject(address, size);
|
| RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag);
|
| raw_obj->ptr()->class_ = cls.raw();
|
| - raw_obj->ptr()->tags_ = 0;
|
| + uword tags = 0;
|
| + tags = RawObject::SizeTag::update(size, tags);
|
| + raw_obj->ptr()->tags_ = tags;
|
| return raw_obj;
|
| }
|
|
|
|
|