cvsuser     03/01/16 09:26:43

  Modified:    .        MANIFEST core.ops debug.c dod.c interpreter.c
                        method_util.c
               classes  csub.pmc default.pmc nci.pmc sub.pmc
               docs/pdds pdd06_pasm.pod
               include/parrot debug.h interpreter.h method_util.h
               jit/i386 jit_emit.h
  Added:       t/pmc    eval.t
  Log:
  eval #1
  
  Revision  Changes    Path
  1.304     +2 -0      parrot/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /cvs/public/parrot/MANIFEST,v
  retrieving revision 1.303
  retrieving revision 1.304
  diff -u -w -r1.303 -r1.304
  --- MANIFEST  10 Jan 2003 15:36:26 -0000      1.303
  +++ MANIFEST  16 Jan 2003 17:26:17 -0000      1.304
  @@ -1394,6 +1394,7 @@
   languages/imcc/t/imcpasm/sub.t
   languages/imcc/t/syn/clash.t
   languages/imcc/t/syn/const.t
  +languages/imcc/t/syn/eval.t
   languages/imcc/t/syn/labels.t
   languages/imcc/t/syn/namespace.t
   languages/imcc/t/syn/scope.t
  @@ -1737,6 +1738,7 @@
   t/op/types.t
   t/pmc/array.t
   t/pmc/boolean.t
  +t/pmc/eval.t
   t/pmc/intlist.t
   t/pmc/multiarray.t
   t/pmc/nci.t
  
  
  
  1.247     +33 -2     parrot/core.ops
  
  Index: core.ops
  ===================================================================
  RCS file: /cvs/public/parrot/core.ops,v
  retrieving revision 1.246
  retrieving revision 1.247
  diff -u -w -r1.246 -r1.247
  --- core.ops  14 Jan 2003 08:09:39 -0000      1.246
  +++ core.ops  16 Jan 2003 17:26:17 -0000      1.247
  @@ -4485,6 +4485,24 @@
   
   Call the subroutine in P0, as described in PDD03.
   
  +=item B<compile>(out PMC, in PMC, in STR)
  +
  +Compile source code $3 with compiler $2 into PMC $1.
  +
  +=item B<compreg>(out PMC, in STR)
  +
  +Get a compiler for source type $2.
  +
  +=item B<compreg>(in STR, in PMC)
  +
  +Register the sub $2 as a compiler for source type $1.
  +XXX: leo: N/Y how would we get the C-subroutine?
  +
  +=item B<compreg>(in STR, in INT)
  +
  +Register the PASM sub at address $2 as a compiler for source type $1.
  +XXX: leo N/Y
  +
   =cut
   
   inline op loadext(in STR, in STR) {
  @@ -4524,6 +4542,7 @@
   
   op dlfunc (out PMC, in PMC, in STR, in STR) {
     char * name = string_to_cstring(interpreter, ($3));
  +  PMC *nci;
   
     Parrot_csub_t p = (Parrot_csub_t)D2FPTR(Parrot_dlsym(($2)->data, name));
     free(name);
  @@ -4534,8 +4553,8 @@
        }
        PANIC("Failed to link native method");
     }
  -
  -  $1 = Parrot_new_nci(interpreter, p, $4);
  +  $1 = nci = pmc_new(interpreter, enum_class_NCI);
  +  nci->vtable->set_string_keyed(interpreter, nci, (PMC*)F2DPTR(p), $4);
     goto NEXT();
   }
   
  @@ -4546,6 +4565,18 @@
     dest = (opcode_t *)p->vtable->invoke(interpreter, p, expr NEXT());
   
     goto ADDRESS(dest);
  +}
  +
  +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);
  +  $1 = interpreter->Parrot_compreg_hash->vtable->get_pmc_keyed(
  +    interpreter, interpreter->Parrot_compreg_hash, key);
  +  goto NEXT();
   }
   
   =item B<find_method>(out PMC, in PMC, in STR)
  
  
  
  1.52      +18 -6     parrot/debug.c
  
  Index: debug.c
  ===================================================================
  RCS file: /cvs/public/parrot/debug.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -w -r1.51 -r1.52
  --- debug.c   13 Jan 2003 16:02:00 -0000      1.51
  +++ debug.c   16 Jan 2003 17:26:17 -0000      1.52
  @@ -2,7 +2,7 @@
    * debug.c
    *
    * CVS Info
  - *    $Id: debug.c,v 1.51 2003/01/13 16:02:00 dan Exp $
  + *    $Id: debug.c,v 1.52 2003/01/16 17:26:17 leo Exp $
    * Overview:
    *    Parrot debugger
    * History:
  @@ -1504,11 +1504,24 @@
   void
   PDB_eval(struct Parrot_Interp *interpreter, const char *command)
   {
  +    opcode_t *run;
  +    run = PDB_compile(interpreter, command);
  +    if (run)
  +        DO_OP(run,interpreter);
  +}
  +
  +/* PDB_compile
  + * compiles one instruction with fully qualified opcode name
  + * and valid arguments, NO error checking.
  + */
  +opcode_t *
  +PDB_compile(struct Parrot_Interp *interpreter, const char *command)
  +{
       char buf[256];
       char s[1], *c = buf;
       op_info_t *op_info;
       /* Opcodes can't have more that 10 arguments */
  -    opcode_t eval[10],*run;
  +    static opcode_t eval[11];
       int op_number,i,k,l,j = 0;
   
       /* find_op needs a string with only the opcode name */
  @@ -1519,7 +1532,7 @@
       op_number = interpreter->op_lib->op_code(buf, 1);
       if (op_number < 0) {
           PIO_eprintf(interpreter, "Invalid opcode '%s'\n", buf);
  -        return;
  +        return NULL;
       }
       /* Start generating the bytecode */
       eval[j++] = (opcode_t)op_number;
  @@ -1575,9 +1588,8 @@
                   break;
           }
       }
  -
  -    run = eval;
  -    DO_OP(run,interpreter);
  +    eval[j++] = 0;      /* append end op */
  +    return eval;
   }
   
   /* PDB_extend_const_table
  
  
  
  1.47      +3 -1      parrot/dod.c
  
  Index: dod.c
  ===================================================================
  RCS file: /cvs/public/parrot/dod.c,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -w -r1.46 -r1.47
  --- dod.c     14 Jan 2003 08:09:39 -0000      1.46
  +++ dod.c     16 Jan 2003 17:26:17 -0000      1.47
  @@ -1,7 +1,7 @@
   /* dod.c
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: dod.c,v 1.46 2003/01/14 08:09:39 leo Exp $
  + *     $Id: dod.c,v 1.47 2003/01/16 17:26:17 leo Exp $
    *  Overview:
    *     Handles dead object destruction of the various headers
    *  Data Structure and Algorithms:
  @@ -104,6 +104,8 @@
       /* mark it as used  */
       pobject_lives(interpreter, (PObj *)current);
   
  +    if (interpreter->Parrot_compreg_hash)
  +        pobject_lives(interpreter, (PObj *)interpreter->Parrot_compreg_hash);
       /* Now, go run through the PMC registers and mark them as live */
       /* First mark the current set. */
       for (i = 0; i < NUM_REGISTERS; i++) {
  
  
  
  1.128     +41 -1     parrot/interpreter.c
  
  Index: interpreter.c
  ===================================================================
  RCS file: /cvs/public/parrot/interpreter.c,v
  retrieving revision 1.127
  retrieving revision 1.128
  diff -u -w -r1.127 -r1.128
  --- interpreter.c     11 Jan 2003 04:24:32 -0000      1.127
  +++ interpreter.c     16 Jan 2003 17:26:17 -0000      1.128
  @@ -1,7 +1,7 @@
   /* interpreter.c
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: interpreter.c,v 1.127 2003/01/11 04:24:32 sfink Exp $
  + *     $Id: interpreter.c,v 1.128 2003/01/16 17:26:17 leo Exp $
    *  Overview:
    *     The interpreter api handles running the operations
    *  Data Structure and Algorithms:
  @@ -21,11 +21,13 @@
   #ifdef HAVE_COMPUTED_GOTO
   #  include "parrot/oplib/core_ops_cg.h"
   #endif
  +#include "parrot/method_util.h"
   
   #define ATEXIT_DESTROY
   
   extern op_lib_t *PARROT_CORE_PREDEREF_OPLIB_INIT(void);
   
  +static void setup_default_compreg(Parrot_Interp interpreter);
   
   /*=for api interpreter runops_generic
    * TODO: Not really part of the API, but here's the docs.
  @@ -512,6 +514,10 @@
       SET_NULL_P(interpreter->prederef_code, void **);
       SET_NULL(interpreter->jit_info);
   
  +    SET_NULL_P(interpreter->Parrot_compreg_hash, PMC *);
  +    /* register assembler/compilers */
  +    setup_default_compreg(interpreter);
  +
       /* Done. Return and be done with it */
   
       /* Okay, we've finished doing anything that might trigger GC.
  @@ -686,6 +692,40 @@
       }
       return ret;
   }
  +
  +/*=for api interpreter Parrot_compreg
  + * register a parser/compiler function
  + */
  +
  +void Parrot_compreg(Parrot_Interp interpreter, STRING *type, PMC *func)
  +{
  +    PMC* key, *hash;
  +    if (!interpreter->Parrot_compreg_hash) {
  +        hash = interpreter->Parrot_compreg_hash =
  +            pmc_new_noinit(interpreter, enum_class_PerlHash);
  +        hash->vtable->init(interpreter, hash);
  +    }
  +    else
  +        hash = interpreter->Parrot_compreg_hash;
  +    key = key_new_string(interpreter, type);
  +    hash->vtable->set_pmc_keyed(interpreter, hash, key, func, NULL);
  +}
  +
  +
  +static void setup_default_compreg(Parrot_Interp interpreter)
  +{
  +    STRING *pasm1 = string_make(interpreter, "PASM1", 5, NULL,0,NULL);
  +    PMC * nci;
  +    Parrot_csub_t p = (Parrot_csub_t) F2DPTR(PDB_compile);
  +    nci = pmc_new(interpreter, enum_class_Compiler);
  +    /* register the nci ccompiler object */
  +    Parrot_compreg(interpreter, pasm1, nci);
  +    /* build native call interface */
  +    nci->vtable->set_string_keyed(interpreter, nci, (PMC*)F2DPTR(p),
  +            string_make(interpreter, "pIt", 3, NULL,0,NULL));
  +}
  +
  +
   /*
    * Local variables:
    * c-indentation-style: bsd
  
  
  
  1.11      +5 -15     parrot/method_util.c
  
  Index: method_util.c
  ===================================================================
  RCS file: /cvs/public/parrot/method_util.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -r1.10 -r1.11
  --- method_util.c     27 Dec 2002 09:33:11 -0000      1.10
  +++ method_util.c     16 Jan 2003 17:26:17 -0000      1.11
  @@ -1,7 +1,7 @@
   /* method_util.c
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: method_util.c,v 1.10 2002/12/27 09:33:11 leo Exp $
  + *     $Id: method_util.c,v 1.11 2003/01/16 17:26:17 leo Exp $
    *  Overview:
    *     Utility functions to handle Parrot calling conventions, lookup
    *     methods, etc.
  @@ -16,20 +16,10 @@
   #include "parrot/method_util.h"
   
   /*
  - * Create a new native sub. (new way)
  - */
  -PMC *
  -Parrot_new_nci(struct Parrot_Interp *interp, Parrot_csub_t func,
  -        String *signature)
  -{
  -    PMC *ret = pmc_new(interp, enum_class_NCI);
  -    ret->cache.struct_val = (DPOINTER *)F2DPTR(func);
  -    ret->data = build_call_func(interp, ret, signature);
  -    return ret;
  -}
  -
  -/*
  - * Create a new native sub.
  + * Create a new native sub. - Obsolete use NCI
  + *
  + * s. core.ops B<dlfunc> and interpreter.c:Parrot_compreg() for examples
  + *
    */
   PMC *
   Parrot_new_csub(struct Parrot_Interp *interp, Parrot_csub_t func)
  
  
  
  1.5       +2 -2      parrot/classes/csub.pmc
  
  Index: csub.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/csub.pmc,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- csub.pmc  10 Jan 2003 17:04:03 -0000      1.4
  +++ csub.pmc  16 Jan 2003 17:26:23 -0000      1.5
  @@ -1,7 +1,7 @@
   /* CSub.pmc
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: csub.pmc,v 1.4 2003/01/10 17:04:03 leo Exp $
  + *     $Id: csub.pmc,v 1.5 2003/01/16 17:26:23 leo Exp $
    *  Overview:
    *     These are the vtable functions for the CSub base class
    *  Data Structure and Algorithms:
  
  
  
  1.46      +8 -13     parrot/classes/default.pmc
  
  Index: default.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/default.pmc,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -w -r1.45 -r1.46
  --- default.pmc       10 Jan 2003 17:04:03 -0000      1.45
  +++ default.pmc       16 Jan 2003 17:26:23 -0000      1.46
  @@ -1,6 +1,6 @@
   /* default.pmc
    *  Copyright: (When this is determined...it will go here)
  - *  CVS Info $Id: default.pmc,v 1.45 2003/01/10 17:04:03 leo Exp $
  + *  CVS Info $Id: default.pmc,v 1.46 2003/01/16 17:26:23 leo Exp $
    *  Overview:
    *     These are the vtable functions for the default PMC class
    *  Data Structure and Algorithms:
  @@ -311,13 +311,8 @@
           return DYNSELF.get_pmc_keyed(r_key);
       }
   
  -    INTVAL is_same (PMC* pmc2) {
  -        /* I think this should cover this correctly, is_same implies that
  -        same B<data> used by each, but as meaning of data is a little
  -        vtable reliant, I include that test as well */
  -        return (INTVAL)(SELF->vtable == pmc2->vtable &&
  -             &SELF->cache == &pmc2->cache &&
  -             &SELF->data == &pmc2->data);
  +    INTVAL is_same (PMC* value) {
  +        return SELF == value;
       }
   
       INTVAL is_same_keyed (PMC* key, PMC* value, PMC* value_key) {
  @@ -466,7 +461,8 @@
       }
   
       void set_same (PMC* value) {
  -        SELF->cache = value->cache;
  +        SELF->cache.struct_val = value->cache.struct_val;
  +     SELF->data = value->data;
       }
   
       void set_same_keyed (PMC* dest_key, PMC* src, PMC* src_key) {
  @@ -1312,10 +1308,9 @@
       }
   
       INTVAL is_equal (PMC* value) {
  -     internal_exception(ILL_INHERIT,
  -             "is_equal() not implemented in class '%s'\n",
  -             caller(INTERP, SELF));
  -        return 0;
  +        return (SELF->vtable == value->vtable
  +                && SELF->cache.struct_val == value->cache.struct_val
  +             && SELF->data == value->data);
       }
   
       INTVAL is_equal_keyed (PMC* key, PMC* value, PMC* value_key) {
  
  
  
  1.7       +7 -25     parrot/classes/nci.pmc
  
  Index: nci.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/nci.pmc,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- nci.pmc   10 Jan 2003 17:04:03 -0000      1.6
  +++ nci.pmc   16 Jan 2003 17:26:23 -0000      1.7
  @@ -1,7 +1,7 @@
   /* NCI.pmc
    *  Copyright: 2002 Yet Another Society
    *  CVS Info
  - *     $Id: nci.pmc,v 1.6 2003/01/10 17:04:03 leo Exp $
  + *     $Id: nci.pmc,v 1.7 2003/01/16 17:26:23 leo Exp $
    *  Overview:
    *     The vtable functions for the native C call functions
    *  Data Structure and Algorithms:
  @@ -20,6 +20,11 @@
        PObj_custom_mark_SET(SELF);
       }
   
  +    void set_string_keyed (PMC* func, STRING* value) {
  +     /* key = func_ptr, value = signature */
  +     SELF->cache.struct_val = (DPOINTER *)func;
  +     SELF->data = build_call_func(INTERP, SELF, value);
  +    }
   
       void mark () {
        PMC *f = SELF->cache.struct_val;
  @@ -27,17 +32,13 @@
            pobject_lives(INTERP, (PObj *)f);
       }
   
  -    INTVAL type () {
  -        return enum_class_NCI;
  -    }
  -
       STRING* name () {
           return whoami;
       }
   
       void destroy() {
        if (SELF->data)
  -         free(SELF->data);
  +         mem_sys_free(SELF->data);
       }
   
       void clone (PMC *ret) {
  @@ -48,25 +49,6 @@
         * ManagedStruct or Buffer?
         */
        ret->data = SELF->data;
  -    }
  -
  -    PMC* get_pmc () {
  -        return SELF;
  -    }
  -
  -    INTVAL is_same (PMC* value) {
  -        return SELF == value;
  -    }
  -
  -    void set_same (PMC* value) {
  -        SELF->cache.struct_val = value->cache.struct_val;
  -     SELF->data = value->data;
  -    }
  -
  -    INTVAL is_equal (PMC* value) {
  -        return (SELF->vtable == value->vtable
  -                && SELF->cache.struct_val == value->cache.struct_val
  -             && SELF->data == value->data);
       }
   
       INTVAL defined () {
  
  
  
  1.12      +1 -6      parrot/classes/sub.pmc
  
  Index: sub.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/sub.pmc,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -r1.11 -r1.12
  --- sub.pmc   10 Jan 2003 17:04:03 -0000      1.11
  +++ sub.pmc   16 Jan 2003 17:26:23 -0000      1.12
  @@ -1,7 +1,7 @@
   /* Sub.pmc
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: sub.pmc,v 1.11 2003/01/10 17:04:03 leo Exp $
  + *     $Id: sub.pmc,v 1.12 2003/01/16 17:26:23 leo Exp $
    *  Overview:
    *     These are the vtable functions for the Sub (subroutine) base class
    *  Data Structure and Algorithms:
  @@ -14,11 +14,6 @@
   #include "parrot/parrot.h"
   
   pmclass Sub {
  -
  -   INTVAL type () {
  -       return enum_class_Sub;
  -   }
  -
   
      STRING* name () {
        return whoami;
  
  
  
  1.21      +19 -11    parrot/docs/pdds/pdd06_pasm.pod
  
  Index: pdd06_pasm.pod
  ===================================================================
  RCS file: /cvs/public/parrot/docs/pdds/pdd06_pasm.pod,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -w -r1.20 -r1.21
  --- pdd06_pasm.pod    31 Dec 2002 18:01:25 -0000      1.20
  +++ pdd06_pasm.pod    16 Jan 2003 17:26:27 -0000      1.21
  @@ -1114,19 +1114,27 @@
   
   =over 4
   
  -=item compile Px, sy, sz
  +=item compile Px, Py, Sz
   
  -Compile source string Y, with compiler unit Z, and stick a handle to
  +Compile source string Z, with compiler unit Y, and stick a handle to
   a subroutine for the resulting bytecode segment (already loaded into
   the current interpreter) into X.
   
  -Z will be the name of a compiler module of some sort, as registered
  -with the compiler unit. This will be something like "Perl5", "Perl6",
  -"Perl5RE", "Perl6RE", "Python", "Ruby"... you get the picture. 
  +Y is a assembler/compiler object of some sort, as registered with the
  +B<compreg> opcode or the Parrot_compreg function. This will be something
  +like "Perl5", "Perl6", "Perl5RE", "Perl6RE", "Python", "Ruby"... you get
  +the picture.
  +
  +Parrot knows of a "PASM1" compiler, i.e. a one statement PASM compiler
  +implemented as PDB_eval. Imcc registers "PASM" and "PIR" compilers.
   
   This is a high-level op, with the assumption that the resulting sub
   will be called. It's the equivalent of perl 5's string eval, except
   for the actual execution of the resulting code.
  +
  +=item compreg Px, Sy
  +
  +Get a compiler for source type Y.
   
   =item compreg Sx, Py
   
  
  
  
  1.20      +6 -5      parrot/include/parrot/debug.h
  
  Index: debug.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/debug.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -w -r1.19 -r1.20
  --- debug.h   28 Dec 2002 01:27:03 -0000      1.19
  +++ debug.h   16 Jan 2003 17:26:33 -0000      1.20
  @@ -2,7 +2,7 @@
    * debug.h
    *
    * CVS Info
  - *    $Id: debug.h,v 1.19 2002/12/28 01:27:03 dan Exp $
  + *    $Id: debug.h,v 1.20 2003/01/16 17:26:33 leo Exp $
    * Overview:
    *    Parrot debugger header files
    * History:
  @@ -173,6 +173,7 @@
   void PDB_trace(struct Parrot_Interp *interpreter, const char *command);
   
   void PDB_eval(struct Parrot_Interp *interpreter, const char *command);
  +opcode_t * PDB_compile(struct Parrot_Interp *, const char *command);
   
   int PDB_extend_const_table(struct Parrot_Interp *interpreter);
   
  
  
  
  1.61      +3 -1      parrot/include/parrot/interpreter.h
  
  Index: interpreter.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/interpreter.h,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -w -r1.60 -r1.61
  --- interpreter.h     4 Jan 2003 11:34:56 -0000       1.60
  +++ interpreter.h     16 Jan 2003 17:26:33 -0000      1.61
  @@ -1,7 +1,7 @@
   /* interpreter.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: interpreter.h,v 1.60 2003/01/04 11:34:56 leo Exp $
  + *     $Id: interpreter.h,v 1.61 2003/01/16 17:26:33 leo Exp $
    *  Overview:
    *     The interpreter api handles running the operations
    *  Data Structure and Algorithms:
  @@ -169,6 +169,7 @@
       INTVAL world_inited;        /* Parrot_init is done */
       PMC *mark_ptr;             /* last PMC marked used in DOD runs */
       PMC *Parrot_base_classname_hash;    /* hash containing name->base_type */
  +    PMC *Parrot_compreg_hash;   /* hash containing assembler/compilers */
   } Interp;
   
   #define PCONST(i) PF_CONST(interpreter->code, (i))
  @@ -189,6 +190,7 @@
   VAR_SCOPE opcode_t *(*run_native)(struct Parrot_Interp * interpreter,
                                     opcode_t * cur_opcode,
                                     opcode_t * start_code);
  +void Parrot_compreg(Parrot_Interp interpreter, STRING *type, PMC *func);
   
   #endif   /* Parrot core */
   
  
  
  
  1.7       +1 -2      parrot/include/parrot/method_util.h
  
  Index: method_util.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/method_util.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- method_util.h     28 Dec 2002 01:33:09 -0000      1.6
  +++ method_util.h     16 Jan 2003 17:26:33 -0000      1.7
  @@ -1,7 +1,7 @@
   /* method_util.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: method_util.h,v 1.6 2002/12/28 01:33:09 dan Exp $
  + *     $Id: method_util.h,v 1.7 2003/01/16 17:26:33 leo Exp $
    *  Overview:
    *     Utilities to help in writing methods.
    *  Data Structure and Algorithms:
  @@ -27,7 +27,6 @@
   
   typedef INTVAL (*Parrot_csub_t)(struct Parrot_Interp * , PMC * );
   PMC * Parrot_new_csub(struct Parrot_Interp * interp, Parrot_csub_t func);
  -PMC * Parrot_new_nci(struct Parrot_Interp * interp, Parrot_csub_t func, String 
*signature);
   
   struct method_rec_t {
       char * name;
  
  
  
  1.48      +4 -1      parrot/jit/i386/jit_emit.h
  
  Index: jit_emit.h
  ===================================================================
  RCS file: /cvs/public/parrot/jit/i386/jit_emit.h,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -w -r1.47 -r1.48
  --- jit_emit.h        14 Jan 2003 09:33:38 -0000      1.47
  +++ jit_emit.h        16 Jan 2003 17:26:36 -0000      1.48
  @@ -3,7 +3,7 @@
    *
    * i386
    *
  - * $Id: jit_emit.h,v 1.47 2003/01/14 09:33:38 leo Exp $
  + * $Id: jit_emit.h,v 1.48 2003/01/16 17:26:36 leo Exp $
    */
   
   #include <assert.h>
  @@ -2136,6 +2136,9 @@
                   emitm_calll(pc, (char*)string_to_cstring - pc - 4);
                   emitm_addb_i_r(pc, 8, emit_ESP);
                   emitm_pushl_r(pc, emit_EAX);
  +                break;
  +            case 'I':
  +                emitm_pushl_i(pc, interpreter);
                   break;
               default:
                   internal_exception(1,
  
  
  
  1.1                  parrot/t/pmc/eval.t
  
  Index: eval.t
  ===================================================================
  #! perl -w
  
  use Parrot::Test tests => 3;
  use Test::More;
  
  output_is(<<'CODE', <<'OUTPUT', "eval_sc");
        compreg P1, "PASM1"     # get compiler
        set S1, "in eval\n"
        compile P0, P1, "print_s S1"
        invoke                  # eval code P0
        print "back again\n"
        end
  CODE
  in eval
  back again
  OUTPUT
  
  output_is(<<'CODE', <<'OUTPUT', "eval_s - check nci globbered reg");
        compreg P1, "PASM1"
        set I0, 41
        set S1, "inc_i I0"
        compile P0, P1, S1
        invoke
        print I0
        print "\n"
        end
  CODE
  42
  OUTPUT
  
  output_is(<<'CODE', <<'OUTPUT', "eval_s - check nci param S5 ");
        compreg P1, "PASM1"
        set S1, "hello "
        set S5, "concat_s_sc S1, 'parrot'"
        compile P0, P1, S5
        invoke
        print S1
        print "\n"
        end
  CODE
  hello parrot
  OUTPUT
  
  
  


Reply via email to