Export <slot> from GOOPS
[bpt/guile.git] / libguile / vm.h
index 387e0b8..8f88d0c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013, 2014 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 License
@@ -28,7 +28,6 @@ enum {
   SCM_VM_POP_CONTINUATION_HOOK,
   SCM_VM_NEXT_HOOK,
   SCM_VM_ABORT_CONTINUATION_HOOK,
-  SCM_VM_RESTORE_CONTINUATION_HOOK,
   SCM_VM_NUM_HOOKS,
 };
 
@@ -40,11 +39,12 @@ struct scm_vm {
   scm_t_uint32 *ip;            /* instruction pointer */
   SCM *sp;                     /* stack pointer */
   SCM *fp;                     /* frame pointer */
-  size_t stack_size;           /* stack size */
-  SCM *stack_base;             /* stack base address */
   SCM *stack_limit;            /* stack limit address */
   int trace_level;              /* traces enabled if trace_level > 0 */
-  size_t max_stack_size;
+  SCM *sp_max_since_gc;         /* highest sp since last gc */
+  size_t stack_size;           /* stack size */
+  SCM *stack_base;             /* stack base address */
+  SCM overflow_handler_stack;   /* alist of max-stack-size -> thunk */
   SCM hooks[SCM_VM_NUM_HOOKS]; /* hooks */
   int engine;                   /* which vm engine we're using */
 };
@@ -52,11 +52,13 @@ struct scm_vm {
 SCM_INTERNAL struct scm_vm *scm_the_vm (void);
 SCM_API SCM scm_call_with_vm (SCM proc, SCM args);
 
+SCM_API SCM scm_call_with_stack_overflow_handler (SCM limit, SCM thunk,
+                                                  SCM handler);
+
 SCM_API SCM scm_vm_apply_hook (void);
 SCM_API SCM scm_vm_push_continuation_hook (void);
 SCM_API SCM scm_vm_pop_continuation_hook (void);
 SCM_API SCM scm_vm_abort_continuation_hook (void);
-SCM_API SCM scm_vm_restore_continuation_hook (void);
 SCM_API SCM scm_vm_next_hook (void);
 SCM_API SCM scm_vm_trace_level (void);
 SCM_API SCM scm_set_vm_trace_level_x (SCM level);
@@ -99,6 +101,7 @@ SCM_INTERNAL SCM scm_i_vm_capture_stack (SCM *stack_base, SCM *fp, SCM *sp,
                                          scm_t_uint32 *ra,
                                          scm_t_dynstack *dynstack,
                                          scm_t_uint32 flags);
+SCM_INTERNAL int scm_i_vm_cont_to_frame (SCM cont, struct scm_frame *frame);
 SCM_INTERNAL void scm_i_vm_cont_print (SCM x, SCM port,
                                        scm_print_state *pstate);
 SCM_INTERNAL void scm_bootstrap_vm (void);