cvsuser     05/03/22 01:19:52

  Modified:    classes  fixedintegerarray.pmc
               jit/i386 core.jit
               t/pmc    object-meths.t
  Log:
  JIT/i386 ord_i_s*
  
  * clear integer array memory
  * all opocdes of MD5 are now JITted on i386
  
  Revision  Changes    Path
  1.6       +11 -10    parrot/classes/fixedintegerarray.pmc
  
  Index: fixedintegerarray.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/fixedintegerarray.pmc,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- fixedintegerarray.pmc     20 Mar 2005 12:47:01 -0000      1.5
  +++ fixedintegerarray.pmc     22 Mar 2005 09:19:50 -0000      1.6
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: fixedintegerarray.pmc,v 1.5 2005/03/20 12:47:01 bernhard Exp $
  +$Id: fixedintegerarray.pmc,v 1.6 2005/03/22 09:19:50 leo Exp $
   
   =head1 NAME
   
  @@ -22,7 +22,7 @@
   #include "parrot/parrot.h"
   
   pmclass FixedIntegerArray need_ext does array {
  -    
  +
   /*
   
   =back
  @@ -89,12 +89,12 @@
       PMC* clone () {
           INTVAL size;
           PMC * dest = pmc_new(INTERP, SELF->vtable->base_type);
  -    
  +
           if (!PMC_data(SELF))
               return dest;
           size = PMC_int_val(SELF);
           PMC_int_val(dest) = size;
  -        
  +
           PMC_data(dest) = mem_sys_allocate(size * sizeof(INTVAL));
           mem_sys_memcopy(PMC_data(dest), PMC_data(SELF), size*sizeof(INTVAL));
           PObj_active_destroy_SET(dest);
  @@ -156,9 +156,9 @@
       INTVAL get_integer_keyed_int (INTVAL key) {
           INTVAL *data;
           if (key < 0 || key >= PMC_int_val(SELF))
  -            internal_exception(OUT_OF_BOUNDS, 
  +            internal_exception(OUT_OF_BOUNDS,
                   "FixedIntegerArray: index out of bounds!");
  -        
  +
           data = (INTVAL *)PMC_data(SELF);
           return data[key];
       }
  @@ -288,9 +288,10 @@
   
       void set_integer_native (INTVAL size) {
           if (PMC_int_val(SELF) || size < 1)
  -            internal_exception(OUT_OF_BOUNDS, "FixedIntegerArray: Can't 
resize!");
  +            internal_exception(OUT_OF_BOUNDS,
  +                "FixedIntegerArray: Can't resize!");
           PMC_int_val(SELF) = size;
  -        PMC_data(SELF) = mem_sys_allocate(size * sizeof(INTVAL));
  +        PMC_data(SELF) = mem_sys_allocate_zeroed(size * sizeof(INTVAL));
           PObj_active_destroy_SET(SELF);
       }
   
  @@ -307,7 +308,7 @@
       void set_integer_keyed_int (INTVAL key, INTVAL value) {
           INTVAL *data;
           if (key < 0 || key >= PMC_int_val(SELF))
  -            internal_exception(OUT_OF_BOUNDS, 
  +            internal_exception(OUT_OF_BOUNDS,
                   "FixedIntegerArray: index out of bounds!");
   
           data = (INTVAL*)PMC_data(SELF);
  @@ -361,7 +362,7 @@
           k = key_integer(INTERP, key);
           DYNSELF.set_number_keyed_int(k, value);
       }
  -    
  +
   /*
   
   =item C<void set_string_keyed_int(INTVAL key, STRING *value)>
  
  
  
  1.71      +44 -7     parrot/jit/i386/core.jit
  
  Index: core.jit
  ===================================================================
  RCS file: /cvs/public/parrot/jit/i386/core.jit,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- core.jit  27 Nov 2004 15:13:06 -0000      1.70
  +++ core.jit  22 Mar 2005 09:19:51 -0000      1.71
  @@ -1,7 +1,7 @@
   ;
   ; i386/core.jit
   ;
  -; $Id: core.jit,v 1.70 2004/11/27 15:13:06 leo Exp $
  +; $Id: core.jit,v 1.71 2005/03/22 09:19:51 leo Exp $
   ;
   
   # TODO complete this
  @@ -1257,13 +1257,50 @@
   #undef push_r
   #undef push_c
   }
  -;Parrot_ord_i_s {
  -;    Parrot_ord_i_sx s/<typ>/r/
  -;}
   
  -;Parrot_ord_i_sc {
  -;    Parrot_ord_i_sx s/<typ>/c/
  -;}
  +Parrot_ord_i_s {
  +    Parrot_ord_i_sx s/<typ>/r/
  +}
  +
  +Parrot_ord_i_sc {
  +    Parrot_ord_i_sx s/<typ>/c/
  +}
  +
  +TEMPLATE Parrot_ord_i_sx_i {
  +# define push_r(i) \
  +    jit_emit_mov_RM_i(NATIVECODE, emit_EAX, ROFFS_STR(i)); \
  +        emitm_pushl_r(NATIVECODE, emit_EAX)
  +# define push_c(i) emitm_pushl_i(NATIVECODE, CONST(i)->u.string)
  +
  +    if (MAP[3]) {
  +        emitm_pushl_r(NATIVECODE, MAP[3]);
  +    }
  +    else {
  +        jit_emit_mov_RM_i(NATIVECODE, ISR1, ROFFS_INT(3));
  +        emitm_pushl_r(NATIVECODE, ISR1);
  +    }
  +    push_<typ>(2);
  +    Parrot_jit_emit_get_INTERP(jit_info->native_ptr, emit_EAX);
  +    emitm_pushl_r(NATIVECODE, emit_EAX);
  +    CALL_FUNCTION(jit_info, (void*)string_ord);
  +    emitm_addb_i_r(NATIVECODE, 12, emit_ESP);
  +    if (MAP[1]) {
  +        jit_emit_mov_rr_i(NATIVECODE, MAP[1], ISR1);
  +    }
  +    else {
  +        jit_emit_mov_MR_i(NATIVECODE, ROFFS_INT(1), ISR1);
  +    }
  +#undef push_r
  +#undef push_c
  +}
  +
  +Parrot_ord_i_s_i {
  +    Parrot_ord_i_sx_i s/<typ>/r/
  +}
  +
  +Parrot_ord_i_sc_i {
  +    Parrot_ord_i_sx_i s/<typ>/c/
  +}
   
   ; TODO or,and,not,cmp
   
  
  
  
  1.34      +23 -2     parrot/t/pmc/object-meths.t
  
  Index: object-meths.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/pmc/object-meths.t,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- object-meths.t    19 Mar 2005 16:20:13 -0000      1.33
  +++ object-meths.t    22 Mar 2005 09:19:52 -0000      1.34
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: object-meths.t,v 1.33 2005/03/19 16:20:13 leo Exp $
  +# $Id: object-meths.t,v 1.34 2005/03/22 09:19:52 leo Exp $
   
   =head1 NAME
   
  @@ -16,7 +16,7 @@
   
   =cut
   
  -use Parrot::Test tests => 28;
  +use Parrot::Test tests => 29;
   use Test::More;
   
   output_like(<<'CODE', <<'OUTPUT', "callmethod - unknown method");
  @@ -935,3 +935,24 @@
   bound class m 0.540302
   bound obj met 0.540302
   OUTPUT
  +
  +pir_output_is(<<'CODE', <<'OUTPUT', "ParrotIO.puts");
  +.sub main @MAIN
  +    .local pmc o, m, cl
  +    o = getstdout
  +    $I0 = o."puts"("ok 1\n")
  +    puts $I0, o, "ok 2\n"
  +    $I0 = "puts"(o, "ok 3\n")
  +    m = getattribute o, "puts"
  +    $I0 = m("ok 4\n")
  +    cl = getclass "ParrotIO"
  +    $I0 = cl."puts"(o, "ok 5\n")
  +.end
  +CODE
  +ok 1
  +ok 2
  +ok 3
  +ok 4
  +ok 5
  +OUTPUT
  +
  
  
  

Reply via email to