<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@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;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="en-CZ" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">We can probably attach the no-arg instructions to the Opcode enum, so the rest of the API will stay unchanged.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">BTW: I just barely remember there was some reason to have each instruction as unique instance, however I don’t see it now.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">From:
</span></b><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">Brian Goetz <brian.goetz@oracle.com><br>
<b>Date: </b>Tuesday, 9 January 2024 at 17:44<br>
<b>To: </b>Adam Sotona <adam.sotona@oracle.com>, liangchenblue@gmail.com <liangchenblue@gmail.com>, classfile-api-dev <classfile-api-dev@openjdk.org><br>
<b>Subject: </b>Re: Revisit j.l.classfile.CodeBuilder API surface<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:13.5pt;font-family:"Courier New"">These look good to me. (Perhaps some of the instruction-specific methods could use the singleton instances of the single-bytecode instructions rather
than the factory?)</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">On 1/9/2024 11:35 AM, Adam Sotona wrote:<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Sorry, wrong PR <a href="https://github.com/openjdk/jdk/pull/17282">
https://github.com/openjdk/jdk/pull/17282</a> in the link below.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">From:
</span></b><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">classfile-api-dev
<a href="mailto:classfile-api-dev-retn@openjdk.org"><classfile-api-dev-retn@openjdk.org></a> on behalf of Adam Sotona
<a href="mailto:adam.sotona@oracle.com"><adam.sotona@oracle.com></a><br>
<b>Date: </b>Tuesday, 9 January 2024 at 17:32<br>
<b>To: </b>Brian Goetz <a href="mailto:brian.goetz@oracle.com"><brian.goetz@oracle.com></a>,
<a href="mailto:liangchenblue@gmail.com">liangchenblue@gmail.com</a> <a href="mailto:liangchenblue@gmail.com">
<liangchenblue@gmail.com></a>, classfile-api-dev <a href="mailto:classfile-api-dev@openjdk.org">
<classfile-api-dev@openjdk.org></a><br>
<b>Subject: </b>Re: Revisit j.l.classfile.CodeBuilder API surface</span><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Hi,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">I’ve updated the
<a href="https://github.com/openjdk/jdk/pull/17306">PR</a> draft with removal of </span>
<span lang="EN-US" style="font-size:12.0pt;font-family:Consolas">operator</span><span lang="EN-US" style="font-size:11.0pt"> method as obsolete and</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:Consolas">newPrimitiveArray</span><span style="font-size:11.0pt">,
</span><span style="font-size:12.0pt;font-family:Consolas">newReferenceArray</span><span lang="EN-US" style="font-size:11.0pt"> and
</span><span style="font-size:12.0pt;font-family:Consolas">newMultidimensionalArray</span><span lang="EN-US" style="font-size:11.0pt"> methods as duplicate.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">I’ve also extended
</span><span lang="EN-US" style="font-size:12.0pt;font-family:Consolas">conversion</span><span lang="EN-US" style="font-size:11.0pt"> method to support the whole matrix (including multi-step conversions, no-op conversions and
</span><span lang="EN-US" style="font-size:12.0pt;font-family:Consolas">BooleanType</span><span lang="EN-US" style="font-size:11.0pt"> conversions), see
<a href="https://github.com/openjdk/jdk/blob/027374004c9c9bf53a709c98593363043e8b7782/src/java.base/share/classes/java/lang/classfile/CodeBuilder.java#L548">
CodeBuilder.java#L548</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Regarding the </span>
<span lang="EN-US" style="font-size:12.0pt;font-family:Consolas">allocateLocal</span><span lang="EN-US" style="font-size:11.0pt"> I would slightly prefer to keep it, however
</span><span style="font-size:12.0pt;font-family:Consolas">allocateSlot</span><span style="font-size:11.0pt"> or
</span><span style="font-size:12.0pt;font-family:Consolas">allocateLocalSlot</span><span style="font-size:11.0pt"> or
</span><span style="font-size:12.0pt;font-family:Consolas">reserveLocalSlot</span><span lang="EN-US" style="font-size:11.0pt"> are also fine.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Prefix </span><span lang="EN-US" style="font-size:12.0pt;font-family:Consolas">new</span><span lang="EN-US" style="font-size:11.0pt"> would be confusing.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Adam</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><o:p></o:p></p>
<div id="mail-editor-reference-message-container">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
</div>
</div>
</body>
</html>