[svn:parrot] r45845 - in branches/runcore_purge: config/gen/config_h include/parrot src src/call src/pmc src/runcore

cotto at svn.parrot.org cotto at svn.parrot.org
Wed Apr 21 08:04:18 UTC 2010


Author: cotto
Date: Wed Apr 21 08:04:17 2010
New Revision: 45845
URL: https://trac.parrot.org/parrot/changeset/45845

Log:
[runcore] remove some prederef-related C code
There's still some remaining but removing it breaks some tests

Modified:
   branches/runcore_purge/config/gen/config_h/config_h.in
   branches/runcore_purge/include/parrot/context.h
   branches/runcore_purge/include/parrot/exceptions.h
   branches/runcore_purge/include/parrot/op.h
   branches/runcore_purge/include/parrot/oplib.h
   branches/runcore_purge/src/call/context.c
   branches/runcore_purge/src/call/context_accessors.c
   branches/runcore_purge/src/packfile.c
   branches/runcore_purge/src/pmc/callcontext.pmc
   branches/runcore_purge/src/runcore/main.c

Modified: branches/runcore_purge/config/gen/config_h/config_h.in
==============================================================================
--- branches/runcore_purge/config/gen/config_h/config_h.in	Wed Apr 21 07:33:47 2010	(r45844)
+++ branches/runcore_purge/config/gen/config_h/config_h.in	Wed Apr 21 08:04:17 2010	(r45845)
@@ -152,7 +152,6 @@
 /* Oplib and dynamic ops related. */
 #define PARROT_CORE_OPLIB_NAME "core"
 #define PARROT_CORE_OPLIB_INIT Parrot_DynOp_core_ at MAJOR@_ at MINOR@_ at PATCH@
-#define PARROT_CORE_PREDEREF_OPLIB_INIT Parrot_DynOp_core_prederef_ at MAJOR@_ at MINOR@_ at PATCH@
 
 /* ICU. */
 #define PARROT_HAS_ICU @has_icu@

Modified: branches/runcore_purge/include/parrot/context.h
==============================================================================
--- branches/runcore_purge/include/parrot/context.h	Wed Apr 21 07:33:47 2010	(r45844)
+++ branches/runcore_purge/include/parrot/context.h	Wed Apr 21 08:04:17 2010	(r45845)
@@ -214,11 +214,6 @@
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
-size_t Parrot_pcc_get_pred_offset_func(PARROT_INTERP, ARGIN(PMC *ctx))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
 UINTVAL Parrot_pcc_get_recursion_depth_func(PARROT_INTERP, ARGIN(PMC *ctx))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
@@ -316,13 +311,6 @@
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
-void Parrot_pcc_set_pred_offset_func(PARROT_INTERP,
-    ARGIN(PMC *ctx),
-    size_t pred_offset)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
 void Parrot_pcc_set_signature_func(PARROT_INTERP,
     ARGIN(PMC *ctx),
     ARGIN_NULLOK(PMC *sig_object))
@@ -431,10 +419,6 @@
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(ctx))
-#define ASSERT_ARGS_Parrot_pcc_get_pred_offset_func \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(ctx))
 #define ASSERT_ARGS_Parrot_pcc_get_recursion_depth_func \
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
@@ -486,10 +470,6 @@
 #define ASSERT_ARGS_Parrot_pcc_set_pc_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(ctx))
-#define ASSERT_ARGS_Parrot_pcc_set_pred_offset_func \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(ctx))
 #define ASSERT_ARGS_Parrot_pcc_set_signature_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(ctx))
@@ -533,9 +513,6 @@
 #  define Parrot_pcc_get_namespace(i, c) (__C(c)->current_namespace)
 #  define Parrot_pcc_set_namespace(i, c, value) (__C(c)->current_namespace = (value))
 
-#  define Parrot_pcc_get_pred_offset(i, c) (__C(c)->pred_offset)
-#  define Parrot_pcc_set_pred_offset(i, c, value) (__C(c)->pred_offset = (value))
-
 #  define Parrot_pcc_get_pc(i, c) (__C(c)->current_pc)
 #  define Parrot_pcc_set_pc(i, c, value) (__C(c)->current_pc = (value))
 
@@ -594,9 +571,6 @@
 #  define Parrot_pcc_get_namespace(i, c) Parrot_pcc_get_namespace_func((i), (c))
 #  define Parrot_pcc_set_namespace(i, c, value) Parrot_pcc_set_namespace_func((i), (c), (value))
 
