Refactor GC allocation with bitmap info

* replace each Object's member marking with Object::fillGCDescriptor
* BigInt allocation is fixed to be handled by simple GC_MALLOC_ATOMIC call

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
HyukWoo Park 2021-05-17 18:09:59 +09:00 committed by Boram Bae
commit b605adbb1f
13 changed files with 15 additions and 49 deletions

View file

@ -42,9 +42,7 @@ void* StringObject::operator new(size_t size)
static GC_descr descr;
if (!typeInited) {
GC_word obj_bitmap[GC_BITMAP_SIZE(StringObject)] = { 0 };
GC_set_bit(obj_bitmap, GC_WORD_OFFSET(StringObject, m_structure));
GC_set_bit(obj_bitmap, GC_WORD_OFFSET(StringObject, m_prototype));
GC_set_bit(obj_bitmap, GC_WORD_OFFSET(StringObject, m_values));
Object::fillGCDescriptor(obj_bitmap);
GC_set_bit(obj_bitmap, GC_WORD_OFFSET(StringObject, m_primitiveValue));
descr = GC_make_descriptor(obj_bitmap, GC_WORD_LEN(StringObject));
typeInited = true;
@ -141,9 +139,7 @@ void* StringIteratorObject::operator new(size_t size)
static GC_descr descr;
if (!typeInited) {
GC_word obj_bitmap[GC_BITMAP_SIZE(StringIteratorObject)] = { 0 };
GC_set_bit(obj_bitmap, GC_WORD_OFFSET(StringIteratorObject, m_structure));
GC_set_bit(obj_bitmap, GC_WORD_OFFSET(StringIteratorObject, m_prototype));
GC_set_bit(obj_bitmap, GC_WORD_OFFSET(StringIteratorObject, m_values));
Object::fillGCDescriptor(obj_bitmap);
GC_set_bit(obj_bitmap, GC_WORD_OFFSET(StringIteratorObject, m_string));
descr = GC_make_descriptor(obj_bitmap, GC_WORD_LEN(StringIteratorObject));
typeInited = true;