initial call/cc support
This commit is contained in:
@@ -57,6 +57,8 @@ typedef struct {
|
||||
struct heap_page *heap;
|
||||
struct pic_object *arena[PIC_ARENA_SIZE];
|
||||
int arena_idx;
|
||||
|
||||
pic_value *native_stack_start;
|
||||
} pic_state;
|
||||
|
||||
typedef pic_value (*pic_func_t)(pic_state *);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef CONT_H__
|
||||
#define CONT_H__
|
||||
|
||||
struct pic_cont {
|
||||
PIC_OBJECT_HEADER
|
||||
jmp_buf jmp;
|
||||
|
||||
size_t stk_len;
|
||||
pic_value *stk_pos, *stk_ptr;
|
||||
|
||||
pic_value *sp;
|
||||
pic_value *stbase, *stend;
|
||||
|
||||
pic_callinfo *ci;
|
||||
pic_callinfo *cibase, *ciend;
|
||||
|
||||
struct pic_object **arena;
|
||||
int arena_idx;
|
||||
|
||||
pic_value result;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -82,7 +82,8 @@ enum pic_tt {
|
||||
PIC_TT_BLOB,
|
||||
PIC_TT_PROC,
|
||||
PIC_TT_PORT,
|
||||
PIC_TT_ENV
|
||||
PIC_TT_ENV,
|
||||
PIC_TT_CONT
|
||||
};
|
||||
|
||||
#define PIC_OBJECT_HEADER \
|
||||
|
||||
Reference in New Issue
Block a user