cvsuser     03/09/23 00:09:39

  Modified:    config/gen/makefiles root.in
               include/parrot vtables.h
               jit/i386 jit_emit.h
               .        nci_test.c trace.c vtables.c
               t/pmc    nci.t
  Log:
  fix vtables protos; add libnci.so make target; test
  
  Revision  Changes    Path
  1.124     +6 -0      parrot/config/gen/makefiles/root.in
  
  Index: root.in
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/makefiles/root.in,v
  retrieving revision 1.123
  retrieving revision 1.124
  diff -u -w -r1.123 -r1.124
  --- root.in   22 Sep 2003 19:27:42 -0000      1.123
  +++ root.in   23 Sep 2003 07:09:28 -0000      1.124
  @@ -763,3 +763,9 @@
   
   exec_so : exec_start$(O) blib/lib/libparrot$(SO)
        $(LINK) ${ld_out}$(EXEC) $(LINKFLAGS) $(EXEC)$(O) exec_start$(O) -lparrot 
$(C_LIBS) -pthread
  +
  +###### OS depend targets ##########
  +# libnci.so used by t/pmc/nci.t
  +
  +libnci.so: nci_test.c
  +     $(LD) $(LD_SHARED) $(LD_SHARED_FLAGS) $(LDFLAGS) $< -o $@
  
  
  
  1.2       +4 -4      parrot/include/parrot/vtables.h
  
  Index: vtables.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/vtables.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- vtables.h 22 Sep 2003 21:02:33 -0000      1.1
  +++ vtables.h 23 Sep 2003 07:09:29 -0000      1.2
  @@ -1,7 +1,7 @@
   /* vtables.h
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: vtables.h,v 1.1 2003/09/22 21:02:33 dan Exp $
  + *     $Id: vtables.h,v 1.2 2003/09/23 07:09:29 leo Exp $
    *  Overview:
    *     Vtable manipulation code. Not to be confused with vtable.h
    *  Data Structure and Algorithms:
  @@ -13,8 +13,8 @@
   #if !defined(PARROT_VTABLES_H_GUARD)
   #define PARROT_VTABLES_H_GUARD
   
  -VTABLE *Parrot_new_vtable(Parrot_Interp *interpreter);
  -VTABLE *Parrot_clone_vtable(Parrot_Interp *interpreter, VTABLE *base_vtable);
  -void Parrot_destroy_vtable(Parrot_Interp *interpreter, VTABLE *vtable);
  +VTABLE *Parrot_new_vtable(Parrot_Interp);
  +VTABLE *Parrot_clone_vtable(Parrot_Interp, VTABLE *base_vtable);
  +void Parrot_destroy_vtable(Parrot_Interp, VTABLE *vtable);
   
   #endif
  
  
  
  1.85      +3 -3      parrot/jit/i386/jit_emit.h
  
  Index: jit_emit.h
  ===================================================================
  RCS file: /cvs/public/parrot/jit/i386/jit_emit.h,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -w -r1.84 -r1.85
  --- jit_emit.h        22 Sep 2003 21:30:19 -0000      1.84
  +++ jit_emit.h        23 Sep 2003 07:09:31 -0000      1.85
  @@ -3,7 +3,7 @@
    *
    * i386
    *
  - * $Id: jit_emit.h,v 1.84 2003/09/22 21:30:19 grunblatt Exp $
  + * $Id: jit_emit.h,v 1.85 2003/09/23 07:09:31 leo Exp $
    */
   
   #include <assert.h>
  @@ -2789,7 +2789,7 @@
   count_regs(char *sig, char *sig_start)
   {
       const char *typs[] = {
  -        "lisc", /* I */
  +        "lisc234", /* I */
           "t",    /* S */
           "pP",   /* P */
           "fd"   /* N */
  
  
  
  1.5       +5 -0      parrot/nci_test.c
  
  Index: nci_test.c
  ===================================================================
  RCS file: /cvs/public/parrot/nci_test.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- nci_test.c        1 Jun 2003 00:17:44 -0000       1.4
  +++ nci_test.c        23 Sep 2003 07:09:36 -0000      1.5
  @@ -49,6 +49,11 @@
       fprintf(stderr, "%d %d %d\n", i1, i2, i3);
       return 2;
   }
  +
  +int nci_i4i(long * l, int i) {
  +    return (int) (*l * i);
  +}
  +
   #ifdef TEST
   char l2 = 4;
   float f2 = 4.0;
  
  
  
  1.39      +6 -6      parrot/trace.c
  
  Index: trace.c
  ===================================================================
  RCS file: /cvs/public/parrot/trace.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -w -r1.38 -r1.39
  --- trace.c   30 Jul 2003 14:59:46 -0000      1.38
  +++ trace.c   23 Sep 2003 07:09:36 -0000      1.39
  @@ -1,7 +1,7 @@
   /* trace.c
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: trace.c,v 1.38 2003/07/30 14:59:46 leo Exp $
  + *     $Id: trace.c,v 1.39 2003/09/23 07:09:36 leo Exp $
    *  Overview:
    *     Tracing support for runops_cores.c.
    *  Data Structure and Algorithms:
  @@ -23,13 +23,13 @@
   {
       if(pmc) {
           if(pmc->vtable) {
  -            if (pmc->vtable == Parrot_base_vtables + enum_class_PerlString) {
  +            if (pmc->vtable->base_type == enum_class_PerlString) {
                   PIO_eprintf(interpreter, "%S=PMC(%#p Str:\"%Ps\")",
                           VTABLE_name(interpreter, pmc), pmc, pmc);
               }
  -            else if (pmc->vtable == Parrot_base_vtables + enum_class_PerlUndef
  -                 ||  pmc->vtable == Parrot_base_vtables + enum_class_PerlInt
  -                 ||  pmc->vtable == Parrot_base_vtables + enum_class_PerlNum) {
  +            else if (pmc->vtable->base_type == enum_class_PerlUndef
  +                 ||  pmc->vtable->base_type == enum_class_PerlInt
  +                 ||  pmc->vtable->base_type == enum_class_PerlNum) {
                   PIO_eprintf(interpreter, "%S=PMC(%#p Num:%Pg Int:%Pd)",
                           VTABLE_name(interpreter, pmc), pmc, pmc, pmc);
               }
  
  
  
  1.2       +4 -4      parrot/vtables.c
  
  Index: vtables.c
  ===================================================================
  RCS file: /cvs/public/parrot/vtables.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- vtables.c 22 Sep 2003 21:04:49 -0000      1.1
  +++ vtables.c 23 Sep 2003 07:09:36 -0000      1.2
  @@ -1,7 +1,7 @@
   /* vtables.c
    *  Copyright: 2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: vtables.c,v 1.1 2003/09/22 21:04:49 dan Exp $
  + *     $Id: vtables.c,v 1.2 2003/09/23 07:09:36 leo Exp $
    *  Overview:
    *     Functions to build and manipulate vtables
    *  Data Structure and Algorithms:
  @@ -13,12 +13,12 @@
   #include "parrot/parrot.h"
   
   VTABLE *
  -Parrot_new_vtable(Parrot_Interp *interpreter) {
  +Parrot_new_vtable(Parrot_Interp interpreter) {
     return mem_sys_allocate_zeroed(sizeof(VTABLE));
   }
   
   VTABLE *
  -Parrot_clone_vtable(Parrot_Interp *interpreter, VTABLE *base_vtable) {
  +Parrot_clone_vtable(Parrot_Interp interpreter, VTABLE *base_vtable) {
     VTABLE *new_vtable = mem_sys_allocate(sizeof(VTABLE));
     if (new_vtable) {
       memcpy(new_vtable, base_vtable, sizeof(VTABLE));
  @@ -27,6 +27,6 @@
   }
   
   void
  -Parrot_destroy_vtable(Parrot_Interp *interpreter, VTABLE *vtable) {
  +Parrot_destroy_vtable(Parrot_Interp interpreter, VTABLE *vtable) {
     mem_sys_free(vtable);
   }
  
  
  
  1.13      +18 -5     parrot/t/pmc/nci.t
  
  Index: nci.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/pmc/nci.t,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -w -r1.12 -r1.13
  --- nci.t     8 Jul 2003 13:01:29 -0000       1.12
  +++ nci.t     23 Sep 2003 07:09:38 -0000      1.13
  @@ -1,4 +1,4 @@
  -use Parrot::Test tests => 10;
  +use Parrot::Test tests => 11;
   use Parrot::Config;
   
   print STDERR $PConfig{jitcpuarch}, " JIT CPU\n";
  @@ -243,7 +243,7 @@
   output_is(gen_test(<<'CODE'), <<'OUTPUT', "nci_d_d - stress test");
     loadlib P1, "libnci.so"
     print "loaded\n"
  -  set I10, 1000000
  +  set I10, 100000
     print "dlfunced\n"
   loop:
     dlfunc P0, P1, "nci_dd", "dd"
  @@ -326,12 +326,25 @@
     set I6, 20
     set I7, 30
     invoke
  -  end
  -  end
  -nok_2: print "nok 2\n"
  +  print I5
  +  print "\n"
     end
   CODE
   10 20 30
  +2
  +OUTPUT
  +
  +output_is(gen_test(<<'CODE'), <<'OUTPUT', "nci_i_4i");
  +  loadlib P1, "libnci.so"
  +  dlfunc P0, P1, "nci_i4i", "i4i"
  +  set I5, 6
  +  set I6, 7
  +  invoke
  +  print I5
  +  print "\n"
  +  end
  +CODE
  +42
   OUTPUT
   
   } # SKIP
  
  
  

Reply via email to