[svn:parrot] r46209 - in trunk/src: . pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Sat May 1 21:12:55 UTC 2010
Author: NotFound
Date: Sat May 1 21:12:54 2010
New Revision: 46209
URL: https://trac.parrot.org/parrot/changeset/46209
Log:
implement PMCProxy vtable init_int and use it
Modified:
trunk/src/oo.c
trunk/src/pmc/default.pmc
trunk/src/pmc/pmcproxy.pmc
Modified: trunk/src/oo.c
==============================================================================
--- trunk/src/oo.c Sat May 1 20:25:04 2010 (r46208)
+++ trunk/src/oo.c Sat May 1 21:12:54 2010 (r46209)
@@ -339,9 +339,7 @@
/* Create proxy if not found */
if (PMC_IS_NULL(proxy)) {
- PMC * const type_num = Parrot_pmc_new(interp, enum_class_Integer);
- VTABLE_set_integer_native(interp, type_num, type);
- proxy = Parrot_pmc_new_init(interp, enum_class_PMCProxy, type_num);
+ proxy = Parrot_pmc_new_init_int(interp, enum_class_PMCProxy, type);
Parrot_pcc_invoke_method_from_c_args(interp, pmc_ns, CONST_STRING(interp, "set_class"), "P->", proxy);
}
return proxy;
Modified: trunk/src/pmc/default.pmc
==============================================================================
--- trunk/src/pmc/default.pmc Sat May 1 20:25:04 2010 (r46208)
+++ trunk/src/pmc/default.pmc Sat May 1 21:12:54 2010 (r46209)
@@ -1043,10 +1043,7 @@
if (PMC_IS_NULL(_class)) {
const INTVAL type = VTABLE_type(interp, SELF);
- PMC * const type_num = Parrot_pmc_new(interp, enum_class_Integer);
-
- VTABLE_set_integer_native(interp, type_num, type);
- return Parrot_pmc_new_init(interp, enum_class_PMCProxy, type_num);
+ return Parrot_pmc_new_init_int(interp, enum_class_PMCProxy, type);
}
return _class;
Modified: trunk/src/pmc/pmcproxy.pmc
==============================================================================
--- trunk/src/pmc/pmcproxy.pmc Sat May 1 20:25:04 2010 (r46208)
+++ trunk/src/pmc/pmcproxy.pmc Sat May 1 21:12:54 2010 (r46209)
@@ -115,8 +115,7 @@
PObj_is_class_SET(SELF);
}
- VTABLE void init_pmc(PMC *init_data) {
- const INTVAL type_num = VTABLE_get_integer(interp, init_data);
+ VTABLE void init_int(INTVAL type_num) {
Parrot_Class_attributes *proxy_info;
INTVAL mro_length, i;
@@ -185,6 +184,11 @@
}
}
+ VTABLE void init_pmc(PMC *init_data) {
+ const INTVAL type_num = VTABLE_get_integer(interp, init_data);
+ SELF.init_int(type_num);
+ }
+
/*
=item C<PMC *instantiate(PMC *init)>
More information about the parrot-commits
mailing list