Crash with "assert(number_of_codes <= 256) failed: too many bytecodes"

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Jul 27 17:12:40 UTC 2017


Looks good

Maurizio


On 27/07/17 17:18, Tobias Hartmann wrote:
> Okay, it's getting complicated. Here are the webrevs:
>
> http://cr.openjdk.java.net/~thartmann/valhalla/vt_prototype/webrev.36.jdk/
> http://cr.openjdk.java.net/~thartmann/valhalla/vt_prototype/webrev.36.langtools/
> http://cr.openjdk.java.net/~thartmann/valhalla/vt_prototype/webrev.36.hs/
>
> What do you think?
>
> Best regards,
> Tobias
>
> On 27.07.2017 18:08, Tobias Hartmann wrote:
>> On 27.07.2017 17:58, Maurizio Cimadamore wrote:
>>> Wait - if you update these opcodes, then we need to update bytecode library as well - see
>>>
>>> jdk.experimental.bytecode.Opcode
>> Right:
>>
>> diff -r 2e4c9a8ae4e3 src/java.base/share/classes/jdk/experimental/bytecode/Opcode.java
>> --- a/src/java.base/share/classes/jdk/experimental/bytecode/Opcode.java	Thu Jul 27 15:59:25 2017 +0100
>> +++ b/src/java.base/share/classes/jdk/experimental/bytecode/Opcode.java	Thu Jul 27 18:07:52 2017 +0200
>> @@ -235,14 +235,11 @@
>>       VSTORE(204),
>>       VALOAD(205),
>>       VASTORE(206),
>> -    VNEW(207),
>> -    VRETURN(210),
>> -    VGETFIELD(211),
>> -    TYPED(212),
>> -    VDEFAULT(214),
>> -    VWITHFIELD(215),
>> -    VBOX(216),
>> -    VUNBOX(217);
>> +    VRETURN(207),
>> +    VDEFAULT(208),
>> +    VWITHFIELD(209),
>> +    VBOX(210),
>> +    VUNBOX(211);
>>   
>>       int code;
>>
>>
>> And I guess we have to change this as well:
>>
>> diff -r 298730c35452 src/jdk.jdeps/share/classes/com/sun/tools/classfile/Opcode.java
>> --- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Opcode.java	Thu Jul 27 16:00:29 2017 +0100
>> +++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Opcode.java	Thu Jul 27 18:08:20 2017 +0200
>> @@ -247,13 +247,13 @@
>>       VSTORE(204, LOCAL),
>>       VALOAD(205),
>>       VASTORE(206),
>> -    VRETURN(210),
>> +    VRETURN(207),
>>   
>> -    VDEFAULT(214, CPREF_W),
>> -    VWITHFIELD(215, CPREF_W),
>> +    VDEFAULT(208, CPREF_W),
>> +    VWITHFIELD(209, CPREF_W),
>>   
>> -    VBOX(216, CPREF_W),
>> -    VUNBOX(217, CPREF_W),
>> +    VBOX(210, CPREF_W),
>> +    VUNBOX(211, CPREF_W),
>>   
>>       // impdep 0xfe: PicoJava nonpriv
>>       // impdep 0xff: Picojava priv
>>
>>
>> Thanks,
>> Tobias
>>
>>> On 27/07/17 16:31, Tobias Hartmann wrote:
>>>> Hi,
>>>>
>>>> seems like this is due to:
>>>> http://hg.openjdk.java.net/valhalla/valhalla/hotspot/rev/dbb31857c4d4
>>>>
>>>> If I count correctly, adding _vgetfield at the end 'causes number_of_codes' to be 257 and thus we fail.
>>>>
>>>> We should reset the value type bytecode numbers:
>>>>
>>>> diff -r 5cd8d5559192 src/share/vm/interpreter/bytecodes.hpp
>>>> --- a/src/share/vm/interpreter/bytecodes.hpp    Thu Jul 27 16:00:00 2017 +0100
>>>> +++ b/src/share/vm/interpreter/bytecodes.hpp    Thu Jul 27 17:23:40 2017 +0200
>>>> @@ -248,11 +248,11 @@
>>>>        _vstore               = 204, // 0xcc
>>>>        _vaload               = 205, // 0xcd
>>>>        _vastore              = 206, // 0xce
>>>> -    _vreturn              = 210, // 0xd2
>>>> -    _vdefault             = 214, // 0xd6
>>>> -    _vwithfield           = 215, // 0xd7
>>>> -    _vbox                 = 216, // 0xd6
>>>> -    _vunbox               = 217, // 0xd7
>>>> +    _vreturn              = 207, // 0xcf
>>>> +    _vdefault             = 208, // 0xd0
>>>> +    _vwithfield           = 209, // 0xd1
>>>> +    _vbox                 = 210, // 0xd2
>>>> +    _vunbox               = 211, // 0xd3
>>>>          number_of_java_codes,
>>>>
>>>> Thanks,
>>>> Tobias




More information about the valhalla-dev mailing list