RFR: 8350892: [JVMCI] Align ResolvedJavaType.getInstanceFields with Class.getDeclaredFields
    Doug Simon 
    dnsimon at openjdk.org
       
    Mon Mar  3 15:32:18 UTC 2025
    
    
  
The current order of fields returned by `ResolvedJavaType.getInstanceFields` is a) not well specified and b) different than the order of fields used almost everywhere else in HotSpot. This PR aligns the order of `getInstanceFields` with `Class.getDeclaredFields()`.
It also makes `ciInstanceKlass::_nonstatic_fields` use the same order which unifies how escape analysis and deoptimization treats fields across C2 and JVMCI.
-------------
Commit messages:
 - made order of ciInstanceKlass::_nonstatic_fields same as JavaFieldStream (and Class.getDeclaredFields)
 - made order of ResolvedJavaType.getInstanceFields match Class.getDeclaredFields
Changes: https://git.openjdk.org/jdk/pull/23849/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23849&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8350892
  Stats: 89 lines in 6 files changed: 18 ins; 32 del; 39 mod
  Patch: https://git.openjdk.org/jdk/pull/23849.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23849/head:pull/23849
PR: https://git.openjdk.org/jdk/pull/23849
    
    
More information about the hotspot-dev
mailing list