-#  define Parrot_pcc_get_pred_offset(i, c) Parrot_pcc_get_pred_offset_func((i), (c))
-#  define Parrot_pcc_set_pred_offset(i, c, value) Parrot_pcc_set_pred_offset_func((i), (c), (value))
-
 #  define Parrot_pcc_get_pc(i, c) Parrot_pcc_get_pc_func((i), (c))
 #  define Parrot_pcc_set_pc(i, c, value) Parrot_pcc_set_pc_func((i), (c), (value))
 

Modified: branches/runcore_purge/include/parrot/exceptions.h
==============================================================================
--- branches/runcore_purge/include/parrot/exceptions.h	Wed Apr 21 07:33:47 2010	(r45844)
+++ branches/runcore_purge/include/parrot/exceptions.h	Wed Apr 21 08:04:17 2010	(r45845)
@@ -51,7 +51,6 @@
     EXCEPTION_JIT_UNAVAILABLE,
     EXCEPTION_EXEC_UNAVAILABLE,
     EXCEPTION_INTERP_ERROR,
-    EXCEPTION_PREDEREF_LOAD_ERROR,
     EXCEPTION_PARROT_USAGE_ERROR,
     EXCEPTION_PIO_ERROR,
     EXCEPTION_PARROT_POINTER_ERROR,

Modified: branches/runcore_purge/include/parrot/op.h
==============================================================================
--- branches/runcore_purge/include/parrot/op.h	Wed Apr 21 07:33:47 2010	(r45844)
+++ branches/runcore_purge/include/parrot/op.h	Wed Apr 21 08:04:17 2010	(r45845)
@@ -57,7 +57,6 @@
 /* NOTE: Sure wish we could put the types here... */
 
 typedef opcode_t *(*op_func_t)(opcode_t *, PARROT_INTERP);
-typedef void **(*op_func_prederef_t)(void **, PARROT_INTERP);
 
 
 /*

Modified: branches/runcore_purge/include/parrot/oplib.h
==============================================================================
--- branches/runcore_purge/include/parrot/oplib.h	Wed Apr 21 07:33:47 2010	(r45844)
+++ branches/runcore_purge/include/parrot/oplib.h	Wed Apr 21 08:04:17 2010	(r45845)
@@ -51,7 +51,6 @@
     CORE_OPS_check_events__,    /* inserted into op dispatch when an event
                                    got scheduled */
     CORE_OPS_wrapper__,         /* inserted by dynop_register for new ops */
-    CORE_OPS_prederef__         /* inserted by dynop_register for new ops */
         /* 2 more reserved */
 } special_core_ops_enum;
 

Modified: branches/runcore_purge/src/call/context.c
==============================================================================
--- branches/runcore_purge/src/call/context.c	Wed Apr 21 07:33:47 2010	(r45844)
+++ branches/runcore_purge/src/call/context.c	Wed Apr 21 08:04:17 2010	(r45845)
@@ -321,7 +321,6 @@
     ctx->current_object    = NULL;
     ctx->handlers          = PMCNULL;
     ctx->caller_ctx        = NULL;
-    ctx->pred_offset       = 0;
     ctx->current_sig       = PMCNULL;
     ctx->current_sub       = PMCNULL;
 
@@ -331,7 +330,6 @@
         ctx->warns             = old->warns;
         ctx->errors            = old->errors;
         ctx->trace_flags       = old->trace_flags;
-        ctx->pred_offset       = old->pred_offset;
         ctx->current_HLL       = old->current_HLL;
         ctx->current_namespace = old->current_namespace;
         /* end COW */
@@ -343,7 +341,6 @@
         ctx->warns             = 0;
         ctx->errors            = 0;
         ctx->trace_flags       = 0;
-        ctx->pred_offset       = 0;
         ctx->current_HLL       = 0;
         ctx->current_namespace = PMCNULL;
         ctx->recursion_depth   = 0;

