mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 04:40:29 +02:00
prompt handlers are always inline
* libguile/control.h (SCM_F_PROMPT_INLINE, SCM_PROMPT_INLINE_P): Remove; prompts always have "inline" handlers now. * libguile/control.c (scm_c_make_prompt): Remove inline_handler_p arg. * libguile/vm-i-system.c (prompt): * module/language/assembly/decompile-bytecode.scm (decode-load-program): * module/language/assembly/compile-bytecode.scm (write-bytecode): Adapt to prompt changes. * module/language/glil.scm (make-glil-prompt, glil-prompt-inline?): Remove inline? flag. (parse-glil, unparse-glil): * module/language/glil/compile-assembly.scm (glil->assembly): Adapt to <glil-prompt> change. * module/language/tree-il/compile-glil.scm (flatten): Require the handler of a <prompt> to be a lambda-case. * module/language/tree-il/primitives.scm (*primitive-expand-table*): Ensure that the handler of a <prompt> is a lambda-case. * module/language/tree-il/inline.scm (inline!): Simplify a degenerate case: (lambda args (apply (lambda ...) args)) => (lambda ...).
This commit is contained in:
parent
f5b1f76af4
commit
ea6b18e82f
10 changed files with 78 additions and 99 deletions
|
@ -1450,13 +1450,12 @@ VM_DEFINE_INSTRUCTION (82, make_symbol, "make-symbol", 0, 1, 1)
|
|||
NEXT;
|
||||
}
|
||||
|
||||
VM_DEFINE_INSTRUCTION (83, prompt, "prompt", 5, 2, 0)
|
||||
VM_DEFINE_INSTRUCTION (83, prompt, "prompt", 4, 2, 0)
|
||||
{
|
||||
scm_t_int32 offset;
|
||||
scm_t_uint8 inline_handler_p, escape_only_p;
|
||||
scm_t_uint8 escape_only_p;
|
||||
SCM k, handler, prompt;
|
||||
|
||||
inline_handler_p = FETCH ();
|
||||
escape_only_p = FETCH ();
|
||||
FETCH_OFFSET (offset);
|
||||
POP (handler);
|
||||
|
@ -1466,14 +1465,13 @@ VM_DEFINE_INSTRUCTION (83, prompt, "prompt", 5, 2, 0)
|
|||
/* Push the prompt onto the dynamic stack. The setjmp itself has to be local
|
||||
to this procedure. */
|
||||
/* FIXME: do more error checking */
|
||||
prompt = scm_c_make_prompt (vm, k, handler, inline_handler_p, escape_only_p);
|
||||
prompt = scm_c_make_prompt (vm, k, handler, escape_only_p);
|
||||
scm_i_set_dynwinds (scm_cons (prompt, scm_i_dynwinds ()));
|
||||
if (SCM_PROMPT_SETJMP (prompt))
|
||||
{
|
||||
/* The prompt exited nonlocally. Cache the regs back from the vp, and go
|
||||
to the handler or post-handler label. (The meaning of the label differs
|
||||
depending on whether the prompt's handler is rendered inline or not.)
|
||||
*/
|
||||
to the handler.
|
||||
*/
|
||||
CACHE_REGISTER (); /* Really we only need SP. FP and IP should be
|
||||
unmodified. */
|
||||
ip += offset;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue