cvsuser 04/05/18 06:03:10
Modified: classes perlstring.pmc perlundef.pmc ref.pmc scalar.pmc
sharedref.pmc
docs/pdds pdd02_vtables.pod
include/parrot mmd.h
ops bit.ops string.ops
src mmd_fallback.c
. vtable.tbl
Log:
mmd_vtables 13 - MMDIfy string ops
* add _STR MMD constants
* fill in missing fallbacks
* update pdd02
Please Configure.pl && make ...
Revision Changes Path
1.70 +5 -5 parrot/classes/perlstring.pmc
Index: perlstring.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlstring.pmc,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -w -r1.69 -r1.70
--- perlstring.pmc 20 Apr 2004 19:01:40 -0000 1.69
+++ perlstring.pmc 18 May 2004 13:02:54 -0000 1.70
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: perlstring.pmc,v 1.69 2004/04/20 19:01:40 boemmels Exp $
+$Id: perlstring.pmc,v 1.70 2004/05/18 13:02:54 leo Exp $
=head1 NAME
@@ -504,7 +504,7 @@
/*
-=item C<void concatenate_native(STRING *value, PMC *dest)>
+=item C<void concatenate_str(STRING *value, PMC *dest)>
Concatenates the string and C<*value> and returns the result in
C<*dest>.
@@ -513,7 +513,7 @@
*/
- void concatenate_native (STRING* value, PMC* dest) {
+ void concatenate_str (STRING* value, PMC* dest) {
STRING* s = PMC_str_val(SELF);
VTABLE_morph(INTERP, dest, enum_class_PerlString);
PMC_str_val(dest) = string_concat(INTERP, s, value, 0);
1.41 +4 -4 parrot/classes/perlundef.pmc
Index: perlundef.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlundef.pmc,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -w -r1.40 -r1.41
--- perlundef.pmc 9 Apr 2004 20:31:57 -0000 1.40
+++ perlundef.pmc 18 May 2004 13:02:54 -0000 1.41
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: perlundef.pmc,v 1.40 2004/04/09 20:31:57 dan Exp $
+$Id: perlundef.pmc,v 1.41 2004/05/18 13:02:54 leo Exp $
=head1 NAME
@@ -618,7 +618,7 @@
/*
-=item C<void concatenate_native(STRING *value, PMC *dest)>
+=item C<void concatenate_str(STRING *value, PMC *dest)>
All these methods warn of the use of an unitialized value, and return
the calculated result in C<*dest>.
@@ -630,7 +630,7 @@
*/
- void concatenate_native (STRING* value, PMC* dest) {
+ void concatenate_str (STRING* value, PMC* dest) {
Parrot_warn(INTERP, PARROT_WARNINGS_UNDEF_FLAG,
"Use of uninitialized value in concatenation");
VTABLE_set_string_native(INTERP, dest, value);
1.18 +5 -1 parrot/classes/ref.pmc
Index: ref.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/ref.pmc,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -r1.17 -r1.18
--- ref.pmc 18 May 2004 12:11:46 -0000 1.17
+++ ref.pmc 18 May 2004 13:02:54 -0000 1.18
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: ref.pmc,v 1.17 2004/05/18 12:11:46 leo Exp $
+$Id: ref.pmc,v 1.18 2004/05/18 13:02:54 leo Exp $
=head1 NAME
@@ -51,8 +51,11 @@
#define VTABLE_bitwise_and(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_BAND)
#define VTABLE_bitwise_and_int(i,l,r,d) mmd_dispatch_v_pip(i,l,r,d,MMD_BAND_INT)
#define VTABLE_bitwise_ors(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_SOR)
+#define VTABLE_bitwise_ors_str(i,l,r,d) mmd_dispatch_v_psp(i,l,r,d,MMD_SOR_STR)
#define VTABLE_bitwise_ands(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_SAND)
+#define VTABLE_bitwise_ands_str(i,l,r,d) mmd_dispatch_v_psp(i,l,r,d,MMD_SAND_STR)
#define VTABLE_bitwise_xors(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_SXOR)
+#define VTABLE_bitwise_xors_str(i,l,r,d) mmd_dispatch_v_psp(i,l,r,d,MMD_SXOR_STR)
#define VTABLE_bitwise_shl(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_BSL)
#define VTABLE_bitwise_shl_int(i,l,r,d) mmd_dispatch_v_pip(i,l,r,d,MMD_BSL_INT)
#define VTABLE_bitwise_shr(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_BSR)
@@ -60,6 +63,7 @@
#define VTABLE_bitwise_or(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_BOR)
#define VTABLE_bitwise_or_int(i,l,r,d) mmd_dispatch_v_pip(i,l,r,d,MMD_BOR_INT)
#define VTABLE_concatenate(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_CONCAT)
+#define VTABLE_concatenate_str(i,l,r,d) mmd_dispatch_v_psp(i,l,r,d,MMD_CONCAT_STR)
#define VTABLE_logical_or(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_LOR)
#define VTABLE_logical_and(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_LAND)
#define VTABLE_logical_xor(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_LXOR)
1.18 +4 -4 parrot/classes/scalar.pmc
Index: scalar.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/scalar.pmc,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -r1.17 -r1.18
--- scalar.pmc 22 Feb 2004 17:48:41 -0000 1.17
+++ scalar.pmc 18 May 2004 13:02:54 -0000 1.18
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: scalar.pmc,v 1.17 2004/02/22 17:48:41 mikescott Exp $
+$Id: scalar.pmc,v 1.18 2004/05/18 13:02:54 leo Exp $
=head1 NAME
@@ -790,7 +790,7 @@
/*
-=item C<void concatenate_native(STRING *value, PMC *dest)>
+=item C<void concatenate_str(STRING *value, PMC *dest)>
Returns in C<*dest> the result of concatenating the scalar and C<*value>.
@@ -798,7 +798,7 @@
*/
- void concatenate_native (STRING* value, PMC* dest) {
+ void concatenate_str (STRING* value, PMC* dest) {
/* dest = SELF (concat) value */
STRING* s = string_concat(INTERP,
DYNSELF.get_string(),
1.16 +5 -1 parrot/classes/sharedref.pmc
Index: sharedref.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/sharedref.pmc,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -r1.15 -r1.16
--- sharedref.pmc 18 May 2004 12:11:46 -0000 1.15
+++ sharedref.pmc 18 May 2004 13:02:54 -0000 1.16
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: sharedref.pmc,v 1.15 2004/05/18 12:11:46 leo Exp $
+$Id: sharedref.pmc,v 1.16 2004/05/18 13:02:54 leo Exp $
=head1 NAME
@@ -63,8 +63,11 @@
#define VTABLE_bitwise_and(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_BAND)
#define VTABLE_bitwise_and_int(i,l,r,d) mmd_dispatch_v_pip(i,l,r,d,MMD_BAND_INT)
#define VTABLE_bitwise_ors(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_SOR)
+#define VTABLE_bitwise_ors_str(i,l,r,d) mmd_dispatch_v_psp(i,l,r,d,MMD_SOR_STR)
#define VTABLE_bitwise_ands(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_SAND)
+#define VTABLE_bitwise_ands_str(i,l,r,d) mmd_dispatch_v_psp(i,l,r,d,MMD_SAND_STR)
#define VTABLE_bitwise_xors(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_SXOR)
+#define VTABLE_bitwise_xors_str(i,l,r,d) mmd_dispatch_v_psp(i,l,r,d,MMD_SXOR_STR)
#define VTABLE_bitwise_shl(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_BSL)
#define VTABLE_bitwise_shl_int(i,l,r,d) mmd_dispatch_v_pip(i,l,r,d,MMD_BSL_INT)
#define VTABLE_bitwise_shr(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_BSR)
@@ -72,6 +75,7 @@
#define VTABLE_bitwise_or(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_BOR)
#define VTABLE_bitwise_or_int(i,l,r,d) mmd_dispatch_v_pip(i,l,r,d,MMD_BOR_INT)
#define VTABLE_concatenate(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_CONCAT)
+#define VTABLE_concatenate_str(i,l,r,d) mmd_dispatch_v_psp(i,l,r,d,MMD_CONCAT_STR)
#define VTABLE_logical_or(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_LOR)
#define VTABLE_logical_and(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_LAND)
#define VTABLE_logical_xor(i,l,r,d) mmd_dispatch_v_ppp(i,l,r,d,MMD_LXOR)
1.36 +14 -418 parrot/docs/pdds/pdd02_vtables.pod
Index: pdd02_vtables.pod
===================================================================
RCS file: /cvs/public/parrot/docs/pdds/pdd02_vtables.pod,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -w -r1.35 -r1.36
--- pdd02_vtables.pod 20 Apr 2004 07:44:43 -0000 1.35
+++ pdd02_vtables.pod 18 May 2004 13:02:58 -0000 1.36
@@ -1,5 +1,5 @@
# Copyright: 2001-2004 The Perl Foundation. All Rights Reserved.
-# $Id: pdd02_vtables.pod,v 1.35 2004/04/20 07:44:43 leo Exp $
+# $Id: pdd02_vtables.pod,v 1.36 2004/05/18 13:02:58 leo Exp $
=head1 NAME
@@ -424,260 +424,91 @@
Return the integer value of the last item on the list, removing that item.
-=item INTVAL pop_integer_keyed(INTERP, PMC* self, PMC* key)
-
-=item INTVAL pop_integer_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Return the integer value of the last item of the list keyed by B<key>,
-removing that item from the list.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item FLOATVAL pop_float(INTERP, PMC* self)
Return the floating-point value of the last item on the list,
removing that item.
-=item FLOATVAL pop_float_keyed(INTERP, PMC* self, PMC* key)
-
-=item FLOATVAL pop_float_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Return the floating-point value of the last item of the list keyed by B<key>,
-removing that item from the list.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item BIGNUM* pop_bignum(INTERP, PMC* self)
Return the bignum value of the last item on the list,
removing that item.
-=item BIGNUM* pop_bignum_keyed(INTERP, PMC* self, PMC* key)
-
-=item BIGNUM* pop_bignum_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Return the bignum value of the last item of the list keyed by B<key>,
-removing that item from the list.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item STRING* pop_string(INTERP, PMC* self)
Return the string value of the last item on the list,
removing that item.
-=item STRING* pop_string_keyed(INTERP, PMC* self, PMC* key)
-
-=item STRING* pop_string_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Return the string value of the last item of the list keyed by B<key>,
-removing that item from the list.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item PMC* pop_pmc(INTERP, PMC* self)
Return the PMC value of the last item on the list,
removing that item.
-=item PMC* pop_pmc_keyed(INTERP, PMC* self, PMC* key)
-
-=item PMC* pop_pmc_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Return the PMC value of the last item of the list keyed by B<key>,
-removing that item from the list.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item void push_integer(INTERP, PMC* self, INTVAL value)
Add the passed in integer value to the end of the list.
-=item void push_integer_keyed(INTERP, PMC* self, PMC* key, INTVAL value)
-
-=item void push_integer_keyed_int(INTERP, PMC* self, INTVAL key, INTVAL value)
-
-Add the passed in integer value to the end of the list keyed by B<key>.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item void push_float(INTERP, PMC* self, FLOATVAL value)
Add the passed in floating-point number to the end of the list.
-=item void push_float_keyed(INTERP, PMC* self, PMC* key, FLOATVAL value)
-
-=item void push_float_keyed_int(INTERP, PMC* self, INTVAL key, FLOATVAL value)
-
-Add the passed in floating-point value to the end of the list keyed by B<key>.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item void push_bignum(INTERP, PMC* self, BIGNUM* value)
Add the passed in bignum to the end of the list.
-=item void push_bignum_keyed(INTERP, PMC* self, PMC* key, BIGNUM* value)
-
-=item void push_bignum_keyed_int(INTERP, PMC* self, INTVAL key, BIGNUM* value)
-
-Add the passed in bignum to the end of the list keyed by B<key>.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item void push_string(INTERP, PMC* self, STRING* value)
Add the passed in string to the end of the list.
-=item void push_string_keyed(INTERP, PMC* self, PMC* key, STRING* value)
-
-=item void push_string_keyed_int(INTERP, PMC* self, INTVAL key, STRING* value)
-
-Add the passed in string to the end of the list keyed by B<key>.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item void push_pmc(INTERP, PMC* self, PMC* value)
Add the passed in PMC to the end of the list.
-=item void push_pmc_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC* value_key)
-
-=item void push_pmc_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key)
-
-Add the passed in PMC to the end of the list keyed by B<key>.
-At least one of the two keys is guaranteed not to be NULL. If B<key> is
-NULL then the method will use B<self>. If B<value_key> is NULL then the
-method will use B<value>.
-
=item INTVAL shift_integer(INTERP, PMC* self)
Return the integer value of the first item on the list, removing that item.
-=item INTVAL shift_integer_keyed(INTERP, PMC* self, PMC* key)
-
-=item INTVAL shift_integer_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Return the integer value of the first item of the list keyed by B<key>,
-removing that item from the list.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item FLOATVAL shift_float(INTERP, PMC* self)
Return the floating-point value of the first item on the list,
removing that item.
-=item FLOATVAL shift_float_keyed(INTERP, PMC* self, PMC* key)
-
-=item FLOATVAL shift_float_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Return the floating-point value of the first item of the list keyed by B<key>,
-removing that item from the list.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item BIGNUM* shift_bignum(INTERP, PMC* self)
Return the bignum value of the first item on the list,
removing that item.
-=item BIGNUM* shift_bignum_keyed(INTERP, PMC* self, PMC* key)
-
-=item BIGNUM* shift_bignum_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Return the bignum value of the first item of the list keyed by B<key>,
-removing that item from the list.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item STRING* shift_string(INTERP, PMC* self)
Return the string value of the first item on the list,
removing that item.
-=item STRING* shift_string_keyed(INTERP, PMC* self, PMC* key)
-
-=item STRING* shift_string_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Return the string value of the first item of the list keyed by B<key>,
-removing that item from the list.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item PMC* shift_pmc(INTERP, PMC* self)
Return the PMC value of the first item on the list,
removing that item.
-=item PMC* shift_pmc_keyed(INTERP, PMC* self, PMC* key)
-
-=item PMC* shift_pmc_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Return the PMC value of the first item of the list keyed by B<key>,
-removing that item from the list.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item void unshift_integer(INTERP, PMC* self, INTVAL value)
Add the passed in integer value to the beginning of the list.
-=item void unshift_integer_keyed(INTERP, PMC* self, PMC* key, INTVAL value)
-
-=item void unshift_integer_keyed_int(INTERP, PMC* self, INTVAL key, INTVAL value)
-
-Add the passed in integer value to the beginning of the list keyed by B<key>.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item void unshift_float(INTERP, PMC* self, FLOATVAL value)
Add the passed in floating-point number to the beginning of the list.
-=item void unshift_float_keyed(INTERP, PMC* self, PMC* key, FLOATVAL value)
-
-=item void unshift_float_keyed_int(INTERP, PMC* self, INTVAL key, FLOATVAL value)
-
-Add the passed in floating-point value to the beginning of the list keyed by B<key>.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item void unshift_bignum(INTERP, PMC* self, BIGNUM* value)
Add the passed in bignum to the beginning of the list.
-=item void unshift_bignum_keyed(INTERP, PMC* self, PMC* key, BIGNUM* value)
-
-=item void unshift_bignum_keyed_int(INTERP, PMC* self, INTVAL key, BIGNUM* value)
-
-Add the passed in bignum to the beginning of the list keyed by B<key>.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
=item void unshift_string(INTERP, PMC* self, STRING* value)
Add the passed in string to the beginning of the list.
-=item void unshift_string_keyed(INTERP, PMC* self, PMC* key, STRING* value)
-
-=item void unshift_string_keyed_int(INTERP, PMC* self, INTVAL key, STRING* value)
-
-Add the passed in string to the beginning of the list keyed by B<key>.
-The B<key> parameter is guaranteed not to be NULL for this method.
-
-=item void unshift_pmc(INTERP, PMC* self, PMC* value)
-
-Add the passed in PMC to the beginning of the list.
-
-=item void unshift_pmc_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC*
value_key)
-
-=item void unshift_pmc_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key)
-
-Add the passed in PMC to the beginning of the list keyed by B<key>.
-At least one of the two keys is guaranteed not to be NULL.
-
=item void splice(INTERP, PMC* self, PMC* value, INTVAL offset, INTVAL count)
Replace the B<count> PMCs at offset B<offset> from the beginning of
B<self> with the PMCs in the aggregate B<value>.
-=item void splice_keyed(INTERP, PMC* self, PMC* key, PMC* value,
-INTVAL offset, INTVAL count, PMC* value_key)
-
-=item void splice_keyed_int(INTERP, PMC* self, INTVAL key, PMC*
-value, INTVAL *value_key, INTVAL offset, INTVAL count)
-
-Replace the B<count> PMCs at offset B<offset> from the beginning of
-the list in B<self> keyed by B<key> with the PMCs in the list in
-B<value> keyed by B<value_key>.
-
-B<NOTE>: the _keyed and _keyed_int variants of B<push>, B<pop>, B<shift>,
-B<unshift> and B<splice> are not currently implemented and may go away.
-
=item void add(INTERP, PMC* self, PMC* value, PMC* dest)
=item void add_int(INTERP, PMC* self, INTVAL value, PMC* dest)
@@ -690,15 +521,6 @@
B<dest> may be equal to B<self>; in that case optimizations I<may> be
made.
-=item void add_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC* value_key, PMC*
dest, PMC* dest_key)
-
-=item void add_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Add the value in B<self> keyed by B<key> to the value in B<value> keyed by
-B<value_key> and store the result in B<dest> keyed by B<dest_key>.
-
-At least one of the three keys is guaranteed to not be NULL.
-
=item void subtract(INTERP, PMC* self, PMC* value, PMC* dest)
=item void subtract_int(INTERP, PMC* self, INTVAL value, PMC* dest)
@@ -710,15 +532,6 @@
Subtract B<value> from B<self> and store the result in B<dest>. Note that
B<dest> may be equal to B<self>; in that case optimizations I<may> be made.
-=item void subtract_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC* value_key,
PMC* dest, PMC* dest_key)
-
-=item void subtract_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Subtract the value in B<value> keyed by B<key> from the value in B<self>
-keyed by B<value_key> and store the result in B<dest> keyed by B<dest_key>.
-
-At least one of the three keys is guaranteed to not be NULL.
-
=item void multiply(INTERP, PMC* self, PMC* value, PMC* dest)
=item void multiply_int(INTERP, PMC* self, INTVAL value, PMC* dest)
@@ -731,15 +544,6 @@
B<dest> may be equal to B<self>; in that case optimizations I<may> be
made.
-=item void multiply_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC* value_key,
PMC* dest, PMC* dest_key)
-
-=item void multiply_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Multiply the value in B<self> keyed by B<key> by the value in B<value> keyed by
-B<value_key> and store the result in B<dest> keyed by B<dest_key>.
-
-At least one of the three keys is guaranteed to not be NULL.
-
=item void divide(INTERP, PMC* self, PMC* value, PMC* dest)
=item void divide_int(INTERP, PMC* self, INTVAL value, PMC* dest)
@@ -752,15 +556,6 @@
B<dest> may be equal to B<self>; in that case optimizations I<may> be
made.
-=item void divide_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC* value_key,
PMC* dest, PMC* dest_key)
-
-=item void divide_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Divide the value in B<self> keyed by B<key> by the value in B<value> keyed by
-B<value_key> and store the result in B<dest> keyed by B<dest_key>.
-
-At least one of the three keys is guaranteed to not be NULL.
-
=item void modulus(INTERP, PMC* self, PMC* value, PMC* dest)
=item void modulus_int(INTERP, PMC* self, INTVAL value, PMC* dest)
@@ -773,19 +568,6 @@
B<dest> may be equal to B<self>; in that case optimizations I<may> be
made.
-=item void modulus_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC* value_key,
PMC* dest, PMC* dest_key)
-
-=item void modulus_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Divide the value in B<self> keyed by B<key> by the value in B<value> keyed by
-B<value_key> and store the remainder in B<dest> keyed by B<dest_key>.
-
-At least one of the three keys is guaranteed to not be NULL.
-
-B<NOTE>: the _keyed and _keyed_int variants of B<add>, B<subtract>,
-B<multiply>, B<divide> and B<modulus> are not currently implemented and may
-go away.
-
=item void cmodulus(INTERP, PMC* self, PMC* value, PMC* dest)
=item void cmodulus_int(INTERP, PMC* self, INTVAL value, PMC* dest)
@@ -815,15 +597,6 @@
in B<dest>. Note that B<dest> may be equal to B<self>; in that case
optimizations I<may> be made.
-=item void bitwise_or_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC*
value_key, PMC* dest, PMC* dest_key)
-
-=item void bitwise_or_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Calculate the bitwise-OR of B<self> keyed by B<key> and B<value> keyed
-by B<value_key>, and store the result in B<dest_key>.
-
-At least one of the keys is guaranteed to be non-NULL.
-
=item void bitwise_and(INTERP, PMC* self, PMC* value, PMC* dest)
=item void bitwise_and_int(INTERP, PMC* self, INTVAL value, PMC* dest)
@@ -832,15 +605,6 @@
in B<dest>. Note that B<dest> may be equal to B<self>; in that case
optimizations I<may> be made.
-=item void bitwise_and_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC*
value_key, PMC* dest, PMC* dest_key)
-
-=item void bitwise_and_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Calculate the bitwise-AND of B<self> keyed by B<key> and B<value> keyed
-by B<value_key>, and store the result in B<dest> keyed by B<dest_key>.
-
-At least one of the keys is guaranteed to be non-NULL.
-
=item void bitwise_xor(INTERP, PMC* self, PMC* value, PMC* dest)
=item void bitwise_xor_int(INTERP, PMC* self, INTVAL value, PMC* dest)
@@ -849,15 +613,6 @@
in B<dest>. Note that B<dest> may be equal to B<self>; in that case
optimizations I<may> be made.
-=item void bitwise_xor_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC*
value_key, PMC* dest, PMC* dest_key)
-
-=item void bitwise_xor_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Calculate the bitwise-XOR of B<self> keyed by B<key> and B<value> keyed
-by B<value_key>, and store the result in B<dest> keyed by B<dest_key>.
-
-At least one of the keys is guaranteed to be non-NULL.
-
=item void bitwise_ors(INTERP, PMC* self, PMC* value, PMC* dest)
=item void bitwise_ors_str(INTERP, PMC* self, STRING* value, PMC* dest)
@@ -888,15 +643,6 @@
Note that B<self> and B<dest> may refer to the same PMC; in that case
optimizations I<may> be made.
-=item void bitwise_not_keyed(INTERP, PMC* self, PMC* key, PMC* dest, PMC* dest_key)
-
-=item void bitwise_not_keyed_int(INTERP, PMC* self, INTVAL key, PMC* dest, INTVAL*
dest_key)
-
-Apply a bitwise negation to B<self> keyed by B<key> and
-store the result in B<dest> keyed by B<dest_key>.
-
-At least one key is guaranteed to be non-NULL.
-
=item void bitwise_shl(INTERP, PMC* self, PMC* value, PMC* dest)
=item void bitwise_shl_int(INTERP, PMC* self, INTVAL value, PMC* dest)
@@ -904,16 +650,6 @@
and place the resulting value in B<dest>. Note that B<self> and B<dest> may
refer to the same PMC; in that case optimizations I<may> be made.
-=item void bitwise_shl_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC*
value_key, PMC* dest, PMC* dest_key)
-
-=item void bitwise_shl_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Apply a leftward shift to the value in B<self> keyed by B<key>; the number of
-bits by which to shift is taken from the value in B<value> keyed by
-B<value_key>. Store the result in B<dest> keyed by B<dest_key>.
-
-At least one key is guaranteed to be non-NULL.
-
=item void bitwise_shr(INTERP, PMC* self, PMC* value, PMC* dest)
=item void bitwise_shr_int(INTERP, PMC* self, INTVAL value, PMC* dest)
@@ -921,48 +657,20 @@
and places the resulting value in B<dest>. Note that B<self> and B<dest> may
refer to the same PMC; in that case optimizations I<may> be made.
-=item void bitwise_shr_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC*
value_key, PMC* dest, PMC* dest_key)
-
-=item void bitwise_shr_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Apply a rightward shift to the value in B<self> keyed by B<key>; the number of
-bits by which to shift is taken from the value in B<value> keyed by
-B<value_key>. Store the result in B<dest> keyed by B<dest_key>.
-
-At least one key is guaranteed to be non-NULL.
-
-B<NOTE>: the _keyed and _keyed_int variants of the B<bitwise> methods are
-not currently implemented and may go away.
-
=item void concatenate(INTERP, PMC* self, PMC* value, PMC* dest)
-=item void concatenate_native(INTERP, PMC* self, STRING* value, PMC* dest)
+=item void concatenate_str(INTERP, PMC* self, STRING* value, PMC* dest)
Concatenate the strings in B<self> and B<value> and store the result
in B<dest>.
Note that B<self> and B<dest> may refer to the same PMC; in that case
optimizations I<may> be made.
-=item void concatenate_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC*
value_key, PMC* dest, PMC* dest_key)
-
-=item void concatenate_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Concatenate the string in B<value> keyed by B<value_key> onto the string in
-B<self> keyed by B<key> and store the result in B<dest> keyed by B<dest_key>.
-
-At least one of the three keys is guaranteed to not be NULL.
-
=item INTVAL is_equal(INTERP, PMC* self, PMC* value)
Return TRUE if the two PMCs are generically equivalent, or
FALSE if they aren't.
-=item INTVAL is_equal_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC* value_key)
-
-Return TRUE if the PMC at B<self> keyed by B<key> is generally
-equivalent to the PMC at B<value> keyed by B<value_key>, or
-FALSE if they aren't.
-
=item INTVAL is_same(INTERP, PMC* self, PMC* value)
Return TRUE if the PMCs are the same, and FALSE if
@@ -975,109 +683,38 @@
Return -1 if B<self> is smaller, 0 if the two are equal, and 1
if B<value> is smaller.
-=item INTVAL cmp_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC* value_key)
-
-=item INTVAL cmp_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key)
-
-Compare the PMC at B<self> keyed by B<key> with the PMC at B<value> keyed by
-B<value_key> as PMCs (whatever that means for the class).
-Return -1 if B<self> is smaller, 0 if the two are equal, and 1
-if B<value> is smaller.
-
-At least one key is guaranteed to be non-NULL.
-
=item INTVAL cmp_num(INTERP, PMC* self, PMC* value)
Compare the two PMCs numerically.
Return -1 if B<self> is smaller, 0 if the two are equal, and 1
if B<value> is smaller.
-=item INTVAL cmp_num_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC* value_key)
-
-=item INTVAL cmp_num_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key)
-
-Compare the PMC at B<self> keyed by B<key> with the PMC at B<value> keyed by
-B<value_key> numerically.
-Return -1 if B<self> is smaller, 0 if the two are equal, and 1
-if B<value> is smaller.
-
-At least one key is guaranteed to be non-NULL.
-
=item INTVAL cmp_string(INTERP, PMC* self, PMC* value)
Compare the two PMCs as strings.
Return -1 if B<self> is smaller, 0 if the two are equal, and 1
if B<value> is smaller.
-=item INTVAL cmp_string_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC*
value_key)
-
-=item INTVAL cmp_string_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value,
INTVAL* value_key)
-
-Compare the PMC at B<self> keyed by B<key> with the PMC at B<value> keyed by
-B<value_key> numerically.
-Return -1 if B<self> is smaller, 0 if the two are equal, and 1
-if B<value> is smaller.
-
-At least one key is guaranteed to be non-NULL.
=item void logical_or(INTERP, PMC* self, PMC* value, PMC* dest)
Do a short-circuiting logical-OR of B<self> and B<value>, storing
the winner in B<dest>.
-=item void logical_or_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC*
value_key, PMC* dest, PMC* dest_key)
-
-=item void logical_or_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Do a short-circuiting logical-OR of B<self> keyed by B<key> and
-B<value> keyed by B<value_key>, storing the winner in B<dest> keyed
-by B<dest_key>.
-
-At least one key is guaranteed to be non-NULL.
-
=item void logical_and(INTERP, PMC* self, PMC* value, PMC* dest)
Do a short-circuiting logical-AND of B<self> and B<value>, storing
the winner in dest.
-=item void logical_and_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC*
value_key, PMC* dest, PMC* dest_key)
-
-=item void logical_and_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Do a short-circuiting logical-AND of B<self> keyed by B<key> and
-B<value> keyed by B<value_key>, storing the winner in B<dest> keyed
-by B<dest_key>.
-
-At least one key is guaranteed to be non-NULL.
-
=item void logical_xor(INTERP, PMC* self, PMC* value, PMC* dest)
If exactly one of B<self> or B<value> is true, store it in B<dest>. Else
set B<dest> to be false.
-=item void logical_xor_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC*
value_key, PMC* dest, PMC* dest_key)
-
-=item void logical_xor_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-If exactly one of B<self> keyed by B<key> or B<value> keyed by B<value_key>
-is true, store it in B<dest> keyed by B<dest_key>. Else set B<dest>
-keyed by B<dest_key> to be false.
-
-At least one key is guaranteed to be non-NULL.
-
=item void logical_not(INTERP, PMC* self, PMC* dest)
Do a logical-NOT on B<self> and stores the result in B<dest>.
-=item void logical_not_keyed(INTERP, PMC* self, PMC* key, PMC* dest, PMC* dest_key)
-
-=item void logical_not_keyed_int(INTERP, PMC* self, INTVAL key, PMC* dest, INTVAL*
dest_key)
-
-Do a logical-NOT on B<self> keyed by B<key> and stores the result
-in B<dest> keyed by B<dest_key>.
-
-At least one key is guaranteed to be non-NULL.
-
=item void repeat(INTERP, PMC* self, PMC* value, PMC* dest)
=item void repeat_int(INTERP, PMC* self, INTVAL value, PMC* dest)
@@ -1085,47 +722,14 @@
Repeat the string value of B<self> B<value> times and store the
resultant string in B<dest>.
-=item void repeat_keyed(INTERP, PMC* self, PMC* key, PMC* value, PMC* value_key,
PMC* dest, PMC* dest_key)
-
-=item void repeat_keyed_int(INTERP, PMC* self, INTVAL key, PMC* value, INTVAL*
value_key, PMC* dest, INTVAL* dest_key)
-
-Repeat the string in B<self> keyed by B<key> by the quantity
-of B<value> keyed by B<value_key> and store the result in
-B<dest> keyed by B<dest_key>.
-
-At least one key is guaranteed to be non-NULL.
-
-=item void repeat_int_keyed(INTERP, PMC* self, PMC* key, INTVAL value, PMC* dest,
PMC* dest_key)
-
-=item void repeat_int_keyed_int(INTERP, PMC* self, INTVAL key, INTVAL value, PMC*
dest, INTVAL* dest_key)
-
-Repeat the string in B<self> keyed by B<key> B<value> times
-and store the result in B<dest> keyed by B<dest_key>.
-
-At least one key is guaranteed to be non-NULL.
-
=item void increment(INTERP, PMC* self)
Auto-increment the PMC.
-=item void increment_keyed(INTERP, PMC* self, PMC* key)
-
-=item void increment_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Auto-increment the PMC keyed by B<key>. The key is
-guaranteed to be non-NULL.
-
=item void decrement(INTERP, PMC* self)
Auto-decrement the PMC.
-=item void decrement_keyed(INTERP, PMC* self, PMC* key)
-
-=item void decrement_keyed_int(INTERP, PMC* self, INTVAL key)
-
-Auto-decrement the PMC keyed by B<key>. The key is
-guaranteed to be non-NULL.
-
=item INTVAL exists_keyed(INTERP, PMC* self, PMC* key)
=item INTVAL exists_keyed_int(INTERP, PMC* self, INTVAL key)
@@ -1180,28 +784,10 @@
Place the value of the substring of B<self> at offset B<offset> and with
length B<length> into B<dest>.
-=item void substr_keyed(INTERP, PMC* self, PMC* key, INTVAL offset, INTVAL length,
PMC* dest, PMC* dest_key)
-
-=item void substr_keyed_int(INTERP, PMC* self, INTVAL key, INTVAL offset, INTVAL
length, PMC* dest, INTVAL* dest_key)
-
-Place the value of the substring of B<self> keyed by B<key> into
-B<dest> keyed by B<dest_key>.
-
-At least one key is guaranteed to be non-NULL.
-
=item STRING* substr_str(INTERP, PMC* self, INTVAL offset, INTVAL length)
Return the substring of B<self> at offset B<offset> and with length B<length>.
-=item STRING* substr_str_keyed(INTERP, PMC* self, PMC* key, INTVAL offset, INTVAL
length)
-
-=item STRING* substr_str_keyed_int(INTERP, PMC* self, INTVAL key, INTVAL offset,
INTVAL length)
-
-Return a substring with offset B<offset> and with length B<length> of the
-string in B<self> that is keyed by B<key>.
-
-The key is guaranteed to be not NULL.
-
=item void* invoke(INTERP, PMC* self, void* next)
Invoke the subroutine/method in the given PMC.
@@ -1217,7 +803,8 @@
See F<pdd03_calling_conventions.pod> for more details.
-XXX: I still don't understand what *next does.
+B<next*> is passed in from the run loop and is the program counter of the
+next instruction.
=item INTVAL can(INTERP, PMC* self, STRING* method)
@@ -1259,7 +846,7 @@
Maintainer: Dan Sugalski <[EMAIL PROTECTED]>
Class: Internals
PDD Number: 2
- Version: 1.3
+ Version: 1.5
Status: Developing
Last Modified: 27 July 2003
PDD Format: 1
@@ -1269,6 +856,10 @@
=over 4
+=item 1.5
+
+18 May 2004
+
=item 1.4
1 Nov 2003
@@ -1294,6 +885,11 @@
=head1 CHANGES
=over 4
+
+=item 1.5
+
+ * Remove obsolete _keyed vtables.
+ * s/concat_native/concat_str/
=item 1.4
1.18 +4 -1 parrot/include/parrot/mmd.h
Index: mmd.h
===================================================================
RCS file: /cvs/public/parrot/include/parrot/mmd.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -r1.17 -r1.18
--- mmd.h 14 May 2004 16:11:18 -0000 1.17
+++ mmd.h 18 May 2004 13:03:01 -0000 1.18
@@ -1,7 +1,7 @@
/* mmd.h
* Copyright: 2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: mmd.h,v 1.17 2004/05/14 16:11:18 dan Exp $
+ * $Id: mmd.h,v 1.18 2004/05/18 13:03:01 leo Exp $
* Overview:
* This is the api header for the mmd subsystem
* Data Structure and Algorithms:
@@ -92,8 +92,11 @@
MMD_NUMCMP,
MMD_STRCMP,
MMD_SOR,
+ MMD_SOR_STR,
MMD_SAND,
+ MMD_SAND_STR,
MMD_SXOR,
+ MMD_SXOR_STR,
MMD_USER_FIRST
} parrot_mmd_func_enum;
1.15 +6 -6 parrot/ops/bit.ops
Index: bit.ops
===================================================================
RCS file: /cvs/public/parrot/ops/bit.ops,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -r1.14 -r1.15
--- bit.ops 18 May 2004 08:59:01 -0000 1.14
+++ bit.ops 18 May 2004 13:03:04 -0000 1.15
@@ -93,7 +93,7 @@
}
inline op bands(in PMC, in STR) :base_core {
- $1->vtable->bitwise_ands_str(interpreter, $1, $2, $1);
+ mmd_dispatch_v_psp(interpreter, $1, $2, $1, MMD_SAND_STR);
goto NEXT();
}
@@ -108,7 +108,7 @@
}
inline op bands(in PMC, in PMC, in STR) :base_core {
- $2->vtable->bitwise_ands_str(interpreter, $2, $3, $1);
+ mmd_dispatch_v_psp(interpreter, $2, $3, $1, MMD_SAND_STR);
goto NEXT();
}
@@ -229,7 +229,7 @@
}
inline op bors(in PMC, in STR) :base_core {
- $1->vtable->bitwise_ors_str(interpreter, $1, $2, $1);
+ mmd_dispatch_v_psp(interpreter, $1, $2, $1, MMD_SOR_STR);
goto NEXT();
}
@@ -244,7 +244,7 @@
}
inline op bors(in PMC, in PMC, in STR) :base_core {
- $2->vtable->bitwise_ors_str(interpreter, $2, $3, $1);
+ mmd_dispatch_v_psp(interpreter, $2, $3, $1, MMD_SOR_STR);
goto NEXT();
}
@@ -447,7 +447,7 @@
}
inline op bxors(in PMC, in STR) :base_core {
- $1->vtable->bitwise_xors_str(interpreter, $1, $2, $1);
+ mmd_dispatch_v_psp(interpreter, $1, $2, $1, MMD_SXOR);
goto NEXT();
}
@@ -462,7 +462,7 @@
}
inline op bxors(in PMC, in PMC, in STR) :base_core {
- $2->vtable->bitwise_xors_str(interpreter, $2, $3, $1);
+ mmd_dispatch_v_psp(interpreter, $2, $3, $1, MMD_SXOR);
goto NEXT();
}
1.25 +1 -2 parrot/ops/string.ops
Index: string.ops
===================================================================
RCS file: /cvs/public/parrot/ops/string.ops,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -w -r1.24 -r1.25
--- string.ops 18 May 2004 08:59:01 -0000 1.24
+++ string.ops 18 May 2004 13:03:04 -0000 1.25
@@ -112,12 +112,11 @@
inline op concat (in PMC, in PMC, in PMC) :base_mem {
mmd_dispatch_v_ppp(interpreter, $2, $3, $1, MMD_CONCAT);
-/* $2->vtable->concatenate(interpreter, $2, $3, $1);*/
goto NEXT();
}
inline op concat (in PMC, in PMC, in STR) :base_mem {
- $2->vtable->concatenate_native(interpreter, $2, $3, $1);
+ mmd_dispatch_v_psp(interpreter, $2, $3, $1, MMD_CONCAT_STR);
goto NEXT();
}
#######################################
1.5 +187 -6 parrot/src/mmd_fallback.c
Index: mmd_fallback.c
===================================================================
RCS file: /cvs/public/parrot/src/mmd_fallback.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- mmd_fallback.c 15 May 2004 22:12:07 -0000 1.4
+++ mmd_fallback.c 18 May 2004 13:03:07 -0000 1.5
@@ -1,6 +1,6 @@
/*
Copyright: 2003 The Perl Foundation. All Rights Reserved.
-$Id: mmd_fallback.c,v 1.4 2004/05/15 22:12:07 dan Exp $
+$Id: mmd_fallback.c,v 1.5 2004/05/18 13:03:07 leo Exp $
=head1 NAME
@@ -70,8 +70,15 @@
static void
mmd_fallback_add_int(Parrot_Interp interp, PMC *left, INTVAL right, PMC *dest)
{
- FLOATVAL result = (VTABLE_get_number(interp, left) +
- right);
+ FLOATVAL result = VTABLE_get_number(interp, left) + right;
+ VTABLE_set_number_native(interp, dest, result);
+}
+
+static void
+mmd_fallback_add_float(Parrot_Interp interp, PMC *left, FLOATVAL right,
+ PMC *dest)
+{
+ FLOATVAL result = VTABLE_get_number(interp, left) + right;
VTABLE_set_number_native(interp, dest, result);
}
@@ -98,6 +105,23 @@
}
+static void
+mmd_fallback_subtract_int(Parrot_Interp interp,
+ PMC *left, INTVAL right, PMC *dest)
+{
+ FLOATVAL result = VTABLE_get_number(interp, left) - right;
+ VTABLE_set_number_native(interp, dest, result);
+
+}
+
+static void
+mmd_fallback_subtract_float(Parrot_Interp interp,
+ PMC *left, FLOATVAL right, PMC *dest)
+{
+ FLOATVAL result = VTABLE_get_number(interp, left) - right;
+ VTABLE_set_number_native(interp, dest, result);
+
+}
/*
=item C<void
@@ -115,8 +139,24 @@
mmd_fallback_multiply_pmc(Parrot_Interp interp,
PMC *left, PMC *right, PMC *dest)
{
- FLOATVAL result = (VTABLE_get_number(interp, left) *
- VTABLE_get_number(interp, right));
+ FLOATVAL result = VTABLE_get_number(interp, left) *
+ VTABLE_get_number(interp, right);
+ VTABLE_set_number_native(interp, dest, result);
+}
+
+static void
+mmd_fallback_multiply_int(Parrot_Interp interp,
+ PMC *left, INTVAL right, PMC *dest)
+{
+ FLOATVAL result = VTABLE_get_number(interp, left) * right;
+ VTABLE_set_number_native(interp, dest, result);
+}
+
+static void
+mmd_fallback_multiply_float(Parrot_Interp interp,
+ PMC *left, FLOATVAL right, PMC *dest)
+{
+ FLOATVAL result = VTABLE_get_number(interp, left) * right;
VTABLE_set_number_native(interp, dest, result);
}
@@ -140,6 +180,22 @@
}
+static void
+mmd_fallback_divide_int(Parrot_Interp interp, PMC *left, INTVAL right,
+ PMC *dest) {
+ FLOATVAL result = VTABLE_get_number(interp, left) / right;
+ VTABLE_set_number_native(interp, dest, result);
+
+}
+
+static void
+mmd_fallback_divide_float(Parrot_Interp interp, PMC *left, FLOATVAL right,
+ PMC *dest) {
+ FLOATVAL result = VTABLE_get_number(interp, left) / right;
+ VTABLE_set_number_native(interp, dest, result);
+
+}
+
/*
=item C<void
@@ -160,6 +216,21 @@
VTABLE_get_integer(interp, right));
}
+static void
+mmd_fallback_cmod_int(Parrot_Interp interp, PMC *left, INTVAL right, PMC *dest)
+{
+ VTABLE_set_number_native(interp, dest,
+ VTABLE_get_integer(interp, left) % right);
+}
+
+static void
+mmd_fallback_cmod_float(Parrot_Interp interp, PMC *left, FLOATVAL right,
+ PMC *dest)
+{
+ VTABLE_set_number_native(interp, dest,
+ VTABLE_get_integer(interp, left) % (INTVAL)right);
+}
+
/*
=item C<void
@@ -180,6 +251,21 @@
VTABLE_set_number_native(interp, dest, result);
}
+static void
+mmd_fallback_mod_int(Parrot_Interp interp, PMC *left, INTVAL right, PMC *dest)
+{
+ FLOATVAL result = floatval_mod(VTABLE_get_number(interp, left), right);
+ VTABLE_set_number_native(interp, dest, result);
+}
+
+static void
+mmd_fallback_mod_float(Parrot_Interp interp, PMC *left, FLOATVAL right,
+ PMC *dest)
+{
+ FLOATVAL result = floatval_mod(VTABLE_get_number(interp, left), right);
+ VTABLE_set_number_native(interp, dest, result);
+}
+
/*
=item C<void
@@ -200,6 +286,13 @@
VTABLE_get_integer(interp, right));
}
+static void
+mmd_fallback_band_int(Parrot_Interp interp, PMC *left, INTVAL right, PMC *dest)
+{
+ VTABLE_set_integer_native(interp, dest,
+ VTABLE_get_integer(interp, left) & right);
+}
+
/*
=item C<void
@@ -220,6 +313,13 @@
VTABLE_get_integer(interp, right));
}
+static void
+mmd_fallback_bor_int(Parrot_Interp interp, PMC *left, INTVAL right, PMC *dest)
+{
+ VTABLE_set_integer_native(interp, dest,
+ VTABLE_get_integer(interp, left) | right);
+}
+
/*
=item C<void
@@ -270,6 +370,13 @@
VTABLE_get_integer(interp, right));
}
+static void
+mmd_fallback_bsl_int(Parrot_Interp interp, PMC *left, INTVAL right, PMC *dest)
+{
+ VTABLE_set_integer_native(interp, dest,
+ VTABLE_get_integer(interp, left) << right);
+}
+
/*
=item C<void
@@ -290,6 +397,13 @@
VTABLE_get_integer(interp, right));
}
+static void
+mmd_fallback_bsr_int(Parrot_Interp interp, PMC *left, INTVAL right, PMC *dest)
+{
+ VTABLE_set_integer_native(interp, dest,
+ VTABLE_get_integer(interp, left) >> right);
+}
+
/*
=item C<void
@@ -313,6 +427,17 @@
}
+static void
+mmd_fallback_concat_str(Parrot_Interp interp, PMC *left, STRING *right,
+ PMC *dest)
+{
+ STRING *left_str, *total_string;
+ left_str = VTABLE_get_string(interp, left);
+ total_string = string_concat(interp, left_str, right, 0);
+ VTABLE_set_string_native(interp, dest, total_string);
+
+}
+
/*
=item C<void
@@ -546,6 +671,15 @@
VTABLE_get_string(interp, right), NULL));
}
+static void
+mmd_fallback_stringor_str(Parrot_Interp interp, PMC *left, STRING *right,
+ PMC *dest)
+{
+ VTABLE_set_string_native(interp, dest,
+ string_bitwise_or(interp,
+ VTABLE_get_string(interp, left), right, NULL));
+}
+
/*
=item C<mmd_fallback_stringand_pmc(Parrot_Interp interp, PMC *left,
@@ -568,6 +702,15 @@
VTABLE_get_string(interp, right), NULL));
}
+static void
+mmd_fallback_stringand_str(Parrot_Interp interp, PMC *left, STRING *right,
+ PMC *dest)
+{
+ VTABLE_set_string_native(interp, dest,
+ string_bitwise_and(interp,
+ VTABLE_get_string(interp, left), right, NULL));
+}
+
/*
=item C<mmd_fallback_stringxor_pmc(Parrot_Interp interp, PMC *left,
@@ -590,27 +733,61 @@
VTABLE_get_string(interp, right), NULL));
}
+static void
+mmd_fallback_stringxor_str(Parrot_Interp interp, PMC *left, STRING *right,
+ PMC *dest)
+{
+ VTABLE_set_string_native(interp, dest,
+ string_bitwise_xor(interp,
+ VTABLE_get_string(interp, left),
+ right, NULL));
+}
+
void
register_fallback_methods(Parrot_Interp interp) {
/* Yeah, this first one's out of order logically, but it means
the table doesn't have to keep being re-malloc'd */
- mmd_add_function(interp, MMD_SXOR, (funcptr_t)mmd_fallback_stringxor_pmc);
+ mmd_add_function(interp, MMD_SXOR_STR,
+ (funcptr_t)mmd_fallback_stringxor_str);
mmd_add_function(interp, MMD_ADD, (funcptr_t)mmd_fallback_add_pmc);
mmd_add_function(interp, MMD_ADD_INT, (funcptr_t)mmd_fallback_add_int);
mmd_add_function(interp, MMD_SUBTRACT,
(funcptr_t)mmd_fallback_subtract_pmc);
+ mmd_add_function(interp, MMD_SUBTRACT_INT,
+ (funcptr_t)mmd_fallback_subtract_int);
+ mmd_add_function(interp, MMD_SUBTRACT_FLOAT,
+ (funcptr_t)mmd_fallback_subtract_float);
mmd_add_function(interp, MMD_MULTIPLY,
(funcptr_t)mmd_fallback_multiply_pmc);
+ mmd_add_function(interp, MMD_MULTIPLY_INT,
+ (funcptr_t)mmd_fallback_multiply_int);
+ mmd_add_function(interp, MMD_MULTIPLY_FLOAT,
+ (funcptr_t)mmd_fallback_multiply_float);
mmd_add_function(interp, MMD_DIVIDE, (funcptr_t)mmd_fallback_divide_pmc);
+ mmd_add_function(interp, MMD_DIVIDE_INT,
+ (funcptr_t)mmd_fallback_divide_int);
+ mmd_add_function(interp, MMD_DIVIDE_FLOAT,
+ (funcptr_t)mmd_fallback_divide_float);
mmd_add_function(interp, MMD_MOD, (funcptr_t)mmd_fallback_mod_pmc);
+ mmd_add_function(interp, MMD_MOD_INT, (funcptr_t)mmd_fallback_mod_int);
+ mmd_add_function(interp, MMD_MOD_FLOAT, (funcptr_t)mmd_fallback_mod_float);
mmd_add_function(interp, MMD_CMOD, (funcptr_t)mmd_fallback_cmod_pmc);
+ mmd_add_function(interp, MMD_CMOD_INT, (funcptr_t)mmd_fallback_cmod_int);
+ mmd_add_function(interp, MMD_CMOD_FLOAT,
+ (funcptr_t)mmd_fallback_cmod_float);
mmd_add_function(interp, MMD_BAND, (funcptr_t)mmd_fallback_band_pmc);
+ mmd_add_function(interp, MMD_BAND_INT, (funcptr_t)mmd_fallback_band_int);
mmd_add_function(interp, MMD_BOR, (funcptr_t)mmd_fallback_bor_pmc);
+ mmd_add_function(interp, MMD_BOR_INT, (funcptr_t)mmd_fallback_bor_int);
mmd_add_function(interp, MMD_BXOR, (funcptr_t)mmd_fallback_bxor_pmc);
mmd_add_function(interp, MMD_BXOR_INT, (funcptr_t)mmd_fallback_bxor_int);
mmd_add_function(interp, MMD_BSL, (funcptr_t)mmd_fallback_bsl_pmc);
+ mmd_add_function(interp, MMD_BSL_INT, (funcptr_t)mmd_fallback_bsl_int);
mmd_add_function(interp, MMD_BSR, (funcptr_t)mmd_fallback_bsr_pmc);
+ mmd_add_function(interp, MMD_BSR_INT, (funcptr_t)mmd_fallback_bsr_int);
mmd_add_function(interp, MMD_CONCAT, (funcptr_t)mmd_fallback_concat_pmc);
+ mmd_add_function(interp, MMD_CONCAT_STR,
+ (funcptr_t)mmd_fallback_concat_str);
mmd_add_function(interp, MMD_LAND, (funcptr_t)mmd_fallback_land_pmc);
mmd_add_function(interp, MMD_LOR, (funcptr_t)mmd_fallback_lor_pmc);
mmd_add_function(interp, MMD_LXOR, (funcptr_t)mmd_fallback_lxor_pmc);
@@ -622,7 +799,11 @@
mmd_add_function(interp, MMD_NUMCMP, (funcptr_t)mmd_fallback_numcmp_pmc);
mmd_add_function(interp, MMD_STRCMP, (funcptr_t)mmd_fallback_strcmp_pmc);
mmd_add_function(interp, MMD_SOR, (funcptr_t)mmd_fallback_stringor_pmc);
+ mmd_add_function(interp, MMD_SOR_STR, (funcptr_t)mmd_fallback_stringor_str);
mmd_add_function(interp, MMD_SAND, (funcptr_t)mmd_fallback_stringand_pmc);
+ mmd_add_function(interp, MMD_SAND_STR,
+ (funcptr_t)mmd_fallback_stringand_str);
+ mmd_add_function(interp, MMD_SXOR, (funcptr_t)mmd_fallback_stringxor_pmc);
}
/*
1.62 +9 -9 parrot/vtable.tbl
Index: vtable.tbl
===================================================================
RCS file: /cvs/public/parrot/vtable.tbl,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -w -r1.61 -r1.62
--- vtable.tbl 18 May 2004 12:11:58 -0000 1.61
+++ vtable.tbl 18 May 2004 13:03:10 -0000 1.62
@@ -1,4 +1,4 @@
-# $Id: vtable.tbl,v 1.61 2004/05/18 12:11:58 leo Exp $
+# $Id: vtable.tbl,v 1.62 2004/05/18 13:03:10 leo Exp $
# [MAIN] #default section name
void init()
@@ -185,13 +185,13 @@
void bitwise_xor_int(INTVAL value, PMC* dest) MMD_BXOR_INT
void bitwise_ors(PMC* value, PMC* dest) MMD_SOR
-void bitwise_ors_str(STRING* value, PMC* dest)
+void bitwise_ors_str(STRING* value, PMC* dest) MMD_SOR_STR
void bitwise_ands(PMC* value, PMC* dest) MMD_SAND
-void bitwise_ands_str(STRING* value, PMC* dest)
+void bitwise_ands_str(STRING* value, PMC* dest) MMD_SAND_STR
void bitwise_xors(PMC* value, PMC* dest) MMD_SXOR
-void bitwise_xors_str(STRING* value, PMC* dest)
+void bitwise_xors_str(STRING* value, PMC* dest) MMD_SXOR_STR
void bitwise_not(PMC* dest)
@@ -205,7 +205,7 @@
[STRING]
void concatenate(PMC* value, PMC* dest) MMD_CONCAT
-void concatenate_native(STRING* value, PMC* dest)
+void concatenate_str(STRING* value, PMC* dest) MMD_CONCAT_STR
[CMP]
INTVAL is_equal(PMC* value) MMD_EQ