Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@rurban authored
Showing with 26 additions and 15 deletions.
  1. +9 −3 Changes
  2. +5 −5 Makefile.PL
  3. +12 −7 lib/B/C.pm
View
12 Changes
@@ -7,7 +7,11 @@
Save %main:: stashes w/o -fno-stash. Switched to git, added github mirror
Fixed hashes and share_hek, when mixed compiled and load-time for >5.8.
- * C: save stashes also, but only values which are also
+ Stability: This release is the first which passes all module tests and passes
+ most tests and is used in production with -staticxs -O3, but further logical
+ improvements failed for no apparent reasons, so it's still considered unstable.
+
+ * C: save stashes optionally with -fstash, but only values which are also
stashes to avoid a second walker besides savecv, and thus do not
walk into unneeded territory; B::STASHGV (46, issue 79)
New -fno-stash with -O2 to omit stashes which are rarely needed.
@@ -48,7 +52,8 @@
need -fstash to add stashes. It caused not understood problems.
Fixed saving %SIG signals and more -2 SV magic (issue 92)
Adjusted IO logic, was erronously skipped (issue 59)
- Defer saving INC to match internally skipped packages (issue 85,87)
+ XXX: Defer saving INC to match internally skipped packages (issue 85,87)
+ inc_cleanup: save only those %INC keys which are stored.
Save ext/mro only if the ext mro methods were loaded.
Force loading of -u arguments to avoid runtime loading.
* CC (1.12): allow overriding of -f<opt> B::C flags.
@@ -64,9 +69,10 @@
Changed verbosity levels and output wording.
* META.yml: remove from MANIFEST and repo, let make dist
autogenerate it.
- * t/TESTS: changed test 46 (Exporter:: and other stashes in
+ * t/test.pl, t/TESTS: changed test 46 (Exporter:: and other stashes in
%main:: stash) to cover issue 79.
use Exporter; print q(ok) if %main::Exporter::
+ * t/test.pl: use general comments with optional TODO. Before only TODO
* t/perldoc.t: fixed for 5.8 with manually adding -uFile::Spec -uIO::Handle
* t/issue81.t: added
View
10 Makefile.PL
@@ -145,7 +145,7 @@ int main() {
";
my $testc = $testori;
if (try_compile($testc)) {
- warn "independent_comalloc() as-is activated\n";
+ warn "-fav-init2 available: independent_comalloc() as-is activated\n";
return 1;
}
@@ -154,7 +154,7 @@ int main() {
$lib =~ s/^-l(.+)$/lib$1.lib/ if $^O eq 'MSWin32';
if (try_compile($testc, $lib)) {
$extra_libs = " $lib";
- warn "independent_comalloc() with $lib activated\n";
+ warn "-fav-init2 available: independent_comalloc() with $lib activated\n";
return 1;
}
}
@@ -165,7 +165,7 @@ int main() {
if (try_compile($testc, $lib)) {
$extra_libs = " $lib";
$use_declare_independent_comalloc = 1;
- warn "dlindependent_comalloc() with $lib activated\n";
+ warn "-fav-init2 available: dlindependent_comalloc() with $lib activated\n";
return 1;
}
}
@@ -177,11 +177,11 @@ int main() {
if (try_compile($testc, $lib)) {
$extra_cflags = " -DNEED_MALLOC_283";
$extra_libs = " $lib";
- warn "independent_comalloc() with -DNEED_MALLOC_283 $lib activated\n";
+ warn "-fav-init2 available: independent_comalloc() with -DNEED_MALLOC_283 $lib activated\n";
return 1;
}
}
- warn "independent_comalloc() not detected.\n";
+ warn "-fav-init2 not available: independent_comalloc() not detected.\n";
warn " Install with $^X Makefile.PL INSTALL_PTMALLOC3 on POSIX systems\n";
return 0;
}
View
19 lib/B/C.pm
@@ -2913,7 +2913,7 @@ sub B::GV::save {
my $sym = objsym($gv);
if ( defined($sym) ) {
warn sprintf( "GV 0x%x already saved as $sym\n", $$gv ) if $debug{gv};
- return $sym unless $_[1] eq 'main::INC' and $_[2];
+ return $sym; # unless $_[1] eq 'main::INC' and $_[2];
}
else {
my $ix = $gv_index++;
@@ -2976,9 +2976,9 @@ if (0) {
return $sym;
}
# defer to the end because we remove compiler-internal and skipped stuff
- if ($fullname eq 'main::INC' and !$_[2]) {
- return $sym;
- }
+ #if ($fullname eq 'main::INC' and !$_[2]) {
+ # return $sym;
+ #}
$init->add(qq[$sym = gv_fetchpv($name, TRUE, SVt_PV);]);
my $svflags = $gv->FLAGS;
my $savefields = 0;
@@ -3109,6 +3109,9 @@ if (0) {
}
my $gvhv = $gv->HV;
if ( $$gvhv && $savefields & Save_HV ) {
+ if ($fullname eq 'main::INC') {
+ inc_cleanup();
+ }
if ($fullname ne 'main::ENV') {
warn "GV::save \%$fullname\n" if $debug{gv};
if ($fullname eq 'main::!') { # force loading Errno
@@ -5000,6 +5003,7 @@ sub save_unused_subs {
}
sub inc_cleanup {
+ return if $inc_cleanup;
# %INC sanity check issue 89:
# omit unused, unsaved packages, so that at least run-time require will pull them in.
for my $packname (keys %INC) {
@@ -5017,6 +5021,7 @@ sub inc_cleanup {
warn "\%INC: ".join(" ",keys %INC)."\n";
warn "\%include_package: ".join(" ",grep{$include_package{$_}} keys %include_package)."\n";
}
+ $inc_cleanup++;
}
sub save_context {
@@ -5069,10 +5074,10 @@ sub save_context {
warn "\%INC and \@INC:\n" if $verbose;
$init->add('/* %INC */');
inc_cleanup();
- svref_2object( \*main::INC )->save('main::INC', 'now');
- $inc_hv = svref_2object( \%main::INC )->save('main::INC');
+ # svref_2object( \*main::INC )->save('main::INC', 'now');
+ $inc_hv = svref_2object( \%INC )->save('main::INC');
$init->add('/* @INC */');
- $inc_av = svref_2object( \@main::INC )->save('main::INC');
+ $inc_av = svref_2object( \@INC )->save('main::INC');
}
my $amagic_generate = amagic_generation;
warn "amagic_generation = $amagic_generate\n" if $verbose;
Please sign in to comment.
Something went wrong with that request. Please try again.