Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

C: revert 0b97dd deferred INC cleanup

Note that tests pass now again, but I am not sure why. I have
not found the real problem with 0b97dd deferred INC cleanup yet.
Improve it with 1.38.
  • Loading branch information...
commit 72cc08512ea4cdf6eaa345cf6d0118348f540ec5 1 parent 719589e
Reini Urban authored January 17, 2012
12  Changes
@@ -7,7 +7,11 @@
7 7
 	Save %main:: stashes w/o -fno-stash. Switched to git, added github mirror
8 8
 	Fixed hashes and share_hek, when mixed compiled and load-time for >5.8.
9 9
 
10  
-	* C: save stashes also, but only values which are also
  10
+	Stability: This release is the first which passes all module tests and passes
  11
+	most tests and is used in production with -staticxs -O3, but further logical
  12
+	improvements failed for no apparent reasons, so it's still considered unstable.
  13
+
  14
+	* C: save stashes optionally with -fstash, but only values which are also
11 15
 	  stashes to avoid a second walker besides savecv, and thus do not
12 16
 	  walk into unneeded territory; B::STASHGV (46, issue 79)
13 17
 	New -fno-stash with -O2 to omit stashes which are rarely needed.
@@ -48,7 +52,8 @@
48 52
 	  need -fstash to add stashes. It caused not understood problems.
49 53
 	Fixed saving %SIG signals and more -2 SV magic (issue 92)
50 54
 	Adjusted IO logic, was erronously skipped (issue 59)
51  
-	Defer saving INC to match internally skipped packages (issue 85,87)
  55
+	XXX: Defer saving INC to match internally skipped packages (issue 85,87)
  56
+	inc_cleanup: save only those %INC keys which are stored.
52 57
 	Save ext/mro only if the ext mro methods were loaded.
53 58
 	Force loading of -u arguments to avoid runtime loading.
54 59
 	* CC (1.12): allow overriding of -f<opt> B::C flags.
@@ -64,9 +69,10 @@
64 69
 	Changed verbosity levels and output wording.
65 70
 	* META.yml: remove from MANIFEST and repo, let make dist
66 71
 	  autogenerate it.
