Details
-
Type:
Enhancement
-
Status: Resolved
-
Priority:
P4
-
Resolution: Fixed
-
Affects Version/s: repo-valhalla
-
Fix Version/s: repo-valhalla
-
Component/s: hotspot
-
Subcomponent:
Description
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.
// 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.