Permalink
Browse files

add freeze/thaw for NCI so it can be cloned by VisitClone

git-svn-id: https://svn.parrot.org/parrot/branches/tt1015@44764 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent 56f72f5 commit 515758acb13788b0533c6f279e927899e09bcafe plobsing committed Mar 8, 2010
Showing with 25 additions and 0 deletions.
  1. +25 −0 src/pmc/nci.pmc
View
@@ -272,6 +272,31 @@ Creates and returns a clone of the NCI.
return ret;
}
+ VTABLE void freeze(PMC *visit) {
+ Parrot_NCI_attributes * const nci = PARROT_NCI(SELF);
+
+ VTABLE_push_integer(INTERP, visit, nci->func);
+ VTABLE_push_integer(INTERP, visit, nci->orig_func);
+ VTABLE_push_string(INTERP, visit, nci->signature);
+ VTABLE_push_string(INTERP, visit, nci->pcc_params_signature);
+ VTABLE_push_integer(INTERP, visit, nci->arity);
+ VTABLE_push_integer(INTERP, visit, nci->jitted);
+ VTABLE_push_integer(INTERP, visit, PObj_get_FLAGS(SELF) & 0x7);
+ }
+
+ VTABLE void thaw(PMC *visit) {
+ Parrot_NCI_attributes * const nci = PARROT_NCI(SELF);
+
+ nci->func = VTABLE_shift_integer(INTERP, visit);
+ nci->orig_func = VTABLE_shift_integer(INTERP, visit);
+ nci->signature = VTABLE_shift_string(INTERP, visit);
+ nci->pcc_params_signature = VTABLE_shift_string(INTERP, visit);
+ nci->arity = VTABLE_shift_integer(INTERP, visit);
+ nci->jitted = VTABLE_shift_integer(INTERP, visit);
+ PObj_get_FLAGS(SELF) |= VTABLE_shift_integer(INTERP, visit);
+ }
+
+
/*
=item C<INTVAL defined()>

0 comments on commit 515758a

Please sign in to comment.