initial call/cc support

This commit is contained in:
Yuichi Nishiwaki
2013-11-09 14:14:25 +09:00
parent e373aa7b92
commit 64ae8bd7b0
10 changed files with 223 additions and 1 deletions
+2
View File
@@ -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 *);
+23
View File
@@ -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
+2 -1
View File
@@ -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 \