Author: Whiteknight
Date: Thu Jan 15 10:11:18 2009
New Revision: 35599
Modified:
trunk/src/pmc/object.pmc
Log:
[PMC] Change Object PMC so that morph vtable interfaces can be overridden (with acceptable results) from PIR
Modified: trunk/src/pmc/object.pmc
==============================================================================
--- trunk/src/pmc/object.pmc (original)
+++ trunk/src/pmc/object.pmc Thu Jan 15 10:11:18 2009
@@ -848,7 +848,16 @@
*/
VTABLE void morph(INTVAL type) {
- SUPER(type);
+ PMC * const classobj = VTABLE_get_class(interp, SELF);
+ STRING * meth_name = CONST_STRING(interp, "morph");
+ /* If there's a vtable override for 'morph' run that instead. */
+ PMC * const method = Parrot_oo_find_vtable_override(interp,
+ classobj, meth_name);
+
+ if (!PMC_IS_NULL(method))
+ Parrot_run_meth_fromc_args(interp, method, SELF, meth_name, "vI", type);
+ else
+ SUPER(type);
}
}