DEADSOFTWARE

Добавлены строки в отладочную информацию класса (быстрохак)
[dsw-obn.git] / src / backends / jvm / generator-jvm.h
index 3ccc9f50ac3cbdfd6563aab5d0ef208320e90a27..52d59fa0e76eda02d804dffbcf797746dc492239 100644 (file)
@@ -1,6 +1,7 @@
 #define MAX_REGISTERS 256
 
-struct gen_register_file {
+struct gen_register_file
+{
        struct
        {
                bool used;
@@ -8,39 +9,105 @@ struct gen_register_file {
        } reg[MAX_REGISTERS];
        int num_used;
        int max_used;
-       struct gen_register_file * up;
 };
 
+struct gen_stack
+{
+       int pointer;
+       int max_pointer;
+};
+
+struct gen_class
+{
+       char * full_name;
+       FILE * fp;
+       gen_proc_t * p;
+       struct gen_class * base;
+       const char * dir;
+};
+
+enum gen_storage
+{
+       JVM_STORAGE_UNKNOWN,
+       /* Обыкновенные Java-переменные */
+       JVM_STORAGE_REGISTER,
+       JVM_STORAGE_STATIC,
+       JVM_STORAGE_FIELD,
+       JVM_STORAGE_PARAM,
+       /* Переменные на которые можно делать указатели без кеширования */
+       JVM_STORAGE_REGISTER_VAR,
+       JVM_STORAGE_STATIC_VAR,
+       JVM_STORAGE_FIELD_VAR,
+       JVM_STORAGE_PARAM_VAR,
+       JVM_STORAGE_PARAM_VARPTR,
+       /* Локальные переменные доступные локальным функциям */
+       JVM_STORAGE_FRAME,
+       JVM_STORAGE_FRAME_VAR,
+       JVM_STORAGE_FRAME_PARAM,
+       JVM_STORAGE_FRAME_PARAM_VAR,
+       JVM_STORAGE_FRAME_PARAM_VARPTR
+};
+
+
 struct gen_proc_t
 {
+       char * full_name;
+       int label_id;
        struct gen_register_file * rf;
+       struct gen_stack * stack;
+       struct gen_class * class;
+
+       char ret_prefix;
+
+       int level;
+       int max_frames;
+       int * reg_frame;
+       gen_var_t * frame_v;
 };
 
 struct gen_type_t
 {
        int rec_id;
-       FILE * fp;
+       struct gen_class * class;
+
+       bool wide;
+       char prefix;
+       char postfix;
+       char * full_name;
+       char * desc;
+       int cell_size;
 };
 
 struct gen_var_t
 {
+       enum gen_storage storage;
+       gen_type_t * type;
        int reg;
-};
+       int level;
 
-struct gen_block_t
-{
+       bool typecheck;
+       gen_type_t * forcetype;
 
+       char * name;
+       char * full_name;
+       gen_proc_t * p;
+       struct gen_class * class;
 };
 
 struct gen_context_t
 {
-       gen_module_t * m;
-       struct gen_register_file * rf;
-       int label_id;
+       gen_module_t * current_m;
+       const char * dir;
 };
 
 struct gen_module_t
 {
+       struct gen_class * class;
        int rec_id;
-       FILE * fp;
+       int line;
+};
+
+struct gen_label_t
+{
+       int id;
 };