summaryrefslogtreecommitdiff
path: root/libguile/vm-builtins.h
Commit message (Expand)AuthorAgeFilesLines
* Small comment fix....* libguile/vm-builtins.h: Rename RTL to VM in a comment. Andy Wingo2013-11-191-1/+1
* Builtins have procedure properties...* libguile/vm-builtins.h (FOR_EACH_VM_BUILTIN): Add arity information. (enum scm_vm_builtins): * libguile/vm.c (scm_vm_builtin_ref): (scm_vm_builtin_name_to_index): (scm_vm_builtin_index_to_name): Adapt to macro interface change. (scm_init_vm_builtin_properties): New helper, sets procedure properties on builtins. (scm_bootstrap_vm): Just define the builtins here. Later in the bootstrap we set their properties. (scm_sym_apply): Move definition here from expand.c. * libguile/procprop.c (scm_init_procprop): Call scm_init_vm_builtin_properties. Andy Wingo2013-11-081-6/+7
* VM has "builtins": primitives addressable by emitted RTL code...* libguile/Makefile.am: * libguile/vm-builtins.h: New header, declaring stubs needed by the compiler like values, apply, and abort-to-prompt. * libguile/vm.c: Adapt the apply and values stubs to conform to a standard interface. Add an abort-to-prompt stub. Add call/cc and call-with-values stubs. (scm_vm_builtin_ref): New helper, for the builtin-ref opcode. (scm_vm_builtin_name_to_index) (scm_vm_builtin_index_to_name): New helpers, for the compiler and disassembler, respectively. (scm_init_vm_builtins, scm_bootstrap_vm): Allow the compiler helpers to be loaded later into a module. * module/language/rtl.scm: Export builtin-index->name and builtin-name->index. * libguile/vm-engine.c (RETURN_VALUE_LIST): Update to use new names of "apply" and "values". (tail-call/shuffle): New opcode. (abort): Update to be a tail VM op, and reorder and renumber other ops. (builtin-ref): New opcode. * libguile/continuations.h: * libguile/continuations.c (scm_i_call_with_current_continuation): Move this to vm.[ch], implemented as a builtin. * module/language/tree-il/compile-cps.scm (convert): Convert to 'abort-to-prompt calls, possibly with 'apply, effectively undoing the tree-il transformation. * module/language/cps/reify-primitives.scm (builtin-ref): New helper. (reify-primitives): Convert builtin primitives to builtin-ref. * module/language/cps/dfg.scm (constant-needs-allocation?): * module/language/cps/compile-rtl.scm (emit-rtl-sequence): Add support for compiling builtin-ref. * module/system/vm/disassembler.scm (code-annotation): Add annotation for builtin-ref. Andy Wingo2013-10-271-0/+46