cvsuser     04/08/23 13:24:37

  Modified:    build_tools build_nativecall.pl
  Log:
  Due to an amazing amount of ineffable evil in hash.c, build_nativecall
  got redone to use a PerlHash and PMCs instead of the lower-level access
  system it had, since that wasn't working
  
  Revision  Changes    Path
  1.51      +12 -15    parrot/build_tools/build_nativecall.pl
  
  Index: build_nativecall.pl
  ===================================================================
  RCS file: /cvs/public/parrot/build_tools/build_nativecall.pl,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -w -r1.50 -r1.51
  --- build_nativecall.pl       14 Aug 2004 08:30:08 -0000      1.50
  +++ build_nativecall.pl       23 Aug 2004 20:24:37 -0000      1.51
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: build_nativecall.pl,v 1.50 2004/08/14 08:30:08 leo Exp $
  +# $Id: build_nativecall.pl,v 1.51 2004/08/23 20:24:37 dan Exp $
   
   =head1 NAME
   
  @@ -165,7 +165,7 @@
   /* nci.c
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: build_nativecall.pl,v 1.50 2004/08/14 08:30:08 leo Exp $
  + *     $Id: build_nativecall.pl,v 1.51 2004/08/23 20:24:37 dan Exp $
    *  Overview:
    *     Native Call Interface routines. The code needed to build a
    *     parrot to C call frame is in here
  @@ -248,8 +248,9 @@
   {
       char       *c;
       STRING     *ns, *message;
  -    HashBucket *b;
  +    PMC        *b;
       PMC        *iglobals;
  +    PMC        *temp_pmc;
   
       void       *result        = NULL;
       Hash       *known_frames  = NULL;
  @@ -282,29 +283,22 @@
           HashPointer = VTABLE_get_pmc_keyed_int(interpreter, iglobals,
               IGLOBALS_NCI_FUNCS);
   
  -    if (HashPointer)
  -        known_frames = PMC_struct_val(HashPointer);
  -
  -    if (known_frames == NULL)
  -    {
  -        new_cstring_hash( interpreter, &known_frames );
  +    if (!HashPointer) {
  +        HashPointer = pmc_new(interpreter, enum_class_PerlHash);
   
   $icky_global_bit
   
           if (iglobals)
           {
  -            HashPointer = pmc_new(interpreter, enum_class_Pointer);
               VTABLE_set_pmc_keyed_int(interpreter, iglobals, IGLOBALS_NCI_FUNCS,
                   HashPointer);
  -            PMC_struct_val(HashPointer) = known_frames;
           }
       }
   
  -    b = hash_get_bucket(interpreter, known_frames,
  -        string_to_cstring(interpreter, signature));
  +    b = VTABLE_get_pmc_keyed_str(interpreter, HashPointer, signature);
   
       if (b)
  -        return F2DPTR( b->value );
  +        return F2DPTR(PMC_data(b));
   
       /*
         These three lines have been added to aid debugging. I want to be able to
  @@ -481,7 +475,10 @@
       ( "$return", "pcf_${return}" ));
   
     push @icky_global_variable,
  -        qq|        hash_put( interpreter, known_frames, const_cast("$key"), $value 
);|;
  +        qq|        temp_pmc = pmc_new(interpreter, enum_class_UnManagedStruct);|,
  +        qq|        PMC_data(temp_pmc) = $value;|,
  +        qq|        VTABLE_set_pmc_keyed_str(interpreter, HashPointer, 
string_from_cstring(interpreter, "$key", 0), temp_pmc);|;
  +#        qq|        hash_put( interpreter, known_frames, const_cast("$key"), $value 
);|;
   }
   
   
  
  
  

Reply via email to