X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=bytecode.pl;h=0d0468846eae25a6cb2472329c77fe799a9c882f;hb=2e34cc90b22e8d09149d579a4d5db71a1836c9ca;hp=8d77620be7df1a502c3f86b98cdda0af4d75a3fc;hpb=742c86ac159dca57a113457cedc5fead0792eade;p=p5sagit%2Fp5-mst-13.2.git diff --git a/bytecode.pl b/bytecode.pl index 8d77620..0d04688 100644 --- a/bytecode.pl +++ b/bytecode.pl @@ -44,6 +44,9 @@ unlink "ext/ByteLoader/byterun.c", "ext/ByteLoader/byterun.h", "ext/B/B/Asmdata. open(ASMDATA_PM, ">ext/B/B/Asmdata.pm") or die "ext/B/B/Asmdata.pm: $!"; print ASMDATA_PM $perl_header, <<'EOT'; package B::Asmdata; + +our $VERSION = '1.00'; + use Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(%insn_data @insn_name @optype @specialsv_name); @@ -71,13 +74,6 @@ print BYTERUN_C $c_header, <<'EOT'; #define NO_XSLOCKS #include "XSUB.h" -#ifdef PERL_OBJECT -#undef CALL_FPTR -#define CALL_FPTR(fptr) (pPerl->*fptr) -#undef PL_ppaddr -#define PL_ppaddr (*get_ppaddr()) -#endif - #include "byterun.h" #include "bytecode.h" @@ -93,7 +89,7 @@ print BYTERUN_C <<'EOT'; }; void * -bset_obj_store(pTHXo_ struct byteloader_state *bstate, void *obj, I32 ix) +bset_obj_store(pTHX_ struct byteloader_state *bstate, void *obj, I32 ix) { if (ix > bstate->bs_obj_list_fill) { Renew(bstate->bs_obj_list, ix + 32, void*); @@ -104,7 +100,7 @@ bset_obj_store(pTHXo_ struct byteloader_state *bstate, void *obj, I32 ix) } void -byterun(pTHXo_ register struct byteloader_state *bstate) +byterun(pTHX_ register struct byteloader_state *bstate) { register int insn; U32 ix; @@ -116,7 +112,7 @@ byterun(pTHXo_ register struct byteloader_state *bstate) EOT -for (my $i = 0; $i < @specialsv; $i++) { +for my $i ( 0 .. $#specialsv ) { print BYTERUN_C " specialsv_list[$i] = $specialsv[$i];\n"; } @@ -209,14 +205,14 @@ struct byteloader_state { int bl_getc(struct byteloader_fdata *); int bl_read(struct byteloader_fdata *, char *, size_t, size_t); -extern void byterun(pTHXo_ struct byteloader_state *); +extern void byterun(pTHX_ struct byteloader_state *); enum { EOT my $add_enum_value = 0; my $max_insn; -for ($i = 0; $i < @insn_name; $i++) { +for $i ( 0 .. $#insn_name ) { $insn = uc($insn_name[$i]); if (defined($insn)) { $max_insn = $i; @@ -316,11 +312,11 @@ xlv_type LvTYPE(bstate->bs_sv) char xbm_useful BmUSEFUL(bstate->bs_sv) I32 xbm_previous BmPREVIOUS(bstate->bs_sv) U16 xbm_rare BmRARE(bstate->bs_sv) U8 -xfm_lines FmLINES(bstate->bs_sv) I32 -xio_lines IoLINES(bstate->bs_sv) long -xio_page IoPAGE(bstate->bs_sv) long -xio_page_len IoPAGE_LEN(bstate->bs_sv) long -xio_lines_left IoLINES_LEFT(bstate->bs_sv) long +xfm_lines FmLINES(bstate->bs_sv) IV +xio_lines IoLINES(bstate->bs_sv) IV +xio_page IoPAGE(bstate->bs_sv) IV +xio_page_len IoPAGE_LEN(bstate->bs_sv) IV +xio_lines_left IoLINES_LEFT(bstate->bs_sv) IV xio_top_name IoTOP_NAME(bstate->bs_sv) pvcontents xio_top_gv *(SV**)&IoTOP_GV(bstate->bs_sv) svindex xio_fmt_name IoFMT_NAME(bstate->bs_sv) pvcontents @@ -379,7 +375,6 @@ op_private PL_op->op_private U8 op_first cUNOP->op_first opindex op_last cBINOP->op_last opindex op_other cLOGOP->op_other opindex -op_children cLISTOP->op_children U32 op_pmreplroot cPMOP->op_pmreplroot opindex op_pmreplrootgv *(SV**)&cPMOP->op_pmreplroot svindex op_pmreplstart cPMOP->op_pmreplstart opindex