cvsuser     05/01/31 04:27:17

  Modified:    classes  closure.pmc continuation.pmc coroutine.pmc
                        exception_handler.pmc nci.pmc retcontinuation.pmc
                        sub.pmc
               include/parrot sub.h
               src      sub.c
  Log:
  swap pmc_val and struct_val in callable PMCs
  * PMC_sub and friends are using now PMC_struct_val
  * PMC_pmc_val is now unused in all callables
  * move the continuation address to PMC_cont()->address
  
  Revision  Changes    Path
  1.22      +2 -2      parrot/classes/closure.pmc
  
  Index: closure.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/closure.pmc,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- closure.pmc       12 Jan 2005 11:42:06 -0000      1.21
  +++ closure.pmc       31 Jan 2005 12:27:14 -0000      1.22
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: closure.pmc,v 1.21 2005/01/12 11:42:06 leo Exp $
  +$Id: closure.pmc,v 1.22 2005/01/31 12:27:14 leo Exp $
   
   =head1 NAME
   
  @@ -36,7 +36,7 @@
   
       void init () {
           PMC_sub(SELF) = new_closure(INTERP);
  -        PMC_struct_val(SELF) = NULL;
  +        PMC_pmc_val(SELF) = NULL;
           PObj_custom_mark_destroy_SETALL(SELF);
   #if 0
           if (Interp_flags_TEST(INTERP, PARROT_DEBUG_FLAG))
  
  
  
  1.41      +10 -10    parrot/classes/continuation.pmc
  
  Index: continuation.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/continuation.pmc,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- continuation.pmc  12 Jan 2005 11:42:06 -0000      1.40
  +++ continuation.pmc  31 Jan 2005 12:27:14 -0000      1.41
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: continuation.pmc,v 1.40 2005/01/12 11:42:06 leo Exp $
  +$Id: continuation.pmc,v 1.41 2005/01/31 12:27:14 leo Exp $
   
   =head1 NAME
   
  @@ -58,7 +58,7 @@
   
       void init () {
           PMC_cont(SELF) = new_continuation(INTERP);
  -        PMC_struct_val(SELF) = NULL;
  +        PMC_pmc_val(SELF) = NULL;
           PObj_custom_mark_destroy_SETALL(SELF);
           /*
            * Whenever we create a continuation, all return continuations
  @@ -116,7 +116,7 @@
           sub = PMC_cont(ret) = mem_sys_allocate(sizeof(struct Parrot_cont));
           memcpy(sub, cc_self, sizeof(struct Parrot_cont));
   
  -        PMC_struct_val(ret) = PMC_struct_val(SELF);
  +        PMC_pmc_val(ret) = PMC_pmc_val(SELF);
           return ret;
       }
   
  @@ -134,7 +134,7 @@
           struct Parrot_cont *cc_src  = PMC_cont(src);
   
           memcpy(cc_self, cc_src, sizeof(struct Parrot_cont));
  -        PMC_struct_val(SELF) = PMC_struct_val(src);
  +        PMC_pmc_val(SELF) = PMC_pmc_val(src);
       }
   /*
   
  @@ -148,7 +148,7 @@
   
       void set_pointer (void* value) {
           PObj_get_FLAGS(SELF) |= PObj_private1_FLAG;
  -        PMC_struct_val(SELF) = value;
  +        PMC_cont(SELF)->address = value;
       }
   
   /*
  @@ -162,7 +162,7 @@
   */
   
       void* get_pointer () {
  -        return PMC_struct_val(SELF);
  +        return PMC_cont(SELF)->address;
       }
   /*
   
  @@ -177,11 +177,11 @@
   */
   
       INTVAL defined () {
  -        return PMC_struct_val(SELF) != NULL;
  +        return PMC_cont(SELF)->address != NULL;
       }
   
       INTVAL get_bool () {
  -        return PMC_struct_val(SELF) != NULL;
  +        return PMC_cont(SELF)->address != NULL;
       }
   
   /*
  @@ -208,7 +208,7 @@
                   sub && PMC_sub(sub) && PMC_sub(sub)->name ?
                   PMC_sub(sub)->name : unk);
           }
  -        if (PMC_struct_val(SELF))
  +        if (cc->address)
               copy_regs(INTERP, caller_regs);
           else if (!cc->seg) {
               /* no address and no segment */
  @@ -217,7 +217,7 @@
           if (INTERP->code->cur_cs != cc->seg) {
               Parrot_switch_to_cs(INTERP, cc->seg, 1);
           }
  -        return PMC_struct_val(SELF);
  +        return cc->address;
       }
   
   /*
  
  
  
  1.49      +2 -2      parrot/classes/coroutine.pmc
  
  Index: coroutine.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/coroutine.pmc,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- coroutine.pmc     12 Jan 2005 11:42:06 -0000      1.48
  +++ coroutine.pmc     31 Jan 2005 12:27:14 -0000      1.49
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: coroutine.pmc,v 1.48 2005/01/12 11:42:06 leo Exp $
  +$Id: coroutine.pmc,v 1.49 2005/01/31 12:27:14 leo Exp $
   
   =head1 NAME
   
  @@ -76,7 +76,7 @@
   
       void init () {
           PMC_coro(SELF) = new_coroutine(INTERP);
  -        PMC_struct_val(SELF) = NULL;
  +        PMC_pmc_val(SELF) = NULL;
           PObj_custom_mark_destroy_SETALL(SELF);
       }
   
  
  
  
  1.13      +2 -2      parrot/classes/exception_handler.pmc
  
  Index: exception_handler.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/exception_handler.pmc,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- exception_handler.pmc     7 Nov 2004 15:29:58 -0000       1.12
  +++ exception_handler.pmc     31 Jan 2005 12:27:14 -0000      1.13
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: exception_handler.pmc,v 1.12 2004/11/07 15:29:58 leo Exp $
  +$Id: exception_handler.pmc,v 1.13 2005/01/31 12:27:14 leo Exp $
   
   =head1 NAME
   
  @@ -37,7 +37,7 @@
   
       void init() {
           PMC_cont(SELF) = new_continuation(INTERP);
  -        PMC_struct_val(SELF) = NULL;
  +        PMC_pmc_val(SELF) = NULL;
           /*
            * an exception handler has no separate context, its
            * only a snapshot of an "earlier" context, which is
  
  
  
  1.31      +3 -1      parrot/classes/nci.pmc
  
  Index: nci.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/nci.pmc,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- nci.pmc   21 Dec 2004 17:37:39 -0000      1.30
  +++ nci.pmc   31 Jan 2005 12:27:14 -0000      1.31
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: nci.pmc,v 1.30 2004/12/21 17:37:39 rubys Exp $
  +$Id: nci.pmc,v 1.31 2005/01/31 12:27:14 leo Exp $
   
   =head1 NAME
   
  @@ -39,6 +39,7 @@
   
       void init() {
           PMC_struct_val(SELF) = NULL;
  +        PMC_pmc_val(SELF) = NULL;
       }
   
   /*
  @@ -85,6 +86,7 @@
       PMC* clone () {
           PMC* ret = pmc_new_noinit(INTERP, SELF->vtable->base_type);
           PMC_struct_val(ret) = PMC_struct_val(SELF);
  +        PMC_pmc_val(ret) = NULL;
           /* FIXME if data is malloced (JIT/i386!) then we need
            * the length of data here, to memcpy it
            * ManagedStruct or Buffer?
  
  
  
  1.26      +2 -2      parrot/classes/retcontinuation.pmc
  
  Index: retcontinuation.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/retcontinuation.pmc,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- retcontinuation.pmc       12 Jan 2005 11:42:06 -0000      1.25
  +++ retcontinuation.pmc       31 Jan 2005 12:27:14 -0000      1.26
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: retcontinuation.pmc,v 1.25 2005/01/12 11:42:06 leo Exp $
  +$Id: retcontinuation.pmc,v 1.26 2005/01/31 12:27:14 leo Exp $
   
   =head1 NAME
   
  @@ -39,7 +39,7 @@
   
       void init () {
           PMC_cont(SELF) = new_continuation(INTERP);
  -        PMC_struct_val(SELF) = NULL;
  +        PMC_pmc_val(SELF) = NULL;
           PObj_custom_mark_destroy_SETALL(SELF);
       }
   
  
  
  
  1.72      +5 -5      parrot/classes/sub.pmc
  
  Index: sub.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/sub.pmc,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- sub.pmc   12 Jan 2005 11:42:06 -0000      1.71
  +++ sub.pmc   31 Jan 2005 12:27:14 -0000      1.72
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: sub.pmc,v 1.71 2005/01/12 11:42:06 leo Exp $
  +$Id: sub.pmc,v 1.72 2005/01/31 12:27:14 leo Exp $
   
   =head1 NAME
   
  @@ -109,12 +109,12 @@
        * see also the enum in include/parrot/sub.h
        *
        * Data used:
  -     *   PMC_struct_val ... unused
  -     *   PMC_pmc_val    ... Parrot_Sub structure
  +     *   PMC_struct_val ... Parrot_Sub structure
  +     *   PMC_pmc_val    ... unused / bound object in Bound_Meth PMC
        */
       void init () {
           PMC_sub(SELF) = new_sub(INTERP);
  -        PMC_struct_val(SELF) = NULL;
  +        PMC_pmc_val(SELF) = NULL;
           PObj_active_destroy_SET(SELF);
   #if 0
           if (Interp_flags_TEST(INTERP, PARROT_DEBUG_FLAG))
  @@ -351,7 +351,7 @@
           sub = PMC_sub(ret) = mem_sys_allocate(sizeof(struct Parrot_sub));
           memcpy(sub, PMC_sub(SELF), sizeof(struct Parrot_sub));
           sub->name = string_copy(INTERP, sub->name);
  -        PMC_struct_val(ret) = NULL;
  +        PMC_pmc_val(ret) = NULL;
           return ret;
       }
   
  
  
  
  1.42      +4 -4      parrot/include/parrot/sub.h
  
  Index: sub.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/sub.h,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- sub.h     25 Nov 2004 09:27:55 -0000      1.41
  +++ sub.h     31 Jan 2005 12:27:16 -0000      1.42
  @@ -1,7 +1,7 @@
   /* sub.h
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: sub.h,v 1.41 2004/11/25 09:27:55 leo Exp $
  + *     $Id: sub.h,v 1.42 2005/01/31 12:27:16 leo Exp $
    *  Overview:
    *  Data Structure and Algorithms:
    *     Subroutine, coroutine, closure and continuation structures
  @@ -56,7 +56,7 @@
       struct Stack_Chunk *pad_stack;      /* only for closure */
   } * parrot_sub_t;
   
  -#define PMC_sub(pmc) LVALUE_CAST(parrot_sub_t, PMC_pmc_val(pmc))
  +#define PMC_sub(pmc) LVALUE_CAST(parrot_sub_t, PMC_struct_val(pmc))
   
   /* the first entries must match Parrot_sub, so we can cast
    * these two to the other type
  @@ -75,7 +75,7 @@
       struct PackFile_ByteCode *caller_seg;      /* bytecode segment */
   } * parrot_coro_t;
   
  -#define PMC_coro(pmc) LVALUE_CAST(parrot_coro_t, PMC_pmc_val(pmc))
  +#define PMC_coro(pmc) LVALUE_CAST(parrot_coro_t, PMC_struct_val(pmc))
   
   typedef struct Parrot_cont {
       struct PackFile_ByteCode *seg;      /* bytecode segment */
  @@ -83,7 +83,7 @@
       struct Parrot_Context ctx;  /* copy of interpreter context */
   } * parrot_cont_t;
   
  -#define PMC_cont(pmc) LVALUE_CAST(parrot_cont_t, PMC_pmc_val(pmc))
  +#define PMC_cont(pmc) LVALUE_CAST(parrot_cont_t, PMC_struct_val(pmc))
   
   struct Parrot_sub * new_sub(Interp * interp);
   struct Parrot_sub * new_closure(Interp * interp);
  
  
  
  1.87      +3 -2      parrot/src/sub.c
  
  Index: sub.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/sub.c,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- sub.c     17 Jan 2005 14:56:46 -0000      1.86
  +++ sub.c     31 Jan 2005 12:27:17 -0000      1.87
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: sub.c,v 1.86 2005/01/17 14:56:46 leo Exp $
  +$Id: sub.c,v 1.87 2005/01/31 12:27:17 leo Exp $
   
   =head1 NAME
   
  @@ -281,6 +281,7 @@
       struct Parrot_cont *cc = mem_sys_allocate(sizeof(struct Parrot_cont));
       save_context(interp, &cc->ctx);
       cc->seg = interp->code->cur_cs;
  +    cc->address = NULL;
       return cc;
   }
   
  @@ -356,7 +357,7 @@
    * Return continuation PMCs are re-used.
    * In the cache they are chained together by this pointer:
    */
  -#  define PREV_RETC(p) PMC_struct_val(p)
  +#  define PREV_RETC(p) PMC_pmc_val(p)
   
   /*
   
  
  
  

Reply via email to