67  
-	* t/TESTS: changed  test 46 (Exporter:: and other stashes in
  72
+	* t/test.pl, t/TESTS: changed test 46 (Exporter:: and other stashes in
68 73
 	  %main:: stash) to cover issue 79.
69 74
 	  use Exporter; print q(ok) if %main::Exporter::
  75
+	* t/test.pl: use general comments with optional TODO. Before only TODO
70 76
 	* t/perldoc.t: fixed for 5.8 with manually adding -uFile::Spec -uIO::Handle
71 77
 	* t/issue81.t: added
72 78
 
10  Makefile.PL
@@ -145,7 +145,7 @@ int main() {
145 145
 ";
146 146
     my $testc = $testori;
147 147
     if (try_compile($testc)) {
148  
-	warn "independent_comalloc() as-is activated\n";
  148
+	warn "-fav-init2 available: independent_comalloc() as-is activated\n";
149 149
 	return 1;
150 150
     }
151 151
 
@@ -154,7 +154,7 @@ int main() {
154 154
         $lib =~ s/^-l(.+)$/lib$1.lib/ if $^O eq 'MSWin32';
155 155
         if (try_compile($testc, $lib)) {
156 156
             $extra_libs = " $lib";
157  
-	    warn "independent_comalloc() with $lib activated\n";
  157
+	    warn "-fav-init2 available: independent_comalloc() with $lib activated\n";
158 158
             return 1;
159 159
         }
160 160
     }
@@ -165,7 +165,7 @@ int main() {
165 165
         if (try_compile($testc, $lib)) {
166 166
             $extra_libs = " $lib";
167 167
             $use_declare_independent_comalloc = 1;
168  
-	    warn "dlindependent_comalloc() with $lib activated\n";
  168
+	    warn "-fav-init2 available: dlindependent_comalloc() with $lib activated\n";
169 169
             return 1;
170 170
         }
171 171
     }
@@ -177,11 +177,11 @@ int main() {
177 177
         if (try_compile($testc, $lib)) {
178 178
             $extra_cflags = " -DNEED_MALLOC_283";
179 179
             $extra_libs = " $lib";
180  
-	    warn "independent_comalloc() with -DNEED_MALLOC_283 $lib activated\n";
  180
+	    warn "-fav-init2 available: independent_comalloc() with -DNEED_MALLOC_283 $lib activated\n";
181 181
             return 1;
182 182
         }
183 183
     }
184  
-    warn "independent_comalloc() not detected.\n";
  184
+    warn "-fav-init2 not available: independent_comalloc() not detected.\n";
185 185
     warn "  Install with $^X Makefile.PL INSTALL_PTMALLOC3 on POSIX systems\n";
186 186
     return 0;
187 187
 }
19  lib/B/C.pm
@@ -2913,7 +2913,7 @@ sub B::GV::save {
2913 2913
   my $sym = objsym($gv);
2914 2914
   if ( defined($sym) ) {
2915 2915
     warn sprintf( "GV 0x%x already saved as $sym\n", $$gv ) if $debug{gv};
2916  
-    return $sym unless $_[1] eq 'main::INC' and $_[2];
  2916
+    return $sym; # unless $_[1] eq 'main::INC' and $_[2];
2917 2917
   }
2918 2918
   else {
2919 2919
     my $ix = $gv_index++;
@@ -2976,9 +2976,9 @@ if (0) {
2976 2976
     return $sym;
2977 2977
   }
2978 2978
   # defer to the end because we remove compiler-internal and skipped stuff
2979  
-  if ($fullname eq 'main::INC' and !$_[2]) {
2980  
-    return $sym;
2981  
-  }
  2979
+  #if ($fullname eq 'main::INC' and !$_[2]) {
  2980
+  #  return $sym;
  2981
+  #}
2982 2982
   $init->add(qq[$sym = gv_fetchpv($name, TRUE, SVt_PV);]);
2983 2983
   my $svflags    = $gv->FLAGS;
2984 2984
   my $savefields = 0;
@@ -3109,6 +3109,9 @@ if (0) {
3109 3109
     }
3110 3110
     my $gvhv = $gv->HV;
3111 3111
     if ( $$gvhv && $savefields & Save_HV ) {
  3112
+      if ($fullname eq 'main::INC') {
  3113
+	inc_cleanup();
  3114
+      }
3112 3115
       if ($fullname ne 'main::ENV') {
3113 3116
 	warn "GV::save \%$fullname\n" if $debug{gv};
3114 3117
 	if ($fullname eq 'main::!') { # force loading Errno
@@ -5000,6 +5003,7 @@ sub save_unused_subs {
5000 5003
 }
5001 5004
 
5002 5005
 sub inc_cleanup {
  5006
+  return if $inc_cleanup;
5003 5007
   # %INC sanity check issue 89:
5004 5008
   # omit unused, unsaved packages, so that at least run-time require will pull them in.
5005 5009
   for my $packname (keys %INC) {
@@ -5017,6 +5021,7 @@ sub inc_cleanup {
5017 5021
     warn "\%INC: ".join(" ",keys %INC)."\n";
5018 5022
     warn "\%include_package: ".join(" ",grep{$include_package{$_}} keys %include_package)."\n";
5019 5023
   }
  5024
+  $inc_cleanup++;
5020 5025
 }
5021 5026
 
5022 5027
 sub save_context {
@@ -5069,10 +5074,10 @@ sub save_context {
5069 5074
     warn "\%INC and \@INC:\n" if $verbose;
5070 5075
     $init->add('/* %INC */');
5071 5076
     inc_cleanup();
5072  
-    svref_2object( \*main::INC )->save('main::INC', 'now');
5073  
-    $inc_hv          = svref_2object( \%main::INC )->save('main::INC');
  5077
+    # svref_2object( \*main::INC )->save('main::INC', 'now');
  5078
+    $inc_hv          = svref_2object( \%INC )->save('main::INC');
5074 5079
     $init->add('/* @INC */');
5075  
-    $inc_av          = svref_2object( \@main::INC )->save('main::INC');
  5080
+    $inc_av          = svref_2object( \@INC )->save('main::INC');
5076 5081
   }
5077 5082
   my $amagic_generate = amagic_generation;
5078 5083
   warn "amagic_generation = $amagic_generate\n" if $verbose;

0 notes on commit 72cc085

Please sign in to comment.
Something went wrong with that request. Please try again.