src/share/vm/prims/jvmtiTagMap.cpp

changeset 5784
190899198332
parent 5097
92ef81e2f571
child 6876
710a3c8b516e
child 6992
2c6ef90f030a
equal deleted inserted replaced
5783:c1fbf21c7397 5784:190899198332
163 163
164 // hash a given key (oop) with the specified size 164 // hash a given key (oop) with the specified size
165 static unsigned int hash(oop key, int size) { 165 static unsigned int hash(oop key, int size) {
166 // shift right to get better distribution (as these bits will be zero 166 // shift right to get better distribution (as these bits will be zero
167 // with aligned addresses) 167 // with aligned addresses)
168 unsigned int addr = (unsigned int)((intptr_t)key); 168 unsigned int addr = (unsigned int)(cast_from_oop<intptr_t>(key));
169 #ifdef _LP64 169 #ifdef _LP64
170 return (addr >> 3) % size; 170 return (addr >> 3) % size;
171 #else 171 #else
172 return (addr >> 2) % size; 172 return (addr >> 2) % size;
173 #endif 173 #endif

mercurial