I am reading the paper Garbage-First Garbage Collection (http://cs.williams.edu/~dbarowy/cs334s18/assets/p37-detlefs.pdf), in section 2.2 it mentions the write barrier. In order to filter out the object from the same region, it has the following code, when rTmp
is 0 means rX
and rY
contains pointer from the same region
rTmp := rX XOR rY
rTmp := rTmp >> LogOfHeapRegionSize
But if assume LogOfHeapRegionSize is 4 (bin=100), and rX starts the address (bin 0), rY starts the address (bin 111), clearly, they are not in the same region, but apply the code above, we have
111 XOR 000 = 111
111 >> 4 = 0
gives they are in the same region, why? Am I understand the code in the right way?