# 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);
+my @specialsv = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no pWARN_ALL pWARN_NONE);
my (%alias_from, $from, $tos);
while (($from, $tos) = each %alias_to) {
use Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(%insn_data @insn_name @optype @specialsv_name);
-use vars qw(%insn_data @insn_name @optype @specialsv_name);
+our(%insn_data, @insn_name, @optype, @specialsv_name);
EOT
print ASMDATA_PM <<"EOT";
#include "bytecode.h"
-static int optype_size[] = {
+static const 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 SV *bytecode_sv;
-static XPV bytecode_pv;
-static void **bytecode_obj_list;
+static void **bytecode_obj_list = Null(void**);
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 + 1, void*);
+ New(666, bytecode_obj_list, ix + 32, void*);
else
- Renew(bytecode_obj_list, ix + 1, void*);
+ Renew(bytecode_obj_list, ix + 32, void*);
bytecode_obj_list_fill = ix;
}
bytecode_obj_list[ix] = obj;
}
void
-byterun(pTHXo_ struct bytestream bs)
+byterun(pTHXo)
{
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 {
+struct bytestream { /* XXX: not currently used - too slow */
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_ 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
+extern void byterun(pTHXo);
EOT
#
xcv_depth CvDEPTH(bytecode_sv) long
xcv_padlist *(SV**)&CvPADLIST(bytecode_sv) svindex
xcv_outside *(SV**)&CvOUTSIDE(bytecode_sv) svindex
-xcv_flags CvFLAGS(bytecode_sv) U8
+xcv_flags CvFLAGS(bytecode_sv) U16
av_extend bytecode_sv SSize_t x
av_push bytecode_sv svindex x
xav_fill AvFILLp(bytecode_sv) SSize_t
op_nextop cLOOP->op_nextop opindex
op_lastop cLOOP->op_lastop opindex
cop_label cCOP->cop_label pvcontents
-cop_stash *(SV**)&cCOP->cop_stash svindex
+cop_stashpv cCOP pvcontents x
cop_file cCOP pvcontents x
cop_seq cCOP->cop_seq U32
cop_arybase cCOP->cop_arybase I32
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