summaryrefslogtreecommitdiff
path: root/iterjit.c
diff options
context:
space:
mode:
Diffstat (limited to 'iterjit.c')
-rw-r--r--iterjit.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/iterjit.c b/iterjit.c
index 5325b4c..fcb2f9d 100644
--- a/iterjit.c
+++ b/iterjit.c
@@ -64,6 +64,35 @@
tell source iter to advance
-=-
+
+ Issues:
+ - The stack based register allocator is not a good fit for this
+ scheme. How about the concept of register "groups"?
+
+ At all times, one group is "active". Allocations are done in this
+ group; registers from other groups can't be used. If such registers
+ are needed, they must be reallocated in the new group.
+
+ When there is no longer enough free registers in a group, a
+ register from another group is kicked out to the stack. When that
+ other group becomes active, all kicked-out registers are moved
+ back in (lazily?). Note, you can never allocate more than the
+ number of real registers within one group.
+
+ API:
+ reg_alloc_init (&ra, stack_manager_t *sman, reg_set_t *regs);
+ reg_alloc_switch (&ra, "name");
+ op_t = reg_alloc_alloc (&ra);
+
+ // The register becomes allocated in the current group
+ // with its current value
+ reg_alloc_preserve (&ra, op_t);
+
+ // After a switch to another group, this make sure the
+ // given registers are reloaded from the stack.
+ reg_alloc_reload (&ra, ..., -1);
+
+ -=-
Iterator based JIT compiler