DEADSOFTWARE

JVM: Добавлено сравнение строк
[dsw-obn.git] / src / backends / jvm / generator-jvm.h
1 #define MAX_REGISTERS 256
3 struct gen_register_file
4 {
5 struct
6 {
7 bool used;
8 bool wide;
9 } reg[MAX_REGISTERS];
10 int num_used;
11 int max_used;
12 };
14 struct gen_stack
15 {
16 int pointer;
17 int max_pointer;
18 };
20 struct gen_class
21 {
22 char * full_name;
23 FILE * fp;
24 gen_proc_t * p;
25 struct gen_class * base;
26 };
28 enum gen_storage
29 {
30 JVM_STORAGE_UNKNOWN,
31 /* Обыкновенные Java-переменные */
32 JVM_STORAGE_REGISTER,
33 JVM_STORAGE_STATIC,
34 JVM_STORAGE_FIELD,
35 JVM_STORAGE_PARAM,
36 /* Переменные на которые можно делать указатели без кеширования */
37 JVM_STORAGE_REGISTER_VAR,
38 JVM_STORAGE_STATIC_VAR,
39 JVM_STORAGE_FIELD_VAR,
40 JVM_STORAGE_PARAM_VAR,
41 JVM_STORAGE_PARAM_VARPTR,
42 /* Локальные переменные доступные локальным функциям */
43 JVM_STORAGE_FRAME,
44 JVM_STORAGE_FRAME_VAR,
45 JVM_STORAGE_FRAME_PARAM,
46 JVM_STORAGE_FRAME_PARAM_VAR,
47 JVM_STORAGE_FRAME_PARAM_VARPTR
48 };
51 struct gen_proc_t
52 {
53 char * full_name;
54 int label_id;
55 struct gen_register_file * rf;
56 struct gen_stack * stack;
57 struct gen_class * class;
59 int level;
60 int max_frames;
61 int * reg_frame;
62 gen_var_t * frame_v;
63 };
65 struct gen_type_t
66 {
67 int rec_id;
68 struct gen_class * class;
70 bool wide;
71 char prefix;
72 char postfix;
73 char * desc;
74 int cell_size;
75 };
77 struct gen_var_t
78 {
79 enum gen_storage storage;
80 gen_type_t * type;
81 int reg;
82 int level;
84 char * name;
85 char * full_name;
86 gen_proc_t * p;
87 struct gen_class * class;
88 };
90 struct gen_context_t
91 {
92 gen_module_t * current_m;
93 };
95 struct gen_module_t
96 {
97 struct gen_class * class;
98 int rec_id;
99 };
101 struct gen_label_t
103 int id;
104 };