[External] : are CodeElements unique?
Mark Roberts
markro at cs.washington.edu
Wed May 7 19:06:44 UTC 2025
How about only for the original, immutable elementlist prior to any
transforms?
Also, not sure what you meant by a (index, element) pair.
Thanks, Mark
*From:* Chen Liang <chen.l.liang at oracle.com>
*Sent:* Wednesday, May 7, 2025 11:03 AM
*To:* Mark Roberts <markro at cs.washington.edu>; classfile-api-dev at openjdk.org
*Subject:* Re: [External] : are CodeElements unique?
Hi Mark,
Very good question - and the answer is unfortunately, no. Transforms are
allowed to reuse code models, and I think the bound Code attribute
expansion also returns duplicate load or store instructions.
To ensure identity, I think tracking a pair of (index, element) is better.
Regards,
Chen Liang
------------------------------
*From:* Mark Roberts <markro at cs.washington.edu>
*Sent:* Wednesday, May 7, 2025 12:43 PM
*To:* classfile-api-dev at openjdk.org <classfile-api-dev at openjdk.org>
*Cc:* Chen Liang <chen.l.liang at oracle.com>
*Subject:* [External] : are CodeElements unique?
Are the members of a CodeModel.elementList() unique? Specifically, is it
safe to use a CodeElement as the key value in a Map?
Thank you,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20250507/6d3ac35c/attachment.htm>
More information about the classfile-api-dev
mailing list