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

Unified Diff: vm/object.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
« no previous file with comments | « vm/object.h ('k') | vm/raw_object.h » ('j') | vm/stub_code_x64.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « vm/object.h ('k') | vm/raw_object.h » ('j') | vm/stub_code_x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698