RFR: JDK-8287288: Fix some typos in C1
David Holmes
dholmes at openjdk.java.net
Thu May 26 02:52:40 UTC 2022
On Thu, 26 May 2022 02:15:08 GMT, Zhuojun Miao <zmiao at openjdk.org> wrote:
>> src/hotspot/share/c1/c1_LIR.hpp line 203:
>>
>>> 201: // data opr-type opr-kind
>>> 202: // +-----------+----------+-------+
>>> 203: // [max........|6 5 4 3|2 1 0]
>>
>> I don't think your change is right. The code below indicates there are 3 bits for kind. So I think the original should actually look like this:
>>
>>
>> // data opr-type opr-kind
>> // +--------------+-------+--------+--+
>> // [max...........|7 6 5 4| 3 2 1 | 0]
>
> According to the definitions of `Opr_kind` and `kind_mask` below, it can be seen that `opr-kind` uses the lowest 3 bits, and if the lowest bit is 0, it means that this is a pointer.
I was reading:
enum OprBits {
pointer_bits = 1
, kind_bits = 3
, type_bits = 4
, size_bits = 2
, destroys_bits = 1
as a bitfield description so 1 pointer bit followed by 3 kind bits, followed by 4 type bits etc. But I agree the later mask value only does a shift of 3 not 4.
Also the code indicates there are a lot more non-data bits before we get to the data so the diagram is incomplete in other ways.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8880
More information about the hotspot-compiler-dev
mailing list