RFR: JDK-8261552: s390: MacroAssembler::encode_klass_not_null() may produce wrong results for non-zero values of narrow klass base

Lutz Schmidt lucy at openjdk.java.net
Thu Feb 18 11:00:40 UTC 2021


On Thu, 18 Feb 2021 05:31:33 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/cpu/s390/macroAssembler_s390.cpp line 3645:
>> 
>>> 3643:   }
>>> 3644: #endif
>>> 3645: 
>> 
>> I do not like the cross-dependency to metaspace.hpp just for the sake of checking an artificial restriction on Klass pointers. And by the way, you could do the check with one test:
>>   z_oihf(current, 0);
>>   z_brc(Assembler::bcondZero, ok);
>> 
>> z_oihf() does modify the contents of register current, but it writes back the same value.
>
>> I do not like the cross-dependency to metaspace.hpp just for the sake of checking an artificial restriction on Klass pointers.
> 
> It is not just for the assertion, it is for limiting the 32bit add to situations where we know Klass pointers cannot exceed 32bit. That was the main reason. As I wrote, I was not sure about the assertion myself and am happy to drop it.
> 
>> And by the way, you could do the check with one test:
>> 
>> ```
>>   z_oihf(current, 0);
>>   z_brc(Assembler::bcondZero, ok);
>> ```
>> 
>> z_oihf() does modify the contents of register current, but it writes back the same value.
> 
> Thank you. Unfortunately, information about z assembly was hard to come by. The only public information I found had hardly more than the instruction names, the rest was trial and error.

I admit. To find System z information, you need to know the "magic keywords" to search for. In this case, it would be "Principles of Operation". The third or so Google hit would lead you to the System z architecture document. With 2000+ pages to read, you would be lost anyway. :-)

-------------

PR: https://git.openjdk.java.net/jdk/pull/2595


More information about the hotspot-dev mailing list