One embodiment of the present invention provides a system that facilitates relocating
an object in a computer system that provides an object-addressed memory hierarchy.
During operation, the system receives a new address specifying to where the object
is to be relocated in main memory. The system then retrieves an object table entry
associated with the object. This object table entry contains a current address
for the object, which is used to translate an object identifier for the object
into a corresponding physical address for the object in main memory. Next, the
system clears an evicted indicator from the object table entry, wherein the evicted
indicator is set whenever the object is modified in main memory. The system then
copies the object from the current address to the new address. After copying is
complete, the system performs an atomic operation that swaps the current address
in the object table entry with the new address if the evicted indicator remains clear.