<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On 2007-03-15, at 11:42, Gonsolo wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">It appeared to me that runFunction in JIT.cpp is slow for repeatedly executing the same function with nontrivial arguments since the "Stub" function in JiT.cpp:183 (LLVM 1.9) is compiled again and again. Is there something I can do to accelerate this?</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Hi G,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Have you tried using this method instead?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="text-indent: -36px;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 36px; "><FONT class="Apple-style-span" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;"> </SPAN></FONT><FONT class="Apple-style-span" color="#236E25" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;">/// getPointerToFunctionOrStub - If the specified function has been</SPAN></FONT></DIV><DIV style="text-indent: -36px;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 36px; "><FONT class="Apple-style-span" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;"> </SPAN></FONT><FONT class="Apple-style-span" color="#236E25" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;">/// code-gen'd, return a pointer to the function.</SPAN></FONT><FONT class="Apple-style-span" color="#236E25" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;"> </SPAN></FONT><FONT class="Apple-style-span" color="#236E25" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;">If not, compile it, or use</SPAN></FONT></DIV><DIV style="text-indent: -36px;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 36px; "><FONT class="Apple-style-span" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;"> </SPAN></FONT><FONT class="Apple-style-span" color="#236E25" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;">/// a stub to implement lazy compilation if available.</SPAN></FONT></DIV><DIV style="text-indent: -36px;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 36px; "><FONT class="Apple-style-span" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;"> </SPAN></FONT><FONT class="Apple-style-span" color="#236E25" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;">///</SPAN></FONT></DIV><DIV style="text-indent: -36px;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 36px; "><FONT class="Apple-style-span" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;"> </SPAN></FONT><FONT class="Apple-style-span" color="#760F50" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;">virtual</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;"> </SPAN></FONT><FONT class="Apple-style-span" color="#760F50" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;">void</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="1"><SPAN class="Apple-style-span" style="font-size: 9px;"> *getPointerToFunctionOrStub(Function *F);</SPAN></FONT></DIV><DIV style=""><DIV style="text-indent: 0px;"><BR class="khtml-block-placeholder"></DIV><DIV style="text-indent: 0px;">If you can use it, this eliminates out the overhead in question, reducing it to an indirect function call.</DIV><DIV><BR class="khtml-block-placeholder"></DIV>— G</DIV><DIV><BR class="khtml-block-placeholder"></DIV></DIV><DIV style="text-indent: -36px;"></DIV></BODY></HTML>