36 /* 37 * @run main/othervm -XX:+EnableValhalla runtime.valhalla.valuetypes.Test8186715 38 */ 39 40 public class Test8186715 { 41 42 public static void main(String[] args) { 43 MyValueType v = MyValueType.testDefault(); 44 45 for (int i = 0; i < 1000000; i++) 46 MyValueType.testBranchArg1(false, v); 47 } 48 } 49 50 __ByValue final class MyValueType { 51 final int i; 52 final int j; 53 54 private MyValueType() 55 { 56 this.i = 0; 57 this.j = 0; 58 } 59 60 __ValueFactory static MyValueType testDefault() { 61 return __MakeDefault MyValueType(); 62 } 63 64 __ValueFactory static MyValueType testBranchArg1(boolean flag, MyValueType v1) { 65 if (flag) { 66 v1.i = 3; 67 v1.j = 4; 68 } 69 return v1; 70 } 71 } | 36 /* 37 * @run main/othervm -XX:+EnableValhalla runtime.valhalla.valuetypes.Test8186715 38 */ 39 40 public class Test8186715 { 41 42 public static void main(String[] args) { 43 MyValueType v = MyValueType.testDefault(); 44 45 for (int i = 0; i < 1000000; i++) 46 MyValueType.testBranchArg1(false, v); 47 } 48 } 49 50 __ByValue final class MyValueType { 51 final int i; 52 final int j; 53 54 private MyValueType() 55 { 56 i = 0; 57 j = 0; 58 } 59 60 static MyValueType testDefault() { 61 return __MakeDefault MyValueType(); 62 } 63 64 static MyValueType testBranchArg1(boolean flag, MyValueType v1) { 65 if (flag) { 66 v1.i = 3; 67 v1.j = 4; 68 } 69 return v1; 70 } 71 } |