Here is a big diff that removes the interpreter argument from vtable function
calls, and creates macros for obtaining the pointer to an interpreter structure
for the current thread from thread local storage, assuming only that there is
one interpreter per thread. It works on unixish systems with pthread, on
mswin32, and systems with no threading (using a global variable). There is no
code here for creating threads etc., this is just intended to eliminate
gratuitous passing of the interpreter pointer to places it is not needed.
Currently it gives a small but consistent increase in the PMC mops figure of
about 5 percent.

I have separate platform thread files since there are a number of different
threading alternatives for some systems, though it might be more reasonable to
ifdef these in platform files.

I'd like to know if no one cares or does care and has suggestions.

-- 
Jason
diff -urN --exclude=CVS parrot/Configure.pl parrot-fixed/Configure.pl
--- parrot/Configure.pl Fri Dec 21 08:47:38 2001
+++ parrot-fixed/Configure.pl   Sat Dec 22 10:49:59 2001
@@ -116,6 +116,7 @@
        make_set_make=>          $Config{make_set_make},
        
        platform =>     $^O,
+       threadplatform => $Config{'i_pthread'} ? 'pthread' : 'fakethreads',
 
     cpuarch  => $cpuarch,
     osname   => $osname,
@@ -162,6 +163,9 @@
     copy("platforms/generic.c", "platform.c");
 }
 
+copy("platforms/$c{threadplatform}.h", "include/parrot/plat_thread.h");
+copy("platforms/$c{threadplatform}.c", "plat_thread.c");
+
 unless( $c{debugging} ) {
        $c{ld_debug} = ' ';
        $c{cc_debug} = ' ';
@@ -179,6 +183,9 @@
        $c{$_}=$Config{$_};
        $c{headers}.=defineifdef((/^i_(.*)$/));
 }
+
+$c{ccflags} .= " -D_REENTRANT" if $Config{'i_pthread'};
+$c{libs} .= " -lpthread" if $Config{'i_pthread'};
 
 print <<"END";
 
diff -urN --exclude=CVS parrot/Makefile.in parrot-fixed/Makefile.in
--- parrot/Makefile.in  Fri Dec 21 14:32:43 2001
+++ parrot-fixed/Makefile.in    Fri Dec 21 18:42:56 2001
@@ -19,7 +19,7 @@
 chartype$(O) runops_cores$(O) trace$(O) pmc$(O) key$(O) \
 encodings/singlebyte$(O) encodings/utf8$(O) encodings/utf16$(O) \
 encodings/utf32$(O) chartypes/unicode$(O) chartypes/usascii$(O) resources$(O) \
-platform$(O) $(CLASS_O_FILES) jit$(O)
+platform$(O) $(CLASS_O_FILES) jit$(O) thread$(O) plat_thread$(O)
 
 #DO NOT ADD C COMPILER FLAGS HERE
 #Add them in Configure.pl--look for the
diff -urN --exclude=CVS parrot/Parrot/Vtable.pm parrot-fixed/Parrot/Vtable.pm
--- parrot/Parrot/Vtable.pm     Sun Dec 16 07:45:00 2001
+++ parrot-fixed/Parrot/Vtable.pm       Fri Dec 21 19:03:10 2001
@@ -47,7 +47,7 @@
                 }
             }
             $vtbl{$expand_name}{type} = $type;
