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

[MVT] Eliminate redundant value type allocations

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • hotspot

      C2 currently creates two allocations in the following case:

              // Create value type and force allocation
              MyValue3 vt = MyValue3.create();
              va[0] = vt;
              val77 = vt;
              vt.verify(val77);

              // Value type is now allocated, make a copy and force allocation.
              MyValue3 copy = MyValue3.setC(vt, vt.c);
              va[0] = copy;

      But because copy is equal to vt, C2 should eliminate this redundant allocation.

            thartmann Tobias Hartmann
            thartmann Tobias Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: