[svn:parrot] r38336 - in trunk/src: dynpmc pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Sat Apr 25 04:53:32 UTC 2009


Author: bacek
Date: Sat Apr 25 04:53:29 2009
New Revision: 38336
URL: https://trac.parrot.org/parrot/changeset/38336

Log:
Merge PMC fixes from pmc_pct branch into trunk. cotto++

Modified:
   trunk/src/dynpmc/dynlexpad.pmc
   trunk/src/dynpmc/gdbmhash.pmc
   trunk/src/dynpmc/pair.pmc
   trunk/src/dynpmc/rotest.pmc
   trunk/src/dynpmc/subproxy.pmc
   trunk/src/pmc/class.pmc
   trunk/src/pmc/default.pmc
   trunk/src/pmc/eventhandler.pmc
   trunk/src/pmc/exception.pmc
   trunk/src/pmc/fixedpmcarray.pmc
   trunk/src/pmc/hash.pmc
   trunk/src/pmc/multisub.pmc
   trunk/src/pmc/null.pmc
   trunk/src/pmc/orderedhash.pmc
   trunk/src/pmc/packfile.pmc
   trunk/src/pmc/pmcproxy.pmc
   trunk/src/pmc/resizablepmcarray.pmc
   trunk/src/pmc/resizablestringarray.pmc
   trunk/src/pmc/string.pmc
   trunk/src/pmc/sub.pmc

Modified: trunk/src/dynpmc/dynlexpad.pmc
==============================================================================
--- trunk/src/dynpmc/dynlexpad.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/dynpmc/dynlexpad.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -38,7 +38,7 @@
 =cut
 
 */
