> This PR remove from `InlineTypeNode` the methods: > > int field_offset(uint index) const; > uint field_index(int offset) const; > ciType* field_type(uint index) const; > bool field_is_flat(uint index) const; > bool field_is_null_free(uint index) const; > bool field_is_volatile(uint index) const; > int field_null_marker_offset(uint index) const; > > in favor of a single > > ciField* field(uint index) const; > > from which we directly access the various properties we are interested in. > > I've called it `field` as suggested in the original discussion. I've started > with `declared_nonstatic_field_at` to be consistent with `ciInstanceKlass` > and to avoid ambiguity wrt which kind of fields we are talking about, but > this name is rather long... Since we are only talking about the declared > fields, and we have no easy getter for `nonstatic_field_at`, then I think > it's ok to have a shorter name. Also, in the context of a `InlineTypeNode`, > the "non-static" part of the long name seems rather redundant. > > The other question is what we should do with asserts? Methods > `field_is_flat`, `field_is_null_free` and `field_is_volatile` had the assert > > assert(!field->is_flat() || field->type()->is_inlinetype(), "must be an > inline type"); > > and `field_null_marker_offset` had > > assert(field->is_flat(), "must be an inline type"); > > > I've tried to propagate them to the call-site of such functions, and where it > makes a bit of sense, and not subsumed by surrounding `if()` and `assert`. > Let me know if it seems unnecessary or not well-placed in some cases. > > Tested with > tier1,tier2,tier3,hs-precheckin-comp,hs-comp-stress,valhalla-comp-stress. > Looks fine, but it doesn't seem too risky. > > Thanks, > Marc
Marc Chevalier has updated the pull request incrementally with one additional commit since the last revision: Copyright ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1922/files - new: https://git.openjdk.org/valhalla/pull/1922/files/d4ce5d50..4ecd309c Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1922&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1922&range=00-01 Stats: 4 lines in 4 files changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/valhalla/pull/1922.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1922/head:pull/1922 PR: https://git.openjdk.org/valhalla/pull/1922
