[svn:parrot] r41350 - in branches/kill_jit: include/parrot src

darbelo at svn.parrot.org darbelo at svn.parrot.org
Sat Sep 19 01:37:43 UTC 2009


Author: darbelo
Date: Sat Sep 19 01:37:42 2009
New Revision: 41350
URL: https://trac.parrot.org/parrot/changeset/41350

Log:
Remove the jit_info member of the PackFile_ByteCode struct. Pull a whole lot of dead code with it.

Modified:
   branches/kill_jit/include/parrot/packfile.h
   branches/kill_jit/include/parrot/runcore_api.h
   branches/kill_jit/src/frame_builder.c
   branches/kill_jit/src/frame_builder.h

Modified: branches/kill_jit/include/parrot/packfile.h
==============================================================================
--- branches/kill_jit/include/parrot/packfile.h	Sat Sep 19 01:15:51 2009	(r41349)
+++ branches/kill_jit/include/parrot/packfile.h	Sat Sep 19 01:37:42 2009	(r41350)
@@ -265,7 +265,6 @@
 struct PackFile_ByteCode {
     PackFile_Segment       base;
     Prederef               prederef;    /* The predereferenced code and info */
-    struct Parrot_jit_info_t     *jit_info;    /* JITs data */
     struct PackFile_Debug *debugs;
     PackFile_ConstTable   *const_table;
     PackFile_FixupTable   *fixups;

Modified: branches/kill_jit/include/parrot/runcore_api.h
==============================================================================
--- branches/kill_jit/include/parrot/runcore_api.h	Sat Sep 19 01:15:51 2009	(r41349)
+++ branches/kill_jit/include/parrot/runcore_api.h	Sat Sep 19 01:37:42 2009	(r41350)
@@ -109,11 +109,6 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-void * init_jit(PARROT_INTERP, SHIM(opcode_t *pc))
-        __attribute__nonnull__(1);
-
 void Parrot_runcore_destroy(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -146,8 +141,6 @@
 #define ASSERT_ARGS_dynop_register __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(lib_pmc)
-#define ASSERT_ARGS_init_jit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_runcore_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_runcore_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \

Modified: branches/kill_jit/src/frame_builder.c
==============================================================================
--- branches/kill_jit/src/frame_builder.c	Sat Sep 19 01:15:51 2009	(r41349)
+++ branches/kill_jit/src/frame_builder.c	Sat Sep 19 01:37:42 2009	(r41350)
@@ -460,56 +460,6 @@
     emitm_jumpl(jit_info->native_ptr, 0xc0def00d);
 }
 
-void
-Parrot_emit_jump_to_eax(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-    /* we have to get the code pointer, which might change
-     * due to intersegment branches
-     */
-
-    /* get interpreter
-     */
-    emitm_movl_m_r(interp, jit_info->native_ptr,
-            emit_EBX, emit_EBP, emit_None, 1, INTERP_BP_OFFS);
-    if (!jit_info->objfile) {
-        /*
-         * emit interp->code->base.data
-         */
-        emitm_movl_m_r(interp, jit_info->native_ptr, emit_ECX, emit_EBX, 0, 1,
-                offsetof(Interp, code));
-        emitm_movl_m_r(interp, jit_info->native_ptr, emit_EDX, emit_ECX, 0, 1,
-                offsetof(PackFile_Segment, data));
-        /* calc code offset */
-        jit_emit_sub_rr_i(interp, jit_info->native_ptr, emit_EAX, emit_EDX);
-        /*
-         * now we have the offset of the ins in EAX
-         *
-         * interp->code->jit_info->arena->op_map
-         *
-         * TODO interleave these 2 calculations
-         */
-        emitm_movl_m_r(interp, jit_info->native_ptr, emit_EDX, emit_ECX, 0, 1,
-                offsetof(PackFile_ByteCode, jit_info));
-        emitm_lea_m_r(interp, jit_info->native_ptr, emit_EDX, emit_EDX, 0, 1,
-                offsetof(Parrot_jit_info_t, arena));
-        emitm_movl_m_r(interp, jit_info->native_ptr, emit_EDX, emit_EDX, 0, 1,
-                offsetof(Parrot_jit_arena_t, op_map));
-
-    }
-    /* get base pointer */
-    emitm_movl_m_r(interp, jit_info->native_ptr, emit_EBX, emit_EBX, 0, 1,
-            offsetof(Interp, ctx));
-    emitm_movl_m_r(interp, jit_info->native_ptr, emit_EBX, emit_EBX, 0, 1,
-            offsetof(PMC, data));
-    emitm_movl_m_r(interp, jit_info->native_ptr, emit_EBX, emit_EBX, 0, 1,
-            offsetof(Parrot_Context, bp));
-
-    /* This jumps to the address in op_map[EDX + sizeof (void *) * INDEX] */
-    emitm_jumpm(jit_info->native_ptr, emit_EDX, emit_EAX,
-            sizeof (*jit_info->arena.op_map) / 4, 0);
-}
-
 #  define CONST(i) (int *)(jit_info->cur_op[i] * \
        sizeof (PackFile_Constant) + \
        offsetof(PackFile_Constant, u))
@@ -1132,125 +1082,10 @@
 
 #  undef CONST
 
