Author: petdance
Date: Thu Jan 1 22:14:49 2009
New Revision: 34790
Modified:
trunk/lib/Parrot/Pmc2c/Method.pm
trunk/lib/Parrot/Pmc2c/MethodEmitter.pm
trunk/lib/Parrot/Pmc2c/PMC/RO.pm
Log:
shim out unused PMC * arguments
Modified: trunk/lib/Parrot/Pmc2c/Method.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/Method.pm (original)
+++ trunk/lib/Parrot/Pmc2c/Method.pm Thu Jan 1 22:14:49 2009
@@ -20,6 +20,7 @@
mmd_rights => [],
parent_name => "",
decorators => [],
+ pmc_unused => 0,
%{ $self_hash || {} }
)
};
@@ -78,6 +79,12 @@
return 0;
}
+sub pmc_unused {
+ my ($self) = @_;
+
+ return $self->{pmc_unused};
+}
+
=head1 C<trans($type)>
Used in C<signature()> to normalize argument types.
Modified: trunk/lib/Parrot/Pmc2c/MethodEmitter.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/MethodEmitter.pm (original)
+++ trunk/lib/Parrot/Pmc2c/MethodEmitter.pm Thu Jan 1 22:14:49 2009
@@ -98,24 +98,22 @@
$args = ", $args" if $args =~ /\S/;
$args =~ s/(\w+)\s*(\*)\s*/$1 $2/g;
- my ( $export, $extern, $newl, $semi, $pmcvar );
+ my ( $export, $extern, $newl, $semi );
if ( $for_header eq 'HEADER' ) {
$export = $pmc->export;
- $extern = '';
$newl = ' ';
$semi = ';';
- $pmcvar = '';
}
else {
$export = '';
- $extern = '';
$newl = "\n";
$semi = '';
- $pmcvar = 'pmc';
}
+ my $pmcarg = 'PMC *pmc';
+ $pmcarg = "SHIM($pmcarg)" if $self->pmc_unused;
return <<"EOC";
-$decs$export $extern$ret${newl}Parrot_${pmcname}_$meth(PARROT_INTERP, PMC
*$pmcvar$args)$semi
+$decs$export $ret${newl}Parrot_${pmcname}_$meth(PARROT_INTERP,
$pmcarg$args)$semi
EOC
}
Modified: trunk/lib/Parrot/Pmc2c/PMC/RO.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/PMC/RO.pm (original)
+++ trunk/lib/Parrot/Pmc2c/PMC/RO.pm Thu Jan 1 22:14:49 2009
@@ -108,6 +108,7 @@
return_type => $vt_method->return_type,
parameters => join( ', ', @parameters ),
type => Parrot::Pmc2c::Method::VTABLE,
+ pmc_unused => 1,
}
);
my $pmcname = $parent->name;