;;; Guile VM assembler
-;; Copyright (C) 2001, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc.
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
((br-if-nargs-lt ,hi ,lo ,l) (write-byte hi) (write-byte lo) (write-break l))
((br-if-nargs-gt ,hi ,lo ,l) (write-byte hi) (write-byte lo) (write-break l))
((mv-call ,n ,l) (write-byte n) (write-break l))
+ ((prompt ,inline-handler? ,escape-only? ,l)
+ (write-byte inline-handler?) (write-byte escape-only?) (write-break l))
(else
(cond
((< (instruction-length inst) 0)
;;; Guile VM code converters
-;; Copyright (C) 2001, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc.
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
(lp (cons `(,br ,hi ,lo ,(ensure-label rel1 rel2 rel3)) out)))
((mv-call ,n ,rel1 ,rel2 ,rel3)
(lp (cons `(mv-call ,n ,(ensure-label rel1 rel2 rel3)) out)))
+ ((prompt ,n0 ,n1 ,rel1 ,rel2 ,rel3)
+ (lp (cons `(prompt ,n0 ,n1 ,(ensure-label rel1 rel2 rel3)) out)))
(else
(lp (cons exp out))))))))))
(list "`~s'" v)))))
((mv-call)
(list "MV -> ~A" (assq-ref labels (cadr args))))
+ ((prompt)
+ ;; the H is for handler
+ (list "H -> ~A" (assq-ref labels (caddr args))))
(else
(and=> (assembly->object code)
(lambda (obj) (list "~s" obj)))))))
(error "Wrong number of stack arguments to instruction:" inst nargs)))))
((<glil-mv-call> nargs ra)
- (emit-code `((mv-call ,nargs ,ra))))))
+ (emit-code `((mv-call ,nargs ,ra))))
+
+ ((<glil-prompt> label inline? escape-only?)
+ (emit-code `((prompt ,(if inline? 1 0)
+ ,(if escape-only? 1 0)
+ ,label))))))
(define (dump-object x addr)
(define (too-long x)