Permalink
Browse files

Invocation protocol serialization.

  • Loading branch information...
1 parent 176fa67 commit 1d927341a92b9877d9fe6ac23b72d8ded989b675 @jnthn jnthn committed Apr 29, 2013
Showing with 23 additions and 1 deletion.
  1. +23 −1 src/vm/parrot/6model/serialization.c
View
24 src/vm/parrot/6model/serialization.c
@@ -19,7 +19,7 @@
/* Version of the serialization format that we are currently at and lowest
* version we support. */
-#define CURRENT_VERSION 4
+#define CURRENT_VERSION 5
#define MIN_VERSION 1
/* Various sizes (in bytes). */
@@ -760,6 +760,17 @@ static void serialize_stable(PARROT_INTERP, SerializationWriter *writer, PMC *st
write_ref_func(interp, writer, st->container_spec->fetch_method);
}
+ /* Invocation spec. */
+ if (writer->root.version >= 5) {
+ write_int_func(interp, writer, st->invocation_spec != NULL);
+ if (st->invocation_spec) {
+ write_ref_func(interp, writer, st->invocation_spec->value_slot.class_handle);
+ write_str_func(interp, writer, st->invocation_spec->value_slot.attr_name);
+ write_int_func(interp, writer, st->invocation_spec->value_slot.hint);
+ write_ref_func(interp, writer, st->invocation_spec->invocation_handler);
+ }
+ }
+
/* Store offset we save REPR data at. */
write_int32(writer->root.stables_table, offset + 8, writer->stables_data_offset);
@@ -1636,6 +1647,17 @@ static void deserialize_stable(PARROT_INTERP, SerializationReader *reader, INTVA
st->container_spec->fetch_method = read_ref_func(interp, reader);
}
+ /* Invocation spec. */
+ if (reader->root.version >= 5) {
+ if (read_int_func(interp, reader)) {
+ st->invocation_spec = (InvocationSpec *)mem_sys_allocate(sizeof(InvocationSpec));
+ st->invocation_spec->value_slot.class_handle = read_ref_func(interp, reader);
+ st->invocation_spec->value_slot.attr_name = read_str_func(interp, reader);
+ st->invocation_spec->value_slot.hint = read_int_func(interp, reader);
+ st->invocation_spec->invocation_handler = read_ref_func(interp, reader);
+ }
+ }
+
/* Mark it as being in the SC we're currently deserializing. */
st->sc = reader->root.sc;

0 comments on commit 1d92734

Please sign in to comment.