[lworld] RFR: 8357785: [lworld] TestResolvedJavaType fails due to unexpected getInstanceFields order [v2]

Marc Chevalier mchevalier at openjdk.org
Thu Jul 24 11:44:11 UTC 2025


On Wed, 23 Jul 2025 18:50:34 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Marc Chevalier has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address Quan Anh's comments
>
> src/hotspot/share/oops/fieldStreams.hpp line 277:
> 
>> 275:  */
>> 276: template<typename FieldStreamType>
>> 277: class HierarchicalFieldStream : public HierarchicalFieldStreamBase<FieldStreamType>  {
> 
> 1. It's good practice marking a class as `final` so the compiler can do more efficient devirtualization.
> 2. It seems the `HierarchicalFieldStreamBase` is only for code reuse. Then it would be better to use private inheritance instead.

1. Yes, good idea. I like that mostly for maintenance. On the other hand, despite my hopes, I never observed really compilers taking advantage of it in the wild (on made up examples, yes, of course).
2. I don't think I can: the public methods of the base class would then be private, and I need them in the public interface of the class. I've tried, and indeed, it doesn't compile.

-------------

PR Review Comment: https://git.openjdk.org/valhalla/pull/1511#discussion_r2228271675


More information about the valhalla-dev mailing list