<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<font size="4"><font face="monospace">It is irritating that one is a
type descriptor and one is a signature, but we can launder that
by observing that both are Utf8Entry. </font></font><br>
<br>
<div class="moz-cite-prefix">On 6/29/2023 9:53 AM, Chen Liang wrote:<br>
</div>
<blockquote type="cite" cite="mid:ShDVdF-ap2mtdiWkhmh3YNQ3kH7J2MgP4HrmZwXhHRM=.009712a8-4e19-4d20-a1f0-0c0a2d066e90@github.com">
<pre class="moz-quote-pre" wrap="">On Thu, 29 Jun 2023 13:41:17 GMT, Brian Goetz <a class="moz-txt-link-rfc2396E" href="mailto:briangoetz@openjdk.org"><briangoetz@openjdk.org></a> wrote:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">`LocalVariable` and `LocalVariableType` includes `writeTo(BufWriter)`, which should be implementation details.
See <a class="moz-txt-link-freetext" href="https://mail.openjdk.org/pipermail/classfile-api-dev/2023-June/000381.html">https://mail.openjdk.org/pipermail/classfile-api-dev/2023-June/000381.html</a> for context.
This patch moves the implementation to `DirectCodeBuilder`'s original use sites; the old `b.canWriteDirect` branch is redundant, as `writeIndex`'s implementation already performs such an optimization.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java line 280:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">278: b.writeIndex(l.name());
279: b.writeIndex(l.type());
280: b.writeU2(l.slot());
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
This idiom is repeated four times; seems like it can be factored somewhere into a helper?
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Good idea. The same routine is used in attribute mapper for the two tables, which could be factored as well.
-------------
PR Review Comment: <a class="moz-txt-link-freetext" href="https://git.openjdk.org/jdk/pull/14705#discussion_r1246652541">https://git.openjdk.org/jdk/pull/14705#discussion_r1246652541</a>
</pre>
</blockquote>
<br>
</body>
</html>