RFR: 8342651: Refactor array constant to use an array of jbyte [v2]
Quan Anh Mai
qamai at openjdk.org
Wed Nov 13 14:10:01 UTC 2024
On Wed, 23 Oct 2024 11:43:33 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> Quan Anh Mai has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>>
>> - Merge branch 'master' into constanttable
>> - refactor array constant, fix codebuffer reallocation
>
> src/hotspot/cpu/x86/x86.ad line 2743:
>
>> 2741: case T_BYTE: val->at(i) = con; break;
>> 2742: case T_SHORT: {
>> 2743: jshort c = con;
>
> Why are these casts needed? Isn't `T con` already of the appropriate j-type?
No for example when `bt == T_BYTE`, `T` is actual `jint`. As a result, I do this for all the cases for uniformity, also a mismatch will not result in a crash but may silently write the wrong data so I'm extra cautious here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21596#discussion_r1840350024
More information about the hotspot-compiler-dev
mailing list