Add a new regbank for spill slots holding managed pointers. Treat those as PIN.
[mono.git] / mono / mini / regalloc.h
1
2 typedef size_t regmask_t;
3
4 enum {
5         MONO_REG_INT,
6         MONO_REG_DOUBLE,
7         /* This is used only for allocating spill slots with GC tracking */
8         MONO_REG_INT_REF,
9         /* Ditto for managed pointers */
10         MONO_REG_INT_MP,
11         MONO_REG_SIMD
12 };
13
14  
15 #ifdef MONO_ARCH_NEED_SIMD_BANK
16 #define MONO_NUM_REGBANKS 5
17 #else
18 #define MONO_NUM_REGBANKS 4
19 #endif
20
21 typedef struct {
22         /* symbolic registers */
23         int next_vreg;
24
25         regmask_t ifree_mask;
26         regmask_t free_mask [MONO_NUM_REGBANKS];
27
28         /* symbolic -> hard register assignment */
29         /* 
30          * If the register is spilled, then this contains -spill - 1, where 'spill'
31          * is the index of the spill variable.
32          */
33         gint32 *vassign;
34
35         /* hard -> symbolic */
36         int isymbolic [MONO_MAX_IREGS];
37         int fsymbolic [MONO_MAX_FREGS];
38 #ifdef MONO_ARCH_NEED_SIMD_BANK
39         int xsymbolic [MONO_MAX_XREGS];
40 #endif
41         /* Points to the arrays above */
42         int *symbolic [MONO_NUM_REGBANKS];
43
44         int vassign_size;
45 } MonoRegState;
46
47 MonoRegState* mono_regstate_new (void) MONO_INTERNAL;
48
49 void          mono_regstate_free      (MonoRegState *rs) MONO_INTERNAL;