[svn:parrot] r49308 - branches/generational_gc/lib/Parrot/Pmc2c
bacek at svn.parrot.org
bacek at svn.parrot.org
Sat Sep 25 00:58:16 UTC 2010
Author: bacek
Date: Sat Sep 25 00:58:16 2010
New Revision: 49308
URL: https://trac.parrot.org/parrot/changeset/49308
Log:
More emitting of WB vtable
Modified:
branches/generational_gc/lib/Parrot/Pmc2c/PMCEmitter.pm
Modified: branches/generational_gc/lib/Parrot/Pmc2c/PMCEmitter.pm
==============================================================================
--- branches/generational_gc/lib/Parrot/Pmc2c/PMCEmitter.pm Sat Sep 25 00:57:59 2010 (r49307)
+++ branches/generational_gc/lib/Parrot/Pmc2c/PMCEmitter.pm Sat Sep 25 00:58:16 2010 (r49308)
@@ -141,9 +141,11 @@
if ($name ne 'default') {
$h->emit("${export}VTABLE* Parrot_${name}_update_vtable(ARGMOD(VTABLE*));\n");
$h->emit("${export}VTABLE* Parrot_${name}_ro_update_vtable(ARGMOD(VTABLE*));\n");
+ $h->emit("${export}VTABLE* Parrot_${name}_wb_update_vtable(ARGMOD(VTABLE*));\n");
}
$h->emit("${export}VTABLE* Parrot_${name}_get_vtable(PARROT_INTERP);\n");
$h->emit("${export}VTABLE* Parrot_${name}_ro_get_vtable(PARROT_INTERP);\n");
+ $h->emit("${export}VTABLE* Parrot_${name}_wb_get_vtable(PARROT_INTERP);\n");
$h->emit("${export}PMC* Parrot_${name}_get_mro(PARROT_INTERP, ARGIN_NULLOK(PMC* mro));\n");
$h->emit("${export}Hash* Parrot_${name}_get_isa(PARROT_INTERP, ARGIN_NULLOK(Hash* isa));\n");
@@ -809,6 +811,33 @@
EOC
+ # Generate WB vtable for implemented non-updating methods
+ $vtable_updates = '';
+ foreach my $name ( @{ $self->vtable->names} ) {
+ next unless exists $self->{has_method}{$name};
+ if ($self->vtable_method_does_write($name)) {
+ # If we override constantness status of vtable
+ if (!$self->vtable->attrs($name)->{write}) {
+ $vtable_updates .= " vt->$name = Parrot_${classname}_wb_${name};\n";
+ }
+ }
+ else {
+ $vtable_updates .= " vt->$name = Parrot_${classname}_${name};\n";
+ }
+ }
+
+ $vtable_updates .= $set_attr_size;
+
+ $cout .= <<"EOC";
+
+$export
+VTABLE *Parrot_${classname}_wb_update_vtable(ARGMOD(VTABLE *vt)) {
+$vtable_updates
+ return vt;
+}
+
+EOC
+
$cout;
}
@@ -971,6 +1000,14 @@
return vt;
}
+$export
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+VTABLE* Parrot_${classname}_wb_get_vtable(PARROT_INTERP) {
+ VTABLE *vt;
+ return vt;
+}
+
EOC
$cout;
More information about the parrot-commits
mailing list