-            $vtbl{$expand_name}{proto} = "$type (*$expand_name)(struct Parrot_Interp 
*interpreter, PMC* pmc";
+            $vtbl{$expand_name}{proto} = "$type (*$expand_name)(PMC* pmc";
 
             # Parse the function parameters
             for (@line) {
diff -urN --exclude=CVS parrot/classes/default.pmc parrot-fixed/classes/default.pmc
--- parrot/classes/default.pmc  Tue Dec 18 02:05:00 2001
+++ parrot-fixed/classes/default.pmc    Fri Dec 21 19:20:30 2001
@@ -224,16 +224,16 @@
    }
 
    void logical_or (PMC* value,  PMC* dest) {
-        dest->vtable->set_integer_native(INTERP, dest, 
-            SELF->vtable->get_bool(INTERP, SELF) ||
-            value->vtable->get_bool(INTERP, value)
+        dest->vtable->set_integer_native(dest, 
+            SELF->vtable->get_bool(SELF) ||
+            value->vtable->get_bool(value)
         );
    }
 
    void logical_and (PMC* value,  PMC* dest) {
-        dest->vtable->set_integer_native(INTERP, dest, 
-            SELF->vtable->get_bool(INTERP, SELF) &&
-            value->vtable->get_bool(INTERP, value)
+        dest->vtable->set_integer_native(dest, 
+            SELF->vtable->get_bool(SELF) &&
+            value->vtable->get_bool(value)
         );
    }
 
diff -urN --exclude=CVS parrot/classes/perlarray.pmc parrot-fixed/classes/perlarray.pmc
--- parrot/classes/perlarray.pmc        Tue Dec 18 02:05:00 2001
+++ parrot-fixed/classes/perlarray.pmc  Fri Dec 21 19:20:30 2001
@@ -93,7 +93,7 @@
     }
 
     void set_integer (PMC* value) {
-       INTVAL size = value->vtable->get_integer(INTERP,value);
+       INTVAL size = value->vtable->get_integer(value);
        KEY* key = SELF->cache.struct_val;
        key_set_size(INTERP,key,size);
     }
@@ -186,15 +186,15 @@
     void add (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
-               SELF->vtable->get_integer(INTERP, SELF) +
+            dest->vtable->set_integer_native(dest, 
+               SELF->vtable->get_integer(SELF) +
                 value->cache.int_val
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
-               SELF->vtable->get_number(INTERP, SELF) +
+            dest->vtable->set_number_native(dest, 
+               SELF->vtable->get_number(SELF) +
                 value->cache.num_val
             );
        }
@@ -204,8 +204,8 @@
 
     void add_int (INTVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-        dest->vtable->set_integer_native(INTERP, dest, 
-           SELF->vtable->get_integer(INTERP, SELF) +
+        dest->vtable->set_integer_native(dest, 
+           SELF->vtable->get_integer(SELF) +
             value
         );
     }
@@ -215,8 +215,8 @@
 
     void add_float (FLOATVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-       dest->vtable->set_number_native(INTERP, dest, 
-           SELF->vtable->get_number(INTERP, SELF) +
+       dest->vtable->set_number_native(dest, 
+           SELF->vtable->get_number(SELF) +
             value
         );
     }
@@ -230,15 +230,15 @@
     void subtract (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
-               SELF->vtable->get_integer(INTERP, SELF) -
+            dest->vtable->set_integer_native(dest, 
+               SELF->vtable->get_integer(SELF) -
                 value->cache.int_val
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
-               SELF->vtable->get_number(INTERP, SELF) -
+            dest->vtable->set_number_native(dest, 
+               SELF->vtable->get_number(SELF) -
                 value->cache.num_val
             );
        }
@@ -248,8 +248,8 @@
 
     void subtract_int (INTVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-        dest->vtable->set_integer_native(INTERP, dest, 
-           SELF->vtable->get_integer(INTERP, SELF) -
+        dest->vtable->set_integer_native(dest, 
+           SELF->vtable->get_integer(SELF) -
             value
         );
     }
@@ -259,8 +259,8 @@
 
     void subtract_float (FLOATVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-       dest->vtable->set_number_native(INTERP, dest, 
-           SELF->vtable->get_number(INTERP, SELF) -
+       dest->vtable->set_number_native(dest, 
+           SELF->vtable->get_number(SELF) -
             value
         );
     }
@@ -274,15 +274,15 @@
     void multiply (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
-               SELF->vtable->get_integer(INTERP, SELF) *
+            dest->vtable->set_integer_native(dest, 
+               SELF->vtable->get_integer(SELF) *
                 value->cache.int_val
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
-               SELF->vtable->get_number(INTERP, SELF) *
+            dest->vtable->set_number_native(dest, 
+               SELF->vtable->get_number(SELF) *
                 value->cache.num_val
             );
        }
@@ -292,8 +292,8 @@
 
     void multiply_int (INTVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-        dest->vtable->set_integer_native(INTERP, dest, 
-           SELF->vtable->get_integer(INTERP, SELF) *
+        dest->vtable->set_integer_native(dest, 
+           SELF->vtable->get_integer(SELF) *
             value
         );
     }
@@ -303,8 +303,8 @@
 
     void multiply_float (FLOATVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-       dest->vtable->set_number_native(INTERP, dest, 
-           SELF->vtable->get_number(INTERP, SELF) *
+       dest->vtable->set_number_native(dest, 
+           SELF->vtable->get_number(SELF) *
             value
         );
     }
@@ -318,15 +318,15 @@
     void divide (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
-               SELF->vtable->get_integer(INTERP, SELF) /
+            dest->vtable->set_integer_native(dest, 
+               SELF->vtable->get_integer(SELF) /
                 value->cache.int_val
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
-               SELF->vtable->get_number(INTERP, SELF) /
+            dest->vtable->set_number_native(dest, 
+               SELF->vtable->get_number(SELF) /
                 value->cache.num_val
             );
        }
@@ -336,8 +336,8 @@
 
     void divide_int (INTVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-        dest->vtable->set_integer_native(INTERP, dest, 
-           SELF->vtable->get_integer(INTERP, SELF) /
+        dest->vtable->set_integer_native(dest, 
+           SELF->vtable->get_integer(SELF) /
             value
         );
     }
@@ -347,8 +347,8 @@
 
     void divide_float (FLOATVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-       dest->vtable->set_number_native(INTERP, dest, 
-           SELF->vtable->get_number(INTERP, SELF) /
+       dest->vtable->set_number_native(dest, 
+           SELF->vtable->get_number(SELF) /
             value
         );
     }
@@ -362,8 +362,8 @@
     void modulus (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
-               SELF->vtable->get_integer(INTERP, SELF) %
+            dest->vtable->set_integer_native(dest, 
+               SELF->vtable->get_integer(SELF) %
                 value->cache.int_val
             );
        }
@@ -373,8 +373,8 @@
 
     void modulus_int (INTVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-        dest->vtable->set_integer_native(INTERP, dest, 
-           SELF->vtable->get_integer(INTERP, SELF) %
+        dest->vtable->set_integer_native(dest, 
+           SELF->vtable->get_integer(SELF) %
             value
         );
     }
@@ -395,7 +395,7 @@
        dest->cache.struct_val =
            string_concat(INTERP,
                          SELF->cache.struct_val,
-                         value->vtable->get_string(INTERP, value),
+                         value->vtable->get_string(value),
                          0
                         );
     }
diff -urN --exclude=CVS parrot/classes/perlint.pmc parrot-fixed/classes/perlint.pmc
--- parrot/classes/perlint.pmc  Tue Dec 18 02:05:00 2001
+++ parrot-fixed/classes/perlint.pmc    Fri Dec 21 21:13:03 2001
@@ -91,7 +91,7 @@
     }
 
     void set_integer (PMC* value) {
-        SELF->cache.int_val = (INTVAL)value->vtable->get_integer(INTERP, value);
+        SELF->cache.int_val = (INTVAL)value->vtable->get_integer(value);
     }
 
     void set_integer_native (INTVAL value) {
@@ -166,40 +166,40 @@
     void add (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                SELF->cache.int_val +
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlString]) {
-           FLOATVAL f = value->vtable->get_number(INTERP, value);
-           INTVAL   i = value->vtable->get_integer(INTERP, value);
+           FLOATVAL f = value->vtable->get_number(value);
+           INTVAL   i = value->vtable->get_integer(value);
            if(f != i) {
                dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-               dest->vtable->set_number_native(INTERP, dest, 
+               dest->vtable->set_number_native(dest, 
                    SELF->cache.int_val +
-                    value->vtable->get_number(INTERP, value)
+                    value->vtable->get_number(value)
                );
            }
            else {
                dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-               dest->vtable->set_integer_native(INTERP, dest, 
+               dest->vtable->set_integer_native(dest, 
                    SELF->cache.int_val +
-                    value->vtable->get_integer(INTERP, value)
+                    value->vtable->get_integer(value)
                );
            }
        }
        else {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
+            dest->vtable->set_integer_native(dest, 
                SELF->cache.int_val +
-                value->vtable->get_integer(INTERP, value)
+                value->vtable->get_integer(value)
             );
        }
     }
 
     void add_int (INTVAL value, PMC* dest) {
-        dest->vtable->set_integer_native(INTERP, dest, SELF->cache.int_val + value);
+        dest->vtable->set_integer_native(dest, SELF->cache.int_val + value);
     }
 
     void add_bigint (BIGINT value, PMC* dest) {
@@ -218,40 +218,40 @@
     void subtract (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                SELF->cache.int_val -
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlString]) {
-           FLOATVAL f = value->vtable->get_number(INTERP, value);
-           INTVAL   i = value->vtable->get_integer(INTERP, value);
+           FLOATVAL f = value->vtable->get_number(value);
+           INTVAL   i = value->vtable->get_integer(value);
            if(f != i) {
                dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-               dest->vtable->set_number_native(INTERP, dest, 
+               dest->vtable->set_number_native(dest, 
                    SELF->cache.int_val -
-                    value->vtable->get_number(INTERP, value)
+                    value->vtable->get_number(value)
                );
            }
            else {
                dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-               dest->vtable->set_integer_native(INTERP, dest, 
+               dest->vtable->set_integer_native(dest, 
                    SELF->cache.int_val -
-                    value->vtable->get_integer(INTERP, value)
+                    value->vtable->get_integer(value)
                );
            }
        }
        else {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
+            dest->vtable->set_integer_native(dest, 
                SELF->cache.int_val -
-                value->vtable->get_integer(INTERP, value)
+                value->vtable->get_integer(value)
             );
        }
     }
 
     void subtract_int (INTVAL value, PMC* dest) {
-        dest->vtable->set_integer_native(INTERP, dest, 
+        dest->vtable->set_integer_native(dest, 
             SELF->cache.int_val - value
         );
     }
@@ -272,40 +272,40 @@
     void multiply (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                SELF->cache.int_val *
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlString]) {
-           FLOATVAL f = value->vtable->get_number(INTERP, value);
-           INTVAL   i = value->vtable->get_integer(INTERP, value);
+           FLOATVAL f = value->vtable->get_number(value);
+           INTVAL   i = value->vtable->get_integer(value);
            if(f != i) {
                dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-               dest->vtable->set_number_native(INTERP, dest, 
+               dest->vtable->set_number_native(dest, 
                    SELF->cache.int_val *
-                    value->vtable->get_number(INTERP, value)
+                    value->vtable->get_number(value)
                );
            }
            else {
                dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-               dest->vtable->set_integer_native(INTERP, dest, 
+               dest->vtable->set_integer_native(dest, 
                    SELF->cache.int_val *
-                    value->vtable->get_integer(INTERP, value)
+                    value->vtable->get_integer(value)
                );
            }
        }
        else {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
+            dest->vtable->set_integer_native(dest, 
                SELF->cache.int_val *
-                value->vtable->get_integer(INTERP, value)
+                value->vtable->get_integer(value)
             );
        }
     }
 
     void multiply_int (INTVAL value, PMC* dest) {
-        dest->vtable->set_integer_native(INTERP, dest, 
+        dest->vtable->set_integer_native(dest, 
             SELF->cache.int_val * value
         );
     }
@@ -326,39 +326,39 @@
     void divide (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                SELF->cache.int_val /
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlString]) {
-           FLOATVAL f = value->vtable->get_number(INTERP, value);
-           INTVAL   i = value->vtable->get_integer(INTERP, value);
+           FLOATVAL f = value->vtable->get_number(value);
+           INTVAL   i = value->vtable->get_integer(value);
            if(f != i) {
                dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-               dest->vtable->set_number_native(INTERP, dest, 
+               dest->vtable->set_number_native(dest, 
                    SELF->cache.int_val /
-                    value->vtable->get_number(INTERP, value)
+                    value->vtable->get_number(value)
                );
            }
            else {
                dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-               dest->vtable->set_integer_native(INTERP, dest, 
+               dest->vtable->set_integer_native(dest, 
                    SELF->cache.int_val /
-                    value->vtable->get_integer(INTERP, value)
+                    value->vtable->get_integer(value)
                );
            }
        }
        else {
             /* Interesting race condition if SELF == dest */
-            FLOATVAL result = SELF->cache.int_val / 
(FLOATVAL)value->vtable->get_integer(INTERP, value);
+            FLOATVAL result = SELF->cache.int_val / 
+(FLOATVAL)value->vtable->get_integer(value);
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, result);
+            dest->vtable->set_number_native(dest, result);
        }
     }
 
     void divide_int (INTVAL value, PMC* dest) {
-        dest->vtable->set_number_native(INTERP, dest, 
+        dest->vtable->set_number_native(dest, 
             SELF->cache.int_val / value
         );
     }
@@ -381,30 +381,30 @@
 fprintf(stderr,"perlint_modulus not implemented for floating point\n");
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlString]) {
-           FLOATVAL f = value->vtable->get_number(INTERP, value);
-           INTVAL   i = value->vtable->get_integer(INTERP, value);
+           FLOATVAL f = value->vtable->get_number(value);
+           INTVAL   i = value->vtable->get_integer(value);
            if(f != i) {
 fprintf(stderr,"perlint_modulus not implemented for floating point\n");
            }
            else {
                dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-               dest->vtable->set_integer_native(INTERP, dest, 
+               dest->vtable->set_integer_native(dest, 
                    SELF->cache.int_val %
-                    value->vtable->get_integer(INTERP, value)
+                    value->vtable->get_integer(value)
                );
            }
        }
        else {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
+            dest->vtable->set_integer_native(dest, 
                SELF->cache.int_val %
-                value->vtable->get_integer(INTERP, value)
+                value->vtable->get_integer(value)
             );
        }
     }
 
     void modulus_int (INTVAL value, PMC* dest) {
-        dest->vtable->set_integer_native(INTERP, dest, 
+        dest->vtable->set_integer_native(dest, 
             SELF->cache.int_val % value
         );
     }
@@ -425,80 +425,80 @@
     void concatenate (PMC * value, PMC* dest) {
        STRING* s;
        s = string_concat(INTERP,
-                         SELF->vtable->get_string(INTERP, SELF),
-                         value->vtable->get_string(INTERP, value),
+                         SELF->vtable->get_string(SELF),
+                         value->vtable->get_string(value),
                          0
         );
        dest->vtable = &Parrot_base_vtables[enum_class_PerlString];
-       dest->vtable->set_string_native(INTERP,dest,s);
+       dest->vtable->set_string_native(dest,s);
     }
 
     void concatenate_native (STRING * value, PMC* dest) {
        STRING* s;
        s = string_concat(INTERP,
-                         SELF->vtable->get_string(INTERP, SELF),
+                         SELF->vtable->get_string(SELF),
                          value,
                          0
         );
        dest->vtable = &Parrot_base_vtables[enum_class_PerlString];
-       dest->vtable->set_string_native(INTERP,dest,s);
+       dest->vtable->set_string_native(dest,s);
     }
 
     void concatenate_unicode (STRING * value, PMC* dest) {
        STRING* s;
        s = string_concat(INTERP,
-                         SELF->vtable->get_string(INTERP, SELF),
+                         SELF->vtable->get_string(SELF),
                          value,
                          0
         );
        dest->vtable = &Parrot_base_vtables[enum_class_PerlString];
-       dest->vtable->set_string_native(INTERP,dest,s);
+       dest->vtable->set_string_native(dest,s);
     }
 
     void concatenate_other (STRING * value, PMC* dest) {
        STRING* s;
        s = string_concat(INTERP,
-                         SELF->vtable->get_string(INTERP, SELF),
+                         SELF->vtable->get_string(SELF),
                          value,
                          0
         );
        dest->vtable = &Parrot_base_vtables[enum_class_PerlString];
-       dest->vtable->set_string_native(INTERP,dest,s);
+       dest->vtable->set_string_native(dest,s);
     }
 
     void concatenate_same (PMC * value, PMC* dest) {
        STRING* s;
        s = string_concat(INTERP,
-                         SELF->vtable->get_string(INTERP, SELF),
-                         value->vtable->get_string(INTERP, value),
+                         SELF->vtable->get_string(SELF),
+                         value->vtable->get_string(value),
                          0
         );
        dest->vtable = &Parrot_base_vtables[enum_class_PerlString];
-       dest->vtable->set_string_native(INTERP,dest,s);
+       dest->vtable->set_string_native(dest,s);
     }
 
     /* == operation */
     BOOLVAL is_equal (PMC* value) {
-        return SELF->cache.int_val == value->vtable->get_integer(INTERP, value);
+        return SELF->cache.int_val == value->vtable->get_integer(value);
     }
 
     void logical_or (PMC* value, PMC* dest) {
         /* No set_bool :( */
-        dest->vtable->set_integer_native(INTERP, dest,
+        dest->vtable->set_integer_native(dest,
             SELF->cache.int_val || 
-            value->vtable->get_integer(INTERP, value)
+            value->vtable->get_integer(value)
         );
     }
 
     void logical_and (PMC* value, PMC* dest) {
-        dest->vtable->set_integer_native(INTERP, dest,
+        dest->vtable->set_integer_native(dest,
             SELF->cache.int_val && 
-            value->vtable->get_integer(INTERP, value)
+            value->vtable->get_integer(value)
         );
     }
 
     void logical_not (PMC* value) {
-        SELF->cache.int_val = (INTVAL)(!value->vtable->get_bool(INTERP, value));
+        SELF->cache.int_val = (INTVAL)(!value->vtable->get_bool(value));
     }
 
     void match (PMC * value,REGEX* re) {
diff -urN --exclude=CVS parrot/classes/perlnum.pmc parrot-fixed/classes/perlnum.pmc
--- parrot/classes/perlnum.pmc  Tue Dec 18 02:05:00 2001
+++ parrot-fixed/classes/perlnum.pmc    Fri Dec 21 20:14:40 2001
@@ -111,7 +111,7 @@
     }
 
     void set_number (PMC * value) {
-        SELF->cache.num_val = (FLOATVAL)value->vtable->get_number(INTERP, value);
+        SELF->cache.num_val = (FLOATVAL)value->vtable->get_number(value);
     }
 
     void set_number_native (FLOATVAL value) {
@@ -164,29 +164,29 @@
     void add (PMC * value, PMC* dest) {
         if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
             dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                 SELF->cache.num_val +
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
         }
         else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
             dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                 SELF->cache.num_val +
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
         }
         else if(value->vtable == &Parrot_base_vtables[enum_class_PerlString]) {
             dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                 SELF->cache.num_val +
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
         }
     }
 
     void add_int (INTVAL value, PMC* dest) {
-        dest->vtable->set_number_native(INTERP, dest, SELF->cache.num_val + value);
+        dest->vtable->set_number_native(dest, SELF->cache.num_val + value);
     }
 
     void add_bigint (BIGINT value, PMC* dest) {
@@ -208,16 +208,16 @@
     void subtract (PMC * value, PMC* dest) {
         if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
             dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                 SELF->cache.num_val -
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
         }
         else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
             dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                 SELF->cache.num_val -
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
         }
         else {
@@ -225,7 +225,7 @@
     }
 
     void subtract_int (INTVAL value, PMC* dest) {
-        dest->vtable->set_number_native(INTERP, dest, 
+        dest->vtable->set_number_native(dest, 
             SELF->cache.num_val - (FLOATVAL)value
         );
     }
@@ -249,16 +249,16 @@
     void multiply (PMC * value, PMC* dest) {
         if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
             dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                 SELF->cache.num_val *
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
         }
         else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
             dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                 SELF->cache.num_val *
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
         }
         else {
@@ -266,7 +266,7 @@
     }
 
     void multiply_int (INTVAL value, PMC* dest) {
-        dest->vtable->set_number_native(INTERP, dest, 
+        dest->vtable->set_number_native(dest, 
             SELF->cache.num_val * value
         );
     }
@@ -290,16 +290,16 @@
     void divide (PMC * value, PMC* dest) {
         if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
             dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                 SELF->cache.num_val /
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
         }
         else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
             dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
+            dest->vtable->set_number_native(dest, 
                 SELF->cache.num_val /
-                value->vtable->get_number(INTERP, value)
+                value->vtable->get_number(value)
             );
         }
         else {
@@ -307,7 +307,7 @@
     }
 
     void divide_int (INTVAL value, PMC* dest) {
-        dest->vtable->set_number_native(INTERP, dest, 
+        dest->vtable->set_number_native(dest, 
             SELF->cache.num_val / value
         );
     }
@@ -355,61 +355,61 @@
     void concatenate (PMC * value, PMC* dest) {
        STRING* s;
        s = string_concat(INTERP,
-                         SELF->vtable->get_string(INTERP, SELF),
-                         value->vtable->get_string(INTERP, value),
+                         SELF->vtable->get_string(SELF),
+                         value->vtable->get_string(value),
                          0
         );
        dest->vtable = &Parrot_base_vtables[enum_class_PerlString];
-       dest->vtable->set_string_native(INTERP,dest,s);
+       dest->vtable->set_string_native(dest,s);
     }
 
     void concatenate_native (STRING * value, PMC* dest) {
        STRING* s;
        s = string_concat(INTERP,
-                         SELF->vtable->get_string(INTERP, SELF),
+                         SELF->vtable->get_string(SELF),
                          value,
                          0
         );
        dest->vtable = &Parrot_base_vtables[enum_class_PerlString];
-       dest->vtable->set_string_native(INTERP,dest,s);
+       dest->vtable->set_string_native(dest,s);
     }
 
     void concatenate_unicode (STRING * value, PMC* dest) {
        STRING* s;
        s = string_concat(INTERP,
-                         SELF->vtable->get_string(INTERP, SELF),
+                         SELF->vtable->get_string(SELF),
                          value,
                          0
         );
        dest->vtable = &Parrot_base_vtables[enum_class_PerlString];
-       dest->vtable->set_string_native(INTERP,dest,s);
+       dest->vtable->set_string_native(dest,s);
     }
 
     void concatenate_other (STRING * value, PMC* dest) {
        STRING* s;
        s = string_concat(INTERP,
-                         SELF->vtable->get_string(INTERP, SELF),
+                         SELF->vtable->get_string(SELF),
                          value,
                          0
         );
        dest->vtable = &Parrot_base_vtables[enum_class_PerlString];
-       dest->vtable->set_string_native(INTERP,dest,s);
+       dest->vtable->set_string_native(dest,s);
     }
 
     void concatenate_same (PMC * value, PMC* dest) {
        STRING* s;
        s = string_concat(INTERP,
-                         SELF->vtable->get_string(INTERP, SELF),
-                         value->vtable->get_string(INTERP, value),
+                         SELF->vtable->get_string(SELF),
+                         value->vtable->get_string(value),
                          0
         );
        dest->vtable = &Parrot_base_vtables[enum_class_PerlString];
-       dest->vtable->set_string_native(INTERP,dest,s);
+       dest->vtable->set_string_native(dest,s);
     }
 
     /* == operation */
     BOOLVAL is_equal (PMC* value) {
-        return SELF->cache.num_val == value->vtable->get_number(INTERP, value);
+        return SELF->cache.num_val == value->vtable->get_number(value);
     }
 
     void logical_or (PMC* value, PMC* dest) = default;
diff -urN --exclude=CVS parrot/classes/perlstring.pmc 
parrot-fixed/classes/perlstring.pmc
--- parrot/classes/perlstring.pmc       Tue Dec 18 02:05:00 2001
+++ parrot-fixed/classes/perlstring.pmc Fri Dec 21 19:20:30 2001
@@ -47,7 +47,7 @@
 
     INTVAL get_integer () {
        STRING* s = (STRING*) SELF->cache.struct_val;
-       return string_to_int(interpreter, s);
+       return string_to_int(INTERP, s);
     }
 
     INTVAL get_integer_index () {
@@ -55,7 +55,7 @@
 
     FLOATVAL get_number () {
        STRING* s = (STRING*) SELF->cache.struct_val;
-       return string_to_num(interpreter, s);
+       return string_to_num(INTERP, s);
     }
 
     FLOATVAL get_number_index () {
@@ -85,7 +85,7 @@
 
     void set_integer (PMC* value) {
        SELF->vtable = &(Parrot_base_vtables[enum_class_PerlInt]);
-       SELF->cache.int_val = value->vtable->get_integer(INTERP,value);
+       SELF->cache.int_val = value->vtable->get_integer(value);
     }
 
     void set_integer_native (INTVAL value) {
@@ -98,7 +98,7 @@
 
     void set_integer_same (PMC * value) {
        SELF->vtable = &(Parrot_base_vtables[enum_class_PerlInt]);
-       SELF->cache.int_val = value->vtable->get_integer(INTERP,value);
+       SELF->cache.int_val = value->vtable->get_integer(value);
     }
 
     void set_integer_index (INTVAL value, INTVAL index) {
@@ -106,7 +106,7 @@
 
     void set_number (PMC * value) {
        SELF->vtable = &(Parrot_base_vtables[enum_class_PerlNum]);
-       SELF->cache.num_val = value->vtable->get_number(INTERP,value);
+       SELF->cache.num_val = value->vtable->get_number(value);
     }
 
     void set_number_native (FLOATVAL value) {
@@ -155,16 +155,14 @@
     void add (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
-               SELF->vtable->get_integer(INTERP, SELF) +
-                value->cache.int_val
+            dest->vtable->set_integer_native(dest, 
+               SELF->vtable->get_integer(SELF) + value->cache.int_val
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
-               SELF->vtable->get_number(INTERP, SELF) +
-                value->cache.num_val
+            dest->vtable->set_number_native(dest, 
+               SELF->vtable->get_number(SELF) + value->cache.num_val
             );
        }
        else {
@@ -173,9 +171,8 @@
 
     void add_int (INTVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-        dest->vtable->set_integer_native(INTERP, dest, 
-           SELF->vtable->get_integer(INTERP, SELF) +
-            value
+        dest->vtable->set_integer_native(dest, 
+           SELF->vtable->get_integer(SELF) + value
         );
     }
 
@@ -184,9 +181,8 @@
 
     void add_float (FLOATVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-       dest->vtable->set_number_native(INTERP, dest, 
-           SELF->vtable->get_number(INTERP, SELF) +
-            value
+       dest->vtable->set_number_native(dest, 
+           SELF->vtable->get_number(SELF) + value
         );
     }
 
@@ -199,16 +195,14 @@
     void subtract (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
-               SELF->vtable->get_integer(INTERP, SELF) -
-                value->cache.int_val
+            dest->vtable->set_integer_native(dest, 
+               SELF->vtable->get_integer(SELF) - value->cache.int_val
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
-               SELF->vtable->get_number(INTERP, SELF) -
-                value->cache.num_val
+            dest->vtable->set_number_native(dest, 
+               SELF->vtable->get_number(SELF) - value->cache.num_val
             );
        }
        else {
@@ -217,9 +211,8 @@
 
     void subtract_int (INTVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-        dest->vtable->set_integer_native(INTERP, dest, 
-           SELF->vtable->get_integer(INTERP, SELF) -
-            value
+        dest->vtable->set_integer_native(dest, 
+           SELF->vtable->get_integer(SELF) - value
         );
     }
 
@@ -228,9 +221,8 @@
 
     void subtract_float (FLOATVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-       dest->vtable->set_number_native(INTERP, dest, 
-           SELF->vtable->get_number(INTERP, SELF) -
-            value
+       dest->vtable->set_number_native(dest, 
+           SELF->vtable->get_number(SELF) - value
         );
     }
 
@@ -243,16 +235,14 @@
     void multiply (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
-               SELF->vtable->get_integer(INTERP, SELF) *
-                value->cache.int_val
+            dest->vtable->set_integer_native(dest, 
+               SELF->vtable->get_integer(SELF) * value->cache.int_val
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
-               SELF->vtable->get_number(INTERP, SELF) *
-                value->cache.num_val
+            dest->vtable->set_number_native(dest, 
+               SELF->vtable->get_number(SELF) * value->cache.num_val
             );
        }
        else {
@@ -261,9 +251,8 @@
 
     void multiply_int (INTVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-        dest->vtable->set_integer_native(INTERP, dest, 
-           SELF->vtable->get_integer(INTERP, SELF) *
-            value
+        dest->vtable->set_integer_native(dest, 
+           SELF->vtable->get_integer(SELF) * value
         );
     }
 
@@ -272,9 +261,8 @@
 
     void multiply_float (FLOATVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-       dest->vtable->set_number_native(INTERP, dest, 
-           SELF->vtable->get_number(INTERP, SELF) *
-            value
+       dest->vtable->set_number_native(dest, 
+           SELF->vtable->get_number(SELF) * value
         );
     }
 
@@ -287,16 +275,14 @@
     void divide (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
-               SELF->vtable->get_integer(INTERP, SELF) /
-                value->cache.int_val
+            dest->vtable->set_integer_native(dest, 
+               SELF->vtable->get_integer(SELF) / value->cache.int_val
             );
        }
        else if(value->vtable == &Parrot_base_vtables[enum_class_PerlNum]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-            dest->vtable->set_number_native(INTERP, dest, 
-               SELF->vtable->get_number(INTERP, SELF) /
-                value->cache.num_val
+            dest->vtable->set_number_native(dest, 
+               SELF->vtable->get_number(SELF) / value->cache.num_val
             );
        }
        else {
@@ -305,9 +291,8 @@
 
     void divide_int (INTVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-        dest->vtable->set_integer_native(INTERP, dest, 
-           SELF->vtable->get_integer(INTERP, SELF) /
-            value
+        dest->vtable->set_integer_native(dest, 
+           SELF->vtable->get_integer(SELF) / value
         );
     }
 
@@ -316,9 +301,8 @@
 
     void divide_float (FLOATVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-       dest->vtable->set_number_native(INTERP, dest, 
-           SELF->vtable->get_number(INTERP, SELF) /
-            value
+       dest->vtable->set_number_native(dest, 
+           SELF->vtable->get_number(SELF) / value
         );
     }
 
@@ -331,9 +315,8 @@
     void modulus (PMC * value, PMC* dest) {
        if(value->vtable == &Parrot_base_vtables[enum_class_PerlInt]) {
            dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-            dest->vtable->set_integer_native(INTERP, dest, 
-               SELF->vtable->get_integer(INTERP, SELF) %
-                value->cache.int_val
+            dest->vtable->set_integer_native(dest, 
+               SELF->vtable->get_integer(SELF) % value->cache.int_val
             );
        }
        else {
@@ -342,9 +325,8 @@
 
     void modulus_int (INTVAL value, PMC* dest) {
        dest->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-        dest->vtable->set_integer_native(INTERP, dest, 
-           SELF->vtable->get_integer(INTERP, SELF) %
-            value
+        dest->vtable->set_integer_native(dest, 
+           SELF->vtable->get_integer(SELF) % value
         );
     }
 
@@ -364,7 +346,7 @@
        dest->cache.struct_val =
            string_concat(INTERP,
                          SELF->cache.struct_val,
-                         value->vtable->get_string(INTERP, value),
+                         value->vtable->get_string(value),
                          0
                         );
     }
diff -urN --exclude=CVS parrot/classes/perlundef.pmc parrot-fixed/classes/perlundef.pmc
--- parrot/classes/perlundef.pmc        Tue Dec 18 02:05:00 2001
+++ parrot-fixed/classes/perlundef.pmc  Fri Dec 21 19:20:30 2001
@@ -80,17 +80,17 @@
 
    void set_integer (PMC * value) {
       pmc->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-      pmc->vtable->set_integer(interpreter, pmc, value);
+      pmc->vtable->set_integer(pmc, value);
    }
 
    void set_integer_native (INTVAL value) {
       pmc->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-      pmc->vtable->set_integer_native(interpreter, pmc, value);
+      pmc->vtable->set_integer_native(pmc, value);
    }
 
    void set_integer_bigint (BIGINT value) {
       pmc->vtable = &Parrot_base_vtables[enum_class_PerlInt];
-      pmc->vtable->set_integer_bigint(interpreter, pmc, value);
+      pmc->vtable->set_integer_bigint(pmc, value);
    }
 
    void set_integer_same (PMC * value) {
@@ -102,17 +102,17 @@
 
    void set_number (PMC * value) {
       pmc->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-      pmc->vtable->set_number(interpreter, pmc, value);
+      pmc->vtable->set_number(pmc, value);
    }
 
    void set_number_native (FLOATVAL value) {
       pmc->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-      pmc->vtable->set_number_native(interpreter, pmc, value);
+      pmc->vtable->set_number_native(pmc, value);
    }
 
    void set_number_bigfloat (BIGFLOAT value) {
       pmc->vtable = &Parrot_base_vtables[enum_class_PerlNum];
-      pmc->vtable->set_number_bigfloat(interpreter, pmc, value);
+      pmc->vtable->set_number_bigfloat(pmc, value);
    }
 
    void set_number_same (PMC * value) {
@@ -124,22 +124,22 @@
 
    void set_string (PMC * value) {
       pmc->vtable = &Parrot_base_vtables[enum_class_PerlString];
-      pmc->vtable->set_string(interpreter, pmc, value);
+      pmc->vtable->set_string(pmc, value);
    }
 
    void set_string_native (STRING * value) {
       pmc->vtable = &Parrot_base_vtables[enum_class_PerlString];
-      pmc->vtable->set_string_native(interpreter, pmc, value);
+      pmc->vtable->set_string_native(pmc, value);
    }
 
    void set_string_unicode (STRING * value) {
       pmc->vtable = &Parrot_base_vtables[enum_class_PerlString];
-      pmc->vtable->set_string_unicode(interpreter, pmc, value);
+      pmc->vtable->set_string_unicode(pmc, value);
    }
 
    void set_string_other (STRING * value) {
       pmc->vtable = &Parrot_base_vtables[enum_class_PerlString];
-      pmc->vtable->set_string_other(interpreter, pmc, value);
+      pmc->vtable->set_string_other(pmc, value);
    }
 
    void set_string_same (PMC * value) {
diff -urN --exclude=CVS parrot/classes/pmc2c.pl parrot-fixed/classes/pmc2c.pl
--- parrot/classes/pmc2c.pl     Sat Dec  8 17:07:13 2001
+++ parrot-fixed/classes/pmc2c.pl       Fri Dec 21 19:19:18 2001
@@ -102,9 +102,9 @@
      my ($methodblock, $rema) = extract_balanced($classblock);
   
      $methodblock =~ s/SELF/pmc/g;
-     $methodblock =~ s/INTERP/interpreter/g;
+     $methodblock =~ s/INTERP/Parrot_cur_intrp()/g;
     
-     $OUT .= "$type Parrot_" . $classname. "_" . "$methodname (struct Parrot_Interp 
*interpreter, PMC* pmc$parameters)";      
+     $OUT .= "$type Parrot_" . $classname. "_" . "$methodname (PMC* pmc$parameters)"; 
+     
      $OUT .= $methodblock;
      $OUT .= "\n\n";
 
diff -urN --exclude=CVS parrot/core.ops parrot-fixed/core.ops
--- parrot/core.ops     Fri Dec 21 14:32:43 2001
+++ parrot-fixed/core.ops       Fri Dec 21 19:02:23 2001
@@ -209,7 +209,7 @@
 
 op print(p) {
   PMC *p = $1;
-  STRING *s = (p->vtable->get_string(interpreter, p));
+  STRING *s = (p->vtable->get_string(p));
   if (s) {
     printf("%.*s",(int)string_length(s),(char *) s->bufstart);
   }
@@ -398,7 +398,7 @@
 }
 
 inline op set(n, p) {
-  $1 = $2->vtable->get_number(interpreter, $2);
+  $1 = $2->vtable->get_number($2);
   goto NEXT();
 }
 
@@ -408,57 +408,57 @@
 }
 
 inline op set(p, i|ic) { 
-  $1->vtable->set_integer_native(interpreter, $1, $2);
+  $1->vtable->set_integer_native($1, $2);
   goto NEXT();
 }
 
 inline op set(p, n|nc) { 
-  $1->vtable->set_number_native(interpreter, $1, $2);
+  $1->vtable->set_number_native($1, $2);
   goto NEXT();
 }
 
 inline op set(p, s|sc) {
-  $1->vtable->set_string_native(interpreter, $1, $2);
+  $1->vtable->set_string_native($1, $2);
   goto NEXT();
 }
 
 inline op set(i, p) {
-  $1 = $2->vtable->get_integer(interpreter, $2);
+  $1 = $2->vtable->get_integer($2);
   goto NEXT();
 }
 
 inline op clone(p, p) {
-  $2->vtable->clone(interpreter, $2, $1);
+  $2->vtable->clone($2, $1);
   goto NEXT();
 }
 
 inline op set(p, i|ic, i|ic) {
-  $1->vtable->set_integer_index(interpreter, $1, $2, $3);
+  $1->vtable->set_integer_index($1, $2, $3);
   goto NEXT();
 }
 
 inline op set(p, n|nc, i|ic) {
-  $1->vtable->set_number_index(interpreter, $1, $2, $3);
+  $1->vtable->set_number_index($1, $2, $3);
   goto NEXT();
 }
 
 inline op set(p, s|sc, i|ic) {
-  $1->vtable->set_string_index(interpreter, $1, $2, $3);
+  $1->vtable->set_string_index($1, $2, $3);
   goto NEXT();
 }
 
 inline op set(i, p, i|ic) {
-  $1 = $2->vtable->get_integer_index(interpreter, $2, $3);
+  $1 = $2->vtable->get_integer_index($2, $3);
   goto NEXT();
 }
 
 inline op set(n, p, i|ic) {
-  $1 = $2->vtable->get_number_index(interpreter, $2, $3);
+  $1 = $2->vtable->get_number_index($2, $3);
   goto NEXT();
 }
 
 inline op set(s, p, i|ic) {
-  $1 = $2->vtable->get_string_index(interpreter, $2, $3);
+  $1 = $2->vtable->get_string_index($2, $3);
   goto NEXT();
 }
 
@@ -923,7 +923,7 @@
 }
 
 op if(p, ic) {
-  if ($1->vtable->get_bool(interpreter, $1)) {
+  if ($1->vtable->get_bool($1)) {
     goto OFFSET($2);
   }
   goto NEXT();
@@ -2341,7 +2341,7 @@
   if ($2 <0 || $2 >= enum_class_max) {
     abort(); /* Deserve to lose */
   }
-  newpmc = pmc_new(interpreter, $2);
+  newpmc = pmc_new($2);
   $1 = newpmc;
   goto NEXT();
 }
diff -urN --exclude=CVS parrot/global_setup.c parrot-fixed/global_setup.c
--- parrot/global_setup.c       Tue Dec 18 02:05:00 2001
+++ parrot-fixed/global_setup.c Fri Dec 21 21:11:06 2001
@@ -23,6 +23,7 @@
     Parrot_PerlNum_class_init();
     Parrot_PerlString_class_init();
     Parrot_PerlArray_class_init();
+    Parrot_Thread_init();
 }
 
 /*
diff -urN --exclude=CVS parrot/hints/mswin32.pl parrot-fixed/hints/mswin32.pl
--- parrot/hints/mswin32.pl     Fri Nov  2 07:11:16 2001
+++ parrot-fixed/hints/mswin32.pl       Fri Dec 21 19:05:49 2001
@@ -10,6 +10,7 @@
                $c{cc_debug} = '-Zi';
                $c{ld_debug} = '-debug';
                $c{platform} = 'win32';
+               $c{threadplatform} = 'win32threads';
                $c{cp} = 'copy';
                $c{slash} = '\\';
        }
diff -urN --exclude=CVS parrot/include/parrot/parrot.h 
parrot-fixed/include/parrot/parrot.h
--- parrot/include/parrot/parrot.h      Mon Dec 10 23:00:33 2001
+++ parrot-fixed/include/parrot/parrot.h        Fri Dec 21 19:21:34 2001
@@ -70,6 +70,7 @@
 
 #include "parrot/global_setup.h"
 #include "parrot/interpreter.h"
+#include "parrot/thread.h"
 #include "parrot/encoding.h"
 #include "parrot/chartype.h"
 #include "parrot/string.h"
diff -urN --exclude=CVS parrot/include/parrot/plat_thread.h 
parrot-fixed/include/parrot/plat_thread.h
--- parrot/include/parrot/plat_thread.h Wed Dec 31 19:00:00 1969
+++ parrot-fixed/include/parrot/plat_thread.h   Sat Dec 22 10:41:10 2001
@@ -0,0 +1,31 @@
+/* fakethreads.h
+ *  Copyright: (When this is determined...it will go here)
+ *  CVS Info
+ *     $Id: global_setup.c,v 1.11 2001/12/18 07:05:00 jgoff Exp $
+ *  Overview:
+ *      
+ *      
+ *  Data Structure and Algorithms:
+ *  History:
+ *  Notes:
+ *  References:
+ */
+
+#if !defined(PARROT_PLAT_THREAD_H_GUARD)
+#define PARROT_PLAT_THREAD_H_GUARD
+
+VAR_SCOPE struct Parrot_Interp *_Parrot_cur_intrp;
+#define Parrot_cur_intrp() _Parrot_cur_intrp
+#define Parrot_set_intrp(a) _Parrot_cur_intrp = (a)
+
+#endif
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil 
+ * End:
+ *
+ * vim: expandtab shiftwidth=4:
+*/
diff -urN --exclude=CVS parrot/include/parrot/pmc.h parrot-fixed/include/parrot/pmc.h
--- parrot/include/parrot/pmc.h Tue Dec 18 02:05:01 2001
+++ parrot-fixed/include/parrot/pmc.h   Fri Dec 21 19:12:55 2001
@@ -59,7 +59,7 @@
 /* XXX add various bit test macros once we have need of them */
 
 /* Prototypes */
-PMC* pmc_new(struct Parrot_Interp *interpreter, INTVAL base_type);
+PMC* pmc_new(INTVAL base_type);
 
 #endif
 
diff -urN --exclude=CVS parrot/include/parrot/thread.h 
parrot-fixed/include/parrot/thread.h
--- parrot/include/parrot/thread.h      Wed Dec 31 19:00:00 1969
+++ parrot-fixed/include/parrot/thread.h        Fri Dec 21 19:16:45 2001
@@ -0,0 +1,21 @@
+/* thread.h
+ *  Copyright: (When this is determined...it will go here)
+ *  CVS Info
+ *     $Id$
+ *  Overview:
+ *      
+ *      
+ *  Data Structure and Algorithms:
+ *  History:
+ *  Notes:
+ *  References:
+ */
+
+#if !defined(PARROT_THREAD_H_GUARD)
+#define PARROT_THREAD_H_GUARD
+
+#include"parrot/plat_thread.h"
+
+void Init_Thread_Locals(void);
+
+#endif
diff -urN --exclude=CVS parrot/interpreter.c parrot-fixed/interpreter.c
--- parrot/interpreter.c        Fri Dec 21 14:32:43 2001
+++ parrot-fixed/interpreter.c  Fri Dec 21 21:11:36 2001
@@ -208,6 +208,7 @@
     interpreter->resume_offset = offset;
     interpreter->resume_flag   = 1;
 
+    Parrot_set_intrp(interpreter);
     while (interpreter->resume_flag) {
         int        which = 0;
         opcode_t * pc    = (opcode_t *)interpreter->code->byte_code + 
interpreter->resume_offset;
diff -urN --exclude=CVS parrot/make_vtable_ops.pl parrot-fixed/make_vtable_ops.pl
--- parrot/make_vtable_ops.pl   Fri Dec 21 14:32:43 2001
+++ parrot-fixed/make_vtable_ops.pl     Fri Dec 21 19:11:40 2001
@@ -14,7 +14,7 @@
         my $entry = $_->[1];
         print "inline op $params[1] ($args) {\n";
         print "  (\$2->vtable->$entry";
-        print ")(interpreter, ";
+        print ")(";
         if ($params[0] == 3) {
             # Three-address function
             print '$2,$3,$1';
Binary files parrot/mops.pbc and parrot-fixed/mops.pbc differ
diff -urN --exclude=CVS parrot/plat_thread.c parrot-fixed/plat_thread.c
--- parrot/plat_thread.c        Wed Dec 31 19:00:00 1969
+++ parrot-fixed/plat_thread.c  Sat Dec 22 10:41:10 2001
@@ -0,0 +1,15 @@
+/* fakethreads.c
+ *  Copyright: (When this is determined...it will go here)
+ *  CVS Info
+ *     $Id: global_setup.c,v 1.11 2001/12/18 07:05:00 jgoff Exp $
+ *  Overview:
+ *      
+ *      
+ *  Data Structure and Algorithms:
+ *  History:
+ *  Notes:
+ *  References:
+ */
+
+void Init_Thread_Locals(void){
+}
diff -urN --exclude=CVS parrot/platforms/fakethreads.c 
parrot-fixed/platforms/fakethreads.c
--- parrot/platforms/fakethreads.c      Wed Dec 31 19:00:00 1969
+++ parrot-fixed/platforms/fakethreads.c        Fri Dec 21 18:35:31 2001
@@ -0,0 +1,15 @@
+/* fakethreads.c
+ *  Copyright: (When this is determined...it will go here)
+ *  CVS Info
+ *     $Id: global_setup.c,v 1.11 2001/12/18 07:05:00 jgoff Exp $
+ *  Overview:
+ *      
+ *      
+ *  Data Structure and Algorithms:
+ *  History:
+ *  Notes:
+ *  References:
+ */
+
+void Init_Thread_Locals(void){
+}
diff -urN --exclude=CVS parrot/platforms/fakethreads.h 
parrot-fixed/platforms/fakethreads.h
--- parrot/platforms/fakethreads.h      Wed Dec 31 19:00:00 1969
+++ parrot-fixed/platforms/fakethreads.h        Fri Dec 21 18:35:31 2001
@@ -0,0 +1,31 @@
+/* fakethreads.h
+ *  Copyright: (When this is determined...it will go here)
+ *  CVS Info
+ *     $Id: global_setup.c,v 1.11 2001/12/18 07:05:00 jgoff Exp $
+ *  Overview:
+ *      
+ *      
+ *  Data Structure and Algorithms:
+ *  History:
+ *  Notes:
+ *  References:
+ */
+
+#if !defined(PARROT_PLAT_THREAD_H_GUARD)
+#define PARROT_PLAT_THREAD_H_GUARD
+
+VAR_SCOPE struct Parrot_Interp *_Parrot_cur_intrp;
+#define Parrot_cur_intrp() _Parrot_cur_intrp
+#define Parrot_set_intrp(a) _Parrot_cur_intrp = (a)
+
+#endif
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil 
+ * End:
+ *
+ * vim: expandtab shiftwidth=4:
+*/
diff -urN --exclude=CVS parrot/platforms/pthread.c parrot-fixed/platforms/pthread.c
--- parrot/platforms/pthread.c  Wed Dec 31 19:00:00 1969
+++ parrot-fixed/platforms/pthread.c    Fri Dec 21 20:45:24 2001
@@ -0,0 +1,31 @@
+/* pthread.c
+ *  Copyright: (When this is determined...it will go here)
+ *  CVS Info
+ *     $Id: global_setup.c,v 1.11 2001/12/18 07:05:00 jgoff Exp $
+ *  Overview:
+ *      
+ *      
+ *  Data Structure and Algorithms:
+ *  History:
+ *  Notes:
+ *  References:
+ */
+
+#include "parrot/parrot.h"
+
+void Init_Thread_Locals(void){
+    if(pthread_key_create(&Parrot_tls, NULL)){
+        printf("no good\n");
+        exit(0);
+    }
+}
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil 
+ * End:
+ *
+ * vim: expandtab shiftwidth=4:
+*/
diff -urN --exclude=CVS parrot/platforms/pthread.h parrot-fixed/platforms/pthread.h
--- parrot/platforms/pthread.h  Wed Dec 31 19:00:00 1969
+++ parrot-fixed/platforms/pthread.h    Fri Dec 21 18:35:31 2001
@@ -0,0 +1,34 @@
+/* pthread.h
+ *  Copyright: (When this is determined...it will go here)
+ *  CVS Info
+ *     $Id: global_setup.c,v 1.11 2001/12/18 07:05:00 jgoff Exp $
+ *  Overview:
+ *      
+ *      
+ *  Data Structure and Algorithms:
+ *  History:
+ *  Notes:
+ *  References:
+ */
+
+#if !defined(PARROT_PLAT_THREAD_H_GUARD)
+#define PARROT_PLAT_THREAD_H_GUARD
+
+#include<pthread.h>
+
+VAR_SCOPE pthread_key_t Parrot_tls;
+
+#define Parrot_cur_intrp() ((struct Parrot_Interp *)pthread_getspecific(Parrot_tls))
+#define Parrot_set_intrp(a) (pthread_setspecific(Parrot_tls, (void *)(a)))
+
+#endif
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil 
+ * End:
+ *
+ * vim: expandtab shiftwidth=4:
+*/
diff -urN --exclude=CVS parrot/platforms/win32threads.c 
parrot-fixed/platforms/win32threads.c
--- parrot/platforms/win32threads.c     Wed Dec 31 19:00:00 1969
+++ parrot-fixed/platforms/win32threads.c       Fri Dec 21 18:35:31 2001
@@ -0,0 +1,33 @@
+/* win32threads.c
+ *  Copyright: (When this is determined...it will go here)
+ *  CVS Info
+ *     $Id: global_setup.c,v 1.11 2001/12/18 07:05:00 jgoff Exp $
+ *  Overview:
+ *      
+ *      
+ *  Data Structure and Algorithms:
+ *  History:
+ *  Notes:
+ *  References:
+ */
+
+#include "parrot/parrot.h"
+
+void Init_Thread_Locals(void){
+    Parrot_tls = TlsAlloc();
+
+    if(Parrot_tls == 0xFFFFFFFF){
+        printf("Unable to allocate Thread storage\n");
+        exit(-1);
+    }
+}
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil 
+ * End:
+ *
+ * vim: expandtab shiftwidth=4:
+*/
diff -urN --exclude=CVS parrot/platforms/win32threads.h 
parrot-fixed/platforms/win32threads.h
--- parrot/platforms/win32threads.h     Wed Dec 31 19:00:00 1969
+++ parrot-fixed/platforms/win32threads.h       Fri Dec 21 18:35:31 2001
@@ -0,0 +1,32 @@
+/* win32threads.h
+ *  Copyright: (When this is determined...it will go here)
+ *  CVS Info
+ *     $Id: global_setup.c,v 1.11 2001/12/18 07:05:00 jgoff Exp $
+ *  Overview:
+ *      
+ *      
+ *  Data Structure and Algorithms:
+ *  History:
+ *  Notes:
+ *  References:
+ */
+
+#if !defined(PARROT_PLAT_THREAD_H_GUARD)
+#define PARROT_PLAT_THREAD_H_GUARD
+
+VAR_SCOPE DWORD Parrot_tls;
+
+#define Parrot_cur_intrp() ((struct Parrot_Interp *)TlsGetValue(Parrot_tls))
+#define Parrot_set_intrp(a) (TlsSetValue(Parrot_tls, (LPVOID)(a)));
+
+#endif
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil 
+ * End:
+ *
+ * vim: expandtab shiftwidth=4:
+*/
diff -urN --exclude=CVS parrot/pmc.c parrot-fixed/pmc.c
--- parrot/pmc.c        Fri Nov 16 16:57:28 2001
+++ parrot-fixed/pmc.c  Fri Dec 21 19:14:40 2001
@@ -28,11 +28,11 @@
 =cut
 */
 
-PMC* pmc_new(struct Parrot_Interp *interpreter, INTVAL base_type) {
-    PMC* pmc = new_pmc_header(interpreter);
+PMC* pmc_new(INTVAL base_type) {
+    PMC* pmc = new_pmc_header(Parrot_cur_intrp());
     pmc->flags = 0;
     pmc->data  = 0;
     pmc->vtable = &(Parrot_base_vtables[base_type]);
-    pmc->vtable->init(interpreter, pmc);
+    pmc->vtable->init(pmc);
     return pmc;
 }
diff -urN --exclude=CVS parrot/thread.c parrot-fixed/thread.c
--- parrot/thread.c     Wed Dec 31 19:00:00 1969
+++ parrot-fixed/thread.c       Fri Dec 21 19:22:08 2001
@@ -0,0 +1,18 @@
+/* thread.c
+ *  Copyright: (When this is determined...it will go here)
+ *  CVS Info
+ *     $Id: global_setup.c,v 1.11 2001/12/18 07:05:00 jgoff Exp $
+ *  Overview:
+ *      
+ *      
+ *  Data Structure and Algorithms:
+ *  History:
+ *  Notes:
+ *  References:
+ */
+
+#include "parrot/parrot.h"
+
+void Parrot_Thread_init(void){
+    Init_Thread_Locals();
+}

Reply via email to