cvsuser     03/10/24 02:08:07

  Modified:    .        PBC_COMPAT
               build_tools fingerprint_c.pl
               config/gen/makefiles root.in
               imcc     imc.c
               t/native_pbc number.t number_1.pbc number_2.pbc
  Log:
  base fingerprinting on PBC_COMPAT; enable native tests; fix a warning
  
  Revision  Changes    Path
  1.2       +1 -0      parrot/PBC_COMPAT
  
  Index: PBC_COMPAT
  ===================================================================
  RCS file: /cvs/public/parrot/PBC_COMPAT,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- PBC_COMPAT        22 Oct 2003 18:45:13 -0000      1.1
  +++ PBC_COMPAT        24 Oct 2003 09:07:54 -0000      1.2
  @@ -19,6 +19,7 @@
   
   # please insert tab separated entries at the top of the list
   
  +2003.10.24   leo     start using this file for fingerprinting
   2003.10.22   dan     add delegates.pmc
   2003.10.21   dan     delete instantiate op
   2003.10.21   leo     start this file
  
  
  
  1.6       +9 -8      parrot/build_tools/fingerprint_c.pl
  
  Index: fingerprint_c.pl
  ===================================================================
  RCS file: /cvs/public/parrot/build_tools/fingerprint_c.pl,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -w -r1.5 -r1.6
  --- fingerprint_c.pl  23 Oct 2003 17:44:32 -0000      1.5
  +++ fingerprint_c.pl  24 Oct 2003 09:07:56 -0000      1.6
  @@ -3,19 +3,20 @@
   use strict;
   use lib 'lib';
   use Digest::Perl::MD5 qw(md5_hex);
  -use Data::Dumper;
  -use Parrot::OpLib::core;
  +
  +my $compat_file = 'PBC_COMPAT';
  +open IN, $compat_file or die "Can't read $compat_file";
  +my @lines = <IN>;
  +close IN;
   
   my $len = 10;
  -my $fingerprint = md5_hex join "\n", map {
  -  join '_', $_->{NAME}, @{$_->{ARGS}}
  -} @$Parrot::OpLib::core::ops;
  +my $fingerprint = md5_hex join "\n", grep { ! /^#/ } @lines;
   
   print << "EOF";
   /*
    * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
    *
  - * This file is generated automatically from 'core.ops' 
  + * This file is generated automatically from '$compat_file'
    * by $0.
    *
    * Any changes made here will be lost!
  
  
  
  1.159     +1 -1      parrot/config/gen/makefiles/root.in
  
  Index: root.in
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/makefiles/root.in,v
  retrieving revision 1.158
  retrieving revision 1.159
  diff -u -w -r1.158 -r1.159
  --- root.in   24 Oct 2003 03:20:59 -0000      1.158
  +++ root.in   24 Oct 2003 09:08:00 -0000      1.159
  @@ -387,7 +387,7 @@
        lib/Parrot/OpsFile.pm lib/Parrot/Op.pm $(OPS)/ops.num
        $(PERL) $(BUILD_TOOL)/ops2pm.pl $(OPS_FILES)
   
  -$(SRC)/fingerprint.c : $(BUILD_TOOL)/fingerprint_c.pl lib/Parrot/OpLib/core.pm
  +$(SRC)/fingerprint.c : $(BUILD_TOOL)/fingerprint_c.pl PBC_COMPAT
        $(PERL) $(BUILD_TOOL)/fingerprint_c.pl > $(SRC)/fingerprint.c
   
   ###############################################################################
  
  
  
  1.59      +22 -22    parrot/imcc/imc.c
  
  Index: imc.c
  ===================================================================
  RCS file: /cvs/public/parrot/imcc/imc.c,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -w -r1.58 -r1.59
  --- imc.c     23 Oct 2003 17:02:49 -0000      1.58
  +++ imc.c     24 Oct 2003 09:08:05 -0000      1.59
  @@ -873,12 +873,12 @@
    */
   
   static void
  -spill(struct Parrot_Interp *interpreter, int spilled) {
  -
  +spill(struct Parrot_Interp *interpreter, int spilled)
  +{
       Instruction * tmp, *ins;
       int i, n, dl;
       int needs_fetch, needs_store;
  -    SymReg * old_symbol, *p31, *new_symbol;
  +    SymReg * old_sym, *p31, *new_sym;
       char * buf;
       SymReg *regs[IMCC_MAX_REGS];
   
  @@ -889,10 +889,10 @@
   
       debug(interpreter, DEBUG_IMC, "#Spilling [%s]:\n", reglist[spilled]->name);
   
  -    new_symbol = old_symbol = reglist[spilled];
  -    if (old_symbol->usage & U_SPILL)
  +    new_sym = old_sym = reglist[spilled];
  +    if (old_sym->usage & U_SPILL)
           fatal(1, "spill", "double spill - program too complex\n");
  -    new_symbol->usage |= U_SPILL;
  +    new_sym->usage |= U_SPILL;
   
       IMCC_INFO(interpreter)->n_spilled++;
       n = 0;
  @@ -924,20 +924,20 @@
        needs_store = 0;
        needs_fetch = 0;
   
  -     if (instruction_reads (ins, old_symbol) && !(ins->flags & ITSPILL))
  +     if (instruction_reads (ins, old_sym) && !(ins->flags & ITSPILL))
            needs_fetch = 1;
   
  -     if (instruction_writes (ins, old_symbol) && !(ins->flags & ITSPILL))
  +     if (instruction_writes (ins, old_sym) && !(ins->flags & ITSPILL))
            needs_store = 1;
           if (dl)
               ins->index += dl;
   
        if (needs_fetch) {
  -         regs[0] = new_symbol;
  +         regs[0] = new_sym;
               regs[1] = p31;
               sprintf(buf, "%d", IMCC_INFO(interpreter)->n_spilled);
               regs[2] = mk_const(str_dup(buf), 'I');
  -         sprintf(buf, "%%s, %%s[%%s] #FETCH %s", old_symbol->name);
  +         sprintf(buf, "%%s, %%s[%%s] #FETCH %s", old_sym->name);
            tmp = INS(interpreter, "set", buf, regs, 3, 4, 0);
            tmp->bbindex = ins->bbindex;
               tmp->flags |= ITSPILL;
  @@ -947,17 +947,17 @@
               insert_ins(ins->prev, tmp);
               dl++;
        }
  -        /* change all occurance of old_symbol to new */
  -        for (i = 0; old_symbol != new_symbol && ins->r[i] &&
  +        /* change all occurance of old_sym to new */
  +        for (i = 0; old_sym != new_sym && ins->r[i] &&
                   i < IMCC_MAX_REGS; i++)
  -            if (ins->r[i] == old_symbol)
  -                ins->r[i] = new_symbol;
  +            if (ins->r[i] == old_sym)
  +                ins->r[i] = new_sym;
        if (needs_store) {
               regs[0] = p31;
               sprintf(buf, "%d", IMCC_INFO(interpreter)->n_spilled);
               regs[1] = mk_const(str_dup(buf), 'I');
  -         regs[2] = new_symbol;
  -         sprintf(buf, "%%s[%%s], %%s #STORE %s", old_symbol->name);
  +         regs[2] = new_sym;
  +         sprintf(buf, "%%s[%%s], %%s #STORE %s", old_sym->name);
            tmp = INS(interpreter, "set", buf, regs, 3, 2, 0);
            tmp->bbindex = ins->bbindex;
               tmp->flags |= ITSPILL;
  @@ -969,19 +969,19 @@
           if (needs_fetch || needs_store) {
   #if ! DOIT_AGAIN_SAM
               /* update life info of prev sym */
  -            update_life(interpreter, ins, new_symbol, needs_fetch, needs_store,
  -                    old_symbol != new_symbol);
  +            update_life(interpreter, ins, new_sym, needs_fetch, needs_store,
  +                    old_sym != new_sym);
               /* and interference of both */
  -            update_interference(interpreter, old_symbol, new_symbol);
  +            update_interference(interpreter, old_sym, new_sym);
   #endif
               /* if all symbols are in one basic_block, we need a new
                * symbol, so that the life_ranges are minimal
                * It would be nice, to detect, when changing the symbol
                * is necessary.
                */
  -            sprintf(buf, "%s_%d", old_symbol->name, n++);
  -            new_symbol = mk_symreg(str_dup(buf), old_symbol->set);
  -            new_symbol->usage |= U_SPILL;
  +            sprintf(buf, "%s_%d", old_sym->name, n++);
  +            new_sym = mk_symreg(str_dup(buf), old_sym->set);
  +            new_sym->usage |= U_SPILL;
               if (needs_store)    /* advance past store */
                   ins = tmp;
           }
  
  
  
  1.10      +1 -1      parrot/t/native_pbc/number.t
  
  Index: number.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/native_pbc/number.t,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -r1.9 -r1.10
  --- number.t  22 Sep 2003 15:01:01 -0000      1.9
  +++ number.t  24 Oct 2003 09:08:07 -0000      1.10
  @@ -23,7 +23,7 @@
   use Parrot::Test tests => 3;
   
   SKIP: {
  -  skip("core ops changes", 2);
  +  #skip("core ops changes", 2);
   
   output_is(<<CODE, <<OUTPUT, "i386 double float 32 bit opcode_t");
   # number_1.pbc
  
  
  
  1.12      +4 -4      parrot/t/native_pbc/number_1.pbc
  
        <<Binary file>>
  
  
  1.12      +4 -4      parrot/t/native_pbc/number_2.pbc
  
        <<Binary file>>
  
  

Reply via email to