# Nullsv *must* come first in the following so that the condition
# ($$sv == 0) can continue to be used to test (sv == Nullsv).
-my @specialsv = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no pWARN_ALL pWARN_NONE);
+my @specialsv = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no);
my (%alias_from, $from, $tos);
while (($from, $tos) = each %alias_to) {
#include "bytecode.h"
-static const int optype_size[] = {
+static int optype_size[] = {
EOT
my $i = 0;
for ($i = 0; $i < @optype - 1; $i++) {
print BYTERUN_C <<'EOT';
};
+static SV *specialsv_list[4];
+
static int bytecode_iv_overflows = 0;
-static void **bytecode_obj_list = Null(void**);
+static SV *bytecode_sv;
+static XPV bytecode_pv;
+static void **bytecode_obj_list;
static I32 bytecode_obj_list_fill = -1;
void *
{
if (ix > bytecode_obj_list_fill) {
if (bytecode_obj_list_fill == -1)
- New(666, bytecode_obj_list, ix + 32, void*);
+ New(666, bytecode_obj_list, ix + 1, void*);
else
- Renew(bytecode_obj_list, ix + 32, void*);
+ Renew(bytecode_obj_list, ix + 1, void*);
bytecode_obj_list_fill = ix;
}
bytecode_obj_list[ix] = obj;
}
void
-byterun(pTHXo)
+byterun(pTHXo_ struct bytestream bs)
{
dTHR;
int insn;
- SV *bytecode_sv;
- XPV bytecode_pv;
- SV *specialsv_list[6];
- ENTER;
- SAVEVPTR(bytecode_obj_list);
- SAVEI32(bytecode_obj_list_fill);
- bytecode_obj_list = Null(void**);
- bytecode_obj_list_fill = -1;
-
- BYTECODE_HEADER_CHECK; /* croak if incorrect platform */
+
EOT
for (my $i = 0; $i < @specialsv; $i++) {
#
open(BYTERUN_H, ">ext/ByteLoader/byterun.h") or die "ext/ByteLoader/byterun.h: $!";
print BYTERUN_H $c_header, <<'EOT';
-struct bytestream { /* XXX: not currently used - too slow */
+struct bytestream {
void *data;
int (*pfgetc)(void *);
int (*pfread)(char *, size_t, size_t, void *);
printf BYTERUN_H " OPt_%s\t\t/* %d */\n};\n\n", $optype[$i], $i;
print BYTERUN_H <<'EOT';
-extern void byterun(pTHXo);
+extern void byterun(pTHXo_ struct bytestream bs);
+
+#define INIT_SPECIALSV_LIST STMT_START { \
+EOT
+for ($i = 0; $i < @specialsv; $i++) {
+ print BYTERUN_H "\tPL_specialsv_list[$i] = $specialsv[$i]; \\\n";
+}
+print BYTERUN_H <<'EOT';
+ } STMT_END
EOT
#
main_start PL_main_start opindex
main_root PL_main_root opindex
curpad PL_curpad svindex x
-push_begin PL_beginav svindex x
-push_init PL_initav svindex x
-push_end PL_endav svindex x