Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8229897

[lworld][c1] avoid allocation when reading a field from a flattened field

    Details

      Description

      When C1 compiles the following code

          inline class Point {int x, ..... }
          class Holder { Point point; }

          int x = holder.point.x

      it first allocates a temporary Point object, copy the value of holder.point.x to the temp object, and then read x from the temp object. This should be simplified into a single load instruction

          x = ((int*)(holder))[offset of point.x];

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              iklam Ioi Lam
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: