[svn:parrot] r39318 - trunk/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Tue Jun 2 09:10:12 UTC 2009


Author: bacek
Date: Tue Jun  2 09:10:12 2009
New Revision: 39318
URL: https://trac.parrot.org/parrot/changeset/39318

Log:
[pmc] Don't reuse dest in BigInt.

Modified:
   trunk/src/pmc/bigint.pmc

Modified: trunk/src/pmc/bigint.pmc
==============================================================================
--- trunk/src/pmc/bigint.pmc	Tue Jun  2 09:09:27 2009	(r39317)
+++ trunk/src/pmc/bigint.pmc	Tue Jun  2 09:10:12 2009	(r39318)
@@ -837,14 +837,14 @@
     }
 
     MULTI PMC *add(BigInt value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_add_bigint(INTERP, SELF, value, dest);
         return dest;
     }
 
     MULTI PMC *add(Integer value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_add_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
         return dest;
@@ -859,7 +859,7 @@
     }
 
     VTABLE PMC *add_int(INTVAL value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, NULL, dest);
+        dest pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_add_bigint_int(INTERP, SELF, value, dest);
         return dest;
@@ -893,14 +893,14 @@
 
 
     MULTI PMC *subtract(BigInt value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_sub_bigint(INTERP, SELF, value, dest);
         return dest;
     }
 
     MULTI PMC *subtract(Integer value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_sub_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
         return dest;
@@ -915,7 +915,7 @@
     }
 
     VTABLE PMC *subtract_int(INTVAL value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, NULL, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_sub_bigint_int(INTERP, SELF, value, dest);
         return dest;
@@ -949,14 +949,14 @@
 
 
     MULTI PMC *multiply(BigInt value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_mul_bigint(INTERP, SELF, value, dest);
         return dest;
     }
 
     MULTI PMC *multiply(Integer value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_mul_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
         return dest;
@@ -971,7 +971,7 @@
     }
 
     VTABLE PMC *multiply_int(INTVAL value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, NULL, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_mul_bigint_int(INTERP, SELF, value, dest);
         return dest;
@@ -1002,7 +1002,7 @@
     }
 
     VTABLE PMC *pow_int(INTVAL value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, NULL, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_pow_bigint_int(INTERP, SELF, value, dest);
         return dest;
@@ -1011,7 +1011,7 @@
     MULTI PMC *pow(PMC *value, PMC *dest) {
         /* XXX only Integer RHS currently */
         const INTVAL r = VTABLE_get_integer(INTERP, value);
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_pow_bigint_int(INTERP, SELF, r, dest);
         return dest;
@@ -1019,7 +1019,7 @@
 
     MULTI PMC *divide(BigInt value, PMC *dest) {
         BIGINT *bi;
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_div_bigint(INTERP, SELF, value, dest);
 #if 0
@@ -1035,7 +1035,7 @@
     }
 
     MULTI PMC *divide(Integer value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_div_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
         return dest;
@@ -1050,7 +1050,7 @@
     }
 
     VTABLE PMC *divide_int(INTVAL value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, NULL, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_div_bigint_int(INTERP, SELF, value, dest);
         return dest;
@@ -1074,14 +1074,14 @@
     }
 
     MULTI PMC *floor_divide(BigInt value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_fdiv_bigint(INTERP, SELF, value, dest);
         return dest;
     }
 
     MULTI PMC *floor_divide(Integer value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_fdiv_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
         return dest;
@@ -1096,7 +1096,7 @@
     }
 
     VTABLE PMC *floor_divide_int(INTVAL value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, NULL, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_fdiv_bigint_int(INTERP, SELF, value, dest);
         return dest;
@@ -1122,14 +1122,14 @@
     }
 
     MULTI PMC *modulus(BigInt value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_mod_bigint(INTERP, SELF, value, dest);
         return dest;
     }
 
     MULTI PMC *modulus(Integer value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_mod_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
         return dest;
@@ -1199,7 +1199,7 @@
 */
 
     VTABLE PMC *absolute(PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, NULL, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_abs(INTERP, SELF, dest);
         return dest;
@@ -1223,7 +1223,7 @@
 */
 
     VTABLE PMC *neg(PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, NULL, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_neg(INTERP, SELF, dest);
         return dest;
@@ -1252,7 +1252,7 @@
 */
 
     MULTI PMC *bitwise_shl(BigInt value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_bitwise_shl_bigint_int(INTERP, SELF,
                                       VTABLE_get_integer(INTERP, value),
@@ -1261,7 +1261,7 @@
     }
 
     MULTI PMC *bitwise_shl(Integer value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_bitwise_shl_bigint_int(INTERP, SELF,
                 VTABLE_get_integer(interp, value), dest);
@@ -1276,7 +1276,7 @@
     }
 
     VTABLE PMC *bitwise_shl_int(INTVAL value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, NULL, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_bitwise_shl_bigint_int(INTERP, SELF, value, dest);
         return dest;
@@ -1324,7 +1324,7 @@
 */
 
     MULTI PMC *bitwise_shr(BigInt value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_bitwise_shr_bigint_int(INTERP, SELF,
                                       VTABLE_get_integer(INTERP, value),
@@ -1333,7 +1333,7 @@
     }
 
     MULTI PMC *bitwise_shr(Integer value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, value, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_bitwise_shr_bigint_int(INTERP, SELF,
                 VTABLE_get_integer(interp, value), dest);
@@ -1349,7 +1349,7 @@
     }
 
     VTABLE PMC *bitwise_shr_int(INTVAL value, PMC *dest) {
-        dest = Parrot_pmc_try_reuse(INTERP, SELF, NULL, dest);
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bigint_bitwise_shr_bigint_int(INTERP, SELF, value, dest);
         return dest;


More information about the parrot-commits mailing list