[MVT] vbox throws a CCE

forax at univ-mlv.fr forax at univ-mlv.fr
Thu Aug 24 15:31:31 UTC 2017


Ok, found,

VBOX should take a class reference if you read the spec but takes a value class reference in the current implementation.
So if instead of
  mv.visitTypeInsn(VBOX, "mvt/Test");
i use
  mv.visitTypeInsn(VBOX, ";Qmvt/Test$Value;");

it works !

Rémi

----- Mail original -----
> De: "Frederic Parain" <frederic.parain at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "valhalla-dev" <valhalla-dev at openjdk.java.net>
> Envoyé: Jeudi 24 Août 2017 01:08:13
> Objet: Re: [MVT] vbox throws a CCE

> Remi,
> 
> Could you send the classfile?
> 
> Thank you,
> 
> Fred
> 
>> On Aug 23, 2017, at 18:40, Remi Forax <forax at univ-mlv.fr> wrote:
>> 
>> When i try to execute this code:
>> 
>> public final class Test {
>>  private final int value;
>> 
>>  public java.lang.String toString();
>>    Code:
>>       0: aload_0
>>       1: getfield      #11                 // Field value:I
>>       4: invokedynamic #23,  0             // InvokeDynamic
>>       #0:makeConcatWithConstants:(I)Ljava/lang/String;
>>       9: areturn
>> 
>>  public static void main(java.lang.String[]);
>>    Code:
>>       0: vdefault      #27                 // class ";QTest;"
>>       3: iconst_3
>>       4: vwithfield    #28                 // Field ";QTest;".value:I
>>       7: vstore        1
>>       9: getstatic     #34                 // Field
>>       java/lang/System.out:Ljava/io/PrintStream;
>>      12: vload         1
>>      14: vbox          #2                  // class Test
>>      17: invokevirtual #40                 // Method
>>      java/io/PrintStream.println:(Ljava/lang/Object;)V
>>      20: return
>> }
>> 
>> with this command line:
>> java -Xverify:none -XX:+EnableMVT Test
>> 
>> i get this exception:
>> Exception in thread "main" java.lang.ClassCastException: vbox not from value
>> type
>> 	at Test.main(Unknown Source)
>> 
>> This is not clear for me why ?
>> 
>> cheers,
> > Rémi



More information about the valhalla-dev mailing list