<div class="gmail_quote">On Sun, Jan 24, 2010 at 8:30 PM, Samium Gromoff <span dir="ltr"><_<a href="mailto:deepfire@feelingofgreen.ru">deepfire@feelingofgreen.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
What about that expensive per-function environment access call, is it<br>
possible to eliminate it in the inlined calls, so that the value<br>
obtained by the caller is used?</blockquote><div><br></div><div>The functions which are now inlined never called ecl_process_env(), since they got the environment as an argument. For example, ecl_bds_bind(env,symbol,new_value), binds a special variable in the current lisp environment.</div>
<div><br></div><div>There is still one ecl_process_env() call per compiled function, though, and some other ECL functions use ecl_process_env() internally. The latter can be changed, but requires auditing ECL carefully.</div>
<div><br></div><div>Finally let me remark that the performance of ecl_process_env() indeed is platform-dependent, as it was pointed out here. On a modern linux using the x86_64 architecture, something like</div><div><br></div>
<div><div><div>void ecl_deliver_fpe(void) {</div><div>        cl_env_ptr env = ecl_process_env();</div><div><br></div></div><div>gets translated into</div></div><div><br></div><div><div>.globl ecl_deliver_fpe</div><div>        .type   ecl_deliver_fpe, @function</div>
<div>ecl_deliver_fpe:</div><div>.LFB76:</div><div>        .loc 1 498 0</div><div>        .cfi_startproc</div><div>        .loc 1 500 0</div><div>        movq    cl_env_p@GOTPCREL(%rip), %rax</div><div>        .loc 1 498 0</div>
<div>        pushq   %rbx</div><div><br></div><div>but on Mac OS X it does not: it always involve a function call.</div><div><br></div><div>Juanjo</div></div></div><br>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br>
<a href="http://juanjose.garciaripoll.googlepages.com">http://juanjose.garciaripoll.googlepages.com</a><br>