-void
-Parrot_jit_dofixup(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    Parrot_jit_fixup_t *fixup, *next;
-    char *fixup_ptr;
-
-    fixup = jit_info->arena.fixups;
-
-    while (fixup) {
-        switch (fixup->type) {
-        /* This fixes-up a branch to a known opcode offset -
-           32-bit displacement only */
-            case JIT_X86BRANCH:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup) + 2;
-                *(long *)(fixup_ptr) =
-                    jit_info->arena.op_map[fixup->param.opcode].offset
-                        - (fixup->native_offset + 6) + fixup->skip;
-                break;
-            case JIT_X86JUMP:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup) + 1;
-                *(long *)(fixup_ptr) =
-                    jit_info->arena.op_map[fixup->param.opcode].offset
-                        - (fixup->native_offset + 5) + fixup->skip;
-                break;
-            case JIT_X86CALL:
-                fixup_ptr = jit_info->arena.start + fixup->native_offset + 1;
-                *(long *)(fixup_ptr) = (long)fixup->param.fptr -
-                    (long)fixup_ptr - 4;
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-                    "Unknown fixup type:%d\n", fixup->type);
-            break;
-        }
-        next = fixup->next;
-        free(fixup);
-        fixup = next;
-    }
-    jit_info->arena.fixups = NULL;
-}
-
 int control_word = 0x27f;
 
 extern int jit_op_count(void);
 
-void
-Parrot_jit_normal_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int cur_op = *jit_info->cur_op;
-    static int check;
-
-/*    if (cur_op >= jit_op_count()) {
-        cur_op = CORE_OPS_wrapper__;
-    }
-*/
-    if ((++check & 0x7) == 0) {
-        /*
-         * every 8 ??? normal ops, we emit a check for event processing
-         */
-
-/*
- * There is an optimization to reuse arguments on the stack.  Compilers may
- * decide to reuse the argument space though.  If you are *absolutely sure*
- * this does not happen define PARROT_JIT_STACK_REUSE_INTERP.
- */
-#ifdef PARROT_JIT_STACK_REUSE_INTERP
-        /*
-        * op functions have the signature (cur_op, interp)
-        * we use the interpreter already on stack and only push the
-        * cur_op
-        */
-#else
-        /* push interpreter */
-        Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-        emitm_pushl_r(jit_info->native_ptr, emit_ECX);
-#endif
-
-        emitm_pushl_i(jit_info->native_ptr, CORE_OPS_check_events);
-
-        call_func(jit_info,
-            (void (*) (void)) (interp->op_func_table[CORE_OPS_check_events]));
-#ifdef PARROT_JIT_STACK_REUSE_INTERP
-        emitm_addb_i_r(jit_info->native_ptr, 4, emit_ESP);
-#else
-        emitm_addb_i_r(jit_info->native_ptr, 8, emit_ESP);
-#endif
-    }
-
-#ifdef PARROT_JIT_STACK_REUSE_INTERP
-    /*
-    * op functions have the signature (cur_op, interp)
-    * we use the interpreter already on stack and only push the
-    * cur_op
-    */
-#else
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-    emitm_pushl_r(jit_info->native_ptr, emit_ECX);
-#endif
-
-    emitm_pushl_i(jit_info->native_ptr, jit_info->cur_op);
-
-    call_func(jit_info,
-            (void (*) (void))(interp->op_func_table[cur_op]));
-#ifdef PARROT_JIT_STACK_REUSE_INTERP
-    emitm_addb_i_r(jit_info->native_ptr, 4, emit_ESP);
-#else
-    emitm_addb_i_r(jit_info->native_ptr, 8, emit_ESP);
-#endif
-}
-
-void
-Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-    Parrot_jit_normal_op(jit_info, interp);
-    Parrot_emit_jump_to_eax(jit_info, interp);
-}
-
 /*
  * params are put rigth to left on the stack
  * parrot registers are counted left to right

Modified: branches/kill_jit/src/frame_builder.h
==============================================================================
--- branches/kill_jit/src/frame_builder.h	Sat Sep 19 01:15:51 2009	(r41349)
+++ branches/kill_jit/src/frame_builder.h	Sat Sep 19 01:37:42 2009	(r41350)
@@ -236,21 +236,6 @@
 
 void Parrot_jit_newfixup(Parrot_jit_info_t *jit_info);
 
-void Parrot_jit_normal_op(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP);
-
-void Parrot_jit_restart_op(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP);
-
-void Parrot_exec_cpcf_op(Parrot_jit_info_t *jit_info,
-                        PARROT_INTERP);
-
-void Parrot_exec_normal_op(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP);
-
-void Parrot_exec_restart_op(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP);
-
 /*
  * interface to architecture specific details
  */
@@ -2044,28 +2029,6 @@
 
 #  endif /* JIT_EMIT = 0 */
 #endif /* JIT_EMIT */
-
-void Parrot_jit_dofixup(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-void Parrot_jit_begin(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-void Parrot_jit_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-void Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-#ifdef JIT_EMIT
-#  if JIT_EMIT == 2
-/* generate code just once */
-
-/* autogened inside core.ops */
-static void Parrot_end_jit(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-#    undef Parrot_jit_restart_op
-#  endif /* JIT_EMIT == 2 */
-#endif /* JIT_EMIT */
-
-void Parrot_jit_restart_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
 int count_regs(PARROT_INTERP, char *sig, char *sig_start);
 
 size_t calc_signature_needs(const char *sig, int *strings);


More information about the parrot-commits mailing list