c1 crashes ?

Tobias Hartmann tobias.hartmann at oracle.com
Tue Jun 26 12:42:51 UTC 2018


Hi Remi,

so this is a C1 crash with an application that uses value types and is executed without
-XX:+EnableValhalla, right? A crash is expected in this case because C1 does not support value types
(and Tiered Compilation is enabled by default). Maybe we should reject value types during
verification if EnableValhalla is off.

Thanks,
Tobias


On 25.06.2018 11:29, forax at univ-mlv.fr wrote:
> 
> 
> ----- Mail original -----
>> De: "Roland Westrelin" <rwestrel at redhat.com>
>> À: "Remi Forax" <forax at univ-mlv.fr>
>> Cc: "valhalla-dev" <valhalla-dev at openjdk.java.net>
>> Envoyé: Lundi 25 Juin 2018 11:13:06
>> Objet: Re: c1 crashes ?
> 
>>> it seems to work without (apart c1 crash).
>>
>> Do you have a test case for the c1 crash?
> 
> yes, sure, see below.
> 
>>
>> Roland.
> 
> Rémi
> 
> ---
> public final __ByValue class IntBox {
>   private final int value;
> 
>   private IntBox() {
>     this.value = 0;
>   }
> 
>   @Override
>   public String toString() {
>     return "" + value;
>   }
> 
>   public int compareTo(IntBox box) {
>     return Integer.compare(value, box.value);
>   }
>   
>   public IntBox add(IntBox box) {
>     return IntBox.valueOf(value + box.value);
>   }
>   
>   public static IntBox valueOf(int value) {
>     IntBox box = __MakeDefault IntBox();
>     box = __WithField(box.value, value);
>     return box;
>   }
> 
>   private static IntBox sum(IntBox n) {
>     IntBox sum = IntBox.valueOf(0);
>     for(IntBox i = IntBox.valueOf(0); i.compareTo(n) < 0; i = i.add(IntBox.valueOf(1))) {
>       sum = sum.add(i);
>     }
>     return sum;
>   }
>   
>   public static void main(String[] args) {
>     for(int i = 0; i < 100_000; i++) {
>       sum(IntBox.valueOf(i));
>     }
>   }
> }
> 



More information about the valhalla-dev mailing list