Author: infinoid
Date: Fri Jan  2 21:13:42 2009
New Revision: 34853

Modified:
   branches/assert_args/compilers/imcc/instructions.c
   branches/assert_args/compilers/imcc/optimizer.c
   branches/assert_args/compilers/imcc/parser_util.c
   branches/assert_args/compilers/imcc/pcc.c
   branches/assert_args/compilers/imcc/reg_alloc.c
   branches/assert_args/src/charset/ascii.c
   branches/assert_args/src/charset/binary.c
   branches/assert_args/src/charset/iso-8859-1.c
   branches/assert_args/src/charset/unicode.c
   branches/assert_args/src/encodings/fixed_8.c
   branches/assert_args/src/encodings/ucs2.c
   branches/assert_args/src/encodings/utf16.c
   branches/assert_args/src/encodings/utf8.c
   branches/assert_args/src/gc/register.c
   branches/assert_args/src/inter_call.c
   branches/assert_args/src/interpreter.c
   branches/assert_args/src/packfile.c
   branches/assert_args/src/stm/backend.c

Log:
[core] Put ASSERT_ARGS in the proper location for the remaining cases.

Modified: branches/assert_args/compilers/imcc/instructions.c
==============================================================================
--- branches/assert_args/compilers/imcc/instructions.c  (original)
+++ branches/assert_args/compilers/imcc/instructions.c  Fri Jan  2 21:13:42 2009
@@ -140,10 +140,10 @@
 void
 imcc_init_tables(PARROT_INTERP)
 {
+    ASSERT_ARGS(imcc_init_tables);
     const char *writes[] = {
         "cleari", "clearn", "clearp", "clears",
     };
-    ASSERT_ARGS(imcc_init_tables);
     /* init opnums */
     if (!w_special[0]) {
         size_t i;

Modified: branches/assert_args/compilers/imcc/optimizer.c
==============================================================================
--- branches/assert_args/compilers/imcc/optimizer.c     (original)
+++ branches/assert_args/compilers/imcc/optimizer.c     Fri Jan  2 21:13:42 2009
@@ -409,6 +409,7 @@
 const char *
 get_neg_op(ARGIN(const char *op), ARGOUT(int *n))
 {
+    ASSERT_ARGS(get_neg_op);
     static const struct br_pairs {
         const char * const op;
         const char * const nop;
@@ -420,7 +421,6 @@
         { "ge", "lt", 3 },
     };
     size_t i;
-    ASSERT_ARGS(get_neg_op);
     for (i = 0; i < N_ELEMENTS(br_pairs); i++) {
         *n = br_pairs[i].n;
         if (STREQ(op, br_pairs[i].op))
@@ -873,13 +873,13 @@
 IMCC_subst_constants_umix(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGIN(const 
char *name),
         ARGMOD(SymReg **r), int n)
 {
+    ASSERT_ARGS(IMCC_subst_constants_umix);
     Instruction *tmp;
     const char * const ops[] = {
         "abs", "add", "div", "mul", "sub", "fdiv"
     };
     size_t i;
     char b[128];
-    ASSERT_ARGS(IMCC_subst_constants_umix);
 
     tmp = NULL;
     for (i = 0; i < N_ELEMENTS(ops); i++) {
@@ -996,6 +996,7 @@
 IMCC_subst_constants(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGIN(const char 
*name),
         ARGMOD(SymReg **r), int n, ARGOUT(int *ok))
 {
+    ASSERT_ARGS(IMCC_subst_constants);
     Instruction *tmp;
     const char * const ops[] = {
         "add", "sub", "mul", "div", "fdiv", "pow",
@@ -1025,7 +1026,6 @@
     char op[20];
     const char *debug_fmt = NULL;   /* gcc -O uninit warn */
     int found, branched;
-    ASSERT_ARGS(IMCC_subst_constants);
 
     /* construct a FLOATVAL_FMT with needed precision */
 #if NUMVAL_SIZE == 8

Modified: branches/assert_args/compilers/imcc/parser_util.c
==============================================================================
--- branches/assert_args/compilers/imcc/parser_util.c   (original)
+++ branches/assert_args/compilers/imcc/parser_util.c   Fri Jan  2 21:13:42 2009
@@ -601,6 +601,7 @@
 imcc_compile(PARROT_INTERP, ARGIN(const char *s), int pasm_file,
         ARGOUT(STRING **error_message))
 {
+    ASSERT_ARGS(imcc_compile);
     /* imcc always compiles to interp->code
      * save old cs, make new
      */
@@ -613,7 +614,6 @@
     Parrot_Context        *ignored;
     INTVAL regs_used[4] = {3, 3, 3, 3};
     INTVAL eval_number;
-    ASSERT_ARGS(imcc_compile);
 
     do_yylex_init(interp, &yyscanner);
 
@@ -881,6 +881,7 @@
 imcc_compile_file(PARROT_INTERP, ARGIN(const char *fullname),
         ARGOUT(STRING **error_message))
 {
+    ASSERT_ARGS(imcc_compile_file);
     PackFile_ByteCode  * const cs_save  = interp->code;
     PackFile_ByteCode         *cs       = NULL;
     struct _imc_info_t        *imc_info = NULL;
@@ -892,7 +893,6 @@
     /* need at least 3 regs for compilation of constant math e.g.
      * add_i_ic_ic - see also IMCC_subst_constants() */
     INTVAL regs_used[4] = {3, 3, 3, 3};
-    ASSERT_ARGS(imcc_compile_file);
 
     if (IMCC_INFO(interp)->last_unit) {
         /* a reentrant compile */
@@ -1202,6 +1202,7 @@
 static const char *
 try_rev_cmp(ARGIN(const char *name), ARGMOD(SymReg **r))
 {
+    ASSERT_ARGS(try_rev_cmp);
     static struct br_pairs {
         ARGIN(const char * const op);
         ARGIN(const char * const nop);
@@ -1214,7 +1215,6 @@
     };
 
     unsigned int i;
-    ASSERT_ARGS(try_rev_cmp);
 
     for (i = 0; i < N_ELEMENTS(br_pairs); i++) {
         if (STREQ(name, br_pairs[i].op)) {

Modified: branches/assert_args/compilers/imcc/pcc.c
==============================================================================
--- branches/assert_args/compilers/imcc/pcc.c   (original)
+++ branches/assert_args/compilers/imcc/pcc.c   Fri Jan  2 21:13:42 2009
@@ -240,6 +240,7 @@
         ARGIN(const char *op_name), int n,
         ARGIN_NULLOK(SymReg * const *args), ARGIN_NULLOK(const int *arg_flags))
 {
+    ASSERT_ARGS(pcc_get_args);
     /* Notes:
      * The created string is in the format "\"(0x0010,0x0220,0x0010)\"".
      * flags always has exactly 4 hex digits.
@@ -272,7 +273,6 @@
     char         *buf     = n < PCC_GET_ARGS_LIMIT ?
         bufcache :
         mem_allocate_n_typed(bufsize, char);
-    ASSERT_ARGS(pcc_get_args);
 
     memcpy(buf, pref, lenpref);
     bufpos += lenpref;

Modified: branches/assert_args/compilers/imcc/reg_alloc.c
==============================================================================
--- branches/assert_args/compilers/imcc/reg_alloc.c     (original)
+++ branches/assert_args/compilers/imcc/reg_alloc.c     Fri Jan  2 21:13:42 2009
@@ -560,13 +560,13 @@
 static void
 print_stat(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
 {
+    ASSERT_ARGS(print_stat);
     int sets[4] = {0, 0, 0, 0};
 
     const char * const function =
         unit->instructions->symreg_count
             ? unit->instructions->symregs[0]->name
             : "(not a function)";
-    ASSERT_ARGS(print_stat);
 
     make_stat(unit, sets, unit->n_regs_used);
     IMCC_info(interp, 1,
@@ -1179,11 +1179,11 @@
 static void
 allocate_uniq(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int usage)
 {
+    ASSERT_ARGS(allocate_uniq);
     SymHash     *hsh     = &unit->hash;
     Set         *sets[4] = { NULL, NULL, NULL, NULL };
     SymReg      *r;
     unsigned int i;
-    ASSERT_ARGS(allocate_uniq);
 
     for (i = 0; i < hsh->size; i++) {
         for (r = hsh->data[i]; r; r = r->next) {

Modified: branches/assert_args/src/charset/ascii.c
==============================================================================
--- branches/assert_args/src/charset/ascii.c    (original)
+++ branches/assert_args/src/charset/ascii.c    Fri Jan  2 21:13:42 2009
@@ -855,6 +855,7 @@
 const CHARSET *
 Parrot_charset_ascii_init(PARROT_INTERP)
 {
+    ASSERT_ARGS(Parrot_charset_ascii_init);
     CHARSET * const return_set = Parrot_new_charset(interp);
     static const CHARSET base_set = {
         "ascii",
@@ -881,7 +882,6 @@
         ascii_compute_hash,
         NULL
     };
-    ASSERT_ARGS(Parrot_charset_ascii_init);
 
     STRUCT_COPY_FROM_STRUCT(return_set, base_set);
     return_set->preferred_encoding = Parrot_fixed_8_encoding_ptr;

Modified: branches/assert_args/src/charset/binary.c
==============================================================================
--- branches/assert_args/src/charset/binary.c   (original)
+++ branches/assert_args/src/charset/binary.c   Fri Jan  2 21:13:42 2009
@@ -505,6 +505,7 @@
 const CHARSET *
 Parrot_charset_binary_init(PARROT_INTERP)
 {
+    ASSERT_ARGS(Parrot_charset_binary_init);
     CHARSET * const return_set = Parrot_new_charset(interp);
     static const CHARSET base_set = {
         "binary",
@@ -531,7 +532,6 @@
         ascii_compute_hash,
         NULL
     };
-    ASSERT_ARGS(Parrot_charset_binary_init);
 
     STRUCT_COPY_FROM_STRUCT(return_set, base_set);
     return_set->preferred_encoding = Parrot_fixed_8_encoding_ptr;

Modified: branches/assert_args/src/charset/iso-8859-1.c
==============================================================================
--- branches/assert_args/src/charset/iso-8859-1.c       (original)
+++ branches/assert_args/src/charset/iso-8859-1.c       Fri Jan  2 21:13:42 2009
@@ -679,6 +679,7 @@
 const CHARSET *
 Parrot_charset_iso_8859_1_init(PARROT_INTERP)
 {
+    ASSERT_ARGS(Parrot_charset_iso_8859_1_init);
     CHARSET * const return_set = Parrot_new_charset(interp);
     static const CHARSET base_set = {
         "iso-8859-1",
@@ -705,7 +706,6 @@
         ascii_compute_hash,
         NULL
     };
-    ASSERT_ARGS(Parrot_charset_iso_8859_1_init);
 
     STRUCT_COPY_FROM_STRUCT(return_set, base_set);
     return_set->preferred_encoding = Parrot_fixed_8_encoding_ptr;

Modified: branches/assert_args/src/charset/unicode.c
==============================================================================
--- branches/assert_args/src/charset/unicode.c  (original)
+++ branches/assert_args/src/charset/unicode.c  Fri Jan  2 21:13:42 2009
@@ -1070,6 +1070,7 @@
 const CHARSET *
 Parrot_charset_unicode_init(PARROT_INTERP)
 {
+    ASSERT_ARGS(Parrot_charset_unicode_init);
     CHARSET * const      return_set = Parrot_new_charset(interp);
     static const CHARSET base_set   = {
         "unicode",
@@ -1096,7 +1097,6 @@
         compute_hash,
         NULL
     };
-    ASSERT_ARGS(Parrot_charset_unicode_init);
 
     STRUCT_COPY_FROM_STRUCT(return_set, base_set);
 

Modified: branches/assert_args/src/encodings/fixed_8.c
==============================================================================
--- branches/assert_args/src/encodings/fixed_8.c        (original)
+++ branches/assert_args/src/encodings/fixed_8.c        Fri Jan  2 21:13:42 2009
@@ -620,6 +620,7 @@
 ENCODING *
 Parrot_encoding_fixed_8_init(PARROT_INTERP)
 {
+    ASSERT_ARGS(Parrot_encoding_fixed_8_init);
     ENCODING * const return_encoding = Parrot_new_encoding(interp);
 
     ENCODING base_encoding = {
@@ -642,7 +643,6 @@
         iter_init
 
     };
-    ASSERT_ARGS(Parrot_encoding_fixed_8_init);
     STRUCT_COPY_FROM_STRUCT(return_encoding, base_encoding);
     Parrot_register_encoding(interp, "fixed_8", return_encoding);
     return return_encoding;

Modified: branches/assert_args/src/encodings/ucs2.c
==============================================================================
--- branches/assert_args/src/encodings/ucs2.c   (original)
+++ branches/assert_args/src/encodings/ucs2.c   Fri Jan  2 21:13:42 2009
@@ -626,6 +626,7 @@
 ENCODING *
 Parrot_encoding_ucs2_init(PARROT_INTERP)
 {
+    ASSERT_ARGS(Parrot_encoding_ucs2_init);
     ENCODING * const return_encoding = Parrot_new_encoding(interp);
 
     static const ENCODING base_encoding = {
@@ -647,7 +648,6 @@
         bytes,
         iter_init
     };
-    ASSERT_ARGS(Parrot_encoding_ucs2_init);
     STRUCT_COPY_FROM_STRUCT(return_encoding, base_encoding);
     Parrot_register_encoding(interp, "ucs2", return_encoding);
     return return_encoding;

Modified: branches/assert_args/src/encodings/utf16.c
==============================================================================
--- branches/assert_args/src/encodings/utf16.c  (original)
+++ branches/assert_args/src/encodings/utf16.c  Fri Jan  2 21:13:42 2009
@@ -773,6 +773,7 @@
 ENCODING *
 Parrot_encoding_utf16_init(PARROT_INTERP)
 {
+    ASSERT_ARGS(Parrot_encoding_utf16_init);
     ENCODING * const return_encoding = Parrot_new_encoding(interp);
 
     static const ENCODING base_encoding = {
@@ -794,7 +795,6 @@
         bytes,
         iter_init
     };
-    ASSERT_ARGS(Parrot_encoding_utf16_init);
     STRUCT_COPY_FROM_STRUCT(return_encoding, base_encoding);
     Parrot_register_encoding(interp, "utf16", return_encoding);
     return return_encoding;

Modified: branches/assert_args/src/encodings/utf8.c
==============================================================================
--- branches/assert_args/src/encodings/utf8.c   (original)
+++ branches/assert_args/src/encodings/utf8.c   Fri Jan  2 21:13:42 2009
@@ -984,6 +984,7 @@
 ENCODING *
 Parrot_encoding_utf8_init(PARROT_INTERP)
 {
+    ASSERT_ARGS(Parrot_encoding_utf8_init);
     ENCODING * const return_encoding = Parrot_new_encoding(interp);
 
     static const ENCODING base_encoding = {
@@ -1005,7 +1006,6 @@
         bytes,
         iter_init
     };
-    ASSERT_ARGS(Parrot_encoding_utf8_init);
     STRUCT_COPY_FROM_STRUCT(return_encoding, base_encoding);
     Parrot_register_encoding(interp, "utf8", return_encoding);
     return return_encoding;

Modified: branches/assert_args/src/gc/register.c
==============================================================================
--- branches/assert_args/src/gc/register.c      (original)
+++ branches/assert_args/src/gc/register.c      Fri Jan  2 21:13:42 2009
@@ -196,9 +196,9 @@
 void
 create_initial_context(PARROT_INTERP)
 {
+    ASSERT_ARGS(create_initial_context);
     static INTVAL   num_regs[] = {32, 32, 32, 32};
     Parrot_Context *ignored;
-    ASSERT_ARGS(create_initial_context);
 
     /* Create some initial free_list slots. */
 

Modified: branches/assert_args/src/inter_call.c
==============================================================================
--- branches/assert_args/src/inter_call.c       (original)
+++ branches/assert_args/src/inter_call.c       Fri Jan  2 21:13:42 2009
@@ -2079,6 +2079,7 @@
 count_signature_elements(PARROT_INTERP, ARGIN(const char *signature),
     ARGMOD(PMC *args_sig), ARGMOD(PMC *results_sig), int flag)
 {
+    ASSERT_ARGS(count_signature_elements);
     const char  *x;
     unsigned int seen_arrow  = 0;
 
@@ -2091,7 +2092,6 @@
 
     /* # of args, # of results */
     int arg_ret_cnt[2]       = { 0, 0 };
-    ASSERT_ARGS(count_signature_elements);
 
     /* Increment these values if we are not calling from a CallSignature
        PMC */
@@ -2552,6 +2552,7 @@
 Parrot_PCCINVOKE(PARROT_INTERP, ARGIN(PMC* pmc), ARGMOD(STRING *method_name),
         ARGIN(const char *signature), ...)
 {
+    ASSERT_ARGS(Parrot_PCCINVOKE);
 #define PCC_ARG_MAX 1024
     /* variables from PCCINVOKE impl in PCCMETHOD.pm */
     /* args INSP, returns INSP */
@@ -2588,7 +2589,6 @@
     int         cur   =  0;
 
     va_list list;
-    ASSERT_ARGS(Parrot_PCCINVOKE);
     va_start(list, signature);
 
     indexes[0] = arg_indexes;
@@ -2733,6 +2733,7 @@
 Parrot_pcc_invoke_sub_from_sig_object(PARROT_INTERP, ARGIN(PMC *sub_obj),
         ARGIN(PMC *sig_obj))
 {
+    ASSERT_ARGS(Parrot_pcc_invoke_sub_from_sig_object);
 #define PCC_ARG_MAX 1024
     /* variables from PCCINVOKE impl in PCCMETHOD.pm */
     /* args INSP, returns INSP */
@@ -2765,7 +2766,6 @@
     PMC *sigs[2];
 
     const char *ret_x  = NULL;
-    ASSERT_ARGS(Parrot_pcc_invoke_sub_from_sig_object);
 
     indexes[0] = arg_indexes;
     indexes[1] = result_indexes;

Modified: branches/assert_args/src/interpreter.c
==============================================================================
--- branches/assert_args/src/interpreter.c      (original)
+++ branches/assert_args/src/interpreter.c      Fri Jan  2 21:13:42 2009
@@ -730,12 +730,12 @@
 static opcode_t *
 runops_jit(PARROT_INTERP, ARGIN(opcode_t *pc))
 {
+    ASSERT_ARGS(runops_jit);
 #if JIT_CAPABLE
 #  ifdef PARROT_EXEC_OS_AIX
     /* AIX calling convention requires that function-call-by-ptr be made
        through the following struct: */
     struct ptrgl_t { jit_f functPtr; void *toc; void *env; } ptrgl_t;
-    ASSERT_ARGS(runops_jit);
 
     ptrgl_t.functPtr = (jit_f) D2FPTR(init_jit(interp, pc));
     ptrgl_t.env      = NULL;

Modified: branches/assert_args/src/packfile.c
==============================================================================
--- branches/assert_args/src/packfile.c (original)
+++ branches/assert_args/src/packfile.c Fri Jan  2 21:13:42 2009
@@ -1468,6 +1468,7 @@
 static void
 pf_register_standard_funcs(PARROT_INTERP, ARGMOD(PackFile *pf))
 {
+    ASSERT_ARGS(pf_register_standard_funcs);
     PackFile_funcs dirf = {
         directory_new,
         directory_destroy,
@@ -1521,7 +1522,6 @@
         pf_debug_unpack,
         pf_debug_dump
     };
-    ASSERT_ARGS(pf_register_standard_funcs);
     PackFile_funcs_register(interp, pf, PF_DIR_SEG,     dirf);
     PackFile_funcs_register(interp, pf, PF_UNKNOWN_SEG, defaultf);
     PackFile_funcs_register(interp, pf, PF_FIXUP_SEG,   fixupf);

Modified: branches/assert_args/src/stm/backend.c
==============================================================================
--- branches/assert_args/src/stm/backend.c      (original)
+++ branches/assert_args/src/stm/backend.c      Fri Jan  2 21:13:42 2009
@@ -797,11 +797,12 @@
 */
 
 static int
-do_real_commit(PARROT_INTERP, ARGIN(STM_tx_log *log)) {
+do_real_commit(PARROT_INTERP, ARGIN(STM_tx_log *log))
+{
+    ASSERT_ARGS(do_real_commit);
     int i;
     int successp;
     STM_tx_log_sub *inner;
-    ASSERT_ARGS(do_real_commit);
 
     PARROT_ASSERT(log->depth == 1);
 

Reply via email to