[svn:parrot] r40502 - branches/auto_attrs/src/pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Wed Aug 12 11:45:31 UTC 2009
Author: NotFound
Date: Wed Aug 12 11:45:29 2009
New Revision: 40502
URL: https://trac.parrot.org/parrot/changeset/40502
Log:
use auto_attrs in CallSignature and some cleaning in Capture
Modified:
branches/auto_attrs/src/pmc/callsignature.pmc
branches/auto_attrs/src/pmc/capture.pmc
Modified: branches/auto_attrs/src/pmc/callsignature.pmc
==============================================================================
--- branches/auto_attrs/src/pmc/callsignature.pmc Wed Aug 12 07:14:58 2009 (r40501)
+++ branches/auto_attrs/src/pmc/callsignature.pmc Wed Aug 12 11:45:29 2009 (r40502)
@@ -27,7 +27,7 @@
if (!PARROT_CAPTURE(obj)->hash) \
PARROT_CAPTURE(obj)->hash = pmc_new((i), enum_class_Hash);
-pmclass CallSignature extends Capture need_ext provides array provides hash {
+pmclass CallSignature extends Capture need_ext auto_attrs provides array provides hash {
ATTR PMC *returns; /* Result PMCs, if they were passed with the call */
ATTR PMC *type_tuple; /* Cached argument types for multiple dispatch */
ATTR STRING *short_sig; /* Simple string signature args & returns */
@@ -44,16 +44,10 @@
VTABLE void init() {
Parrot_CallSignature_attributes * const sig_struct =
- mem_allocate_typed(Parrot_CallSignature_attributes);
- PMC_data(SELF) = sig_struct;
- sig_struct->short_sig = NULL;
+ (Parrot_CallSignature_attributes *) PMC_data(SELF);
+ SUPER();
sig_struct->type_tuple = PMCNULL;
sig_struct->returns = PMCNULL;
- sig_struct->array = NULL;
- sig_struct->hash = NULL;
- sig_struct->data_size = CAPTURE_DATA_SIZE;
- PObj_active_destroy_SET(SELF);
- PObj_custom_mark_SET(SELF);
}
/*
@@ -182,15 +176,9 @@
*/
VTABLE void mark() {
- PMC ** const data = PMC_data_typed(SELF, PMC **);
Parrot_CallSignature_attributes * const attrs = PARROT_CALLSIGNATURE(SELF);
if (attrs) {
-
- if (attrs->array)
- Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->array);
- if (attrs->hash)
- Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->hash);
if (attrs->returns)
Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->returns);
if (attrs->type_tuple)
@@ -198,13 +186,7 @@
if (attrs->short_sig)
Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->short_sig);
}
-
- if (data) {
- INTVAL i;
- for (i = attrs->data_size - 1; i >= 0; --i)
- if (data[i])
- Parrot_gc_mark_PObj_alive(interp, (PObj *)data[i]);
- }
+ SUPER();
}
Modified: branches/auto_attrs/src/pmc/capture.pmc
==============================================================================
--- branches/auto_attrs/src/pmc/capture.pmc Wed Aug 12 07:14:58 2009 (r40501)
+++ branches/auto_attrs/src/pmc/capture.pmc Wed Aug 12 11:45:29 2009 (r40502)
@@ -44,8 +44,6 @@
VTABLE void init() {
Parrot_Capture_attributes *capture =
(Parrot_Capture_attributes *) PMC_data(SELF);
- capture->array = NULL;
- capture->hash = NULL;
capture->data_size = CAPTURE_DATA_SIZE;
PObj_custom_mark_SET(SELF);
}
More information about the parrot-commits
mailing list