RFR: 8278947: Support for array constants in constant table [v2]

Quan Anh Mai duke at openjdk.java.net
Tue Feb 8 17:51:13 UTC 2022


On Tue, 8 Feb 2022 14:59:03 GMT, Jie Fu <jiefu 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 10 additional commits since the last revision:
>> 
>>  - Merge branch 'master' into constantVectorUpdate
>>  - update copyright
>>  - missing type in array_constant
>>  - Merge branch 'master' into constantVector
>>  - use constant table for remaining types
>>  - Merge branch 'master' into constantVector
>>  - refactor
>>  - replicate using constant
>>  - Merge branch 'master' into constantVector
>>  - initial commit
>
> src/hotspot/share/opto/constantTable.cpp line 44:
> 
>> 42:   switch (type()) {
>> 43:   case T_INT:     return (_v._value.i == other._v._value.i);
>> 44:   case T_FLOAT:   return jint_cast(_v._value.f) == jint_cast(other._v._value.f);
> 
> Why did you add `jint_cast`?
> 
> Does it mean the original impl for `T_FLOAD` wouldn't work as expected?

They are the same. The current one uses type punning to do a bit cast. The updated one just makes the cast more explicit and consolidates the theoretical UB of type punning so that we can fix it more easily in the future.
Thanks.

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

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


More information about the hotspot-compiler-dev mailing list