[Ecls-list] More on special variables and multithreading

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sun Jan 24 20:40:10 UTC 2010


On Sun, Jan 24, 2010 at 8:30 PM, Samium Gromoff <_deepfire at feelingofgreen.ru
> wrote:

> What about that expensive per-function environment access call, is it
> possible to eliminate it in the inlined calls, so that the value
> obtained by the caller is used?


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.

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.

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

void ecl_deliver_fpe(void) {
        cl_env_ptr env = ecl_process_env();

gets translated into

.globl ecl_deliver_fpe
        .type   ecl_deliver_fpe, @function
ecl_deliver_fpe:
.LFB76:
        .loc 1 498 0
        .cfi_startproc
        .loc 1 500 0
        movq    cl_env_p at GOTPCREL(%rip), %rax
        .loc 1 498 0
        pushq   %rbx

but on Mac OS X it does not: it always involve a function call.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20100124/d805f342/attachment.html>


More information about the ecl-devel mailing list