cvsuser     03/12/03 06:43:17

  Modified:    classes  parrotio.pmc
               config/gen core_pmcs.pl
               ops      core.ops var.ops
               src      interpreter.c pmc.c
  Log:
  more usage of keyed_str vtables
  
  Revision  Changes    Path
  1.14      +5 -6      parrot/classes/parrotio.pmc
  
  Index: parrotio.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/parrotio.pmc,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -r1.13 -r1.14
  --- parrotio.pmc      5 Oct 2003 17:42:09 -0000       1.13
  +++ parrotio.pmc      3 Dec 2003 14:43:11 -0000       1.14
  @@ -1,7 +1,7 @@
   /* ParrotIO.pmc
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: parrotio.pmc,v 1.13 2003/10/05 17:42:09 leo Exp $
  + *     $Id: parrotio.pmc,v 1.14 2003/12/03 14:43:11 leo Exp $
    *  Overview:
    *     These are the vtable functions for Parrot IO
    *  Data Structure and Algorithms:
  @@ -26,11 +26,10 @@
       VTABLE_set_string_keyed(interpreter, method, func,
            string_make(interpreter, proto, strlen(proto),
                NULL, PObj_constant_FLAG|PObj_external_FLAG, NULL));
  -    VTABLE_set_pmc_keyed(interpreter, method_table,
  -         key_new_string(interpreter,
  +    VTABLE_set_pmc_keyed_str(interpreter, method_table,
                string_make(interpreter, name,
                    strlen(name), NULL,
  -                 PObj_constant_FLAG|PObj_external_FLAG, NULL)),
  +             PObj_constant_FLAG|PObj_external_FLAG, NULL),
            method);
   }
   
  
  
  
  1.12      +2 -3      parrot/config/gen/core_pmcs.pl
  
  Index: core_pmcs.pl
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/core_pmcs.pl,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -r1.11 -r1.12
  --- core_pmcs.pl      23 Oct 2003 19:54:07 -0000      1.11
  +++ core_pmcs.pl      3 Dec 2003 14:43:13 -0000       1.12
  @@ -78,9 +78,8 @@
   
   static void register_pmc(Interp *interp, PMC* registry, int pmc_id)
   {
  -    PMC* key;
  -    key = key_new_string(interp, Parrot_base_vtables[pmc_id]->whoami);
  -    VTABLE_set_integer_keyed(interp, registry, key, pmc_id);
  +    STRING* key = Parrot_base_vtables[pmc_id]->whoami;
  +    VTABLE_set_integer_keyed_str(interp, registry, key, pmc_id);
   }
   
   extern void Parrot_register_core_pmcs(Interp *interp, PMC* registry);
  
  
  
  1.339     +3 -4      parrot/ops/core.ops
  
  Index: core.ops
  ===================================================================
  RCS file: /cvs/public/parrot/ops/core.ops,v
  retrieving revision 1.338
  retrieving revision 1.339
  diff -u -w -r1.338 -r1.339
  --- core.ops  1 Nov 2003 16:33:26 -0000       1.338
  +++ core.ops  3 Dec 2003 14:43:15 -0000       1.339
  @@ -1052,16 +1052,15 @@
     goto NEXT();
   }
   
  -inline op compile(OUT PMC, in PMC, in STR) {
  +inline op compile(out PMC, in PMC, in STR) {
     $1 = $2->vtable->invoke(interpreter, $2, $3);
     goto NEXT();
   }
   
  -inline op compreg(OUT PMC, in STR) {
  -  PMC *key = key_new_string(interpreter, $2);
  +inline op compreg(out PMC, in STR) {
     PMC *compreg_hash = VTABLE_get_pmc_keyed_int(interpreter,
         interpreter->iglobals, IGLOBALS_COMPREG_HASH);
  -  $1 = VTABLE_get_pmc_keyed(interpreter, compreg_hash, key);
  +  $1 = VTABLE_get_pmc_keyed_str(interpreter, compreg_hash, $2);
     goto NEXT();
   }
   
  
  
  
  1.11      +6 -9      parrot/ops/var.ops
  
  Index: var.ops
  ===================================================================
  RCS file: /cvs/public/parrot/ops/var.ops,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -r1.10 -r1.11
  --- var.ops   24 Nov 2003 05:47:38 -0000      1.10
  +++ var.ops   3 Dec 2003 14:43:15 -0000       1.11
  @@ -235,9 +235,8 @@
   
   op store_global(in STR, in PMC) {
       /* XXX: All globals should go through an API */
  -    PMC * key = key_new_string(interpreter, $1);
       PMC * globals = interpreter->globals->stash_hash;
  -    globals->vtable->set_pmc_keyed(interpreter, globals, key, $2);
  +    VTABLE_set_pmc_keyed_str(interpreter, globals, $1, $2);
       goto NEXT();
   }
   
  @@ -252,18 +251,16 @@
   op find_global(out PMC, in STR) {
       /* XXX: All globals should go through an API */
       opcode_t * resume;
  -    PMC* key = key_new_string(interpreter, $2);
  +    PMC * globals = interpreter->globals->stash_hash;
       if (!$2)
           internal_exception(1, "Tried to get null global.");
       
       resume = expr NEXT();
  -    if (!VTABLE_exists_keyed(interpreter,
  -                       interpreter->globals->stash_hash, key)) 
  +    if (!VTABLE_exists_keyed_str(interpreter, globals, $2))
           real_exception(interpreter, resume, GLOBAL_NOT_FOUND,
                   "Global '%s' not found\n", string_to_cstring(interpreter, $2));
                          
  -    $1 = VTABLE_get_pmc_keyed(interpreter,
  -                             interpreter->globals->stash_hash, key);
  +    $1 = VTABLE_get_pmc_keyed_str(interpreter, globals, $2);
   
       restart ADDRESS(resume);
   }
  
  
  
  1.234     +3 -4      parrot/src/interpreter.c
  
  Index: interpreter.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/interpreter.c,v
  retrieving revision 1.233
  retrieving revision 1.234
  diff -u -w -r1.233 -r1.234
  --- interpreter.c     2 Dec 2003 10:04:49 -0000       1.233
  +++ interpreter.c     3 Dec 2003 14:43:17 -0000       1.234
  @@ -1,7 +1,7 @@
   /* interpreter.c
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: interpreter.c,v 1.233 2003/12/02 10:04:49 leo Exp $
  + *     $Id: interpreter.c,v 1.234 2003/12/03 14:43:17 leo Exp $
    *  Overview:
    *     The interpreter api handles running the operations
    *  Data Structure and Algorithms:
  @@ -1127,7 +1127,7 @@
   
   void Parrot_compreg(Parrot_Interp interpreter, STRING *type, PMC *func)
   {
  -    PMC* key, *hash, *nci;
  +    PMC *hash, *nci;
       PMC* iglobals = interpreter->iglobals;
       hash = VTABLE_get_pmc_keyed_int(interpreter, interpreter->iglobals,
               IGLOBALS_COMPREG_HASH);
  @@ -1138,8 +1138,7 @@
                   (INTVAL)IGLOBALS_COMPREG_HASH, hash);
       }
       nci = pmc_new(interpreter, enum_class_Compiler);
  -    key = key_new_string(interpreter, type);
  -    VTABLE_set_pmc_keyed(interpreter, hash, key, nci);
  +    VTABLE_set_pmc_keyed_str(interpreter, hash, type, nci);
       /* build native call interface fir the C sub in "func" */
       VTABLE_set_string_keyed(interpreter, nci, func,
               string_from_cstring(interpreter, "pIt", 0));
  
  
  
  1.58      +5 -9      parrot/src/pmc.c
  
  Index: pmc.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/pmc.c,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -w -r1.57 -r1.58
  --- pmc.c     2 Dec 2003 17:45:16 -0000       1.57
  +++ pmc.c     3 Dec 2003 14:43:17 -0000       1.58
  @@ -1,7 +1,7 @@
   /* pmc.c
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: pmc.c,v 1.57 2003/12/02 17:45:16 dan Exp $
  + *     $Id: pmc.c,v 1.58 2003/12/03 14:43:17 leo Exp $
    *  Overview:
    *     The base vtable calling functions.
    *  Data Structure and Algorithms:
  @@ -200,7 +200,6 @@
   {
       INTVAL type;
       PMC *classname_hash;
  -    PMC *key;
       /* If they're looking to register an existing class, return that
          class' type number */
       if ((type = pmc_type(interp, name)) > enum_type_undef) {
  @@ -223,8 +222,6 @@
   
       classname_hash = VTABLE_get_pmc_keyed_int(interp, interp->iglobals,
                                                 IGLOBALS_CLASSNAME_HASH);
  -    key = key_new_string(interp, name);
  -
       type = enum_class_max++;
       /* Have we overflowed the table? */
       if (enum_class_max > class_table_size - 1) {
  @@ -241,7 +238,7 @@
           class_table_size = new_max;
       }
       
  -    VTABLE_set_integer_keyed(interp, classname_hash, key, type);
  +    VTABLE_set_integer_keyed_str(interp, classname_hash, name, type);
   
       UNLOCK(class_count_mutex);
       return type;
  @@ -251,11 +248,10 @@
   pmc_type(Parrot_Interp interp, STRING *name)
   {
       INTVAL return_val;
  -    PMC * key = key_new_string(interp, name);
       PMC *classname_hash = VTABLE_get_pmc_keyed_int(interp,
                               interp->iglobals, IGLOBALS_CLASSNAME_HASH);
   
  -    return_val = VTABLE_get_integer_keyed(interp, classname_hash, key);
  +    return_val = VTABLE_get_integer_keyed_str(interp, classname_hash, name);
       if (return_val == enum_type_undef) {
        return_val = Parrot_get_datatype_enum(interp, name);
       }
  
  
  

Reply via email to