"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core.c/CompUnit/PrecompilationRepository.pm6" between
rakudo-2020.08.2.tar.gz and rakudo-2020.09.tar.gz

About: Rakudo is a compiler for the Perl 6 programming language.

PrecompilationRepository.pm6  (rakudo-2020.08.2):PrecompilationRepository.pm6  (rakudo-2020.09)
skipping to change at line 342 skipping to change at line 342
} }
multi method precompile( multi method precompile(
IO::Path:D $path, IO::Path:D $path,
CompUnit::PrecompilationId:D $id, CompUnit::PrecompilationId:D $id,
Bool :$force, Bool :$force,
Str :$source-name = $path.Str, Str :$source-name = $path.Str,
:$precomp-stores, :$precomp-stores,
--> Bool:D) { --> Bool:D) {
my $env := nqp::clone(nqp::getattr(%*ENV,Map,'$!storage'));
my $rpl := nqp::atkey($env,'RAKUDO_PRECOMP_LOADING');
if $rpl {
my @modules := Rakudo::Internals::JSON.from-json: $rpl;
die "Circular module loading detected trying to precompile $path"
if $path.Str (elem) @modules;
}
# obtain destination, lock the store for other processes # obtain destination, lock the store for other processes
my $store := self.store; my $store := self.store;
my $io := $store.destination($compiler-id, $id); my $io := $store.destination($compiler-id, $id);
return False unless $io; return False unless $io;
if $force { if $force {
return self!already-precompiled($path,$source-name,$io,1) return self!already-precompiled($path,$source-name,$io,1)
if $precomp-stores if $precomp-stores
and my $unit := self!load-file($precomp-stores, $id, :refresh) and my $unit := self!load-file($precomp-stores, $id, :refresh)
and do { and do {
skipping to change at line 363 skipping to change at line 371
$path.CHECKSUM eq $unit.source-checksum $path.CHECKSUM eq $unit.source-checksum
and self!load-dependencies($unit, $precomp-stores) and self!load-dependencies($unit, $precomp-stores)
} }
} }
elsif Rakudo::Internals.FILETEST-ES($io.absolute) { elsif Rakudo::Internals.FILETEST-ES($io.absolute) {
return self!already-precompiled($path,$source-name,$io,0) return self!already-precompiled($path,$source-name,$io,0)
} }
# Local copy for us to tweak # Local copy for us to tweak
my $env := nqp::clone(nqp::getattr(%*ENV,Map,'$!storage')); $env := nqp::clone($env);
my $REPO := $*REPO; my $REPO := $*REPO;
nqp::bindkey($env,'RAKUDO_PRECOMP_WITH', nqp::bindkey($env,'RAKUDO_PRECOMP_WITH',
$REPO.repo-chain.map(*.path-spec).join(',') $REPO.repo-chain.map(*.path-spec).join(',')
); );
if nqp::atkey($env,'RAKUDO_PRECOMP_LOADING') -> $rpl { if $rpl {
my @modules := Rakudo::Internals::JSON.from-json: $rpl;
die "Circular module loading detected trying to precompile $path"
if $path.Str (elem) @modules;
nqp::bindkey($env,'RAKUDO_PRECOMP_LOADING', nqp::bindkey($env,'RAKUDO_PRECOMP_LOADING',
$rpl.chop $rpl.chop
~ ',' ~ ','
~ Rakudo::Internals::JSON.to-json($path.Str) ~ Rakudo::Internals::JSON.to-json($path.Str)
~ ']'); ~ ']');
} }
else { else {
nqp::bindkey($env,'RAKUDO_PRECOMP_LOADING', nqp::bindkey($env,'RAKUDO_PRECOMP_LOADING',
'[' ~ Rakudo::Internals::JSON.to-json($path.Str) ~ ']'); '[' ~ Rakudo::Internals::JSON.to-json($path.Str) ~ ']');
} }
skipping to change at line 509 skipping to change at line 514
} }
# HLLize dependencies # HLLize dependencies
my CompUnit::PrecompilationDependency::File @dependencies; my CompUnit::PrecompilationDependency::File @dependencies;
nqp::bindattr(@dependencies,List,'$!reified',$dependencies); nqp::bindattr(@dependencies,List,'$!reified',$dependencies);
my $source-checksum := $path.CHECKSUM; my $source-checksum := $path.CHECKSUM;
$!RMD("Writing dependencies and byte code to $io.tmp for source checksum : $source-checksum") $!RMD("Writing dependencies and byte code to $io.tmp for source checksum : $source-checksum")
if $!RMD; if $!RMD;
$store.store-repo-id($compiler-id, $id, :repo-id($REPO.id));
$store.store-unit( $store.store-unit(
$compiler-id, $compiler-id,
$id, $id,
$store.new-unit( $store.new-unit(
:$id, :$id,
:@dependencies :@dependencies
:$source-checksum, :$source-checksum,
:bytecode($bc.slurp(:bin)) :bytecode($bc.slurp(:bin))
), ),
); );
$bc.unlink; $bc.unlink;
$store.store-repo-id($compiler-id, $id, :repo-id($REPO.id));
$store.unlock; $store.unlock;
True True
} }
} }
# vim: expandtab shiftwidth=4 # vim: expandtab shiftwidth=4
 End of changes. 5 change blocks. 
6 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)