<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<br>
<br>
<div class="moz-cite-prefix">On 8/19/2022 10:30 AM, Adam Sotona
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CY4PR1001MB2150013C8D8E2F9B25567C638C6C9@CY4PR1001MB2150.namprd10.prod.outlook.com">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@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:12.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";
mso-fareast-language:EN-GB;}span.literal
{mso-style-name:literal;}span.st0
{mso-style-name:st0;}span.comment
{mso-style-name:comment;}span.EmailStyle25
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}div.WordSection1
{page:WordSection1;}ol
{margin-bottom:0cm;}ul
{margin-bottom:0cm;}</style>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">These
tools are helpers for specific use cases and they do not
represent transformations, but rather they collect and
provide information necessary for building code.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">For
example I need to know actual stack when I plan to use
stack-to-locals (and back) function in my generated code.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">Another
example (which we may embed) is to count max stack when the
generator is off.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">Optional
custom logging of the exact instructions dropped to
CodeBuilder is another requested use case.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">All
of the above are expensive operations, so they should be
applied on user request only.</span></p>
</div>
</blockquote>
<br>
That's what I thought. So, since they are only applied when you
really need them, can't these be treated as "generate the classfile,
and then traverse it as a classfile with the API we already have?"
This seems like it would work in all the cases when we *can*
generate a classfile, which leaves the cases where we would fail to
generate a classfile and therefore have nothing to analyze, which is
probably a non-zero but not-large fraction of the cases, right? <br>
<br>
<blockquote type="cite" cite="mid:CY4PR1001MB2150013C8D8E2F9B25567C638C6C9@CY4PR1001MB2150.namprd10.prod.outlook.com">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt" lang="EN-US">This
API does not have much value for transformations, where user
can easily listen to each transformed CodeElement and
compute whatever is necessary. However when building code
using various “magic” (like blocks, constants
auto-detection, and other conveniences…) it is important to
see what instructions it really builds into.</span></p>
</div>
</blockquote>
<br>
I think you misunderstood my question. I didn't mean "is this
useful in transformation". I meant that, we *already* have
composable transforms, where the output of one activity is piped
into another; there's a lot of similarity here (and they'll use the
same underlying plumbing.) I was suggesting that you could think of
teeing as being a (likely no-op) transformation on the building that
is already in progress. <br>
<br>
<br>
</body>
</html>