[Sablevm-developer] Generational GC and Hashcode
Brought to you by:
egagnon
From: Carl L. <le...@ia...> - 2004-01-17 22:26:44
|
I am finishing up an implementation for Generational garbage collection for SableVM and have a question regarding the hashcode. I have based the GC on the original copying GC but am not sure I understand how the hashcode is handled. From what I have read, the hashcode is used by various hashing functions when storing objects, and thus the hashcode should be constant for the life of the object. It is also suggested that the hashcode be distributed across the range of integers, and although does not need to be unique for each object, uniqueness will provide better performance. It is suggested to use the heap address of the object for the hashcode, but in a copying collector, such as in SableVM, the location of the object will not be static. Could someone explain to me how the lockword bits denoting SVM_HASH_NONE, SVM_HASH_NOT_MOVED, SVM_HASH_MOVED work in conjunction with the garbage collector, specifically with env->vm->heap.hashcode_base? I feel I understand the intention, but not the details. I think the major difference between the current collector and a generational collector is that only a small subset of the objects are relocated during a collection of the nursery. Carl Lebsack PhD Student Iowa State University |