guile-devel
[Top][All Lists]
Advanced

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

Re: lighter prompts?


From: Andy Wingo
Subject: Re: lighter prompts?
Date: Tue, 06 Dec 2011 12:04:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Hi Stefan,

On Mon 18 Jul 2011 23:08, Stefan Israelsson Tampe <address@hidden> writes:

> I noted that prompts in guile-2.0 is quite heavy e.g. using vanilla
> setjmp facilities.

Indeed.

> So if I'm not miss-taken a prompt will save several machine
> registers. Is this really needed?

It is needed if you are jumping back into a vm_run invocation from
within a nested vm_run invocation.

> Why I am asking is that everything looks the same after a prompt
> returns e.g. basically setting up registers from stored data and
> recall a structures from that info and do a named goto.

One option would be to do a setjmp() at the beginning of every VM
invocation, and use that jmpbuf for every prompt with the same
vm_cookie.  That does penalize recursion into the VM, though.

Another thing that would make prompts lighter would be to implement the
dynamic stack (scm_i_dynwinds()) as a block-allocated stack, like the VM
stack, rather than as a heap-allocated linked list.

Also, in some cases it should be possible to statically remove prompts,
with a special compiler pass.  This would probably be easier with a
CPS-based IL though.

Andy
-- 
http://wingolog.org/



reply via email to

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