This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
It's possible to write the dup of struct reg_substr_datum with a
[perl5.git] / bytecode.pl
index 359110d..95b5b12 100644 (file)
@@ -1,17 +1,21 @@
+BEGIN {
+  push @INC, './lib';
+  require 'regen_lib.pl';
+}
 use strict;
 my %alias_to = (
-    U32 => [qw(PADOFFSET STRLEN)],
-    I32 => [qw(SSize_t long)],
-    U16 => [qw(OPCODE line_t short)],
-    U8 => [qw(char)],
-    objindex => [qw(svindex opindex)]          
+    U32 => [qw(line_t)],
+    PADOFFSET => [qw(STRLEN SSize_t)],
+    U16 => [qw(OPCODE short)],
+    U8  => [qw(char)],
 );
 
-my @optype= qw(OP UNOP BINOP LOGOP CONDOP LISTOP PMOP SVOP GVOP PVOP LOOP COP);
+my @optype= qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP PADOP PVOP LOOP COP);
 
 # 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 &sv_undef &sv_yes &sv_no);
+my @specialsv = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no
+                  (SV*)pWARN_ALL (SV*)pWARN_NONE (SV*)pWARN_STD);
 
 my (%alias_from, $from, $tos);
 while (($from, $tos) = each %alias_to) {
@@ -19,8 +23,9 @@ while (($from, $tos) = each %alias_to) {
 }
 
 my $c_header = <<'EOT';
-/*
- *      Copyright (c) 1996 Malcolm Beattie
+/* -*- buffer-read-only: t -*-
+ *
+ *      Copyright (c) 1996-1999 Malcolm Beattie
  *
  *      You may distribute under the terms of either the GNU General Public
  *      License or the Artistic License, as specified in the README file.
@@ -34,26 +39,22 @@ EOT
 my $perl_header;
 ($perl_header = $c_header) =~ s{[/ ]?\*/?}{#}g;
 
-if (-f "byterun.c") {
-    rename("byterun.c", "byterun.c.old");
-}
-if (-f "byterun.h") {
-    rename("byterun.h", "byterun.h.old");
-}
-if (-f "Asmdata.pm") {
-    rename("Asmdata.pm", "Asmdata.pm.old");
-}
+safer_unlink "ext/B/B/Asmdata.pm";
 
 #
 # Start with boilerplate for Asmdata.pm
 #
-open(ASMDATA_PM, ">Asmdata.pm") or die "Asmdata.pm: $!";
+open(ASMDATA_PM, ">ext/B/B/Asmdata.pm") or die "ext/B/B/Asmdata.pm: $!";
+binmode ASMDATA_PM;
 print ASMDATA_PM $perl_header, <<'EOT';
 package B::Asmdata;
+
+our $VERSION = '1.01';
+
 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";
@@ -65,36 +66,15 @@ print ASMDATA_PM <<"EOT";
 # I get a hard-to-track-down stack underflow and segfault.
 EOT
 
-#
-# Boilerplate for byterun.c
-#
-open(BYTERUN_C, ">byterun.c") or die "byterun.c: $!";
-print BYTERUN_C $c_header, <<'EOT';
-
-#include "EXTERN.h"
-#include "perl.h"
-#include "bytecode.h"
-#include "byterun.h"
-
-#ifdef INDIRECT_BGET_MACROS
-void byterun(bs)
-struct bytestream bs;
-#else
-void byterun(fp)
-FILE *fp;
-#endif /* INDIRECT_BGET_MACROS */
-{
-    int insn;
-    while ((insn = FGETC()) != EOF) {
-       switch (insn) {
-EOT
-
+my $size = @specialsv;
 
 my (@insn_name, $insn_num, $insn, $lvalue, $argtype, $flags, $fundtype);
 
 while (<DATA>) {
+    if (/^\s*#/) {
+       next;
+    }
     chop;
-    s/#.*//;                   # remove comments
     next unless length;
     if (/^%number\s+(.*)/) {
        $insn_num = $1;
@@ -104,30 +84,14 @@ while (<DATA>) {
        next;
     }
     ($insn, $lvalue, $argtype, $flags) = split;
+    my $rvalcast = '';
+    if ($argtype =~ m:(.+)/(.+):) {
+       ($rvalcast, $argtype) = ("($1)", $2);
+    }
     $insn_name[$insn_num] = $insn;
     $fundtype = $alias_from{$argtype} || $argtype;
 
     #
-    # Add the case statement and code for the bytecode interpreter in byterun.c
-    #
-    printf BYTERUN_C "\t  case INSN_%s:\t\t/* %d */\n\t    {\n",
-       uc($insn), $insn_num;
-    my $optarg = $argtype eq "none" ? "" : ", arg";
-    if ($optarg) {
-       printf BYTERUN_C "\t\t$argtype arg;\n\t\tBGET_%s(arg);\n", $fundtype;
-    }
-    if ($flags =~ /x/) {
-       print BYTERUN_C "\t\tBSET_$insn($lvalue$optarg);\n";
-    } elsif ($flags =~ /s/) {
-       # Store instructions store to obj_list[arg]. "lvalue" field is rvalue.
-       print BYTERUN_C "\t\tBSET_OBJ_STORE($lvalue$optarg);\n";
-    }
-    elsif ($optarg && $lvalue ne "none") {
-       print BYTERUN_C "\t\t$lvalue = arg;\n";
-    }
-    print BYTERUN_C "\t\tbreak;\n\t    }\n";
-
-    #
     # Add the initialiser line for %insn_data in Asmdata.pm
     #
     print ASMDATA_PM <<"EOT";
@@ -139,89 +103,6 @@ EOT
 }
 
 #
-# Finish off byterun.c
-#
-print BYTERUN_C <<'EOT';
-         default:
-           croak("Illegal bytecode instruction %d\n", insn);
-           /* NOTREACHED */
-       }
-    }
-}
-EOT
-
-#
-# Write the instruction and optype enum constants into byterun.h
-#
-open(BYTERUN_H, ">byterun.h") or die "byterun.h: $!";
-print BYTERUN_H $c_header, <<'EOT';
-#ifdef INDIRECT_BGET_MACROS
-struct bytestream {
-    void *data;
-    int (*fgetc)(void *);
-    int (*fread)(char *, size_t, size_t, void*);
-    void (*freadpv)(U32, void*);
-};
-void freadpv _((U32, void *));
-void byterun _((struct bytestream));
-#else
-void byterun _((FILE *));
-#endif /* INDIRECT_BGET_MACROS */
-
-enum {
-EOT
-
-my $i = 0;
-my $add_enum_value = 0;
-my $max_insn;
-for ($i = 0; $i < @insn_name; $i++) {
-    $insn = uc($insn_name[$i]);
-    if (defined($insn)) {
-       $max_insn = $i;
-       if ($add_enum_value) {
-           print BYTERUN_H "    INSN_$insn = $i,\t\t\t/* $i */\n";
-           $add_enum_value = 0;
-       } else {
-           print BYTERUN_H "    INSN_$insn,\t\t\t/* $i */\n";
-       }
-    } else {
-       $add_enum_value = 1;
-    }
-}
-
-print BYTERUN_H "    MAX_INSN = $max_insn\n};\n";
-
-print BYTERUN_H "\nenum {\n";
-for ($i = 0; $i < @optype - 1; $i++) {
-    printf BYTERUN_H "    OPt_%s,\t\t/* %d */\n", $optype[$i], $i;
-}
-printf BYTERUN_H "    OPt_%s\t\t/* %d */\n};\n\n", $optype[$i], $i;
-print BYTERUN_H <<'EOT';
-EXT int optype_size[]
-#ifdef DOINIT
-= {
-EOT
-for ($i = 0; $i < @optype - 1; $i++) {
-    printf BYTERUN_H "    sizeof(%s),\n", $optype[$i], $i;
-}
-printf BYTERUN_H "    sizeof(%s)\n}\n", $optype[$i], $i;
-print BYTERUN_H <<'EOT';
-#endif /* DOINIT */
-;
-
-EOT
-
-printf BYTERUN_H <<'EOT', scalar(@specialsv);
-EXT SV * specialsv_list[%d]
-#ifdef DOINIT
-EOT
-print BYTERUN_H "= { ", join(", ", @specialsv), " }\n";
-print BYTERUN_H <<'EOT';
-#endif /* DOINIT */
-;
-EOT
-
-#
 # Finish off insn_data and create array initialisers in Asmdata.pm
 #
 print ASMDATA_PM <<'EOT';
@@ -234,137 +115,244 @@ while (($insn_name, $insn_data) = each %insn_data) {
 @insn_name = map($_ || "unused", @insn_name);
 
 1;
+
+__END__
+
+=head1 NAME
+
+B::Asmdata - Autogenerated data about Perl ops
+
+=head1 SYNOPSIS
+
+       use B::Asmdata qw(%insn_data @insn_name @optype @specialsv_name);
+
+=head1 DESCRIPTION
+
+Provides information about Perl ops in order to generate bytecode via
+a bunch of exported variables.  Its mostly used by B::Assembler and
+B::Disassembler.
+
+=over 4
+
+=item %insn_data
+
+  my($bytecode_num, $put_sub, $get_meth) = @$insn_data{$op_name};
+
+For a given $op_name (for example, 'cop_label', 'sv_flags', etc...) 
+you get an array ref containing the bytecode number of the op, a
+reference to the subroutine used to 'PUT', and the name of the method
+used to 'GET'.
+
+=for _private
+Add more detail about what $put_sub and $get_meth are and how to use them.
+
+=item @insn_name
+
+  my $op_name = $insn_name[$bytecode_num];
+
+A simple mapping of the bytecode number to the name of the op.
+Suitable for using with %insn_data like so:
+
+  my $op_info = $insn_data{$insn_name[$bytecode_num]};
+
+=item @optype
+
+  my $op_type = $optype[$op_type_num];
+
+A simple mapping of the op type number to its type (like 'COP' or 'BINOP').
+
+=item @specialsv_name
+
+  my $sv_name = $specialsv_name[$sv_index];
+
+Certain SV types are considered 'special'.  They're represented by
+B::SPECIAL and are referred to by a number from the specialsv_list.
+This array maps that number back to the name of the SV (like 'Nullsv'
+or '&PL_sv_undef').
+
+=back
+
+=head1 AUTHOR
+
+Malcolm Beattie, C<mbeattie@sable.ox.ac.uk>
+
+=cut
+
+# ex: set ro:
 EOT
 
+
+close ASMDATA_PM or die "Error closing ASMDATA_PM: $!";
+
 __END__
 # First set instruction ord("#") to read comment to end-of-line (sneaky)
 %number 35
-comment                arg                     comment
+comment                arg                     comment_t
 # Then make ord("\n") into a no-op
 %number 10
 nop            none                    none
+
 # Now for the rest of the ordinary ones, beginning with \0 which is
 # ret so that \0-terminated strings can be read properly as bytecode.
 %number 0
 #
-#opcode                lvalue                  argtype         flags   
+# The argtype is either a single type or "rightvaluecast/argtype".
+#
+#opcode                lvalue                                  argtype         flags   
 #
-ret            none                    none            x
-ldsv           sv                      svindex
-ldop           op                      opindex
-stsv           sv                      U32             s
-stop           op                      U32             s
-ldspecsv       sv                      U8              x
-newsv          sv                      U8              x
-newop          op                      U8              x
-newopn         op                      U8              x
-newpv          none                    PV
-pv_cur         pv.xpv_cur              STRLEN
-pv_free                pv                      none            x
-sv_upgrade     sv                      char            x
-sv_refcnt      SvREFCNT(sv)            U32
-sv_refcnt_add  SvREFCNT(sv)            I32             x
-sv_flags       SvFLAGS(sv)             U32
-xrv            SvRV(sv)                svindex
-xpv            sv                      none            x
-xiv32          SvIVX(sv)               I32
-xiv64          SvIVX(sv)               IV64
-xnv            SvNVX(sv)               double
-xlv_targoff    LvTARGOFF(sv)           STRLEN
-xlv_targlen    LvTARGLEN(sv)           STRLEN
-xlv_targ       LvTARG(sv)              svindex
-xlv_type       LvTYPE(sv)              char
-xbm_useful     BmUSEFUL(sv)            I32
-xbm_previous   BmPREVIOUS(sv)          U16
-xbm_rare       BmRARE(sv)              U8
-xfm_lines      FmLINES(sv)             I32
-xio_lines      IoLINES(sv)             long
-xio_page       IoPAGE(sv)              long
-xio_page_len   IoPAGE_LEN(sv)          long
-xio_lines_left IoLINES_LEFT(sv)        long
-xio_top_name   IoTOP_NAME(sv)          pvcontents
-xio_top_gv     IoTOP_GV(sv)            svindex
-xio_fmt_name   IoFMT_NAME(sv)          pvcontents
-xio_fmt_gv     IoFMT_GV(sv)            svindex
-xio_bottom_name        IoBOTTOM_NAME(sv)       pvcontents
-xio_bottom_gv  IoBOTTOM_GV(sv)         svindex
-xio_subprocess IoSUBPROCESS(sv)        short
-xio_type       IoTYPE(sv)              char
-xio_flags      IoFLAGS(sv)             char
-xcv_stash      *(SV**)&CvSTASH(sv)     svindex
-xcv_start      CvSTART(sv)             opindex
-xcv_root       CvROOT(sv)              opindex
-xcv_gv         CvGV(sv)                svindex
-xcv_filegv     CvFILEGV(sv)            svindex
-xcv_depth      CvDEPTH(sv)             long
-xcv_padlist    *(SV**)&CvPADLIST(sv)   svindex
-xcv_outside    *(SV**)&CvOUTSIDE(sv)   svindex
-xcv_flags      CvFLAGS(sv)             U8
-av_extend      sv                      SSize_t         x
-av_push                sv                      svindex         x
-xav_fill       AvFILL(sv)              SSize_t
-xav_max                AvMAX(sv)               SSize_t
-xav_flags      AvFLAGS(sv)             U8
-xhv_riter      HvRITER(sv)             I32
-xhv_name       HvNAME(sv)              pvcontents
-hv_store       sv                      svindex         x
-sv_magic       sv                      char            x
-mg_obj         SvMAGIC(sv)->mg_obj     svindex
-mg_private     SvMAGIC(sv)->mg_private U16
-mg_flags       SvMAGIC(sv)->mg_flags   U8
-mg_pv          SvMAGIC(sv)             pvcontents      x
-xmg_stash      *(SV**)&SvSTASH(sv)     svindex
-gv_fetchpv     sv                      strconst        x
-gv_stashpv     sv                      strconst        x
-gp_sv          GvSV(sv)                svindex
-gp_refcnt      GvREFCNT(sv)            U32
-gp_refcnt_add  GvREFCNT(sv)            I32             x
-gp_av          *(SV**)&GvAV(sv)        svindex
-gp_hv          *(SV**)&GvHV(sv)        svindex
-gp_cv          *(SV**)&GvCV(sv)        svindex
-gp_filegv      *(SV**)&GvFILEGV(sv)    svindex
-gp_io          *(SV**)&GvIOp(sv)       svindex
-gp_form                *(SV**)&GvFORM(sv)      svindex
-gp_cvgen       GvCVGEN(sv)             U32
-gp_line                GvLINE(sv)              line_t
-gp_share       sv                      svindex         x
-xgv_flags      GvFLAGS(sv)             U8
-op_next                op->op_next             opindex
-op_sibling     op->op_sibling          opindex
-op_ppaddr      op->op_ppaddr           strconst        x
-op_targ                op->op_targ             PADOFFSET
-op_type                op                      OPCODE          x
-op_seq         op->op_seq              U16
-op_flags       op->op_flags            U8
-op_private     op->op_private          U8
-op_first       cUNOP->op_first         opindex
-op_last                cBINOP->op_last         opindex
-op_other       cLOGOP->op_other        opindex
-op_true                cCONDOP->op_true        opindex
-op_false       cCONDOP->op_false       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
-op_pmnext      *(OP**)&cPMOP->op_pmnext        opindex
-pregcomp       op                      pvcontents      x
-op_pmshort     cPMOP->op_pmshort       svindex
-op_pmflags     cPMOP->op_pmflags       U16
-op_pmpermflags cPMOP->op_pmpermflags   U16
-op_pmslen      cPMOP->op_pmslen        char
-op_sv          cSVOP->op_sv            svindex
-op_gv          cGVOP->op_gv            svindex
-op_pv          cPVOP->op_pv            pvcontents
-op_pv_tr       cPVOP->op_pv            op_tr_array
-op_redoop      cLOOP->op_redoop        opindex
-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_filegv     cCOP->cop_filegv        svindex
-cop_seq                cCOP->cop_seq           U32
-cop_arybase    cCOP->cop_arybase       I32
-cop_line       cCOP->cop_line          line_t
-main_start     main_start              opindex
-main_root      main_root               opindex
-curpad         curpad                  svindex         x
+ret            none                                    none            x
+ldsv           bstate->bs_sv                           svindex
+ldop           PL_op                                   opindex
+stsv           bstate->bs_sv                           U32             s
+stop           PL_op                                   U32             s
+stpv           bstate->bs_pv.pvx                       U32             x
+ldspecsv       bstate->bs_sv                           U8              x
+ldspecsvx      bstate->bs_sv                           U8              x
+newsv          bstate->bs_sv                           svtype          x
+newsvx         bstate->bs_sv                           svtype          x
+newop          PL_op                                   U8              x
+newopx         PL_op                                   U16             x
+newopn         PL_op                                   U8              x
+newpv          none                                    PV
+pv_cur         bstate->bs_pv.xpv.xpv_cur               STRLEN
+pv_free                bstate->bs_pv.pvx                       none            x
+sv_upgrade     bstate->bs_sv                           svtype          x
+sv_refcnt      SvREFCNT(bstate->bs_sv)                 U32
+sv_refcnt_add  SvREFCNT(bstate->bs_sv)                 I32             x
+sv_flags       SvFLAGS(bstate->bs_sv)                  U32
+xrv            bstate->bs_sv                           svindex         x
+xpv            bstate->bs_sv                           none            x
+xpv_cur                bstate->bs_sv                           STRLEN          x
+xpv_len                bstate->bs_sv                           STRLEN          x
+xiv            bstate->bs_sv                           IV              x
+xnv            bstate->bs_sv                           NV              x
+xlv_targoff    LvTARGOFF(bstate->bs_sv)                STRLEN
+xlv_targlen    LvTARGLEN(bstate->bs_sv)                STRLEN
+xlv_targ       LvTARG(bstate->bs_sv)                   svindex
+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)                  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)               pvindex
+xio_top_gv     *(SV**)&IoTOP_GV(bstate->bs_sv)         svindex
+xio_fmt_name   IoFMT_NAME(bstate->bs_sv)               pvindex
+xio_fmt_gv     *(SV**)&IoFMT_GV(bstate->bs_sv)         svindex
+xio_bottom_name        IoBOTTOM_NAME(bstate->bs_sv)            pvindex
+xio_bottom_gv  *(SV**)&IoBOTTOM_GV(bstate->bs_sv)      svindex
+xio_subprocess IoSUBPROCESS(bstate->bs_sv)             short
+xio_type       IoTYPE(bstate->bs_sv)                   char
+xio_flags      IoFLAGS(bstate->bs_sv)                  char
+xcv_xsubany    *(SV**)&CvXSUBANY(bstate->bs_sv).any_ptr        svindex
+xcv_stash      *(SV**)&CvSTASH(bstate->bs_sv)          svindex
+xcv_start      CvSTART(bstate->bs_sv)                  opindex
+xcv_root       CvROOT(bstate->bs_sv)                   opindex
+xcv_gv         *(SV**)&CvGV(bstate->bs_sv)             svindex
+xcv_file       CvFILE(bstate->bs_sv)                   pvindex
+xcv_depth      CvDEPTH(bstate->bs_sv)                  long
+xcv_padlist    *(SV**)&CvPADLIST(bstate->bs_sv)        svindex
+xcv_outside    *(SV**)&CvOUTSIDE(bstate->bs_sv)        svindex
+xcv_outside_seq        CvOUTSIDE_SEQ(bstate->bs_sv)            U32
+xcv_flags      CvFLAGS(bstate->bs_sv)                  U16
+av_extend      bstate->bs_sv                           SSize_t         x
+av_pushx       bstate->bs_sv                           svindex         x
+av_push                bstate->bs_sv                           svindex         x
+xav_fill       AvFILLp(bstate->bs_sv)                  SSize_t
+xav_max                AvMAX(bstate->bs_sv)                    SSize_t
+xhv_riter      HvRITER(bstate->bs_sv)                  I32
+xhv_name       bstate->bs_sv                           pvindex         x
+hv_store       bstate->bs_sv                           svindex         x
+sv_magic       bstate->bs_sv                           char            x
+mg_obj         SvMAGIC(bstate->bs_sv)->mg_obj          svindex
+mg_private     SvMAGIC(bstate->bs_sv)->mg_private      U16
+mg_flags       SvMAGIC(bstate->bs_sv)->mg_flags        U8
+mg_name                SvMAGIC(bstate->bs_sv)                  pvcontents      x
+mg_namex       SvMAGIC(bstate->bs_sv)                  svindex         x
+xmg_stash      bstate->bs_sv                           svindex         x
+gv_fetchpv     bstate->bs_sv                           strconst        x
+gv_fetchpvx    bstate->bs_sv                           strconst        x
+gv_stashpv     bstate->bs_sv                           strconst        x
+gv_stashpvx    bstate->bs_sv                           strconst        x
+gp_sv          GvSV(bstate->bs_sv)                     svindex
+gp_refcnt      GvREFCNT(bstate->bs_sv)                 U32
+gp_refcnt_add  GvREFCNT(bstate->bs_sv)                 I32             x
+gp_av          *(SV**)&GvAV(bstate->bs_sv)             svindex
+gp_hv          *(SV**)&GvHV(bstate->bs_sv)             svindex
+gp_cv          *(SV**)&GvCV(bstate->bs_sv)             svindex
+gp_file                bstate->bs_sv                           pvindex         x
+gp_io          *(SV**)&GvIOp(bstate->bs_sv)            svindex
+gp_form                *(SV**)&GvFORM(bstate->bs_sv)           svindex
+gp_cvgen       GvCVGEN(bstate->bs_sv)                  U32
+gp_line                GvLINE(bstate->bs_sv)                   line_t
+gp_share       bstate->bs_sv                           svindex         x
+xgv_flags      GvFLAGS(bstate->bs_sv)                  U8
+op_next                PL_op->op_next                          opindex
+op_sibling     PL_op->op_sibling                       opindex
+op_ppaddr      PL_op->op_ppaddr                        strconst        x
+op_targ                PL_op->op_targ                          PADOFFSET
+op_type                PL_op                                   OPCODE          x
+op_opt         PL_op->op_opt                           U8
+op_static      PL_op->op_static                        U8
+op_flags       PL_op->op_flags                         U8
+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_pmreplroot  cPMOP->op_pmreplroot                    opindex
+op_pmreplstart cPMOP->op_pmreplstart                   opindex
+op_pmnext      *(OP**)&cPMOP->op_pmnext                opindex
+#ifdef USE_ITHREADS
+op_pmstashpv   cPMOP                                   pvindex         x
+op_pmreplrootpo        cPMOP->op_pmreplroot                    OP*/PADOFFSET
+#else
+op_pmstash     *(SV**)&cPMOP->op_pmstash               svindex
+op_pmreplrootgv        *(SV**)&cPMOP->op_pmreplroot            svindex
+#endif
+pregcomp       PL_op                                   pvcontents      x
+op_pmflags     cPMOP->op_pmflags                       U16
+op_pmpermflags cPMOP->op_pmpermflags                   U16
+op_pmdynflags  cPMOP->op_pmdynflags                    U8
+op_sv          cSVOP->op_sv                            svindex
+op_padix       cPADOP->op_padix                        PADOFFSET
+op_pv          cPVOP->op_pv                            pvcontents
+op_pv_tr       cPVOP->op_pv                            op_tr_array
+op_redoop      cLOOP->op_redoop                        opindex
+op_nextop      cLOOP->op_nextop                        opindex
+op_lastop      cLOOP->op_lastop                        opindex
+cop_label      cCOP->cop_label                         pvindex
+#ifdef USE_ITHREADS
+cop_stashpv    cCOP                                    pvindex         x
+cop_file       cCOP                                    pvindex         x
+#else
+cop_stash      cCOP                                    svindex         x
+cop_filegv     cCOP                                    svindex         x
+#endif
+cop_seq                cCOP->cop_seq                           U32
+cop_arybase    cCOP                                    I32             x
+cop_line       cCOP->cop_line                          line_t
+cop_warnings   cCOP                                    svindex         x
+main_start     PL_main_start                           opindex
+main_root      PL_main_root                            opindex
+main_cv                *(SV**)&PL_main_cv                      svindex
+curpad         PL_curpad                               svindex         x
+push_begin     PL_beginav                              svindex         x
+push_init      PL_initav                               svindex         x
+push_end       PL_endav                                svindex         x
+curstash       *(SV**)&PL_curstash                     svindex
+defstash       *(SV**)&PL_defstash                     svindex
+data           none                                    U8              x
+incav          *(SV**)&GvAV(PL_incgv)                  svindex
+load_glob      none                                    svindex         x
+#ifdef USE_ITHREADS
+regex_padav    *(SV**)&PL_regex_padav                  svindex
+#endif
+dowarn         PL_dowarn                               U8
+comppad_name   *(SV**)&PL_comppad_name                 svindex
+xgv_stash      *(SV**)&GvSTASH(bstate->bs_sv)          svindex
+signal         bstate->bs_sv                           strconst        x
+# to be removed
+formfeed       PL_formfeed                             svindex