Modified: branches/runcore_purge/src/call/context_accessors.c
==============================================================================
--- branches/runcore_purge/src/call/context_accessors.c	Wed Apr 21 07:33:47 2010	(r45844)
+++ branches/runcore_purge/src/call/context_accessors.c	Wed Apr 21 08:04:17 2010	(r45845)
@@ -471,38 +471,6 @@
 
 /*
 
-=item C<size_t Parrot_pcc_get_pred_offset_func(PARROT_INTERP, PMC *ctx)>
-
-=item C<void Parrot_pcc_set_pred_offset_func(PARROT_INTERP, PMC *ctx, size_t
-pred_offset)>
-
-Get/set pred_offset
-
-=cut
-
-*/
-
-PARROT_EXPORT
-size_t
-Parrot_pcc_get_pred_offset_func(PARROT_INTERP, ARGIN(PMC *ctx))
-{
-    ASSERT_ARGS(Parrot_pcc_get_pred_offset_func)
-    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
-    return c->pred_offset;
-}
-
-PARROT_EXPORT
-void
-Parrot_pcc_set_pred_offset_func(PARROT_INTERP, ARGIN(PMC *ctx), size_t pred_offset)
-{
-    ASSERT_ARGS(Parrot_pcc_set_pred_offset_func)
-    Parrot_Context *c = get_context_struct_fast(interp, ctx);
-    c->pred_offset = pred_offset;
-}
-
-
-/*
-
 =item C<UINTVAL Parrot_pcc_warnings_on_func(PARROT_INTERP, PMC *ctx, UINTVAL
 flags)>
 

Modified: branches/runcore_purge/src/packfile.c
==============================================================================
--- branches/runcore_purge/src/packfile.c	Wed Apr 21 07:33:47 2010	(r45844)
+++ branches/runcore_purge/src/packfile.c	Wed Apr 21 08:04:17 2010	(r45845)
@@ -3093,10 +3093,6 @@
                                ? find_constants(interp, new_cs->const_table)
                                : new_cs->const_table->constants);
 
-    /* new_cs->const_table->constants; */
-    Parrot_pcc_set_pred_offset(interp, CURRENT_CONTEXT(interp),
-        new_cs->base.data - (opcode_t*) new_cs->prederef.code);
-
     if (really)
         prepare_for_run(interp);
 

Modified: branches/runcore_purge/src/pmc/callcontext.pmc
==============================================================================
--- branches/runcore_purge/src/pmc/callcontext.pmc	Wed Apr 21 07:33:47 2010	(r45844)
+++ branches/runcore_purge/src/pmc/callcontext.pmc	Wed Apr 21 08:04:17 2010	(r45845)
@@ -434,10 +434,6 @@
     ATTR UINTVAL                trace_flags;
     ATTR UINTVAL                recursion_depth; /* Sub call recursion depth */
 
-    /* code->prederefed.code - code->base.data in opcodes
-     * to simplify conversion between code ptrs in e.g. invoke */
-    ATTR size_t pred_offset;
-
     /* Storage for arguments */
     ATTR struct Pcc_cell *positionals; /* array of positionals */
     ATTR INTVAL  num_positionals;      /* count of used positionals */

Modified: branches/runcore_purge/src/runcore/main.c
==============================================================================
--- branches/runcore_purge/src/runcore/main.c	Wed Apr 21 07:33:47 2010	(r45844)
+++ branches/runcore_purge/src/runcore/main.c	Wed Apr 21 08:04:17 2010	(r45845)
@@ -51,9 +51,6 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static void stop_prederef(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
 #define ASSERT_ARGS_dynop_register_switch __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_get_dynamic_op_lib_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
@@ -61,8 +58,6 @@
 #define ASSERT_ARGS_notify_func_table __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(table))
-#define ASSERT_ARGS_stop_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -187,33 +182,6 @@
 
 /*
 
-=item C<static void stop_prederef(PARROT_INTERP)>
-
-Restore the interpreter's op function tables to their initial state.
-Also recreate the event function pointers. This is only necessary
-for run-core changes, but we don't know the old run core.
-
-=cut
-
-*/
-
-static void
-stop_prederef(PARROT_INTERP)
-{
-    ASSERT_ARGS(stop_prederef)
-    interp->op_func_table = PARROT_CORE_OPLIB_INIT(interp, 1)->op_func_table;
-
-    if (interp->evc_func_table) {
-        mem_gc_free(interp, interp->evc_func_table);
-        interp->evc_func_table = NULL;
-    }
-
-    Parrot_setup_event_func_ptrs(interp);
-}
-
-
-/*
-
 =item C<void prepare_for_run(PARROT_INTERP)>
 
 Prepares to run the interpreter's run core.
@@ -275,7 +243,6 @@
             if ((int)interp->resume_offset < 0)
                 Parrot_ex_throw_from_c_args(interp, NULL, 1,
                     "branch_cs: illegal resume offset");
-            stop_prederef(interp);
         }
     }
 }


More information about the parrot-commits mailing list