RFR: 8309751: Duplicate constant pool entries added during default method processing [v2]
Coleen Phillimore
coleenp at openjdk.org
Tue Apr 2 13:06:25 UTC 2024
On Tue, 2 Apr 2024 01:11:34 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Added a comment and did some renaming to make it clearer what this is doing.
>
> src/hotspot/share/classfile/bytecodeAssembler.hpp line 98:
>
>> 96: static BytecodeCPEntry string(Symbol* symbol) {
>> 97: BytecodeCPEntry bcpe(STRING);
>> 98: bcpe._u.utf8 = symbol;
>
> It seems to me that these changes have killed off the use of the `_u.string` union component.
>
> I also can't make a connection between these changes and the duplicate removals.
I added some comments and renamed a couple things to make it make more sense, and remove u.string component since you're right, it's no longer used.
> src/hotspot/share/classfile/bytecodeAssembler.hpp line 158:
>
>> 156: u2 string(Symbol* str, TRAPS) {
>> 157: u2 utf8_entry = utf8(str, CHECK_0);
>> 158: return find_or_add(BytecodeCPEntry::string(utf8_entry), THREAD);
>
> So `utf8_entry` is now unneeded.
I added some comment to make this make more sense. It needs the Symbol from the original constant pool to compare, since the utf8 constant pool entry from the one we're copying doesn't point to the UTF8 entry anymore (it points to the symbol). Took me a while to figure out what hash is, so I renamed it value.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18548#discussion_r1547837105
PR Review Comment: https://git.openjdk.org/jdk/pull/18548#discussion_r1547835529
More information about the hotspot-runtime-dev
mailing list