mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-19 18:20:22 +02:00
Add new "throw" VM ops
* libguile/throw.h (scm_ithrow, scm_throw): Mark as SCM_NORETURN. * libguile/throw.c (scm_throw, scm_ithrow): Adapt to not return. * libguile/vm-engine.c (throw, throw/value, throw/value+data): New instructions. * libguile/vm.c (vm_throw, vm_throw_with_value) (vm_throw_with_value_and_data): New helpers. * module/language/cps/compile-bytecode.scm (compile-function): Add cases for new instructions. * module/language/cps/prune-bailouts.scm (prune-bailouts): More simple, now that there are no $kreceives in play. * module/language/cps/reify-primitives.scm (reify-clause): Update reification of no-clause functions to use new throw op. * module/language/tree-il/compile-cps.scm (convert): Convert invocations of the variable-arity 'throw primitive from Tree-IL to the new fixed-arity CPS instructions. * module/system/vm/assembler.scm (emit-throw/value*) (emit-throw/value+data*, emit-throw): Export new instructions. * module/system/vm/disassembler.scm (code-annotation): Add annotation.
This commit is contained in:
parent
cf486700b7
commit
f96a670332
10 changed files with 199 additions and 48 deletions
|
@ -99,6 +99,10 @@
|
|||
|
||||
emit-untag-fixnum
|
||||
|
||||
emit-throw
|
||||
(emit-throw/value* . emit-throw/value)
|
||||
(emit-throw/value+data* . emit-throw/value+data)
|
||||
|
||||
emit-pair?
|
||||
emit-struct?
|
||||
emit-symbol?
|
||||
|
@ -975,6 +979,12 @@ later by the linker."
|
|||
(emit-fmov* asm dst (1+ proc))
|
||||
(emit-reset-frame asm nlocals))))
|
||||
|
||||
(define (emit-throw/value* asm val param)
|
||||
(emit-throw/value asm val (intern-non-immediate asm param)))
|
||||
|
||||
(define (emit-throw/value+data* asm val param)
|
||||
(emit-throw/value+data asm val (intern-non-immediate asm param)))
|
||||
|
||||
(define (emit-text asm instructions)
|
||||
"Assemble @var{instructions} using the assembler @var{asm}.
|
||||
@var{instructions} is a sequence of instructions, expressed as a list of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue