[lworld] RFR: 8315935: [lworld] Apply flat renaming to C2 code

Tobias Hartmann thartmann at openjdk.org
Tue Sep 12 07:42:13 UTC 2023


On Fri, 8 Sep 2023 13:56:25 GMT, Frederic Parain <fparain at openjdk.org> wrote:

> Same renaming as in JDK-8315412 applied to C2 code.
> 
> Tested with Mach5, tier1
> 
> Fred

Thanks a lot for taking care of this renaming, Fred! I found some remaining occurrences of "flattened", maybe there are more that need to be updated.

src/hotspot/share/oops/flatArrayOop.hpp line 32:

> 30: #include "runtime/handles.hpp"
> 31: 
> 32: // A flatArrayOop is an array containing flattened inline types (no indirection).

Shouldn't this be "flat inline types" instead?

src/hotspot/share/opto/loopnode.hpp line 103:

> 101:   bool is_loop_nest_inner_loop() const { return _loop_flags & LoopNestInnerLoop; }
> 102:   bool is_loop_nest_outer_loop() const { return _loop_flags & LoopNestLongOuterLoop; }
> 103:   bool is_flat_arrays() const { return _loop_flags & FlattenedArrays; }

Should we also rename `FlattenedArrays`?

src/hotspot/share/opto/parse2.cpp line 280:

> 278:         Node* casted_ary = ary;
> 279:         if (vk != nullptr && !stopped()) {
> 280:           // Element type is known, cast and store to flattened representation

Suggestion:

          // Element type is known, cast and store to flat representation

src/hotspot/share/opto/subnode.cpp line 1050:

> 1048:       if ((r0->flat_array() && r1->not_flat_array()) ||
> 1049:           (r1->flat_array() && r0->not_flat_array())) {
> 1050:         // One type is flattened in arrays but the other type is not. Must be unrelated.

Suggestion:

        // One type is flat in arrays but the other type is not. Must be unrelated.

src/hotspot/share/opto/subtypenode.cpp line 55:

> 53:   // Handle inline type arrays
> 54:   if (subk->flat_array() && superk->not_flat_array()) {
> 55:     // The subtype is flattened in arrays and the supertype is not flattened in arrays. Must be unrelated.

Suggestion:

    // The subtype is flat in arrays and the supertype is not flat in arrays. Must be unrelated.

src/hotspot/share/opto/type.cpp line 5203:

> 5201:       // Meeting flat inline type array with non-flat array. Adjust (field) offset accordingly.
> 5202:       if (tary->_flat) {
> 5203:         // Result is flattened

Suggestion:

        // Result is flat

src/hotspot/share/opto/type.cpp line 5207:

> 5205:         field_off = is_flat() ? field_offset() : tap->field_offset();
> 5206:       } else if (below_centerline(ptr)) {
> 5207:         // Result is non-flattened

Suggestion:

        // Result is non-flat

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

Marked as reviewed by thartmann (Committer).

PR Review: https://git.openjdk.org/valhalla/pull/925#pullrequestreview-1621519616
PR Review Comment: https://git.openjdk.org/valhalla/pull/925#discussion_r1322576078
PR Review Comment: https://git.openjdk.org/valhalla/pull/925#discussion_r1322578698
PR Review Comment: https://git.openjdk.org/valhalla/pull/925#discussion_r1322580115
PR Review Comment: https://git.openjdk.org/valhalla/pull/925#discussion_r1322579665
PR Review Comment: https://git.openjdk.org/valhalla/pull/925#discussion_r1322580705
PR Review Comment: https://git.openjdk.org/valhalla/pull/925#discussion_r1322581323
PR Review Comment: https://git.openjdk.org/valhalla/pull/925#discussion_r1322581494



More information about the valhalla-dev mailing list