RFR: 8230203: Replace markWord enums with uintptr_t constants

Stefan Karlsson stefan.karlsson at oracle.com
Tue Aug 27 07:32:33 UTC 2019


Hi all,

Please review this patch to convert the enum constants in markWord into 
static const unintptr_t constants.

http://cr.openjdk.java.net/~stefank/8230203/webrev.01/
https://bugs.openjdk.java.net/browse/JDK-8230203

This is a follow-up RFE from the review of JDK-8229258, where a number 
of unnecessary casts were pointed out.

There was also a recent bug in this area, JDK-8221725, where Thomas 
points out the problem of relying on the bit width of the enum values.

This patch:
1) changes all constants to have the same type as the markWord::_value 
field.
2) Removes unnecessary uintptr_t casts
3) Removes uintx casts, because they are typedefed to be uintptr_t
4) Adds explicit casts to (int) when values are negated.
5) Try to only use uintptr_t inside markWord.
6) Leaves the use of intptr_t for parameters and return types of the 
different hash functions.

Tested with tier1-3

Thanks,
StefanK


More information about the hotspot-dev mailing list