[svn:parrot] r43031 - in branches/pmc_freeze_cleanup: compilers/pirc/src include/parrot src src/pmc
plobsing at svn.parrot.org
plobsing at svn.parrot.org
Mon Dec 14 05:40:05 UTC 2009
Author: plobsing
Date: Mon Dec 14 05:40:03 2009
New Revision: 43031
URL: https://trac.parrot.org/parrot/changeset/43031
Log:
Merge image_io and visit_info.
This moves the vtable functionality into visit_info, which is what everything outside
of this subsystem deals with (and what should become a PMC).
Add get_integer vtable interface to replace visit_info.what.
Modified:
branches/pmc_freeze_cleanup/compilers/pirc/src/bcgen.h
branches/pmc_freeze_cleanup/include/parrot/pmc_freeze.h
branches/pmc_freeze_cleanup/src/hash.c
branches/pmc_freeze_cleanup/src/pmc/array.pmc
branches/pmc_freeze_cleanup/src/pmc/class.pmc
branches/pmc_freeze_cleanup/src/pmc/eval.pmc
branches/pmc_freeze_cleanup/src/pmc/fixedbooleanarray.pmc
branches/pmc_freeze_cleanup/src/pmc/fixedintegerarray.pmc
branches/pmc_freeze_cleanup/src/pmc/fixedpmcarray.pmc
branches/pmc_freeze_cleanup/src/pmc/fixedstringarray.pmc
branches/pmc_freeze_cleanup/src/pmc/float.pmc
branches/pmc_freeze_cleanup/src/pmc/hash.pmc
branches/pmc_freeze_cleanup/src/pmc/integer.pmc
branches/pmc_freeze_cleanup/src/pmc/key.pmc
branches/pmc_freeze_cleanup/src/pmc/lexinfo.pmc
branches/pmc_freeze_cleanup/src/pmc/orderedhash.pmc
branches/pmc_freeze_cleanup/src/pmc/resizablebooleanarray.pmc
branches/pmc_freeze_cleanup/src/pmc/resizableintegerarray.pmc
branches/pmc_freeze_cleanup/src/pmc/scheduler.pmc
branches/pmc_freeze_cleanup/src/pmc/schedulermessage.pmc
branches/pmc_freeze_cleanup/src/pmc/string.pmc
branches/pmc_freeze_cleanup/src/pmc/sub.pmc
branches/pmc_freeze_cleanup/src/pmc/task.pmc
branches/pmc_freeze_cleanup/src/pmc_freeze.c
Modified: branches/pmc_freeze_cleanup/compilers/pirc/src/bcgen.h
==============================================================================
--- branches/pmc_freeze_cleanup/compilers/pirc/src/bcgen.h Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/compilers/pirc/src/bcgen.h Mon Dec 14 05:40:03 2009 (r43031)
@@ -162,6 +162,10 @@
emit_opcode(ARGIN(bytecode * const bc), opcode_t op)
__attribute__nonnull__(1);
+int emit_pbc_key(ARGIN(bytecode * const bc), ARGIN(key * const k))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
FLOATVAL get_num_const(ARGIN(bytecode * const bc), unsigned index)
__attribute__nonnull__(1);
Modified: branches/pmc_freeze_cleanup/include/parrot/pmc_freeze.h
==============================================================================
--- branches/pmc_freeze_cleanup/include/parrot/pmc_freeze.h Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/include/parrot/pmc_freeze.h Mon Dec 14 05:40:03 2009 (r43031)
@@ -26,16 +26,17 @@
VISIT_DESTRUCTION_ORDER
} visit_enum_type;
-struct _image_io;
-#define IMAGE_IO struct _image_io
-typedef void (*push_integer_f) (PARROT_INTERP, IMAGE_IO*, INTVAL);
-typedef void (*push_string_f) (PARROT_INTERP, IMAGE_IO*, STRING*);
-typedef void (*push_number_f) (PARROT_INTERP, IMAGE_IO*, FLOATVAL);
-typedef INTVAL (*shift_integer_f) (PARROT_INTERP, IMAGE_IO*);
-typedef STRING* (*shift_string_f) (PARROT_INTERP, IMAGE_IO*);
-typedef FLOATVAL (*shift_number_f) (PARROT_INTERP, IMAGE_IO*);
+struct _visit_info;
+typedef INTVAL (*get_integer_f) (PARROT_INTERP, struct _visit_info*);
+typedef void (*push_integer_f) (PARROT_INTERP, struct _visit_info*, INTVAL);
+typedef void (*push_string_f) (PARROT_INTERP, struct _visit_info*, STRING*);
+typedef void (*push_number_f) (PARROT_INTERP, struct _visit_info*, FLOATVAL);
+typedef INTVAL (*shift_integer_f) (PARROT_INTERP, struct _visit_info*);
+typedef STRING* (*shift_string_f) (PARROT_INTERP, struct _visit_info*);
+typedef FLOATVAL (*shift_number_f) (PARROT_INTERP, struct _visit_info*);
typedef struct _image_funcs {
+ get_integer_f get_integer;
push_integer_f push_integer;
push_string_f push_string;
push_number_f push_float;
@@ -44,12 +45,6 @@
shift_number_f shift_float;
} image_funcs;
-typedef struct _image_io {
- STRING *image;
- struct PackFile *pf;
- const image_funcs *vtable;
-} image_io;
-
typedef enum {
EXTRA_IS_NULL,
EXTRA_IS_UNUSED,
@@ -71,7 +66,8 @@
void *extra; /* PMC specific */
INTVAL extra_flags; /* concerning to extra */
PMC *thaw_result; /* 1st thawed */
- IMAGE_IO *image_io;
+ struct PackFile *pf;
+ const image_funcs *vtable;
} visit_info;
/*
Modified: branches/pmc_freeze_cleanup/src/hash.c
==============================================================================
--- branches/pmc_freeze_cleanup/src/hash.c Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/hash.c Mon Dec 14 05:40:03 2009 (r43031)
@@ -555,7 +555,6 @@
hash_thaw(PARROT_INTERP, ARGMOD(Hash *hash), ARGMOD(visit_info *info))
{
ASSERT_ARGS(hash_thaw)
- IMAGE_IO * const io = info->image_io;
/* during thaw, info->extra is the key/value count */
const size_t num_entries = (size_t) hash->entries;
@@ -569,13 +568,13 @@
switch (hash->key_type) {
case Hash_key_type_STRING:
{
- STRING * const s_key = VTABLE_shift_string(interp, io);
+ STRING * const s_key = VTABLE_shift_string(interp, info);
b = parrot_hash_put(interp, hash, s_key, NULL);
}
break;
case Hash_key_type_int:
{
- const INTVAL i_key = VTABLE_shift_integer(interp, io);
+ const INTVAL i_key = VTABLE_shift_integer(interp, info);
b = parrot_hash_put(interp, hash, (void*)i_key, NULL);
}
break;
@@ -596,7 +595,7 @@
}
case enum_hash_int:
{
- const INTVAL i = VTABLE_shift_integer(interp, io);
+ const INTVAL i = VTABLE_shift_integer(interp, info);
b->value = (void *)i;
break;
}
@@ -629,7 +628,6 @@
hash_freeze(PARROT_INTERP, ARGIN(const Hash * const hash), ARGMOD(visit_info *info))
{
ASSERT_ARGS(hash_freeze)
- IMAGE_IO * const io = info->image_io;
size_t i;
for (i = 0; i < hash->entries; i++) {
@@ -637,10 +635,10 @@
switch (hash->key_type) {
case Hash_key_type_STRING:
- VTABLE_push_string(interp, io, (STRING *)b->key);
+ VTABLE_push_string(interp, info, (STRING *)b->key);
break;
case Hash_key_type_int:
- VTABLE_push_integer(interp, io, (INTVAL)b->key);
+ VTABLE_push_integer(interp, info, (INTVAL)b->key);
break;
default:
Parrot_ex_throw_from_c_args(interp, NULL, 1,
@@ -653,7 +651,7 @@
(info->visit_pmc_now)(interp, (PMC *)b->value, info);
break;
case enum_hash_int:
- VTABLE_push_integer(interp, io, (INTVAL)b->value);
+ VTABLE_push_integer(interp, info, (INTVAL)b->value);
break;
default:
Parrot_ex_throw_from_c_args(interp, NULL, 1,
@@ -683,7 +681,7 @@
ASSERT_ARGS(parrot_hash_visit)
visit_info* const info = (visit_info*) pinfo;
- switch (info->what) {
+ switch (VTABLE_get_integer(interp, info)) {
case VISIT_THAW_NORMAL:
case VISIT_THAW_CONSTANTS:
hash_thaw(interp, hash, info);
Modified: branches/pmc_freeze_cleanup/src/pmc/array.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/array.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/array.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -1184,9 +1184,8 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
- VTABLE_push_integer(INTERP, io, VTABLE_elements(INTERP, SELF));
+ VTABLE_push_integer(INTERP, info, VTABLE_elements(INTERP, SELF));
}
/*
@@ -1200,11 +1199,9 @@
*/
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
-
SUPER(info);
if (info->extra_flags == EXTRA_IS_NULL) {
- SELF.set_integer_native(VTABLE_shift_integer(INTERP, io));
+ SELF.set_integer_native(VTABLE_shift_integer(INTERP, info));
}
}
Modified: branches/pmc_freeze_cleanup/src/pmc/class.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/class.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/class.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -1477,15 +1477,14 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
Parrot_Class_attributes * const class_data = PARROT_CLASS(SELF);
STRING *serial_namespace = CONST_STRING(interp, "");
/* 1) freeze class id */
- VTABLE_push_integer(INTERP, io, class_data->id);
+ VTABLE_push_integer(INTERP, info, class_data->id);
/* 2) freeze class name */
- VTABLE_push_string(INTERP, io, class_data->name);
+ VTABLE_push_string(INTERP, info, class_data->name);
/* 3) serialize namespace name, including HLL */
if (!PMC_IS_NULL(class_data->_namespace)) {
@@ -1494,7 +1493,7 @@
if (!PMC_IS_NULL(names))
serial_namespace = Parrot_str_join(interp, CONST_STRING(interp, ";"), names);
}
- VTABLE_push_string(INTERP, io, serial_namespace);
+ VTABLE_push_string(INTERP, info, serial_namespace);
}
/*
@@ -1516,16 +1515,14 @@
SUPER(info);
}
else if (info->extra_flags == EXTRA_IS_NULL) {
- IMAGE_IO * const io = info->image_io;
-
/* 1) thaw class id */
- const INTVAL id = VTABLE_shift_integer(INTERP, io);
+ const INTVAL id = VTABLE_shift_integer(INTERP, info);
/* 2) thaw class name */
- STRING * const name = VTABLE_shift_string(INTERP, io);
+ STRING * const name = VTABLE_shift_string(INTERP, info);
/* 3) deserialize namespace name, including HLL */
- STRING * const serial_namespace = VTABLE_shift_string(INTERP, io);
+ STRING * const serial_namespace = VTABLE_shift_string(INTERP, info);
STRING * const semicolon_str = CONST_STRING(INTERP, ";");
PMC * const namespace_array =
Parrot_str_split(INTERP, semicolon_str, serial_namespace);
Modified: branches/pmc_freeze_cleanup/src/pmc/eval.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/eval.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/eval.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -333,16 +333,14 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO *io = info->image_io;
STRING *packed = SELF.get_string();
- VTABLE_push_string(INTERP, io, packed);
+ VTABLE_push_string(INTERP, info, packed);
SUPER(info);
}
VTABLE void thaw(visit_info *info) {
- IMAGE_IO *io = info->image_io;
- STRING *packed = VTABLE_shift_string(INTERP, io);
+ STRING *packed = VTABLE_shift_string(INTERP, info);
PackFile *pf;
PackFile_Segment *seg;
Parrot_Sub_attributes *sub;
Modified: branches/pmc_freeze_cleanup/src/pmc/fixedbooleanarray.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/fixedbooleanarray.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/fixedbooleanarray.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -516,7 +516,6 @@
VTABLE void freeze(visit_info *info) {
UINTVAL size, resize_threshold;
unsigned char * bit_array;
- IMAGE_IO * const io = info->image_io;
STRING * s;
GET_ATTR_size(INTERP, SELF, size);
GET_ATTR_resize_threshold(INTERP, SELF, resize_threshold);
@@ -525,8 +524,8 @@
s = Parrot_str_new(INTERP, (char*)bit_array,
(resize_threshold / BITS_PER_CHAR));
- VTABLE_push_integer(INTERP, io, size);
- VTABLE_push_string(INTERP, io, s);
+ VTABLE_push_integer(INTERP, info, size);
+ VTABLE_push_string(INTERP, info, s);
}
/*
@@ -539,14 +538,13 @@
*/
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
if (info->extra_flags == EXTRA_IS_NULL) {
unsigned char * bit_array;
UINTVAL threshold;
- const INTVAL size = VTABLE_shift_integer(INTERP, io);
- STRING * const s = VTABLE_shift_string(INTERP, io);
+ const INTVAL size = VTABLE_shift_integer(INTERP, info);
+ STRING * const s = VTABLE_shift_string(INTERP, info);
bit_array = (unsigned char *)Parrot_str_to_cstring(INTERP, s);
threshold = Parrot_str_byte_length(interp, s) * BITS_PER_CHAR;
Modified: branches/pmc_freeze_cleanup/src/pmc/fixedintegerarray.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/fixedintegerarray.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/fixedintegerarray.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -560,26 +560,24 @@
}*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO *io = info->image_io;
INTVAL *int_array;
INTVAL i, n;
SUPER(info);
GET_ATTR_size(INTERP, SELF, n);
- VTABLE_push_integer(INTERP, io, n);
+ VTABLE_push_integer(INTERP, info, n);
GET_ATTR_int_array(INTERP, SELF, int_array);
for (i = 0; i < n; ++i)
- VTABLE_push_integer(INTERP, io, int_array[i]);
+ VTABLE_push_integer(INTERP, info, int_array[i]);
}
VTABLE void thaw(visit_info *info) {
PObj_custom_destroy_SET(SELF);
if (info->extra_flags == EXTRA_IS_NULL) {
- IMAGE_IO * const io = info->image_io;
- const INTVAL n = VTABLE_shift_integer(INTERP, io);
+ const INTVAL n = VTABLE_shift_integer(INTERP, info);
SET_ATTR_size(INTERP, SELF, 0);
SET_ATTR_int_array(INTERP, SELF, NULL);
@@ -592,7 +590,7 @@
GET_ATTR_int_array(INTERP, SELF, int_array);
for (i = 0; i < n; ++i)
- int_array[i] = VTABLE_shift_integer(INTERP, io);
+ int_array[i] = VTABLE_shift_integer(INTERP, info);
}
}
else
Modified: branches/pmc_freeze_cleanup/src/pmc/fixedpmcarray.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/fixedpmcarray.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/fixedpmcarray.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -721,16 +721,14 @@
}
VTABLE void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
- VTABLE_push_integer(INTERP, io, VTABLE_elements(INTERP, SELF));
+ VTABLE_push_integer(INTERP, info, VTABLE_elements(INTERP, SELF));
}
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
if (info->extra_flags == EXTRA_IS_NULL)
- SELF.set_integer_native(VTABLE_shift_integer(INTERP, io));
+ SELF.set_integer_native(VTABLE_shift_integer(INTERP, info));
}
/*
Modified: branches/pmc_freeze_cleanup/src/pmc/fixedstringarray.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/fixedstringarray.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/fixedstringarray.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -567,16 +567,15 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
STRING **str_array;
UINTVAL size, i;
GET_ATTR_size(INTERP, SELF, size);
GET_ATTR_str_array(INTERP, SELF, str_array);
- VTABLE_push_integer(INTERP, io, size);
+ VTABLE_push_integer(INTERP, info, size);
for (i = 0; i < size; ++i)
- VTABLE_push_string(INTERP, io, str_array[i]);
+ VTABLE_push_string(INTERP, info, str_array[i]);
}
/*
@@ -589,7 +588,6 @@
*/
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
if (info->extra_flags == EXTRA_IS_NULL) {
@@ -598,12 +596,12 @@
SELF.init();
- size = VTABLE_shift_integer(INTERP, io);
+ size = VTABLE_shift_integer(INTERP, info);
SELF.set_integer_native((INTVAL)size);
GET_ATTR_str_array(INTERP, SELF, str_array);
for (i = 0; i < size; ++i)
- str_array[i] = VTABLE_shift_string(INTERP, io);
+ str_array[i] = VTABLE_shift_string(INTERP, info);
}
}
}
Modified: branches/pmc_freeze_cleanup/src/pmc/float.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/float.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/float.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -352,9 +352,8 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
- VTABLE_push_float(INTERP, io, SELF.get_number());
+ VTABLE_push_float(INTERP, info, SELF.get_number());
}
/*
@@ -367,10 +366,9 @@
*/
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
if (info->extra_flags == EXTRA_IS_NULL)
- SET_ATTR_fv(INTERP, SELF, VTABLE_shift_float(INTERP, io));
+ SET_ATTR_fv(INTERP, SELF, VTABLE_shift_float(INTERP, info));
}
/*
Modified: branches/pmc_freeze_cleanup/src/pmc/hash.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/hash.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/hash.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -1102,13 +1102,12 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
Hash * const hash = (Hash *)SELF.get_pointer();;
SUPER(info);
- VTABLE_push_integer(INTERP, io, VTABLE_elements(INTERP, SELF));
- VTABLE_push_integer(INTERP, io, (INTVAL)hash->key_type);
- VTABLE_push_integer(INTERP, io, hash->entry_type);
+ VTABLE_push_integer(INTERP, info, VTABLE_elements(INTERP, SELF));
+ VTABLE_push_integer(INTERP, info, (INTVAL)hash->key_type);
+ VTABLE_push_integer(INTERP, info, hash->entry_type);
}
/*
@@ -1122,13 +1121,11 @@
*/
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
-
SUPER(info);
if (info->extra_flags == EXTRA_IS_NULL) {
- const INTVAL elems = VTABLE_shift_integer(INTERP, io);
- const INTVAL k_type = VTABLE_shift_integer(INTERP, io);
- const INTVAL v_type = VTABLE_shift_integer(INTERP, io);
+ const INTVAL elems = VTABLE_shift_integer(INTERP, info);
+ const INTVAL k_type = VTABLE_shift_integer(INTERP, info);
+ const INTVAL v_type = VTABLE_shift_integer(INTERP, info);
Hash *hash;
if (k_type == Hash_key_type_int && v_type == enum_hash_int) {
Modified: branches/pmc_freeze_cleanup/src/pmc/integer.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/integer.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/integer.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -1312,9 +1312,8 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
- VTABLE_push_integer(INTERP, io, SELF.get_integer());
+ VTABLE_push_integer(INTERP, info, SELF.get_integer());
}
@@ -1328,10 +1327,9 @@
*/
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
if (info->extra_flags == EXTRA_IS_NULL)
- SELF.set_integer_native(VTABLE_shift_integer(INTERP, io));
+ SELF.set_integer_native(VTABLE_shift_integer(INTERP, info));
}
}
Modified: branches/pmc_freeze_cleanup/src/pmc/key.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/key.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/key.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -319,28 +319,26 @@
}
void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
-
/* write flags */
const INTVAL flags = (PObj_get_FLAGS(SELF) & KEY_type_FLAGS);
/* write the contents of a register - else thaw can't restore
* the register state */
- VTABLE_push_integer(INTERP, io, flags & ~KEY_register_FLAG);
+ VTABLE_push_integer(INTERP, info, flags & ~KEY_register_FLAG);
/* and contents of this key component */
switch (flags) {
case KEY_integer_FLAG:
case KEY_integer_FLAG | KEY_register_FLAG:
- VTABLE_push_integer(INTERP, io, key_integer(INTERP, SELF));
+ VTABLE_push_integer(INTERP, info, key_integer(INTERP, SELF));
break;
case KEY_number_FLAG:
case KEY_number_FLAG | KEY_register_FLAG:
- VTABLE_push_float(INTERP, io, key_number(INTERP, SELF));
+ VTABLE_push_float(INTERP, info, key_number(INTERP, SELF));
break;
case KEY_string_FLAG:
case KEY_string_FLAG | KEY_register_FLAG:
- VTABLE_push_string(INTERP, io, key_string(INTERP, SELF));
+ VTABLE_push_string(INTERP, info, key_string(INTERP, SELF));
break;
default:
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_KEY_NOT_FOUND,
@@ -350,8 +348,7 @@
}
void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
- const INTVAL flags = VTABLE_shift_integer(INTERP, io) & KEY_type_FLAGS;
+ const INTVAL flags = VTABLE_shift_integer(INTERP, info) & KEY_type_FLAGS;
PObj_get_FLAGS(SELF) |= flags;
PObj_custom_mark_SET(SELF);
@@ -362,13 +359,13 @@
/* get contents */
switch (flags) {
case KEY_integer_FLAG:
- SET_ATTR_int_key(INTERP, SELF, VTABLE_shift_integer(INTERP, io));
+ SET_ATTR_int_key(INTERP, SELF, VTABLE_shift_integer(INTERP, info));
break;
case KEY_number_FLAG:
- VTABLE_set_number_native(INTERP, SELF, VTABLE_shift_float(INTERP, io));
+ VTABLE_set_number_native(INTERP, SELF, VTABLE_shift_float(INTERP, info));
break;
case KEY_string_FLAG:
- VTABLE_set_string_native(INTERP, SELF, VTABLE_shift_string(INTERP, io));
+ VTABLE_set_string_native(INTERP, SELF, VTABLE_shift_string(INTERP, info));
break;
default:
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_KEY_NOT_FOUND,
Modified: branches/pmc_freeze_cleanup/src/pmc/lexinfo.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/lexinfo.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/lexinfo.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -140,12 +140,10 @@
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
-
if (info->extra_flags == EXTRA_IS_NULL) {
- const INTVAL elems = VTABLE_shift_integer(INTERP, io);
- const INTVAL k_type = VTABLE_shift_integer(INTERP, io);
- const INTVAL v_type = VTABLE_shift_integer(INTERP, io);
+ const INTVAL elems = VTABLE_shift_integer(INTERP, info);
+ const INTVAL k_type = VTABLE_shift_integer(INTERP, info);
+ const INTVAL v_type = VTABLE_shift_integer(INTERP, info);
Hash *hash;
UNUSED(k_type);
Modified: branches/pmc_freeze_cleanup/src/pmc/orderedhash.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/orderedhash.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/orderedhash.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -637,7 +637,6 @@
case VISIT_FREEZE_AT_DESTRUCT:
{
Hash * const hash = (Hash *)SELF.get_pointer();
- IMAGE_IO * const io = info->image_io;
const UINTVAL entries = hash->entries;
UINTVAL i;
@@ -647,7 +646,7 @@
if (b) {
STRING * const key = (STRING *)b->key;
if (key) {
- VTABLE_push_string(interp, io, key);
+ VTABLE_push_string(interp, info, key);
(info->visit_pmc_now)(interp, (PMC *)b->value, info);
}
}
Modified: branches/pmc_freeze_cleanup/src/pmc/resizablebooleanarray.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/resizablebooleanarray.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/resizablebooleanarray.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -422,19 +422,18 @@
STRING *s;
UINTVAL tail_pos, rounded_size, head_pos;
unsigned char *bit_array;
- IMAGE_IO * const io = info->image_io;
GET_ATTR_size(INTERP, SELF, tail_pos);
GET_ATTR_resize_threshold(INTERP, SELF, head_pos);
GET_ATTR_bit_array(INTERP, SELF, bit_array);
rounded_size = ROUND_BYTES(tail_pos);
- VTABLE_push_integer(INTERP, io, head_pos);
- VTABLE_push_integer(INTERP, io, tail_pos);
+ VTABLE_push_integer(INTERP, info, head_pos);
+ VTABLE_push_integer(INTERP, info, tail_pos);
s = Parrot_str_new(INTERP, (char*)bit_array, rounded_size);
- VTABLE_push_string(INTERP, io, s);
+ VTABLE_push_string(INTERP, info, s);
}
/*
@@ -448,10 +447,9 @@
*/
VTABLE void thaw(visit_info *info) {
unsigned char *bit_array;
- IMAGE_IO * const io = info->image_io;
- const UINTVAL head_pos = VTABLE_shift_integer(INTERP, io);
- const UINTVAL tail_pos = VTABLE_shift_integer(INTERP, io);
- STRING * const s = VTABLE_shift_string(INTERP, io);
+ const UINTVAL head_pos = VTABLE_shift_integer(INTERP, info);
+ const UINTVAL tail_pos = VTABLE_shift_integer(INTERP, info);
+ STRING * const s = VTABLE_shift_string(INTERP, info);
bit_array = (unsigned char*)Parrot_str_to_cstring(INTERP, s);
SET_ATTR_size(INTERP, SELF, tail_pos);
Modified: branches/pmc_freeze_cleanup/src/pmc/resizableintegerarray.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/resizableintegerarray.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/resizableintegerarray.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -292,7 +292,6 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO *io = info->image_io;
INTVAL *int_array;
INTVAL i, n, rt;
@@ -300,20 +299,19 @@
n = SELF.get_integer();
GET_ATTR_resize_threshold(INTERP, SELF, rt);
- VTABLE_push_integer(INTERP, io, n);
- VTABLE_push_integer(INTERP, io, rt);
+ VTABLE_push_integer(INTERP, info, n);
+ VTABLE_push_integer(INTERP, info, rt);
GET_ATTR_int_array(INTERP, SELF, int_array);
for (i = 0; i < n; ++i)
- VTABLE_push_integer(INTERP, io, int_array[i]);
+ VTABLE_push_integer(INTERP, info, int_array[i]);
}
VTABLE void thaw(visit_info *info) {
if (info->extra_flags == EXTRA_IS_NULL) {
- IMAGE_IO * const io = info->image_io;
- const INTVAL n = VTABLE_shift_integer(INTERP, io);
- const INTVAL rt = VTABLE_shift_integer(INTERP, io);
+ const INTVAL n = VTABLE_shift_integer(INTERP, info);
+ const INTVAL rt = VTABLE_shift_integer(INTERP, info);
SET_ATTR_size(INTERP, SELF, 0);
SET_ATTR_resize_threshold(INTERP, SELF, rt);
@@ -327,7 +325,7 @@
GET_ATTR_int_array(INTERP, SELF, int_array);
for (i = 0; i < n; ++i)
- int_array[i] = VTABLE_shift_integer(INTERP, io);
+ int_array[i] = VTABLE_shift_integer(INTERP, info);
}
}
else
Modified: branches/pmc_freeze_cleanup/src/pmc/scheduler.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/scheduler.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/scheduler.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -314,14 +314,13 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO *io = info->image_io;
Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF);
/* 1) freeze scheduler id */
- VTABLE_push_integer(INTERP, io, core_struct->id);
+ VTABLE_push_integer(INTERP, info, core_struct->id);
/* 2) freeze maximum task id */
- VTABLE_push_integer(INTERP, io, core_struct->max_tid);
+ VTABLE_push_integer(INTERP, info, core_struct->max_tid);
}
@@ -336,13 +335,11 @@
*/
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
-
/* 1. thaw scheduler id */
- const INTVAL id = VTABLE_shift_integer(INTERP, io);
+ const INTVAL id = VTABLE_shift_integer(INTERP, info);
/* 2. thaw maximum task id */
- const INTVAL max_tid = VTABLE_shift_integer(INTERP, io);
+ const INTVAL max_tid = VTABLE_shift_integer(INTERP, info);
/* Allocate the scheduler's core data struct and set custom flags. */
SELF.init();
Modified: branches/pmc_freeze_cleanup/src/pmc/schedulermessage.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/schedulermessage.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/schedulermessage.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -238,15 +238,14 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO *io = info->image_io;
Parrot_SchedulerMessage_attributes * const core_struct =
PARROT_SCHEDULERMESSAGE(SELF);
/* 1) freeze message id */
- VTABLE_push_integer(INTERP, io, core_struct->id);
+ VTABLE_push_integer(INTERP, info, core_struct->id);
/* 2) freeze message type */
- VTABLE_push_string(INTERP, io, core_struct->type);
+ VTABLE_push_string(INTERP, info, core_struct->type);
}
/*
@@ -260,13 +259,11 @@
*/
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
-
/* 1. thaw message id */
- const INTVAL id = VTABLE_shift_integer(INTERP, io);
+ const INTVAL id = VTABLE_shift_integer(INTERP, info);
/* 2. thaw message type */
- STRING * const type = VTABLE_shift_string(INTERP, io);
+ STRING * const type = VTABLE_shift_string(INTERP, info);
/* Allocate the message's core data struct and set custom flags. */
SELF.init();
Modified: branches/pmc_freeze_cleanup/src/pmc/string.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/string.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/string.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -782,9 +782,8 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
- VTABLE_push_string(INTERP, io, VTABLE_get_string(INTERP, SELF));
+ VTABLE_push_string(INTERP, info, VTABLE_get_string(INTERP, SELF));
}
/*
@@ -797,10 +796,9 @@
*/
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
if (info->extra_flags == EXTRA_IS_NULL)
- SET_ATTR_str_val(INTERP, SELF, VTABLE_shift_string(INTERP, io));
+ SET_ATTR_str_val(INTERP, SELF, VTABLE_shift_string(INTERP, info));
}
/*
Modified: branches/pmc_freeze_cleanup/src/pmc/sub.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/sub.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/sub.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -653,7 +653,6 @@
}
VTABLE void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
Parrot_Sub_attributes *sub;
STRING *hll_name;
int i;
@@ -678,35 +677,35 @@
* - subid
*/
- VTABLE_push_integer(INTERP, io, (INTVAL) sub->start_offs);
- VTABLE_push_integer(INTERP, io, (INTVAL) sub->end_offs);
- VTABLE_push_integer(INTERP, io,
+ VTABLE_push_integer(INTERP, info, (INTVAL) sub->start_offs);
+ VTABLE_push_integer(INTERP, info, (INTVAL) sub->end_offs);
+ VTABLE_push_integer(INTERP, info,
(INTVAL)(PObj_get_FLAGS(pmc) & SUB_FLAG_PF_MASK));
- VTABLE_push_string(INTERP, io, sub->name);
+ VTABLE_push_string(INTERP, info, sub->name);
if (!sub->method_name)
sub->method_name = CONST_STRING(INTERP, "");
- VTABLE_push_string(INTERP, io, sub->method_name);
+ VTABLE_push_string(INTERP, info, sub->method_name);
if (!sub->ns_entry_name)
sub->ns_entry_name = CONST_STRING(INTERP, "");
- VTABLE_push_string(INTERP, io, sub->ns_entry_name);
+ VTABLE_push_string(INTERP, info, sub->ns_entry_name);
hll_name = Parrot_get_HLL_name(INTERP, sub->HLL_id);
if (!hll_name)
hll_name = CONST_STRING(INTERP, "");
- VTABLE_push_string(INTERP, io, hll_name);
+ VTABLE_push_string(INTERP, info, hll_name);
- VTABLE_push_integer(INTERP, io, (INTVAL)sub->comp_flags);
- VTABLE_push_integer(INTERP, io, sub->vtable_index);
+ VTABLE_push_integer(INTERP, info, (INTVAL)sub->comp_flags);
+ VTABLE_push_integer(INTERP, info, sub->vtable_index);
for (i = 0; i < 4; ++i)
- VTABLE_push_integer(INTERP, io, sub->n_regs_used[i]);
+ VTABLE_push_integer(INTERP, info, sub->n_regs_used[i]);
if (!sub->subid)
sub->subid = CONST_STRING(INTERP, "");
- VTABLE_push_string(INTERP, io, sub->subid);
+ VTABLE_push_string(INTERP, info, sub->subid);
}
/*
@@ -720,7 +719,6 @@
*/
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
SUPER(info);
if (info->extra_flags == EXTRA_IS_NULL) {
@@ -731,24 +729,24 @@
PMC_get_sub(INTERP, SELF, sub);
/* we get relative offsets */
- sub->start_offs = (size_t) VTABLE_shift_integer(INTERP, io);
- sub->end_offs = (size_t) VTABLE_shift_integer(INTERP, io);
- flags = VTABLE_shift_integer(INTERP, io);
+ sub->start_offs = (size_t) VTABLE_shift_integer(INTERP, info);
+ sub->end_offs = (size_t) VTABLE_shift_integer(INTERP, info);
+ flags = VTABLE_shift_integer(INTERP, info);
PObj_get_FLAGS(SELF) |= flags & SUB_FLAG_PF_MASK;
- sub->name = VTABLE_shift_string(INTERP, io);
- sub->method_name = VTABLE_shift_string(INTERP, io);
- sub->ns_entry_name = VTABLE_shift_string(INTERP, io);
+ sub->name = VTABLE_shift_string(INTERP, info);
+ sub->method_name = VTABLE_shift_string(INTERP, info);
+ sub->ns_entry_name = VTABLE_shift_string(INTERP, info);
sub->HLL_id = Parrot_get_HLL_id(INTERP,
- VTABLE_shift_string(INTERP, io));
- sub->comp_flags = VTABLE_shift_integer(INTERP, io);
- sub->vtable_index = VTABLE_shift_integer(INTERP, io);
+ VTABLE_shift_string(INTERP, info));
+ sub->comp_flags = VTABLE_shift_integer(INTERP, info);
+ sub->vtable_index = VTABLE_shift_integer(INTERP, info);
for (i = 0; i < 4; ++i)
- sub->n_regs_used[i] = VTABLE_shift_integer(INTERP, io);
+ sub->n_regs_used[i] = VTABLE_shift_integer(INTERP, info);
- sub->subid = VTABLE_shift_string(INTERP, io);
+ sub->subid = VTABLE_shift_string(INTERP, info);
}
}
Modified: branches/pmc_freeze_cleanup/src/pmc/task.pmc
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc/task.pmc Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc/task.pmc Mon Dec 14 05:40:03 2009 (r43031)
@@ -416,26 +416,25 @@
*/
VTABLE void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
const Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF);
/* 1) freeze task id */
- VTABLE_push_integer(INTERP, io, core_struct->id);
+ VTABLE_push_integer(INTERP, info, core_struct->id);
/* 2) freeze task birthtime */
- VTABLE_push_float(INTERP, io, core_struct->birthtime);
+ VTABLE_push_float(INTERP, info, core_struct->birthtime);
/* 3) freeze task priority */
- VTABLE_push_integer(INTERP, io, core_struct->priority);
+ VTABLE_push_integer(INTERP, info, core_struct->priority);
/* 4) freeze task type */
- VTABLE_push_string(INTERP, io, core_struct->type);
+ VTABLE_push_string(INTERP, info, core_struct->type);
/* 5) freeze task subtype */
- VTABLE_push_string(INTERP, io, core_struct->subtype);
+ VTABLE_push_string(INTERP, info, core_struct->subtype);
/* 6) freeze task status */
- VTABLE_push_string(INTERP, io, core_struct->status);
+ VTABLE_push_string(INTERP, info, core_struct->status);
}
/*
@@ -449,25 +448,23 @@
*/
VTABLE void thaw(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
-
/* 1. thaw task id */
- const INTVAL id = VTABLE_shift_integer(INTERP, io);
+ const INTVAL id = VTABLE_shift_integer(INTERP, info);
/* 2. thaw task birthtime */
- const FLOATVAL birthtime = VTABLE_shift_float(INTERP, io);
+ const FLOATVAL birthtime = VTABLE_shift_float(INTERP, info);
/* 3. thaw task priority */
- const INTVAL priority = VTABLE_shift_integer(INTERP, io);
+ const INTVAL priority = VTABLE_shift_integer(INTERP, info);
/* 4. thaw task type */
- STRING * const type = VTABLE_shift_string(INTERP, io);
+ STRING * const type = VTABLE_shift_string(INTERP, info);
/* 5. thaw task subtype */
- STRING * const subtype = VTABLE_shift_string(INTERP, io);
+ STRING * const subtype = VTABLE_shift_string(INTERP, info);
/* 6. thaw task status */
- STRING * const status = VTABLE_shift_string(INTERP, io);
+ STRING * const status = VTABLE_shift_string(INTERP, info);
/* Allocate the task's core data struct and set custom flags. */
SELF.init();
Modified: branches/pmc_freeze_cleanup/src/pmc_freeze.c
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc_freeze.c Mon Dec 14 02:30:25 2009 (r43030)
+++ branches/pmc_freeze_cleanup/src/pmc_freeze.c Mon Dec 14 05:40:03 2009 (r43031)
@@ -18,7 +18,7 @@
Container PMCs call a "todo-callback" for all contained PMCs. The
individual action vtable (freeze/thaw) is then called for all todo-PMCs.
-In the current implementation C<IMAGE_IO> is a stand-in for some kind of
+In the current implementation C<visit_info> is a stand-in for some kind of
serializer PMC which will eventually be written. It associates a Parrot
C<STRING> with a vtable.
@@ -76,19 +76,19 @@
__attribute__nonnull__(2);
static void push_opcode_integer(PARROT_INTERP,
- ARGIN(IMAGE_IO *io),
+ ARGIN(visit_info *io),
INTVAL v)
__attribute__nonnull__(1)
__attribute__nonnull__(2);
static void push_opcode_number(PARROT_INTERP,
- ARGIN(IMAGE_IO *io),
+ ARGIN(visit_info *io),
FLOATVAL v)
__attribute__nonnull__(1)
__attribute__nonnull__(2);
static void push_opcode_string(PARROT_INTERP,
- ARGIN(IMAGE_IO *io),
+ ARGIN(visit_info *io),
ARGIN(STRING *v))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
@@ -102,15 +102,15 @@
__attribute__nonnull__(1)
__attribute__nonnull__(2);
-static INTVAL shift_opcode_integer(SHIM_INTERP, ARGIN(IMAGE_IO *io))
+static INTVAL shift_opcode_integer(SHIM_INTERP, ARGIN(visit_info *io))
__attribute__nonnull__(2);
-static FLOATVAL shift_opcode_number(SHIM_INTERP, ARGIN(IMAGE_IO *io))
+static FLOATVAL shift_opcode_number(SHIM_INTERP, ARGIN(visit_info *io))
__attribute__nonnull__(2);
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-static STRING* shift_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io))
+static STRING* shift_opcode_string(PARROT_INTERP, ARGIN(visit_info *io))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -298,10 +298,25 @@
}
+/*
+
+=item C<static INTVAL get_visit_integer(PARROT_INTERP, visit_info *io)>
+
+XXX TODO!!!
+
+=cut
+
+*/
+
+static INTVAL
+get_visit_integer(PARROT_INTERP, visit_info *io) {
+ return io->what;
+}
/*
-=item C<static void push_opcode_integer(PARROT_INTERP, IMAGE_IO *io, INTVAL v)>
+=item C<static void push_opcode_integer(PARROT_INTERP, visit_info *io, INTVAL
+v)>
Pushes the integer C<v> onto the end of the C<*io> "stream".
@@ -312,7 +327,7 @@
*/
static void
-push_opcode_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), INTVAL v)
+push_opcode_integer(PARROT_INTERP, ARGIN(visit_info *io), INTVAL v)
{
ASSERT_ARGS(push_opcode_integer)
UINTVAL size = sizeof (opcode_t);
@@ -326,7 +341,8 @@
/*
-=item C<static void push_opcode_number(PARROT_INTERP, IMAGE_IO *io, FLOATVAL v)>
+=item C<static void push_opcode_number(PARROT_INTERP, visit_info *io, FLOATVAL
+v)>
Pushes the number C<v> onto the end of the C<*io> "stream".
@@ -335,7 +351,7 @@
*/
static void
-push_opcode_number(PARROT_INTERP, ARGIN(IMAGE_IO *io), FLOATVAL v)
+push_opcode_number(PARROT_INTERP, ARGIN(visit_info *io), FLOATVAL v)
{
ASSERT_ARGS(push_opcode_number)
UINTVAL len = PF_size_number() * sizeof (opcode_t);
@@ -352,7 +368,8 @@
/*
-=item C<static void push_opcode_string(PARROT_INTERP, IMAGE_IO *io, STRING *v)>
+=item C<static void push_opcode_string(PARROT_INTERP, visit_info *io, STRING
+*v)>
Pushes the string C<*v> onto the end of the C<*io> "stream".
@@ -361,7 +378,7 @@
*/
static void
-push_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io), ARGIN(STRING *v))
+push_opcode_string(PARROT_INTERP, ARGIN(visit_info *io), ARGIN(STRING *v))
{
ASSERT_ARGS(push_opcode_string)
@@ -379,7 +396,7 @@
/*
-=item C<static INTVAL shift_opcode_integer(PARROT_INTERP, IMAGE_IO *io)>
+=item C<static INTVAL shift_opcode_integer(PARROT_INTERP, visit_info *io)>
Removes and returns an integer from the start of the C<*io> "stream".
@@ -388,7 +405,7 @@
*/
static INTVAL
-shift_opcode_integer(SHIM_INTERP, ARGIN(IMAGE_IO *io))
+shift_opcode_integer(SHIM_INTERP, ARGIN(visit_info *io))
{
ASSERT_ARGS(shift_opcode_integer)
const char * const start = (char *)io->image->strstart;
@@ -407,7 +424,7 @@
/*
-=item C<static FLOATVAL shift_opcode_number(PARROT_INTERP, IMAGE_IO *io)>
+=item C<static FLOATVAL shift_opcode_number(PARROT_INTERP, visit_info *io)>
Removes and returns an number from the start of the C<*io> "stream".
@@ -416,7 +433,7 @@
*/
static FLOATVAL
-shift_opcode_number(SHIM_INTERP, ARGIN(IMAGE_IO *io))
+shift_opcode_number(SHIM_INTERP, ARGIN(visit_info *io))
{
ASSERT_ARGS(shift_opcode_number)
@@ -436,7 +453,7 @@
/*
-=item C<static STRING* shift_opcode_string(PARROT_INTERP, IMAGE_IO *io)>
+=item C<static STRING* shift_opcode_string(PARROT_INTERP, visit_info *io)>
Removes and returns a string from the start of the C<*io> "stream".
@@ -447,7 +464,7 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
static STRING*
-shift_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io))
+shift_opcode_string(PARROT_INTERP, ARGIN(visit_info *io))
{
ASSERT_ARGS(shift_opcode_string)
@@ -485,6 +502,7 @@
*/
static image_funcs opcode_funcs = {
+ get_visit_integer,
push_opcode_integer,
push_opcode_string,
push_opcode_number,
@@ -516,12 +534,9 @@
(PACKFILE_HEADER_BYTES % 16 ?
16 - PACKFILE_HEADER_BYTES % 16 : 0);
- info->image_io = mem_allocate_typed(IMAGE_IO);
- info->image_io->image = s = info->image;
-
- info->image_io->vtable = &opcode_funcs;
+ info->vtable = &opcode_funcs;
- pf = info->image_io->pf = PackFile_new(interp, 0);
+ pf = info->pf = PackFile_new(interp, 0);
if (info->what == VISIT_FREEZE_NORMAL
|| info->what == VISIT_FREEZE_AT_DESTRUCT) {
@@ -605,12 +620,11 @@
int seen, UINTVAL id)
{
ASSERT_ARGS(freeze_pmc)
- IMAGE_IO * const io = info->image_io;
INTVAL type;
if (PMC_IS_NULL(pmc)) {
/* NULL + seen bit */
- VTABLE_push_integer(interp, io, PackID_new(NULL, enum_PackID_seen));
+ VTABLE_push_integer(interp, info, PackID_new(NULL, enum_PackID_seen));
return;
}
@@ -622,8 +636,8 @@
if (seen) {
if (info->extra_flags) {
PackID_set_FLAGS(id, enum_PackID_extra_info);
- VTABLE_push_integer(interp, io, id);
- VTABLE_push_integer(interp, io, info->extra_flags);
+ VTABLE_push_integer(interp, info, id);
+ VTABLE_push_integer(interp, info, info->extra_flags);
return;
}
@@ -632,11 +646,11 @@
else if (type == info->last_type)
PackID_set_FLAGS(id, enum_PackID_prev_type);
- VTABLE_push_integer(interp, io, id);
+ VTABLE_push_integer(interp, info, id);
if (PackID_get_FLAGS(id) == enum_PackID_normal) {
/* write type */
- VTABLE_push_integer(interp, io, type);
+ VTABLE_push_integer(interp, info, type);
info->last_type = type;
}
}
@@ -671,8 +685,7 @@
ARGOUT(UINTVAL *id), ARGOUT(INTVAL *type))
{
ASSERT_ARGS(thaw_pmc)
- IMAGE_IO * const io = info->image_io;
- UINTVAL n = VTABLE_shift_integer(interp, io);
+ UINTVAL n = VTABLE_shift_integer(interp, info);
int seen = 0;
info->extra_flags = EXTRA_IS_NULL;
@@ -680,7 +693,7 @@
switch (PackID_get_FLAGS(n)) {
case enum_PackID_extra_info:
/* pmc has extra data */
- info->extra_flags = VTABLE_shift_integer(interp, io);
+ info->extra_flags = VTABLE_shift_integer(interp, info);
break;
case enum_PackID_seen:
seen = 1;
@@ -692,7 +705,7 @@
default:
/* type follows */
{
- *type = VTABLE_shift_integer(interp, io);
+ *type = VTABLE_shift_integer(interp, info);
info->last_type = *type;
if (*type <= 0)
@@ -1142,9 +1155,7 @@
Parrot_unblock_GC_sweep(interp);
}
- PackFile_destroy(interp, info.image_io->pf);
- mem_sys_free(info.image_io);
- info.image_io = NULL;
+ PackFile_destroy(interp, info.pf);
return info.thaw_result;
}
@@ -1185,8 +1196,7 @@
visit_loop_todo_list(interp, pmc, &info);
- PackFile_destroy(interp, info.image_io->pf);
- mem_sys_free(info.image_io);
+ PackFile_destroy(interp, info.pf);
return info.image;
}
More information about the parrot-commits
mailing list