Author: chromatic
Date: Tue Dec 30 12:38:41 2008
New Revision: 34665
Modified:
trunk/compilers/imcc/symreg.h
Log:
[IMCC] Rearranged some struct members (hopefully to minimize their size due to
padding and alignment).
Modified: trunk/compilers/imcc/symreg.h
==============================================================================
--- trunk/compilers/imcc/symreg.h (original)
+++ trunk/compilers/imcc/symreg.h Tue Dec 30 12:38:41 2008
@@ -67,6 +67,14 @@
typedef struct _SymReg {
char *name;
char *subid;
+ Life_range **life_info; /* Each block has a Life_range status
*/
+ struct _SymReg *nextkey; /* keys */
+ struct _SymReg *reg; /* key->register for VTREGKEYs */
+ struct pcc_sub_t *pcc_sub; /* PCC subroutine */
+ struct _SymReg *used; /* used register in invoke */
+ struct _SymReg *next; /* used in the symbols hash */
+ struct _Instruction *first_ins; /* first and last instruction */
+ struct _Instruction *last_ins; /* this symbol is in */
INTVAL type; /* Variable type */
INTVAL usage; /* s. USAGE above */
int set; /* parent register set/file */
@@ -76,20 +84,11 @@
int offset; /* used for label fixup */
int use_count; /* How often this symbol is used */
int lhs_use_count; /* Frequency of writing to this
symbol*/
- Life_range **life_info; /* Each block has a Life_range status
*/
- struct _SymReg *next; /* used in the symbols hash */
- struct _Instruction *first_ins; /* first and last instruction */
- struct _Instruction *last_ins; /* this symbol is in */
- /* also used by labels as position of label and last reference */
- struct _SymReg *nextkey; /* keys */
- struct _SymReg *reg; /* key->register for VTREGKEYs */
- struct pcc_sub_t *pcc_sub; /* PCC subroutine */
- struct _SymReg *used; /* used register in invoke */
int pmc_type; /* class enum */
} SymReg;
typedef struct _SymHash {
- SymReg **data;
+ SymReg **data;
unsigned int size;
unsigned int entries;
} SymHash;
@@ -113,7 +112,6 @@
struct _IMC_Unit;
-
/* functions */
/* HEADERIZER BEGIN: compilers/imcc/symreg.c */
@@ -341,14 +339,14 @@
typedef enum {
P_NONE = 0x00, /* 0<<0 */
P_NEED_LEX = 0x01, /* 1<<0 */
- /* P_XXXX = 0x02, */ /* 1<<1 */
+ /* P_XXXX = 0x02, */ /* 1<<1 */
P_METHOD = 0x04, /* 1<<2 */
- P_ANON = SUB_FLAG_PF_ANON, /* 1<<3 0x8 - private3 */
- P_MAIN = SUB_FLAG_PF_MAIN, /* 1<<4 0x10 - private4 */
- P_LOAD = SUB_FLAG_PF_LOAD, /* 1<<5 0x20 - private5 */
- P_IMMEDIATE = SUB_FLAG_PF_IMMEDIATE, /* 1<<6 0x40 - private6 */
- P_POSTCOMP = SUB_FLAG_PF_POSTCOMP, /* 1<<7 0x80 - private7 */
- P_INIT = SUB_COMP_FLAG_PF_INIT /* 1<<10 0x400 - 10 */
+ P_ANON = SUB_FLAG_PF_ANON, /* 1<<3 0x8 - private3 */
+ P_MAIN = SUB_FLAG_PF_MAIN, /* 1<<4 0x10 - private4 */
+ P_LOAD = SUB_FLAG_PF_LOAD, /* 1<<5 0x20 - private5 */
+ P_IMMEDIATE = SUB_FLAG_PF_IMMEDIATE, /* 1<<6 0x40 - private6 */
+ P_POSTCOMP = SUB_FLAG_PF_POSTCOMP, /* 1<<7 0x80 - private7 */
+ P_INIT = SUB_COMP_FLAG_PF_INIT /* 1<<10 0x400 - 10 */
} pragma_enum_t;
typedef enum {
@@ -357,24 +355,23 @@
} pcc_flags_t;
typedef struct pcc_sub_t {
- SymReg ** args;
- int *arg_flags; /* :slurpy, :optional, ... */
- int nargs;
SymReg *sub;
SymReg *cc;
- SymReg ** ret;
- int *ret_flags; /* :slurpy, :optional, ... */
- int nret;
- SymReg ** multi;
- int nmulti;
- INTVAL pragma;
- int calls_a_sub;
- int flags; /* isNCI, isTAIL_CALL */
- int label;
- SymReg * object;
+ SymReg **args;
+ SymReg **multi;
+ SymReg **ret;
+ SymReg *object;
+ int *arg_flags; /* :slurpy, :optional, ... */
+ int *ret_flags; /* :slurpy, :optional, ... */
+ int nargs;
+ int nret;
+ int nmulti;
+ int calls_a_sub;
+ int flags; /* isNCI, isTAIL_CALL */
+ int label;
+ INTVAL pragma;
} pcc_sub_t;
-
enum uniq_t {
U_add_once,
U_add_uniq_label,
@@ -390,4 +387,3 @@
* End:
* vim: expandtab shiftwidth=4:
*/
-