[svn:parrot] r38041 - in trunk: docs include/parrot src src/pmc tools/build
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Fri Apr 10 23:10:21 UTC 2009
Author: whiteknight
Date: Fri Apr 10 23:10:20 2009
New Revision: 38041
URL: https://trac.parrot.org/parrot/changeset/38041
Log:
kill PMC_struct_val. kill it dead
Modified:
trunk/docs/pmc.pod
trunk/include/parrot/pobj.h
trunk/src/pmc.c
trunk/src/pmc/scalar.pmc
trunk/src/utils.c
trunk/tools/build/nativecall.pl
Modified: trunk/docs/pmc.pod
==============================================================================
--- trunk/docs/pmc.pod Fri Apr 10 22:39:35 2009 (r38040)
+++ trunk/docs/pmc.pod Fri Apr 10 23:10:20 2009 (r38041)
@@ -18,15 +18,6 @@
B<PMC_data> or B<pmc_ext> is set to NULL. The flags are set to their default
value, especially the private flags are 0.
-=head2 UnionVal usage
-
-There are no special rules, where to store what: use whatever fits best. If
-your PMC points to a B<STRING *>, hang it off the B<PMC_str_val()>, if it's an
-B<INTVAL>, place it in B<PMC_int_val()>. If you need to store two items, try to
-use union members that have distinct storage like B<PObj_bustart()> /
-B<PObj_buf_len()> or B<PMC_struct_val()> / B<PMC_pmc_val()> in parallel with
-B<PMC_num_val()>.
-
=head2 PMC_data()
If your PMC contains other PMCs that possibly would allow the creation of
Modified: trunk/include/parrot/pobj.h
==============================================================================
--- trunk/include/parrot/pobj.h Fri Apr 10 22:39:35 2009 (r38040)
+++ trunk/include/parrot/pobj.h Fri Apr 10 23:10:20 2009 (r38041)
@@ -55,7 +55,6 @@
#define PObj_bufstart(pmc) (pmc)->cache._b._bufstart
#define PObj_buflen(pmc) (pmc)->cache._b._buflen
-#define PMC_struct_val(pmc) (pmc)->cache._ptrs._struct_val
#define PMC_int_val(pmc) (pmc)->cache._i._int_val
/* See src/gc/resources.c. the basic idea is that buffer memory is
Modified: trunk/src/pmc.c
==============================================================================
--- trunk/src/pmc.c Fri Apr 10 22:39:35 2009 (r38040)
+++ trunk/src/pmc.c Fri Apr 10 23:10:20 2009 (r38041)
@@ -690,8 +690,6 @@
gc_flag_CLEAR(is_special_PMC, _class);
- PMC_struct_val(_class) = (void *)0xdeadbeef;
-
PObj_is_PMC_shared_CLEAR(_class);
interp->vtables[type]->pmc_class = _class;
Modified: trunk/src/pmc/scalar.pmc
==============================================================================
--- trunk/src/pmc/scalar.pmc Fri Apr 10 22:39:35 2009 (r38040)
+++ trunk/src/pmc/scalar.pmc Fri Apr 10 23:10:20 2009 (r38041)
@@ -1218,11 +1218,12 @@
*/
+/*
MULTI INTVAL is_equal(PMC *value) {
return (SELF->vtable == value->vtable
- && PMC_struct_val(SELF) == PMC_struct_val(value)
&& PMC_data(SELF) == PMC_data(value));
}
+*/
/*
Modified: trunk/src/utils.c
==============================================================================
--- trunk/src/utils.c Fri Apr 10 22:39:35 2009 (r38040)
+++ trunk/src/utils.c Fri Apr 10 23:10:20 2009 (r38041)
@@ -21,6 +21,7 @@
*/
#include "parrot/parrot.h"
+#include "pmc/pmc_nci.h"
typedef unsigned short _rand_buf[3];
@@ -906,7 +907,7 @@
return VTABLE_cmp(interp, (PMC *)a, (PMC *)b);
if (cmp->vtable->base_type == enum_class_NCI) {
- const sort_func_t f = (sort_func_t)D2FPTR(PMC_struct_val(cmp));
+ const sort_func_t f = (sort_func_t)D2FPTR(PARROT_NCI(cmp)->func);
return f(interp, a, b);
}
Modified: trunk/tools/build/nativecall.pl
==============================================================================
--- trunk/tools/build/nativecall.pl Fri Apr 10 22:39:35 2009 (r38040)
+++ trunk/tools/build/nativecall.pl Fri Apr 10 23:10:20 2009 (r38041)
@@ -623,7 +623,6 @@
$ret_type (*pointer)();
$ret_type return_data;
- pointer = PMC_struct_val(self);
return_data = ($ret_type)(*pointer)($params);
$ret_reg = return_data;
REG_INT(interp, 0) = $stack_returns;
More information about the parrot-commits
mailing list