Looking more carefully at this issue, it seems that those variables
and the code that uses them has no real effect. Without it, make test
pass, make testj pass, make hello and make perl6 builds and runs.

This patch cleans all. It needs to be tested with make testj in win
32, and for completeness in other jitable platforms, but the variables
are only used in the i386 jit files. I already tested in linux i386.

-- 
Salu2
Index: src/exec.c
===================================================================
--- src/exec.c	(revisión: 28051)
+++ src/exec.c	(copia de trabajo)
@@ -62,9 +62,6 @@
 
 int Parrot_exec_run = 0;
 
-extern char **Parrot_exec_rel_addr;
-extern int Parrot_exec_rel_count;
-
 /*
 
 =item C<void Parrot_exec>
@@ -90,7 +87,6 @@
     Parrot_exec_objfile_t * const obj =
         mem_allocate_zeroed_typed(Parrot_exec_objfile_t);
     exec_init(obj);
-    Parrot_exec_rel_addr = mem_allocate_n_zeroed_typed(4, char *);
     obj->bytecode_header_size =
         (interp->code->base.file_offset + 4) * sizeof (opcode_t);
     jit_info = parrot_build_asm(interp, code_start, code_end,
@@ -341,10 +337,7 @@
             break;
     }
 
-    if (Parrot_exec_rel_count)
-        addr = Parrot_exec_rel_addr[--Parrot_exec_rel_count];
-    else
-        addr = nptr + disp;
+    addr = nptr + disp;
     new_relloc->offset        = (int)(addr - obj->text.code);
     new_relloc->symbol_number = symbol_number;
     new_relloc->type          = type;
Index: src/jit/i386/jit_emit.h
===================================================================
--- src/jit/i386/jit_emit.h	(revisión: 28051)
+++ src/jit/i386/jit_emit.h	(copia de trabajo)
@@ -94,19 +94,6 @@
 #define ISR1 emit_EAX
 #define FSR1 0
 
-extern char **Parrot_exec_rel_addr;
-extern int Parrot_exec_rel_count;
-
-/* Register the address of a rellocation. */
-#if EXEC_CAPABLE
-#  define EXEC_RA(addr) \
-       if (Parrot_exec_rel_addr) \
-         Parrot_exec_rel_addr[Parrot_exec_rel_count++] = addr;
-#  define EXEC_RD \
-       if (Parrot_exec_rel_addr && Parrot_exec_rel_count) \
-         Parrot_exec_rel_count--;
-#endif /* EXEC_CAPABLE */
-
 #define emit_b00 0
 #define emit_b01 1
 #define emit_b10 2
@@ -170,9 +157,6 @@
     }
     else {
         *(long *)pc = disp;
-#if EXEC_CAPABLE
-        EXEC_RA(pc);
-#endif /* EXEC_CAPABLE */
         return pc + 4;
     }
 }
@@ -240,9 +224,6 @@
     if (!base && !(i && scale)) {
         *(pc++) = (char)(emit_Mod_b00 | reg_opcode | emit_rm_b101);
         *(long *)pc = disp;
-#if EXEC_CAPABLE
-        EXEC_RA(pc);
-#endif /* EXEC_CAPABLE */
         return pc + 4;
     }
 
@@ -371,7 +352,6 @@
        *(pc++) = (char) 0xff; \
        *(pc++) = (char) 0x35; \
        *(long *)pc = (long)mem; \
-       EXEC_RA(pc); \
        (pc) += 4; }
 #else /* EXEC_CAPABLE */
 #  define emitm_pushl_m(pc, mem) { \
@@ -1353,7 +1333,7 @@
 #  define emitm_callm(pc, b, i, s, d) { \
        *((pc)++) = (char) 0xff; \
        (pc) = emit_r_X(interp, pc, emit_reg(emit_b010), b, i, s, d);\
-       EXEC_RD }
+       }
 #else /* EXEC_CAPABLE */
 #  define emitm_callm(pc, b, i, s, d) { \
        *((pc)++) = (char) 0xff; \
@@ -1376,7 +1356,7 @@
 #  define emitm_jumpm(pc, b, i, s, d) { \
        *((pc)++) = (char) 0xff; \
        (pc) = emit_r_X(interp, pc, emit_reg(emit_b100), b, i, s, d); \
-       EXEC_RD }
+       }
 #else /* EXEC_CAPABLE */
 #  define emitm_jumpm(pc, b, i, s, d) { \
        *((pc)++) = (char) 0xff; \
Index: src/jit/i386/exec_dep.c
===================================================================
--- src/jit/i386/exec_dep.c	(revisión: 28051)
+++ src/jit/i386/exec_dep.c	(copia de trabajo)
@@ -32,8 +32,6 @@
         jit_info->optimizer->cur_section;
     int i, j, last_is_branch = 0;
     void ** offset;
-    extern char **Parrot_exec_rel_addr;
-    extern int Parrot_exec_rel_count;
 
     assert(op_jit[*jit_info->cur_op].extcall == 1);
     if (cur_section->done == 1)
Index: src/jit.c
===================================================================
--- src/jit.c	(revisión: 28051)
+++ src/jit.c	(copia de trabajo)
@@ -48,9 +48,6 @@
 void Parrot_jit_debug(PARROT_INTERP);
 #endif
 
-char **Parrot_exec_rel_addr;
-int Parrot_exec_rel_count;
-
 /*
 
 =item C<static void
Index: tools/build/jit2c.pl
===================================================================
--- tools/build/jit2c.pl	(revisión: 28051)
+++ tools/build/jit2c.pl	(copia de trabajo)
@@ -285,9 +285,6 @@
 # define MAP(i) jit_info->optimizer->map_branch[jit_info->op_i + (i)]
 #endif
 
-extern char **Parrot_exec_rel_addr;
-extern int Parrot_exec_rel_count;
-
 #define ROFFS_INT(x) REG_OFFS_INT(jit_info->cur_op[x])
 #define ROFFS_NUM(x) REG_OFFS_NUM(jit_info->cur_op[x])
 #define ROFFS_STR(x) REG_OFFS_STR(jit_info->cur_op[x])

Reply via email to