Hi Stefan, On Mon 18 Jul 2011 23:08, Stefan Israelsson Tampe <[email protected]> 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/
