line numbers are given % 64k
authorJames Jurach <muaddib@erf.net>
Wed, 2 Jul 2003 13:31:05 +0000 (08:31 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 2 Jul 2003 19:39:11 +0000 (19:39 +0000)
Message-ID: <20030702183105.GA4837@lebowski>

p4raw-id: //depot/perl@19934

bytecode.pl
ext/B/B/Asmdata.pm
ext/ByteLoader/byterun.c
handy.h
pp_ctl.c
scope.h

index 38ae809..e544485 100644 (file)
@@ -5,8 +5,8 @@ BEGIN {
 use strict;
 my %alias_to = (
     U32 => [qw(PADOFFSET STRLEN)],
-    I32 => [qw(SSize_t long)],
-    U16 => [qw(OPCODE line_t short)],
+    I32 => [qw(SSize_t line_t long)],
+    U16 => [qw(OPCODE short)],
     U8 => [qw(char)],
 );
 
index 1f6498a..83ec2ec 100644 (file)
@@ -104,7 +104,7 @@ $insn_data{gp_file} = [77, \&PUT_pvindex, "GET_pvindex"];
 $insn_data{gp_io} = [78, \&PUT_svindex, "GET_svindex"];
 $insn_data{gp_form} = [79, \&PUT_svindex, "GET_svindex"];
 $insn_data{gp_cvgen} = [80, \&PUT_U32, "GET_U32"];
-$insn_data{gp_line} = [81, \&PUT_U16, "GET_U16"];
+$insn_data{gp_line} = [81, \&PUT_U32, "GET_U32"];
 $insn_data{gp_share} = [82, \&PUT_svindex, "GET_svindex"];
 $insn_data{xgv_flags} = [83, \&PUT_U8, "GET_U8"];
 $insn_data{op_next} = [84, \&PUT_opindex, "GET_opindex"];
@@ -137,7 +137,7 @@ $insn_data{cop_stashpv} = [110, \&PUT_pvindex, "GET_pvindex"];
 $insn_data{cop_file} = [111, \&PUT_pvindex, "GET_pvindex"];
 $insn_data{cop_seq} = [112, \&PUT_U32, "GET_U32"];
 $insn_data{cop_arybase} = [113, \&PUT_I32, "GET_I32"];
-$insn_data{cop_line} = [114, \&PUT_U16, "GET_U16"];
+$insn_data{cop_line} = [114, \&PUT_U32, "GET_U32"];
 $insn_data{cop_warnings} = [115, \&PUT_svindex, "GET_svindex"];
 $insn_data{main_start} = [116, \&PUT_opindex, "GET_opindex"];
 $insn_data{main_root} = [117, \&PUT_opindex, "GET_opindex"];
index 8c8ad12..93c0a39 100644 (file)
@@ -624,7 +624,7 @@ byterun(pTHX_ register struct byteloader_state *bstate)
          case INSN_GP_LINE:            /* 81 */
            {
                line_t arg;
-               BGET_U16(arg);
+               BGET_U32(arg);
                GvLINE(bstate->bs_sv) = arg;
                break;
            }
@@ -855,7 +855,7 @@ byterun(pTHX_ register struct byteloader_state *bstate)
          case INSN_COP_LINE:           /* 114 */
            {
                line_t arg;
-               BGET_U16(arg);
+               BGET_U32(arg);
                BSET_cop_line(cCOP, arg);
                break;
            }
diff --git a/handy.h b/handy.h
index 9f0fb3c..94798f4 100644 (file)
--- a/handy.h
+++ b/handy.h
@@ -512,12 +512,12 @@ Converts the specified character to lowercase.
 #  define toCTRL(c)    (toUPPER(c) ^ 64)
 #endif
 
-/* Line numbers are unsigned, 16 bits. */
-typedef U16 line_t;
+/* Line numbers are unsigned, 32 bits. */
+typedef U32 line_t;
 #ifdef lint
 #define NOLINE ((line_t)0)
 #else
-#define NOLINE ((line_t) 65535)
+#define NOLINE ((line_t) 4294967295UL)
 #endif
 
 
index dbfc39c..242253b 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -22,7 +22,7 @@
 #include "perl.h"
 
 #ifndef WORD_ALIGN
-#define WORD_ALIGN sizeof(U16)
+#define WORD_ALIGN sizeof(U32)
 #endif
 
 #define DOCATCH(o) ((CATCH_GET == TRUE) ? docatch(o) : (o))
@@ -349,7 +349,7 @@ PP(pp_formline)
 {
     dSP; dMARK; dORIGMARK;
     register SV *tmpForm = *++MARK;
-    register U16 *fpc;
+    register U32 *fpc;
     register char *t;
     register char *f;
     register char *s;
@@ -389,7 +389,7 @@ PP(pp_formline)
     /* need to jump to the next word */
     s = f + len + WORD_ALIGN - SvCUR(tmpForm) % WORD_ALIGN;
 
-    fpc = (U16*)s;
+    fpc = (U32*)s;
 
     for (;;) {
        DEBUG_f( {
@@ -3549,9 +3549,9 @@ S_doparseform(pTHX_ SV *sv)
     bool noblank   = FALSE;
     bool repeat    = FALSE;
     bool postspace = FALSE;
-    U16 *fops;
-    register U16 *fpc;
-    U16 *linepc = 0;
+    U32 *fops;
+    register U32 *fpc;
+    U32 *linepc = 0;
     register I32 arg;
     bool ischop;
     int maxops = 2; /* FF_LINEMARK + FF_END) */
@@ -3567,7 +3567,7 @@ S_doparseform(pTHX_ SV *sv)
     s = base;
     base = Nullch;
 
-    New(804, fops, maxops, U16);
+    New(804, fops, maxops, U32);
     fpc = fops;
 
     if (s < send) {
@@ -3735,10 +3735,10 @@ S_doparseform(pTHX_ SV *sv)
     { /* need to jump to the next word */
         int z;
        z = WORD_ALIGN - SvCUR(sv) % WORD_ALIGN;
-       SvGROW(sv, SvCUR(sv) + z + arg * sizeof(U16) + 4);
+       SvGROW(sv, SvCUR(sv) + z + arg * sizeof(U32) + 4);
        s = SvPVX(sv) + SvCUR(sv) + z;
     }
-    Copy(fops, s, arg, U16);
+    Copy(fops, s, arg, U32);
     Safefree(fops);
     sv_magic(sv, Nullsv, PERL_MAGIC_fm, Nullch, 0);
     SvCOMPILED_on(sv);
diff --git a/scope.h b/scope.h
index 25c7bc5..a2e760e 100644 (file)
--- a/scope.h
+++ b/scope.h
@@ -179,7 +179,7 @@ Closing bracket on a callback.  See C<ENTER> and L<perlcall>.
 #  define SAVECOPFILE_FREE(c)  SAVEGENERICSV(CopFILEGV(c))
 #endif
 
-#define SAVECOPLINE(c)         SAVEI16(CopLINE(c))
+#define SAVECOPLINE(c)         SAVEI32(CopLINE(c))
 
 /* SSNEW() temporarily allocates a specified number of bytes of data on the
  * savestack.  It returns an integer index into the savestack, because a