From: David P G. <gr...@us...> - 2021-03-25 13:24:50
|
Kenan Liu via Jikesrvm-researchers <jik...@li...> 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 |