forked from nominolo/lambdachine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
info-tables.h
61 lines (40 loc) · 1.16 KB
/
info-tables.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef LC_INFOTABLES_H
#define LC_INFOTABLES_H
#include "def.h"
#include "bc.h"
/*
* A large bitmap.
*/
typedef struct {
StgWord size;
StgWord bitmap[FLEXIBLE_ARRAY];
} LcLargeBitmap;
/* A thing that (normally) describes the closure layout.
size = one word.
*/
typedef union {
struct {
StgHalfWord ptrs; // number of pointers
StgHalfWord nptrs; // number of non-pointers
} payload;
StgWord bitmap; // bit map that describes pointers and non-pointers.
LcLargeBitmap *large_bitmap; // if we need more than 32/64 bits.
// possibly add more stuff here.
} LcClosureInfo;
/* The common part of any info table.
The `type` field defines which other information is present.
*/
typedef struct LcInfoTable_ {
char* closure_type;
char* closure_desc;
LcClosureInfo layout; // closure layout info (one word)
StgHalfWord type; // closure type
StgHalfWord srt_bitmap; // number of entries in SRT or constructor tag
BcIns code[];
} *LcInfoTablePtr;
typedef struct LcConInfoTable_ {
char *con_descr; // name of the data constructor in the form:
// Package:Module.Name
LcInfoTable i;
} LcConInfoTable;
#endif