Author: jkeenan
Date: Fri Jan  2 05:05:54 2009
New Revision: 34803

Modified:
   branches/assert_args/src/pic.c

Log:
Adding ASSERT_ARGS() to all functions in src/pic.c; storing tested results.

Modified: branches/assert_args/src/pic.c
==============================================================================
--- branches/assert_args/src/pic.c      (original)
+++ branches/assert_args/src/pic.c      Fri Jan  2 05:05:54 2009
@@ -251,6 +251,7 @@
 {
     Parrot_PIC_store *store;
     size_t size;
+    ASSERT_ARGS(parrot_PIC_alloc_store);
 
     /*
      * estimated 95% of calls are monomorphic, 5% are polymorphic
@@ -286,6 +287,7 @@
 void
 parrot_PIC_destroy(ARGMOD(PackFile_ByteCode *cs))
 {
+    ASSERT_ARGS(parrot_PIC_destroy);
     Parrot_PIC_store *store = cs->pic_store;
 
     while (store) {
@@ -311,6 +313,7 @@
 int
 parrot_PIC_op_is_cached(int op_code)
 {
+    ASSERT_ARGS(parrot_PIC_op_is_cached);
     switch (op_code) {
         case PARROT_OP_get_params_pc:
         case PARROT_OP_set_returns_pc:
@@ -337,6 +340,7 @@
 Parrot_MIC*
 parrot_PIC_alloc_mic(const PARROT_INTERP, size_t n)
 {
+    ASSERT_ARGS(parrot_PIC_alloc_mic);
     Parrot_PIC_store * const store = interp->code->pic_store;
     PARROT_ASSERT(n < store->n_mics);
     return store->mic + n;
@@ -358,6 +362,7 @@
 Parrot_PIC*
 parrot_PIC_alloc_pic(PARROT_INTERP)
 {
+    ASSERT_ARGS(parrot_PIC_alloc_pic);
     Parrot_PIC_store *store = interp->code->pic_store;
     Parrot_PIC_store *new_store;
 
@@ -402,6 +407,7 @@
 void *
 parrot_pic_opcode(PARROT_INTERP, INTVAL op)
 {
+    ASSERT_ARGS(parrot_pic_opcode);
 #ifdef HAVE_COMPUTED_GOTO
     op_lib_t *cg_lib;
 #endif
@@ -432,6 +438,7 @@
         ARGIN(const void **src), ARGOUT(char *dest_base), ARGIN(void * const 
*dest))
 {
     int i;
+    ASSERT_ARGS(pass_int);
     int n = SIG_ELEMS(sig);
 
     for (i = 2; n; ++i, --n) {
@@ -456,6 +463,7 @@
         ARGIN(const void **src), ARGOUT(char *dest_base), ARGIN(void * const 
*dest))
 {
     int i;
+    ASSERT_ARGS(pass_num);
     int n = SIG_ELEMS(sig);
 
     for (i = 2; n; ++i, --n) {
@@ -480,6 +488,7 @@
         ARGIN(const void **src), ARGOUT(char *dest_base), ARGIN(void * const 
*dest))
 {
     int i;
+    ASSERT_ARGS(pass_str);
     int n = SIG_ELEMS(sig);
 
     for (i = 2; n; ++i, --n) {
@@ -504,8 +513,9 @@
 pass_pmc(SHIM_INTERP, ARGIN(const PMC *sig), ARGIN(const char *src_base),
         ARGIN(const void **src), ARGOUT(char *dest_base), ARGIN(void * const 
*dest))
 {
-    int n = SIG_ELEMS(sig);
     int i;
+    ASSERT_ARGS(pass_pmc);
+    int n = SIG_ELEMS(sig);
 
     for (i = 2; n; ++i, --n) {
         PMC * const arg = *(PMC* const *)(src_base + ((const 
opcode_t*)src)[i]);
@@ -528,9 +538,10 @@
 pass_mixed(PARROT_INTERP, ARGIN(const PMC *sig), ARGIN(const char *src_base),
         ARGIN(void * const *src), ARGOUT(char *dest_base), ARGIN(void * const 
*dest))
 {
-    int n = SIG_ELEMS(sig);
     int i;
     INTVAL *bitp;
+    ASSERT_ARGS(pass_mixed);
+    int n = SIG_ELEMS(sig);
 
     ASSERT_SIG_PMC(sig);
     bitp = SIG_ARRAY(sig);
@@ -616,6 +627,7 @@
 {
     int i, n, t0;
 
+    ASSERT_ARGS(parrot_pic_check_sig);
     ASSERT_SIG_PMC(sig1);
     ASSERT_SIG_PMC(sig2);
 
@@ -680,6 +692,7 @@
 static int
 is_pic_param(PARROT_INTERP, ARGIN(void **pc), ARGOUT(Parrot_MIC *mic), 
opcode_t op)
 {
+    ASSERT_ARGS(is_pic_param);
     PMC                           *sig2;
     Parrot_Context                *caller_ctx;
     opcode_t                      *args;
@@ -781,6 +794,7 @@
      * pc is at set_args
      */
 
+    ASSERT_ARGS(is_pic_func);
     PMC *sub, *sig_results;
     opcode_t *op, n;
     int flags;
@@ -839,6 +853,7 @@
 void
 parrot_PIC_prederef(PARROT_INTERP, opcode_t op, ARGOUT(void **pc_pred), int 
core)
 {
+    ASSERT_ARGS(parrot_PIC_prederef);
     op_func_t * const prederef_op_func = interp->op_lib->op_func_table;
     opcode_t  * const cur_opcode       = (opcode_t *)pc_pred;
     Parrot_MIC       *mic              = NULL;
@@ -900,6 +915,7 @@
 static void
 parrot_pic_move(PARROT_INTERP, ARGMOD(Parrot_MIC *mic))
 {
+    ASSERT_ARGS(parrot_pic_move);
     /* MIC slot is empty - use it */
     if (!mic->lru.u.type)
         return;

Reply via email to