Re: [rvm-research] [External Email] Re: IR class wrap around NormalMethod
Kenan Liu via Jikesrvm-researchers <[email protected]> Thu, 25 Mar 2021 11:47:41 -0700
| Newsgroups | gmane.comp.java.jikes.rvm.devel |
|---|---|
| Message-ID | <CA+qhk+pb22AXYF6ZdLkjCkJBDwDvuKyT406d-7fZEdFY1KB6jA@mail.gmail.com> |
--===============1454831559068857545== Content-Type: multipart/alternative; boundary="0000000000004e0a6f05be60da40" --0000000000004e0a6f05be60da40 Content-Type: text/plain; charset="UTF-8" Hi David, Thank you so much for the prompt response! I did find the way how it replaces HIR instructions with runtime routines in ExpandRuntimeServices.java but missed there are inlining calls cases ;-) Thanks to point it out, it really helps. Thanks, Kenan On Thu, Mar 25, 2021 at 6:24 AM David P Grove <[email protected]> wrote: > Kenan Liu via Jikesrvm-researchers < > [email protected]> wrote on 03/24/2021 11:31:26 > PM: > > > Hi, > > > > I have a few questions regarding the behavior after the > > instrumentation inserted into the code as IR. > > > > When the user-defined methods inserted into the opt compiler. Let's > > say, inserting the IR in the stage of hir2lir. Would the compiler > > treat this IR/NormalMethod as the real method? To clarify it, does > > this instrumentation would introduce the real method invocations or > > it would be inlined automatically? > > If the IR instrumentation is treated as a method, is there any way > > that I can explicitly inline it? > > If the answers for both questions above are no. Is there any way > > that I can add instrumentations without introducing extra method > invocations? > > Thanks, > > Kenan > > > Hi, > > Take a look at ExpandRuntimeServices.java ( > https://github.com/JikesRVM/JikesRVM/blob/master/rvm/src/org/jikesrvm/compilers/opt/hir2lir/ExpandRuntimeServices.java). > This code is replacing HIR instructions like NEW with calls to runtime > routines, then immediately inlining those calls. You should be able to > do something similar to add your instrumentation. > > --dave > > -- Kenan Liu PhD Candidate in Computer Science SUNY Binghamton --0000000000004e0a6f05be60da40 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi David,<div><br></div><div>Thank you so much for the pro= mpt response!</div><div><br></div><div>I did find the way how it replaces H= IR instructions with runtime routines=C2=A0in=C2=A0<span style=3D"font-fami= ly:monospace">ExpandRuntimeServices.java=C2=A0</span>but missed there=C2=A0= are inlining calls cases ;-)=C2=A0</div><div>Thanks to point it out, it rea= lly helps.=C2=A0</div><div><br></div><div>Thanks,</div><div>Kenan</div><div= ><br></div><div><br></div><div><br></div><div><br></div></div><br><div clas= s=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Mar 25, 202= 1 at 6:24 AM David P Grove <<a href=3D"mailto:[email protected]">groved@= us.ibm.com</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style= =3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding= -left:1ex"><div><p><tt><font size=3D"2">Kenan Liu via Jikesrvm-researchers = <<a href=3D"mailto:[email protected]" target=3D= "_blank">[email protected]</a>> wrote on 03/24/= 2021 11:31:26 PM:<br></font></tt><br><tt><font size=3D"2">> Hi,</font></= tt><br><tt><font size=3D"2">> <br>> I have a few questions regarding = the behavior after the <br>> instrumentation inserted into the code as I= R.</font></tt><br><tt><font size=3D"2">> <br>> When the user-defined = methods inserted into the opt compiler. Let's <br>> say, inserting t= he IR in the stage of hir2lir. Would the compiler <br>> treat this IR/No= rmalMethod as the real method? To clarify it, does <br>> this instrument= ation=C2=A0would introduce the real method invocations or <br>> it would= be inlined automatically?</font></tt><br><tt><font size=3D"2">> If the = IR instrumentation is treated as a method, is there any way <br>> that I= can explicitly inline it?</font></tt><br><tt><font size=3D"2">> If the = answers for both questions above are no. Is there any way <br>> that I c= an add instrumentations without introducing extra method invocations?</font= ></tt><br><tt><font size=3D"2">> Thanks,</font></tt><br><tt><font size= =3D"2">> Kenan</font></tt><br><br><br><tt><font size=3D"2">Hi,</font></t= t><br><br><tt><font size=3D"2"> Take a look at ExpandRuntimeServices= .java (</font></tt><a href=3D"https://github.com/JikesRVM/JikesRVM/blob/mas= ter/rvm/src/org/jikesrvm/compilers/opt/hir2lir/ExpandRuntimeServices.java" = target=3D"_blank"><tt><font size=3D"2">https://github.com/JikesRVM/JikesRVM= /blob/master/rvm/src/org/jikesrvm/compilers/opt/hir2lir/ExpandRuntimeServic= es.java</font></tt></a><tt><font size=3D"2">). This code is replacing HIR i= nstructions like NEW with calls to runtime routines, then immediately inlin= ing those calls. =C2=A0 =C2=A0You should be able to do something similar to= add your instrumentation.</font></tt><br><br><tt><font size=3D"2">--dave</= font></tt><br><br> </p></div> </blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"= class=3D"gmail_signature"><div dir=3D"ltr"><div><div>Kenan Liu<br></div>Ph= D Candidate in Computer Science<br></div>SUNY Binghamton<br></div></div> --0000000000004e0a6f05be60da40-- --===============1454831559068857545== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============1454831559068857545== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Jikesrvm-researchers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers --===============1454831559068857545==--