<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<font size="4"><font face="monospace">Just a little bit of history
here. We started writing this API before we had pattern support
in the language, so we used the classic trick of having an enum
constant per node type that could be switched over. When
patterns came along, we thought about removing them, but we were
still a little diffident as we knew that the cost of switching
over types was higher than switching over enums, and worried
about performance-sensitive transformation code. <br>
<br>
I wouldn't mind seeing a quick microbench comparing switching
over bytecodes the two different ways, just to see if it still
shows up on the profile.<br>
</font></font><br>
<div class="moz-cite-prefix">On 2/7/2023 9:33 AM, Adam Sotona wrote:<br>
</div>
<blockquote type="cite" cite="mid:CY4PR1001MB2150C3F7941955576396D44D8CDB9@CY4PR1001MB2150.namprd10.prod.outlook.com">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-fareast-language:EN-US;}div.WordSection1
{page:WordSection1;}ol
{margin-bottom:0cm;}ul
{margin-bottom:0cm;}</style>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Based on discussion in
the Classfile API PR:
<a href="https://github.com/openjdk/jdk/pull/10982#discussion_r1098601988" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/openjdk/jdk/pull/10982#discussion_r1098601988</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I would like to propose
removal of AttributedElement.Kind across all Classfile API.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The
AttributedElement.Kind models Attributes “where applicable”
and it is a duplication of each Attribute extending
ClassElement, MethodElement, CodeElement, etc…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Classfile API is not
actively using the AttributedElement.Kind except for
parsing, where inappropriate AttributedElement.Kind is
resolved as UnknownAttribute.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Following proposal
removes all usages of AttributedElement.Kind from Classfile
API:<o:p></o:p></span></p>
<p class="MsoNormal"><a href="https://github.com/openjdk/jdk-sandbox/pull/48/files" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/openjdk/jdk-sandbox/pull/48/files</a><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Please let me know is
there are any objections.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Adam<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</blockquote>
<br>
</body>
</html>