This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove compiler files from their old lib/B locations. The compiler
[perl5.git] / bytecode.pl
index 0dd7c1e..8eadbdd 100644 (file)
@@ -20,7 +20,7 @@ while (($from, $tos) = each %alias_to) {
 
 my $c_header = <<'EOT';
 /*
- *      Copyright (c) 1996, 1997 Malcolm Beattie
+ *      Copyright (c) 1996-1998 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,20 +34,12 @@ 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 "B/Asmdata.pm") {
-    rename("B/Asmdata.pm", "B/Asmdata.pm.old");
-}
+unlink "byterun.c", "byterun.h", "ext/B/Asmdata.pm";
 
 #
 # Start with boilerplate for Asmdata.pm
 #
-open(ASMDATA_PM, ">B/Asmdata.pm") or die "Asmdata.pm: $!";
+open(ASMDATA_PM, ">ext/B/Asmdata.pm") or die "Asmdata.pm: $!";
 print ASMDATA_PM $perl_header, <<'EOT';
 package B::Asmdata;
 use Exporter;
@@ -220,13 +212,14 @@ print BYTERUN_H <<'EOT';
 EOT
 
 printf BYTERUN_H <<'EOT', scalar(@specialsv);
-EXT SV * specialsv_list[%d]
-#ifdef DOINIT
+EXT SV * specialsv_list[%d];
+#define INIT_SPECIALSV_LIST STMT_START { \
 EOT
-print BYTERUN_H "= { ", join(", ", @specialsv), " }\n";
+for ($i = 0; $i < @specialsv; $i++) {
+    print BYTERUN_H "specialsv_list[$i] = $specialsv[$i]; \\\n";
+}
 print BYTERUN_H <<'EOT';
-#endif /* DOINIT */
-;
+} STMT_END
 EOT
 
 #
@@ -310,7 +303,7 @@ 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_fill       AvFILLp(sv)             SSize_t
 xav_max                AvMAX(sv)               SSize_t
 xav_flags      AvFLAGS(sv)             U8
 xhv_riter      HvRITER(sv)             I32