-    void init_pmc(PMC* lexinfo) {
+    VTABLE void init_pmc(PMC* lexinfo) {
         Hash *hash;
 
         Parrot_DynLexPad_attributes *attrs =
@@ -66,7 +66,7 @@
 =cut
 
 */
-    void set_pointer(void* ctx) {
+    VTABLE void set_pointer(void* ctx) {
         PMC *std_pad = PARROT_DYNLEXPAD(SELF)->init;
         if (std_pad)
             VTABLE_set_pointer(interp, std_pad, ctx);
@@ -81,7 +81,7 @@
 =cut
 
 */
-    INTVAL elements() {
+    VTABLE INTVAL elements() {
         return parrot_hash_size(interp, PARROT_DYNLEXPAD(SELF)->hash);
     }
 
@@ -97,12 +97,12 @@
 
 */
 
-    INTVAL exists_keyed(PMC* name) {
+    VTABLE INTVAL exists_keyed(PMC* name) {
         STRING *s = VTABLE_get_string(interp, name);
         return SELF.exists_keyed_str(s);
     }
 
-    INTVAL exists_keyed_str(STRING* name) {
+    VTABLE INTVAL exists_keyed_str(STRING* name) {
         PMC *std_pad;
         if (parrot_hash_exists(interp, PARROT_DYNLEXPAD(SELF)->hash, name))
             return 1;
@@ -124,7 +124,7 @@
 =cut
 
 */
-    PMC* get_pmc_keyed_str(STRING* name) {
+    VTABLE PMC* get_pmc_keyed_str(STRING* name) {
         HashBucket *b = parrot_hash_get_bucket(interp,
             PARROT_DYNLEXPAD(SELF)->hash, name);
 
@@ -140,7 +140,7 @@
         return (PMC *)b->value;
     }
 
-    PMC* get_pmc_keyed(PMC* name) {
+    VTABLE PMC* get_pmc_keyed(PMC* name) {
         STRING *s = VTABLE_get_string(interp, name);
         return SELF.get_pmc_keyed_str(s);
     }
@@ -159,12 +159,12 @@
 
 */
 
-    void set_pmc_keyed(PMC* name, PMC* value) {
+    VTABLE void set_pmc_keyed(PMC* name, PMC* value) {
         STRING *s = VTABLE_get_string(interp, name);
         SELF.set_pmc_keyed_str(s, value);
     }
 
-    void set_pmc_keyed_str(STRING* name, PMC* value) {
+    VTABLE void set_pmc_keyed_str(STRING* name, PMC* value) {
         PMC *std_pad = PARROT_DYNLEXPAD(SELF)->init;
 
         if (std_pad && VTABLE_exists_keyed_str(interp, std_pad, name))

Modified: trunk/src/dynpmc/gdbmhash.pmc
==============================================================================
--- trunk/src/dynpmc/gdbmhash.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/dynpmc/gdbmhash.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -91,7 +91,7 @@
 
 */
 
-    void class_init() {
+    VTABLE void class_init() {
         if (pass) {
 #ifdef WIN32
             /* RT #46393: What if libgdbm.so cannot be loaded */
@@ -116,11 +116,11 @@
         mem_sys_free(PMC_data(SELF));
     }
 
-    void* get_pointer() {
+    VTABLE void* get_pointer() {
         return PMC_dbfh(SELF);
     }
 
-    void set_pointer(void* p) {
+    VTABLE void set_pointer(void* p) {
         PMC_dbfh(SELF) = (GDBM_FILE)p;
     }
 
@@ -134,7 +134,7 @@
 
 */
 
-    void set_string_native(STRING* value) {
+    VTABLE void set_string_native(STRING* value) {
         char * const c_db_name = Parrot_str_to_cstring(interp, value);
         GDBM_FILE dbf          = gdbm_open(c_db_name, 0, GDBM_NEWDB, 0666, 0);
 
@@ -206,7 +206,7 @@
 
 */
 
-    void set_string_keyed(PMC* key, STRING* value) {
+    VTABLE void set_string_keyed(PMC* key, STRING* value) {
         STRING* keystr;
         GDBM_FILE dbf = PMC_dbfh(SELF);
         datum key_gdbm, val_gdbm;
@@ -235,7 +235,7 @@
 
 */
 
-    STRING* get_string_keyed(PMC *key) {
+    VTABLE STRING* get_string_keyed(PMC *key) {
         STRING *keystr, *val;
         GDBM_FILE dbf = PMC_dbfh(SELF);
         datum key_gdbm, val_gdbm;
@@ -269,7 +269,7 @@
 
 */
 
-    void set_pmc_keyed(PMC* key, PMC* value) {
+    VTABLE void set_pmc_keyed(PMC* key, PMC* value) {
         STRING *temp;
 
         temp = VTABLE_get_string(interp, value);
@@ -286,7 +286,7 @@
 
 */
 
-    PMC* get_pmc_keyed(PMC* key) {
+    VTABLE PMC* get_pmc_keyed(PMC* key) {
         STRING * ret_string = SELF.get_string_keyed(key);
         PMC *ret_pmc = pmc_new(interp, enum_class_String);
 
@@ -305,7 +305,7 @@
 
 */
 
-    void set_integer_keyed(PMC* key, INTVAL value) {
+    VTABLE void set_integer_keyed(PMC* key, INTVAL value) {
         PMC *temp;
 
         temp = pmc_new(interp, enum_class_String);
@@ -324,7 +324,7 @@
 
 */
 
-    void set_number_keyed(PMC* key, FLOATVAL value) {
+    VTABLE void set_number_keyed(PMC* key, FLOATVAL value) {
         PMC *temp;
 
         temp = pmc_new(interp, enum_class_String);
@@ -342,7 +342,7 @@
 
 */
 
-    INTVAL exists_keyed(PMC* key) {
+    VTABLE INTVAL exists_keyed(PMC* key) {
         STRING* keystr;
         GDBM_FILE dbf = PMC_dbfh(SELF);
         datum key_gdbm;
@@ -367,7 +367,7 @@
 
 */
 
-    void delete_keyed(PMC* key) {
+    VTABLE void delete_keyed(PMC* key) {
         STRING* keystr;
         GDBM_FILE dbf = PMC_dbfh(SELF);
         datum key_gdbm;

Modified: trunk/src/dynpmc/pair.pmc
==============================================================================
--- trunk/src/dynpmc/pair.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/dynpmc/pair.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -175,7 +175,7 @@
 
 */
 
-    void set_pmc(PMC *pair) {
+    VTABLE void set_pmc(PMC *pair) {
         if (pair->vtable->base_type == SELF->vtable->base_type) {
             Parrot_Pair_attributes * const from = PARROT_PAIR(SELF);
             Parrot_Pair_attributes * const to   = PARROT_PAIR(SELF);

Modified: trunk/src/dynpmc/rotest.pmc
==============================================================================
--- trunk/src/dynpmc/rotest.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/dynpmc/rotest.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -9,9 +9,9 @@
  */
 
 pmclass ROTest dynpmc provides scalar extends Integer {
-    void set_integer_native(INTVAL value) :read {
+    VTABLE void set_integer_native(INTVAL value) :read {
     }
-    INTVAL get_integer() :write {
+    VTABLE INTVAL get_integer() :write {
         return 42;
     }
 

Modified: trunk/src/dynpmc/subproxy.pmc
==============================================================================
--- trunk/src/dynpmc/subproxy.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/dynpmc/subproxy.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -25,7 +25,7 @@
         PMC_data(SELF) = key;
     }
 
-    opcode_t* invoke(void* next) {
+    VTABLE opcode_t* invoke(void* next) {
         if (PObj_get_FLAGS(SELF) & PObj_private0_FLAG) {
 
             PMC         *key = PMC_data_typed(SELF, PMC *);

Modified: trunk/src/pmc/class.pmc
==============================================================================
--- trunk/src/pmc/class.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/class.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -533,36 +533,6 @@
 
 /*
 
-=item C<PMC *subclass(PMC *name)>
-
-Creates a subclass, optionally with a given C<name>.
-
-=cut
-
-*/
-
-    PMC *subclass(PMC *name) {
-        PMC *child_class;
-
-        /* Create a new class. Set the classname, if we have one. */
-        if (PMC_IS_NULL(name)) {
-            child_class = pmc_new(interp, enum_class_Class);
-        }
-        else {
-            PMC * const naming_hash = pmc_new(interp, enum_class_Hash);
-
-            VTABLE_set_pmc_keyed_str(interp, naming_hash, CONST_STRING(interp, "name"), name);
-            child_class = pmc_new_init(interp, enum_class_Class, naming_hash);
-        }
-
-        /* Make the new class a subclass of the current class */
-        VTABLE_add_parent(interp, child_class, SELF);
-
-        return child_class;
-    }
-
-/*
-
 =item C<void destroy()>
 
 Frees the memory associated with the class's underlying struct.
@@ -1357,7 +1327,7 @@
 =cut
 
 */
-    INTVAL does(STRING *role_name) {
+    VTABLE INTVAL does(STRING *role_name) {
         Parrot_Class_attributes * const _class    = PARROT_CLASS(SELF);
         PMC          * const role_list = _class->roles;
         INTVAL i, count;
@@ -1398,7 +1368,7 @@
 =cut
 
 */
-    INTVAL does_pmc(PMC *role) {
+    VTABLE INTVAL does_pmc(PMC *role) {
         Parrot_Class_attributes * const _class    = PARROT_CLASS(SELF);
         PMC * const role_list          = _class->roles;
         INTVAL i, role_count, count;

Modified: trunk/src/pmc/default.pmc
==============================================================================
--- trunk/src/pmc/default.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/default.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -538,23 +538,6 @@
 
 /*
 
-=item C<INTVAL elements_keyed_int(INTVAL key)>
-
-Converts C<key> to a PMC key and returns the result of calling
-C<elements_keyed()> with it.
-
-=cut
-
-*/
-
-    INTVAL elements_keyed_int(INTVAL key) {
-        PMC *const r_key = INT2KEY(INTERP, key);
-        return SELF.elements_keyed(r_key);
-    }
-
-
-/*
-
 =item C<PMC *get_pmc_keyed_int(INTVAL key)>
 
 Converts C<key> to a PMC key and returns the result of calling
@@ -687,22 +670,6 @@
 
 /*
 
-=item C<void set_bool_keyed_int(INTVAL key, INTVAL value)>
-
-Converts C<key> to a PMC key and calls C<set_bool_keyed()> with it
-and C<value>.
-
-=cut
-
-*/
-
-    void set_bool_keyed_int(INTVAL key, INTVAL value) {
-        PMC *const r_key = INT2KEY(INTERP, key);
-        SELF.set_bool_keyed(r_key, value);
-    }
-
-/*
-
 =item C<void set_pmc_keyed_int(INTVAL key, PMC *value)>
 
 Converts C<key> to a PMC key and calls C<set_pmc_keyed()> with it
@@ -890,7 +857,7 @@
 
 */
 
-    INTVAL does_pmc(PMC *role) {
+    VTABLE INTVAL does_pmc(PMC *role) {
         UNUSED(role)
         /* No C-level roles yet. */
         return 0;
@@ -945,7 +912,7 @@
 
 */
 
-    PMC *inspect_str(STRING *name) {
+    VTABLE PMC *inspect_str(STRING *name) {
         if (Parrot_str_equal(interp, name, CONST_STRING(interp, "flags"))) {
             PMC *found = pmc_new(interp, enum_class_Integer);
             VTABLE_set_integer_native(interp, found,
@@ -970,7 +937,7 @@
 =cut
 
 */
-    PMC *inspect() {
+    VTABLE PMC *inspect() {
         PMC    *metadata           = pmc_new(interp, enum_class_Hash);
         STRING * const flags_str   = CONST_STRING(interp, "flags");
 

Modified: trunk/src/pmc/eventhandler.pmc
==============================================================================
--- trunk/src/pmc/eventhandler.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/eventhandler.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -172,7 +172,7 @@
 
 */
 
-    void set_string(STRING *type) {
+    VTABLE void set_string(STRING *type) {
         Parrot_EventHandler_attributes *e = PMC_data_typed(SELF, Parrot_EventHandler_attributes *);
 
         if (e)

Modified: trunk/src/pmc/exception.pmc
==============================================================================
--- trunk/src/pmc/exception.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/exception.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -709,7 +709,7 @@
 
 */
 
-    METHOD PMC *annotations(STRING *name :optional, INTVAL have_name :opt_flag) {
+    METHOD annotations(STRING *name :optional, INTVAL have_name :opt_flag) {
         PMC *resume;
         PMC *result = PMCNULL;
 
@@ -746,7 +746,7 @@
 
 */
 
-    METHOD PMC *backtrace() {
+    METHOD backtrace() {
         PMC *result = pmc_new(interp, enum_class_ResizablePMCArray);
         PMC *resume;
 

Modified: trunk/src/pmc/fixedpmcarray.pmc
==============================================================================
--- trunk/src/pmc/fixedpmcarray.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/fixedpmcarray.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -705,7 +705,7 @@
 
 */
 
-    void splice(PMC *value, INTVAL offset, INTVAL count) {
+    VTABLE void splice(PMC *value, INTVAL offset, INTVAL count) {
         if (count + offset > PMC_size(SELF))
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
                 _("FixedPMCArray: index out of bounds!"));

Modified: trunk/src/pmc/hash.pmc
==============================================================================
--- trunk/src/pmc/hash.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/hash.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -576,7 +576,7 @@
         return iter;
     }
 
-    PMC *slice(PMC *key) {
+    VTABLE PMC *slice(PMC *key) {
         return PMCNULL;
     }
 

Modified: trunk/src/pmc/multisub.pmc
==============================================================================
--- trunk/src/pmc/multisub.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/multisub.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -24,7 +24,7 @@
 
 pmclass MultiSub extends ResizablePMCArray need_ext provides array {
 
-    void push_pmc(PMC *value) {
+    VTABLE void push_pmc(PMC *value) {
         STRING * const _sub = CONST_STRING(interp, "Sub");
         STRING * const _nci = CONST_STRING(interp, "NCI");
 
@@ -99,7 +99,7 @@
        (N, I, S, P). It should sort the argument list according to closeness
        to this input argument list and return an iterator over that list. */
 
-    METHOD PMC *get_iter(PMC *args) {
+    METHOD get_iter(PMC *args) {
         STRING * const _array  = CONST_STRING(interp, "Array");
         STRING * const _string = CONST_STRING(interp, "String");
 

Modified: trunk/src/pmc/null.pmc
==============================================================================
--- trunk/src/pmc/null.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/null.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -36,7 +36,6 @@
     VTABLE void init() {
     }
 
-    PARROT_CAN_RETURN_NULL
     VTABLE void *get_pointer() {
         return PMCNULL;
     }

Modified: trunk/src/pmc/orderedhash.pmc
==============================================================================
--- trunk/src/pmc/orderedhash.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/orderedhash.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -346,7 +346,7 @@
 
 */
 
-    void push_pmc(PMC *value) {
+    VTABLE void push_pmc(PMC *value) {
         const INTVAL n = SELF.elements();
         SELF.set_pmc_keyed_int(n, value);
     }

Modified: trunk/src/pmc/packfile.pmc
==============================================================================
--- trunk/src/pmc/packfile.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/packfile.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -421,7 +421,7 @@
 
 */
 
-    METHOD STRING *pack() {
+    METHOD pack() {
         STRING * ret = SELF.get_string();
         RETURN(STRING * ret);
     }
@@ -437,7 +437,7 @@
 
 */
 
-    METHOD void unpack(STRING *str) {
+    METHOD unpack(STRING *str) {
         SELF.set_string_native(str);
     }
 

Modified: trunk/src/pmc/pmcproxy.pmc
==============================================================================
--- trunk/src/pmc/pmcproxy.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/pmcproxy.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -389,7 +389,7 @@
 =cut
 
 */
-    PMC *inspect()
+    VTABLE PMC *inspect()
     {
         /* Create a hash, then use inspect_str to get all of the data to
          * fill it up with. */

Modified: trunk/src/pmc/resizablepmcarray.pmc
==============================================================================
--- trunk/src/pmc/resizablepmcarray.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/resizablepmcarray.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -385,7 +385,7 @@
         return;
     }
 
-    void push_pmc(PMC *value) {
+    VTABLE void push_pmc(PMC *value) {
 
         INTVAL size = PMC_size(SELF);
         SELF.set_integer_native(size + 1);
@@ -538,7 +538,7 @@
         return;
     }
 
-    void unshift_pmc(PMC *value) {
+    VTABLE void unshift_pmc(PMC *value) {
 
         INTVAL  size = PMC_size(SELF);
         PMC   **data;
@@ -714,7 +714,7 @@
 
 */
 
-    void splice(PMC *value, INTVAL offset, INTVAL count) {
+    VTABLE void splice(PMC *value, INTVAL offset, INTVAL count) {
 
         const INTVAL length = VTABLE_elements(INTERP, SELF);
         const INTVAL elems  = VTABLE_elements(INTERP, value);
@@ -768,12 +768,12 @@
 
 */
 
-    METHOD PMC* shift() {
+    METHOD shift() {
         PMC *value = VTABLE_shift_pmc(INTERP, SELF);
         RETURN(PMC *value);
     }
 
-    METHOD PMC* pop() {
+    METHOD pop() {
         PMC *value = VTABLE_pop_pmc(INTERP, SELF);
         RETURN(PMC *value);
     }

Modified: trunk/src/pmc/resizablestringarray.pmc
==============================================================================
--- trunk/src/pmc/resizablestringarray.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/resizablestringarray.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -372,7 +372,7 @@
 
 */
 
-    void push_pmc(PMC *value) {
+    VTABLE void push_pmc(PMC *value) {
         STRING *strvalue = VTABLE_get_string(INTERP, value);
         SELF.push_string(strvalue);
     }
@@ -484,7 +484,7 @@
 
 */
 
-    void unshift_pmc(PMC *value) {
+    VTABLE void unshift_pmc(PMC *value) {
         STRING *strvalue = VTABLE_get_string(INTERP, value);
         SELF.unshift_string(strvalue);
     }
@@ -592,7 +592,7 @@
 
 */
 
-    void splice(PMC *value, INTVAL offset, INTVAL count) {
+    VTABLE void splice(PMC *value, INTVAL offset, INTVAL count) {
 
         INTVAL length, elems, shift, i;
 
@@ -652,12 +652,12 @@
 
 */
 
-    METHOD PMC* shift() {
+    METHOD shift() {
         PMC *value = SELF.shift_pmc();
         RETURN(PMC *value);
     }
 
-    METHOD PMC* pop() {
+    METHOD pop() {
         PMC *value = SELF.pop_pmc();
         RETURN(PMC *value);
     }

Modified: trunk/src/pmc/string.pmc
==============================================================================
--- trunk/src/pmc/string.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/string.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -655,7 +655,7 @@
         return string_ord(INTERP, s, key_integer(INTERP, key));
     }
 
-    void set_string_keyed(PMC *key, STRING * const value) {
+    VTABLE void set_string_keyed(PMC *key, STRING * const value) {
         STRING * const s   = SELF.get_string();
         const INTVAL   len = Parrot_str_byte_length(INTERP, value);
         Parrot_str_replace(INTERP, s, key_integer(INTERP, key), len, value, NULL);

Modified: trunk/src/pmc/sub.pmc
==============================================================================
--- trunk/src/pmc/sub.pmc	Sat Apr 25 03:30:24 2009	(r38335)
+++ trunk/src/pmc/sub.pmc	Sat Apr 25 04:53:29 2009	(r38336)
@@ -666,7 +666,7 @@
 
 */
 
-    PMC *inspect()
+    VTABLE PMC *inspect()
     {
         /* Create a hash, then use inspect_str to get all of the data to
          * fill it up with. */
@@ -738,7 +738,7 @@
 
 */
 
-    PMC *inspect_str(STRING *what)
+    VTABLE PMC *inspect_str(STRING *what)
     {
         Parrot_sub *sub;
         INTVAL count_found = -1;


More information about the parrot-commits mailing list