[svn:parrot] r36562 - branches/vtable_morph_change/src/pmc
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Tue Feb 10 23:51:56 UTC 2009
Author: whiteknight
Date: Tue Feb 10 23:51:56 2009
New Revision: 36562
URL: https://trac.parrot.org/parrot/changeset/36562
Log:
[vtable_morph_change] fixed the errors in t/pmc/complex.t, but three more errors magically appeared
Modified:
branches/vtable_morph_change/src/pmc/complex.pmc
branches/vtable_morph_change/src/pmc/pointer.pmc
branches/vtable_morph_change/src/pmc/ref.pmc
branches/vtable_morph_change/src/pmc/scalar.pmc
Modified: branches/vtable_morph_change/src/pmc/complex.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/complex.pmc Tue Feb 10 23:30:58 2009 (r36561)
+++ branches/vtable_morph_change/src/pmc/complex.pmc Tue Feb 10 23:51:56 2009 (r36562)
@@ -1248,7 +1248,7 @@
GET_ATTR_re(INTERP, SELF, re);
GET_ATTR_im(INTERP, SELF, im);
d = sqrt(re*re + im*im);
- VTABLE_morph(INTERP, SELF, interp->vtables[enum_class_Float]->pmc_class);
+ pmc_reuse(INTERP, SELF, enum_class_Float, 0);
VTABLE_set_number_native(INTERP, SELF, d);
}
Modified: branches/vtable_morph_change/src/pmc/pointer.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/pointer.pmc Tue Feb 10 23:30:58 2009 (r36561)
+++ branches/vtable_morph_change/src/pmc/pointer.pmc Tue Feb 10 23:51:56 2009 (r36562)
@@ -40,19 +40,6 @@
/*
-=item C<void morph(INTVAL type)>
-
-Does nothing.
-
-=cut
-
-*/
-
- VTABLE void morph(PMC* type) {
- }
-
-/*
-
=item C<void mark()>
Marks the pointer as live.
Modified: branches/vtable_morph_change/src/pmc/ref.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/ref.pmc Tue Feb 10 23:30:58 2009 (r36561)
+++ branches/vtable_morph_change/src/pmc/ref.pmc Tue Feb 10 23:51:56 2009 (r36562)
@@ -140,19 +140,6 @@
return SUPER();
}
-/*
-
-=item C<void morph(PMC* type)>
-
-Changes the PMC to a PMC of a new type.
-
-=cut
-
-*/
- VTABLE void morph(PMC* type) {
- SUPER(type);
- }
-
}
/*
Modified: branches/vtable_morph_change/src/pmc/scalar.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/scalar.pmc Tue Feb 10 23:30:58 2009 (r36561)
+++ branches/vtable_morph_change/src/pmc/scalar.pmc Tue Feb 10 23:51:56 2009 (r36562)
@@ -73,7 +73,7 @@
else {
/* Overflow; must promote dest to BigInt, and do a BigInt shift. */
if (self == dest)
- VTABLE_morph(interp, self, interp->vtables[enum_class_BigInt]->pmc_class);
+ pmc_reuse(interp, self, enum_class_BigInt, 0);
else
dest = pmc_new(interp, enum_class_BigInt);
@@ -88,22 +88,6 @@
/*
-=item C<void morph(PMC* type)>
-
-Morphs the scalar to the specified type.
-
-=cut
-
-*/
-
- VTABLE void morph(PMC* type) {
- INTVAL type_id = VTABLE_get_integer(interp, type);
- if (SELF->vtable->base_type == type_id)
- return;
- pmc_reuse(INTERP, SELF, type_id, 0);
- }
-/*
-
=item C<void assign_pmc(PMC *value)>
Sets the PMC C<*value>, calling the appropriate C<set_*> method
@@ -118,13 +102,12 @@
STRING *s_num;
STRING *s_str;
- if (SELF->vtable->base_type == enum_class_Boolean) {
+ if (SELF->vtable->base_type == enum_class_Boolean)
/* doesn't morph */
- SELF.morph(value->vtable->pmc_class);
- }
+ pmc_reuse(INTERP, SELF, value->vtable->base_type, 0);
if (value->vtable->base_type == enum_class_Undef) {
- SELF.morph(value->vtable->pmc_class);
+ pmc_reuse(INTERP, SELF, value->vtable->base_type, 0);
return;
}
@@ -149,7 +132,7 @@
SELF.set_string_native(v);
return;
}
- SELF.morph(interp->vtables[enum_class_Ref]->pmc_class);
+ pmc_reuse(INTERP, SELF, enum_class_Ref, 0);
SELF.set_pmc(value);
}
@@ -246,7 +229,7 @@
MULTI void i_add(Complex value) {
const FLOATVAL a = SELF.get_number();
- VTABLE_morph(INTERP, SELF, value->vtable->pmc_class);
+ pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
VTABLE_set_number_native(INTERP, SELF,
a + VTABLE_get_number_keyed_int(INTERP, value, 0));
VTABLE_set_number_keyed_int(INTERP, SELF, 1,
@@ -294,7 +277,7 @@
MULTI PMC *subtract(Complex value, PMC *dest) {
const FLOATVAL a = SELF.get_number();
if (dest)
- VTABLE_morph(INTERP, dest, value->vtable->pmc_class);
+ pmc_reuse(INTERP, dest, value->vtable->base_type, 0);
else
dest = pmc_new(INTERP, VTABLE_type(INTERP, value));
@@ -331,7 +314,7 @@
MULTI void i_subtract(Complex value) {
const FLOATVAL a = SELF.get_number();
- VTABLE_morph(INTERP, SELF, value->vtable->pmc_class);
+ pmc_reuse(INTERP, SELF, enum_class_Complex, 0);
VTABLE_set_number_native(INTERP, SELF,
a - VTABLE_get_number_keyed_int(INTERP, value, 0));
VTABLE_set_number_keyed_int(INTERP, SELF, 1,
More information about the parrot-commits
mailing list