Created
June 5, 2016 13:10
-
-
Save niner/c49899d7912bc3699211b28efbc8c0b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/CompUnit/PrecompilationRepository.pm b/src/core/CompUnit/PrecompilationRepository.pm | |
index 8fb1ee4..f911b3e 100644 | |
--- a/src/core/CompUnit/PrecompilationRepository.pm | |
+++ b/src/core/CompUnit/PrecompilationRepository.pm | |
@@ -209,7 +209,7 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR | |
"--source-name=$source-name", | |
$path, | |
:out, | |
- :err, | |
+ #:err, | |
); | |
%ENV.DELETE-KEY(<RAKUDO_PRECOMP_WITH>); | |
%ENV.DELETE-KEY(<RAKUDO_PRECOMP_LOADING>); | |
@@ -219,13 +219,14 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR | |
if not $proc.out.close or $proc.status { # something wrong | |
self.store.unlock; | |
$RMD("Precomping $path failed: $proc.status()") if $RMD; | |
- Rakudo::Internals.VERBATIM-EXCEPTION(1); | |
- die $proc.err.slurp-rest; | |
+ die @result; | |
+ #Rakudo::Internals.VERBATIM-EXCEPTION(1); | |
+ #die $proc.err.slurp-rest; | |
} | |
- if $proc.err.slurp-rest -> $warnings { | |
- $*ERR.print($warnings); | |
- } | |
+ #if $proc.err.slurp-rest -> $warnings { | |
+ # $*ERR.print($warnings); | |
+ #} | |
unless $bc.e { | |
$RMD("$path aborted precompilation without failure") if $RMD; | |
self.store.unlock; | |
diff --git a/src/core/CompUnit/PrecompilationStore/File.pm b/src/core/CompUnit/PrecompilationStore/File.pm | |
index bce07e1..03aed59 100644 | |
--- a/src/core/CompUnit/PrecompilationStore/File.pm | |
+++ b/src/core/CompUnit/PrecompilationStore/File.pm | |
@@ -37,8 +37,26 @@ class CompUnit::PrecompilationStore::File does CompUnit::PrecompilationStore { | |
} | |
method bytecode(--> Buf) { | |
+# #?if !jvm | |
self!read-dependencies; | |
$!bytecode //= $!file.slurp-rest(:bin) | |
+# #?endif | |
+##?if jvm | |
+# # this can go once mixing get() and slurp-rest(:bin) on the JVM works | |
+# $!file.seek(0); | |
+# my $buf = $!file.slurp-rest(:bin); | |
+# #my $buf = $!path.slurp(:bin); | |
+# my int $elems = $buf.elems; | |
+# my int $start = 0; | |
+# my $prev = 0x0a; | |
+# loop (my int $i = 0; $i < $elems; $i++) { | |
+# if $prev == 0x0a and $buf[$i] == 0x0a { | |
+# $start = $i; | |
+# last; | |
+# } | |
+# } | |
+# $!bytecode = $buf.subbuf($start + 1); | |
+##?endif | |
} | |
method bytecode-handle(--> IO::Handle) { | |
diff --git a/src/core/control.pm b/src/core/control.pm | |
index ff4980f..c43a732 100644 | |
--- a/src/core/control.pm | |
+++ b/src/core/control.pm | |
@@ -211,7 +211,9 @@ proto sub EVAL(Cool $code, Str() :$lang = 'perl6', PseudoStash :$context, *%n) { | |
} | |
my $eval_ctx := nqp::getattr(nqp::decont($context // CALLER::), PseudoStash, '$!ctx'); | |
my $?FILES := 'EVAL_' ~ (state $no)++; | |
- my \mast_frames := nqp::hash(); | |
+ my \mast_frames := ($*W and $*W.is_precompilation_mode() and %*COMPILING<%?OPTIONS><mast_frames>) | |
+ ?? %*COMPILING<%?OPTIONS><mast_frames> | |
+ !! nqp::hash(); | |
my $compiled := $compiler.compile( | |
$code.Stringy, | |
:outer_ctx($eval_ctx), | |
diff --git a/tools/build/Makefile-JVM.in b/tools/build/Makefile-JVM.in | |
index 8ee5863..2d6f436 100644 | |
--- a/tools/build/Makefile-JVM.in | |
+++ b/tools/build/Makefile-JVM.in | |
@@ -399,9 +399,9 @@ j-install: j-all tools/build/create-jvm-runner.pl tools/build/install-core-dist. | |
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/site/short | |
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/site/precomp | |
echo 1 > $(DESTDIR)$(PERL6_LANG_DIR)/site/version | |
- .@slash@$(J_RUNNER) tools/build/install-core-dist.pl $(DESTDIR)$(PERL6_LANG_DIR) | |
$(PERL5) tools/build/create-jvm-runner.pl install "$(DESTDIR)" $(PREFIX) $(NQP_PREFIX) $(NQP_JARS) | |
$(PERL5) tools/build/create-jvm-runner.pl install-debug "$(DESTDIR)" $(PREFIX) $(NQP_PREFIX) $(NQP_JARS) | |
+ .@slash@$(J_RUNNER) tools/build/install-core-dist.pl $(DESTDIR)$(PERL6_LANG_DIR) | |
j-runner-default-install: j-install | |
$(PERL5) tools/build/create-jvm-runner.pl install "$(DESTDIR)" $(PREFIX) $(NQP_PREFIX) $(NQP_JARS) | |
diff --git a/tools/build/Makefile-Moar.in b/tools/build/Makefile-Moar.in | |
index 8c721ed..880b245 100644 | |
--- a/tools/build/Makefile-Moar.in | |
+++ b/tools/build/Makefile-Moar.in | |
@@ -288,10 +288,10 @@ m-install: m-all tools/build/create-moar-runner.pl tools/build/install-core-dist | |
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/site/short | |
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/site/precomp | |
echo 1 > $(DESTDIR)$(PERL6_LANG_DIR)/site/version | |
- .@slash@$(M_RUNNER) tools/build/install-core-dist.pl $(DESTDIR)$(PERL6_LANG_DIR) | |
$(PERL5) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm $(DESTDIR)$(PREFIX)/bin/perl6-m "$(PERL6_LANG_DIR)/runtime" "" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime" | |
$(PERL5) tools/build/create-moar-runner.pl "$(MOAR)" perl6-debug.moarvm $(DESTDIR)$(PREFIX)/bin/perl6-debug-m "$(PERL6_LANG_DIR)/runtime" "" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime" | |
$(CHMOD) 755 $(DESTDIR)$(PREFIX)/bin/perl6-m$(M_BAT) | |
+ .@slash@$(M_RUNNER) tools/build/install-core-dist.pl $(DESTDIR)$(PERL6_LANG_DIR) | |
@m_install@ | |
m-runner-default-install: m-install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment