<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
No worries - this actually reminds me of Adam's complaints about ClassFile API's parsed instructions having no identity and thus complicated to handle for the low code model in Babylon.</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Identity is important for control flow and transforms like SSA transform. Unfortunately, since transforms are free to pass in any element or duplicate them, we probably can't do that for ClassFile API, and have to resort to such an external mechanism at the
terminals.</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Chen</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Paul Sandoz <paul.sandoz@oracle.com><br>
<b>Sent:</b> Wednesday, May 7, 2025 1:00 PM<br>
<b>Cc:</b> Mark Roberts <markro@cs.washington.edu>; classfile-api-dev@openjdk.org <classfile-api-dev@openjdk.org>; Chen Liang <chen.l.liang@oracle.com><br>
<b>Subject:</b> Re: are CodeElements unique?</font>
<div> </div>
</div>
<div style="line-break:after-white-space">Oops apologies, I thought this was a Babylon code model question, please ignore!
<div><br>
</div>
<div>Paul.<br id="x_lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On May 7, 2025, at 10:59 AM, paul.sandoz@oracle.com wrote:</div>
<br class="x_Apple-interchange-newline">
<div>
<div style="line-break:after-white-space">Yes. All code items have identity, and their equals/hashCode is defined in terms of that identity i.e., same implementation as for Object.
<div><br>
</div>
<div>A reflected method body or lambda body must have only one code model instance associated with it. (We have been fixing some a bugs to ensure this is guaranteed.)
<div><br>
</div>
<div>Paul.<br id="x_lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On May 7, 2025, at 10:43 AM, Mark Roberts <markro@cs.washington.edu> wrote:</div>
<br class="x_Apple-interchange-newline">
<div>
<div class="x_WordSection1" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<div style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">Are the members of a CodeModel.elementList() unique? Specifically, is it safe to use a CodeElement as the key value in a Map?</div>
<p class="x_MsoNormal" style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">
</p>
<div style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">Thank you,</div>
<div style="margin:0in; font-size:11pt; font-family:Calibri,sans-serif">Mark</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>