[svn:parrot] r40863 - in branches/context_pmc3: include/parrot src/call

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Aug 30 09:54:25 UTC 2009


Author: bacek
Date: Sun Aug 30 09:54:25 2009
New Revision: 40863
URL: https://trac.parrot.org/parrot/changeset/40863

Log:
Add Context flags accessors and use them

Modified:
   branches/context_pmc3/include/parrot/call.h
   branches/context_pmc3/include/parrot/interpreter.h
   branches/context_pmc3/include/parrot/warnings.h
   branches/context_pmc3/src/call/context.c

Modified: branches/context_pmc3/include/parrot/call.h
==============================================================================
--- branches/context_pmc3/include/parrot/call.h	Sun Aug 30 09:53:47 2009	(r40862)
+++ branches/context_pmc3/include/parrot/call.h	Sun Aug 30 09:54:25 2009	(r40863)
@@ -766,6 +766,23 @@
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
+void Parrot_pcc_errors_off(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_errors_on(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_errors_test(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
 PMC* Parrot_pcc_get_caller_ctx(PARROT_INTERP, ARGIN(PMC *ctx))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
@@ -940,6 +957,46 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
+PARROT_EXPORT
+void Parrot_pcc_trace_flags_off(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_trace_flags_on(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_trace_flags_test(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_warnings_off(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_warnings_on(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_warnings_test(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
 #define ASSERT_ARGS_Parrot_pcc_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(ctx)
@@ -947,6 +1004,15 @@
      __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(ctx)
+#define ASSERT_ARGS_Parrot_pcc_errors_off __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(ctx)
+#define ASSERT_ARGS_Parrot_pcc_errors_on __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(ctx)
+#define ASSERT_ARGS_Parrot_pcc_errors_test __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(ctx)
 #define ASSERT_ARGS_Parrot_pcc_get_caller_ctx __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(ctx)
@@ -1041,6 +1107,24 @@
 #define ASSERT_ARGS_Parrot_pcc_set_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(ctx)
+#define ASSERT_ARGS_Parrot_pcc_trace_flags_off __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(ctx)
+#define ASSERT_ARGS_Parrot_pcc_trace_flags_on __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(ctx)
+#define ASSERT_ARGS_Parrot_pcc_trace_flags_test __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(ctx)
+#define ASSERT_ARGS_Parrot_pcc_warnings_off __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(ctx)
+#define ASSERT_ARGS_Parrot_pcc_warnings_on __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(ctx)
+#define ASSERT_ARGS_Parrot_pcc_warnings_test __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(ctx)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/call/context.c */
 

Modified: branches/context_pmc3/include/parrot/interpreter.h
==============================================================================
--- branches/context_pmc3/include/parrot/interpreter.h	Sun Aug 30 09:53:47 2009	(r40862)
+++ branches/context_pmc3/include/parrot/interpreter.h	Sun Aug 30 09:54:25 2009	(r40863)
@@ -124,9 +124,9 @@
 #define Interp_debug_CLEAR(interp, flag) ((interp)->debug_flags &= ~(flag))
 #define Interp_debug_TEST(interp, flag)  ((interp)->debug_flags & (flag))
 
-#define Interp_trace_SET(interp, flag)   (CURRENT_CONTEXT_FIELD(interp, trace_flags) |= (flag))
-#define Interp_trace_CLEAR(interp, flag) (CURRENT_CONTEXT_FIELD(interp, trace_flags) &= ~(flag))
-#define Interp_trace_TEST(interp, flag)  (CURRENT_CONTEXT_FIELD(interp, trace_flags) & (flag))
+#define Interp_trace_SET(interp, flag)   Parrot_pcc_trace_flags_on(interp, interp->ctx, (flag))
+#define Interp_trace_CLEAR(interp, flag) Parrot_pcc_trace_flags_off(interp, interp->ctx, (flag))
+#define Interp_trace_TEST(interp, flag)  Parrot_pcc_trace_flags_test(interp, interp->ctx, (flag))
 
 #define Interp_core_SET(interp, core)   ((interp)->run_core = (core))
 #define Interp_core_TEST(interp, core)  ((interp)->run_core == (core))

Modified: branches/context_pmc3/include/parrot/warnings.h
==============================================================================
--- branches/context_pmc3/include/parrot/warnings.h	Sun Aug 30 09:53:47 2009	(r40862)
+++ branches/context_pmc3/include/parrot/warnings.h	Sun Aug 30 09:54:25 2009	(r40863)
@@ -35,19 +35,13 @@
 
 /* &end_gen */
 
-#define PARROT_WARNINGS_on(interp, flag) do { \
-    CURRENT_CONTEXT_FIELD(interp, warns) |= (flag); } while (0)
-#define PARROT_WARNINGS_off(interp, flag) do { \
-    CURRENT_CONTEXT_FIELD(interp, warns) &= ~(flag); } while (0)
-#define PARROT_WARNINGS_test(interp, flag)  \
-    (CURRENT_CONTEXT_FIELD(interp, warns) & (flag))
-
-#define PARROT_ERRORS_on(interp, flag) do { \
-    CURRENT_CONTEXT_FIELD(interp, errors) |= (flag); } while (0)
-#define PARROT_ERRORS_off(interp, flag) do { \
-    CURRENT_CONTEXT_FIELD(interp, errors) &= ~(flag); } while (0)
-#define PARROT_ERRORS_test(interp, flag)  \
-    (CURRENT_CONTEXT_FIELD(interp, errors) & (flag))
+#define PARROT_WARNINGS_on(interp, flag)   Parrot_pcc_warnings_on(interp, interp->ctx, (flag))
+#define PARROT_WARNINGS_off(interp, flag)  Parrot_pcc_warnings_off(interp, interp->ctx, (flag))
+#define PARROT_WARNINGS_test(interp, flag) Parrot_pcc_warnings_test(interp, interp->ctx, (flag))
+
+#define PARROT_ERRORS_on(interp, flag)   Parrot_pcc_errors_on(interp, interp->ctx, (flag))
+#define PARROT_ERRORS_off(interp, flag)  Parrot_pcc_errors_off(interp, interp->ctx, (flag))
+#define PARROT_ERRORS_test(interp, flag) Parrot_pcc_errors_test(interp, interp->ctx, (flag))
 
 #if defined(PARROT_IN_CORE)
 

Modified: branches/context_pmc3/src/call/context.c
==============================================================================
--- branches/context_pmc3/src/call/context.c	Sun Aug 30 09:53:47 2009	(r40862)
+++ branches/context_pmc3/src/call/context.c	Sun Aug 30 09:54:25 2009	(r40863)
@@ -585,7 +585,8 @@
 
 /*
 
-=item C<void Parrot_pcc_set_results(PARROT_INTERP, PMC *ctx, opcode_t *pc)>
+=item C<void Parrot_pcc_set_results_signature(PARROT_INTERP, PMC *ctx, PMC
+*sig)>
 
 Set ptr into code with get_results opcode.
 
@@ -646,10 +647,189 @@
 
 /*
 
-=back
+=item C<UINTVAL Parrot_pcc_warnings_on(PARROT_INTERP, PMC *ctx, UINTVAL flags)>
+
+Set warnings flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_warnings_on(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_get_pred_offset)
+    Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
+    c->warns |= flags;
+    return c->warns;
+}
+
+
+/*
+
+=item C<void Parrot_pcc_warnings_off(PARROT_INTERP, PMC *ctx, UINTVAL flags)>
+
+Clear warnings flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_warnings_off(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+    Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
+    c->warns &= ~flags;
+    return c->warns;
+}
+
+
+/*
+
+=item C<UINTVAL Parrot_pcc_warnings_test(PARROT_INTERP, PMC *ctx, UINTVAL
+flags)>
+
+Test warnings flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_warnings_test(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+    Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
+    return c->warns & flags;
+}
+
+/*
+
+=item C<UINTVAL Parrot_pcc_errors_on(PARROT_INTERP, PMC *ctx, UINTVAL flags)>
+
+Set errors flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_errors_on(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_get_pred_offset)
+    Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
+    c->errors |= flags;
+    return c->errors;
+}
+
+
+/*
+
+=item C<void Parrot_pcc_errors_off(PARROT_INTERP, PMC *ctx, UINTVAL flags)>
+
+Clear errors flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_errors_off(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+    Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
+    c->errors &= ~flags;
+    return c->errors;
+}
+
+
+/*
+
+=item C<UINTVAL Parrot_pcc_errors_test(PARROT_INTERP, PMC *ctx, UINTVAL flags)>
+
+Test errors flags.
+
+=cut
 
 */
 
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_errors_test(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+    Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
+    return c->errors & flags;
+}
+
+/*
+
+=item C<UINTVAL Parrot_pcc_trace_flags_on(PARROT_INTERP, PMC *ctx, UINTVAL
+flags)>
+
+Set trace flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_trace_flags_on(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_get_pred_offset)
+    Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
+    c->trace_flags |= flags;
+    return c->trace_flags;
+}
+
+
+/*
+
+=item C<void Parrot_pcc_trace_flags_off(PARROT_INTERP, PMC *ctx, UINTVAL flags)>
+
+Clear trace flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_trace_flags_off(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+    Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
+    c->trace_flags &= ~flags;
+    return c->trace_flags;
+}
+
+
+/*
+
+=item C<UINTVAL Parrot_pcc_trace_flags_test(PARROT_INTERP, PMC *ctx, UINTVAL
+flags)>
+
+Test trace flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_trace_flags_test(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+    Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
+    return c->trace_flags & flags;
+}
 
 /*
 


More information about the parrot-commits mailing list