guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: goops and memoization


From: Dirk Herrmann
Subject: Re: goops and memoization
Date: Wed, 20 Nov 2002 19:11:20 +0100 (CET)

On 17 Nov 2002, Neil Jerram wrote:

> >>>>> "Dirk" == Dirk Herrmann <address@hidden> writes:
> 
>     Dirk> Is there any goops expert around willing to improve the
>     Dirk> situation with goops?
> 
> No, but I'm willing to try to become one.
> 
> If you can describe some of the things that you want
> investigated/understood as a few specific questions, I'll take a look.

First, some explanation about the way my memoizer works:  My memoizer code
memoizes local variable accesses, that is, replaces the symbols by the
corresponding ilocs.  Symbols that correspond to accesses to global
variables are (at least for now) just left as they are.  The executor will
memoize them whenever the code is executed.  Thus, symbols that are left
within the code are known to belong to global variables.  Thus, I have
changed the executor such that if it finds a symbol in the code it only
looks up the module for a binding, not the local environment frames.

This conflicts with goops:  goops unmemoizes the function code, using
'procedure-source' (look into oop/goops/compile.scm).  This will re-create
the original code, including all the symbols that refer to local
variables.  This un-memoized code is then optimized in some way, and
re-written into the closure object.  Then, if the closure is evaluated, it
is not run through the memoizer again (since it is already a closure).
Now, if the executor runs over a symbol corresponding to a local variable,
it will treat is as a symbol belonging to a global variable and try to
find it within the module.

It would be great if you could take a look at goops and find a solution
for this problem.

Best regards,
Dirk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]