cvsuser 03/11/20 06:57:49
Modified: classes sub.pmc
docs/dev pmc_freeze.pod
Log:
argh: typos and escape flag docs
Revision Changes Path
1.30 +15 -1 parrot/classes/sub.pmc
Index: sub.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/sub.pmc,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -w -r1.29 -r1.30
--- sub.pmc 1 Nov 2003 16:33:20 -0000 1.29
+++ sub.pmc 20 Nov 2003 14:57:47 -0000 1.30
@@ -1,7 +1,7 @@
/* Sub.pmc
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: sub.pmc,v 1.29 2003/11/01 16:33:20 leo Exp $
+ * $Id: sub.pmc,v 1.30 2003/11/20 14:57:47 leo Exp $
* Overview:
* These are the vtable functions for the Sub (subroutine) base class
* Data Structure and Algorithms:
@@ -81,4 +81,18 @@
SELF->cache.struct_val == value->cache.struct_val;
}
+ void freeze(visit_info *info) {
+ IMAGE_IO *io = info->image_io;
+ struct Parrot_Sub * sub = (struct Parrot_Sub *)PMC_sub(SELF);
+ /*
+ * we currently need to write 3 items
+ * - name of the sub's label
+ * - start offset in byte-code segment
+ * - end offset in byte-code segment
+ */
+ }
+
+ void thaw(visit_info *info) {
+ IMAGE_IO *io = info->image_io;
+ }
}
1.3 +22 -6 parrot/docs/dev/pmc_freeze.pod
Index: pmc_freeze.pod
===================================================================
RCS file: /cvs/public/parrot/docs/dev/pmc_freeze.pod,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- pmc_freeze.pod 20 Nov 2003 12:44:05 -0000 1.2
+++ pmc_freeze.pod 20 Nov 2003 14:57:49 -0000 1.3
@@ -99,7 +99,7 @@
=item todo list
A B<List> called B<todo> holds items still to be worked on. This
-method is slower, consumes more resources, but doesn't interfer with
+method is slower, consumes more resources, but doesn't interfere with
DOD runs and is thread-safe.
=back
@@ -108,7 +108,7 @@
This is done by a callback function inside the B<visit_info> structure
called B<visit_child_function>. It gets called initially to put the
-first item on the list and is called therafter from all PMCs for
+first item on the list and is called thereafter from all PMCs for
contained PMCs inside the B<visit> vtable method.
@@ -117,7 +117,7 @@
The general scheme above shows that this method is called for all
items on the B<todo_list>. B<visit> has to call
B<visit_child_function> for all contained PMCs, which then get
-visitted until all is done.
+visited until all is done.
=head2 The visit_child_function() callback
@@ -201,7 +201,7 @@
=head2 Serializer interface
-During initialisation the B<visit_info>s B<image_io> data pointer is
+During initialization the B<visit_info>s B<image_io> data pointer is
filled with an object having B<vtable> methods that remarkably look
like a PMCs vtable. So B<io-E<gt>vtable-E<gt>push_integer> spits out
an INTVAL to the frozen B<image>, while B<shift_integer> gets an
@@ -221,7 +221,7 @@
We already have a platform-independent way of reading and writing
opcodes, string-, and number-constants. So this serializer uses
-functionality of the packfile routines. The produced image isn't as
+functionality of the pack-file routines. The produced image isn't as
dense as it could be though, because all data are aligned at
B<opcode_t> boundaries.
@@ -240,7 +240,7 @@
<id><type><pmc-specific-data>
-The text prepresentation of the array
+The text representation of the array
P0 = [P1=666, P2=777, P0]
@@ -258,10 +258,26 @@
777 ... value
0xdf5 ... id of array itself with lo bit set
+The escape flag marks places in the image, where additional data will
+follow. Used as an initial PMC B<id> means, that a property hash will
+follow. Used inside the PMC stream allows a PMC to insert additional
+information into the image. During B<thaw> the PMCs vtable is called
+again, to restore these data.
+
+This is e.g. needed for arrays containing sparse holes, to set the
+array index of the following data.
+
+A PMC with a property hash thus looks like:
+
+ <id+0x3><type><id-prop><pmc-data><prop-data>
+
[ To be continued ]
=head1 Author
Leopold Toetsch <[EMAIL PROTECTED]>
+=cut
+
+# vim: expandtab shiftwidth=2 tw=70: