guile-devel
[Top][All Lists]
Advanced

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

Re: Adding Identities to Peval


From: Mark H Weaver
Subject: Re: Adding Identities to Peval
Date: Wed, 15 Feb 2012 21:32:53 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Hi Noah,

Noah Lavine <address@hidden> writes:
> I've been working on a patch to add a new sort of optimization to
> peval, and I think it's almost ready. It's based on some of the ideas
> in "Environment Analysis of Higher-Order Languages".

Nice! :)

> There's one glaring wart. The identity checking is activiated by calls
> to (toplevel 'eq?). Clearly, it should be activated by calls to the
> primitive 'eq? (and eqv? and equal?). The reason it's not is that my
> example above compiles to (call (toplevel-ref 'eq?) ...), and I don't
> know how to make it turn into a (primcall 'eq? ...).

The conversion from (toplevel-ref 'eq?) to (primcall 'eq?) is
done by 'resolve-primitives!' in (language tree-il primitives).
'expand-primitives!' is normally also called before 'peval'.
See 'optimize!' in (language tree-il optimize) for details.

I hope to take a deeper look at your patch later, but for now I wanted
to quickly answer your question :)

    Thanks!
      Mark



reply via email to

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