equal
deleted
inserted
replaced
57 #include "runtime/threadSMR.hpp" |
57 #include "runtime/threadSMR.hpp" |
58 #include "runtime/vframe.hpp" |
58 #include "runtime/vframe.hpp" |
59 #include "runtime/vmThread.hpp" |
59 #include "runtime/vmThread.hpp" |
60 #include "runtime/vm_operations.hpp" |
60 #include "runtime/vm_operations.hpp" |
61 #include "utilities/macros.hpp" |
61 #include "utilities/macros.hpp" |
|
62 #if INCLUDE_ZGC |
|
63 #include "gc/z/zGlobals.hpp" |
|
64 #endif |
62 |
65 |
63 // JvmtiTagHashmapEntry |
66 // JvmtiTagHashmapEntry |
64 // |
67 // |
65 // Each entry encapsulates a reference to the tagged object |
68 // Each entry encapsulates a reference to the tagged object |
66 // and the tag value. In addition an entry includes a next pointer which |
69 // and the tag value. In addition an entry includes a next pointer which |
176 } |
179 } |
177 } |
180 } |
178 |
181 |
179 // hash a given key (oop) with the specified size |
182 // hash a given key (oop) with the specified size |
180 static unsigned int hash(oop key, int size) { |
183 static unsigned int hash(oop key, int size) { |
|
184 ZGC_ONLY(assert(ZAddressMetadataShift >= sizeof(unsigned int) * BitsPerByte, "cast removes the metadata bits");) |
|
185 |
181 // shift right to get better distribution (as these bits will be zero |
186 // shift right to get better distribution (as these bits will be zero |
182 // with aligned addresses) |
187 // with aligned addresses) |
183 unsigned int addr = (unsigned int)(cast_from_oop<intptr_t>(key)); |
188 unsigned int addr = (unsigned int)(cast_from_oop<intptr_t>(key)); |
184 #ifdef _LP64 |
189 #ifdef _LP64 |
185 return (addr >> 3) % size; |
190 return (addr >> 3) % size; |