From 67d3c2834d61026d5556cf9846f707844109cf33 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 14 Aug 2015 15:54:25 -0400 Subject: tentative support for fast allocs It seems that the MEM reference type is meaningless in too many positions. Because of this, it is unclear if we should keep it or just introduce a OAddr instruction that only accepts slots. Regardless of the above, the spilling module needs to use the new slot_() function, also, the emit function needs to fetch the size of the stack frame from the slot[] array. The naming is still very transitional, here is a list of all bogus names I can think of: - SLOT() - Tmp.spill - slot_ --- lisc/lisc.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lisc/lisc.h') diff --git a/lisc/lisc.h b/lisc/lisc.h index 3ae5c56..50c6504 100644 --- a/lisc/lisc.h +++ b/lisc/lisc.h @@ -90,6 +90,7 @@ struct Ref { enum { RTmp, RCon, + RMem, RSlot, NRef = (1<<14) - 1 }; @@ -98,6 +99,7 @@ enum { #define TMP(x) (Ref){RTmp, x} #define CON(x) (Ref){RCon, x} #define CON_Z CON(0) /* reserved zero constant */ +#define MEM(x) (Ref){RMem, x} #define SLOT(x) (Ref){RSlot, x} static inline int req(Ref a, Ref b) @@ -139,6 +141,7 @@ enum Op { OLoadub, OCopy, OAlloc, + OAlloc1 = OAlloc + 2, NPubOp, /* reserved instructions */ @@ -237,7 +240,7 @@ struct Fn { int ncon; int nblk; Blk **rpo; - uint nspill; + int slot[3]; }; @@ -262,6 +265,7 @@ void ssafix(Fn *, int); void filllive(Fn *); /* isel.c */ +int slot_(int, int, Fn *); void isel(Fn *); /* spill.c */ -- cgit 1.4.1