RFR(XS): 8181377: Capture underlying type for unsafe/unaligned pointers in ClassFileParser
Mikael Vidstedt
mikael.vidstedt at oracle.com
Wed May 31 21:48:46 UTC 2017
Bug: https://bugs.openjdk.java.net/browse/JDK-8181377 <https://bugs.openjdk.java.net/browse/JDK-8181377>
Webrev: http://cr.openjdk.java.net/~mikael/webrevs/8181377/webrev.00/hotspot/webrev/ <http://cr.openjdk.java.net/~mikael/webrevs/8181377/webrev.00/hotspot/webrev/>
Copied from the issue description:
As part of JDK-8180032 I fixed a problem where ClassFileParser passed around potentially unaligned pointers to various class file data structures, and in some cases dereferenced those unaligned pointers which is not valid in C++. As part of the fix I chose to switch from using typed pointers (like u2*) in favor of void*, to signal that the pointer is not (necessarily) possible to dereference directly. However, by switching to void* the information about the underlying type (u2) is lost, which is unfortunate. The information about the type should be maintained in some way.
I’ve been playing around with a more generic representation of “unsafe” pointers, but I think it’s a slightly bigger project and meanwhile I don’t want to “lose" the type information, so the suggested change at least addresses the “regression” in information.
Cheers,
Mikael
More information about the hotspot-runtime-dev
mailing list