Skip to content

Instantly share code, notes, and snippets.

View usev6's full-sized avatar

Christian Bartolomäus usev6

  • Berlin, Germany
View GitHub Profile
@usev6
usev6 / gist:9a2fde23088b755914af263175641b4c
Created September 22, 2017 06:22
Take environmental variable NQP_LIB into account when looking for BOOTSTRAP.nqp
diff --git a/src/Perl6/ModuleLoader.nqp b/src/Perl6/ModuleLoader.nqp
index 96fb7c51a..90b7fb3f0 100644
--- a/src/Perl6/ModuleLoader.nqp
+++ b/src/Perl6/ModuleLoader.nqp
@@ -49,7 +49,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
my $*CTXSAVE := self;
my $*MAIN_CTX;
my $file := 'Perl6/BOOTSTRAP' ~ self.file-extension;
- my $include := nqp::getcomp('perl6').cli-options<nqp-lib>;
+ my $include := nqp::getcomp('perl6').cli-options<nqp-lib> // nqp::atkey(nqp::getenvhash(), 'NQP_LIB');
@usev6
usev6 / gist:22cb7599839dcc3117dbe0ec68ce72e8
Created September 7, 2017 19:06
build trouble with jvm backend
1) prevent NullPointerException, happening since ed4f6cc998906ab0f868e19c19a7e66efd70a4b2
diff --git a/src/Perl6/Grammar.nqp b/src/Perl6/Grammar.nqp
index ae8e85e79..b370df8b6 100644
--- a/src/Perl6/Grammar.nqp
+++ b/src/Perl6/Grammar.nqp
@@ -253,9 +253,10 @@ role STD {
}
# core grammar also has a penchant for sending us trailing .ws contents
$stopper := $stopper // $goal;
@usev6
usev6 / gist:a3aa19f605e99c96e2b841ce24622d66
Created January 20, 2017 20:11
rakudo-j build error after 66b2fc2c3c
Stage jast : Serialization Error: could not locate static code ref for closure
in deserialization_code (gen/jvm/stage2/QAST.nqp:3586)
in as_jast (gen/jvm/stage2/QAST.nqp:3470)
in as_jast (gen/jvm/stage2/QAST.nqp:3382)
in jast (gen/jvm/stage2/QAST.nqp:3248)
in jast (gen/jvm/stage2/NQPHLL.nqp:68)
in run (gen/jvm/stage2/NQPHLL.nqp:1416)
in (gen/jvm/stage2/NQPHLL.nqp:1423)
in compile (gen/jvm/stage2/NQPHLL.nqp:1401)
in eval (gen/jvm/stage2/NQPHLL.nqp:1147)
@usev6
usev6 / gist:8a2fd8fd55bb8b2dc68d08e0f4aece9a
Created January 14, 2017 16:45
additional material for RT #130556
$ ./perl6-j --ll-exception -e '(2).combinations(0)'
java.lang.RuntimeException: This type does not support positional operations
in pull-one (gen/jvm/CORE.setting:5626)
in sink-all (gen/jvm/CORE.setting:2821)
in sink (gen/jvm/CORE.setting:17278)
in <unit> (-e:1)
in <unit-outer> (-e:1)
in eval (gen/jvm/stage2/NQPHLL.nqp:1165)
in (gen/jvm/stage2/NQPHLL.nqp:1255)
in command_eval (gen/jvm/stage2/NQPHLL.nqp:1252)
@usev6
usev6 / gist:5af8723084aa1754d7867a5e13e234f3
Created December 23, 2016 07:36
Removing some integers from constant pool
diff --git a/src/vm/jvm/QAST/Compiler.nqp b/src/vm/jvm/QAST/Compiler.nqp
index 6de7ab6..9da7b46 100644
--- a/src/vm/jvm/QAST/Compiler.nqp
+++ b/src/vm/jvm/QAST/Compiler.nqp
@@ -4822,7 +4822,14 @@ class QAST::CompilerJAST {
my $idx := nqp::scgetobjidx($sc, $val);
my $il := JAST::InstructionList.new();
$il.append(JAST::PushSVal.new( :value($handle) ));
- $il.append(JAST::PushIndex.new( :value($idx) ));
+ if $idx >= 32768 {
@usev6
usev6 / gist:78beac8113b8a54cf02acba66c3cd68f
Last active October 18, 2016 13:21
Hunting UnwindExceptions
We couldn’t find that file to show.
@usev6
usev6 / gist:8d8f77399587404afb6b555134ac479f
Created September 27, 2016 21:34
half-revert 222d16b0b9
diff --git a/src/core/Exception.pm b/src/core/Exception.pm
index d7e2957..ee6f29b3 100644
--- a/src/core/Exception.pm
+++ b/src/core/Exception.pm
@@ -276,6 +276,15 @@ sub EXCEPTION(|) {
elsif $type == nqp::const::CONTROL_RETURN {
$ex := CX::Return.new();
}
+#?if !moar
+ elsif !nqp::isnull_s(nqp::getmessage($vm_ex)) &&
@usev6
usev6 / gist:9d68c9dcf6b139d8147ec0cf299b1450
Last active August 8, 2016 21:57
rakudo-j: spectests start to fail after integration/advent2014-day05.t
For some reasons somewhere between rakudo commits 715b822 and 0de1391 all test files after integration2014-day05.t
started to fail on rakudo-j during my daily spectest runs. Running those test files manually works as expected.
I somehow suspect not the tests themselve, but the evalserver (or the communication with it) causes the failures.
[...]
integration/advent2013-day21.t..................... 24 0 0 0 24
integration/advent2013-day22.t..................... 9 0 0 0 9
integration/advent2013-day23.t..................... 9 0 0 0 9
integration/advent2014-day05.rakudo.jvm............ 6 0 0 1 7
@usev6
usev6 / gist:aac530b87dd24c0261e257b75c7ceaf5
Last active July 15, 2016 22:19
Avoid tpye check error 'expected Positional but got Seq' on rakudo-j
$ ./perl6-j -e 'sub foo (@a) { say @a.perl }; my $foo = gather { take 2; take 4 }; foo($foo)'
Type check failed in binding @a; expected Positional but got Seq ((2, 4).Seq)
in sub foo at -e line 1
in block <unit> at -e line 1
$ vim src/vm/jvm/runtime/org/perl6/rakudo/Binder.java
$ git diff
diff --git a/src/vm/jvm/runtime/org/perl6/rakudo/Binder.java b/src/vm/jvm/runtime/org/perl6/rakudo/Binder.java
index d46ede9..c574c52 100644
--- a/src/vm/jvm/runtime/org/perl6/rakudo/Binder.java
@usev6
usev6 / gist:db5153f6b17a89078ebcb8ed4c44bddc
Created July 11, 2016 19:35
rename does not overwrite existing file on JVM
$ > Foo.pm6; ./perl6-j -I. -e 'use Foo; say "alive"'
alive
$ > Foo.pm6; ./perl6-j -I. -e 'use Foo; say "alive"'
===SORRY!===
Failed to rename '/usr/home/christian/perl6/perl6-roast-data/rakudo.jvm/.precomp/54B30A4BDF363852FC8D6905165A5E0131320458.1.468265383996E9/77/7795C5BD3D21241ED31BB5DB19106B21CC622A86.tmp' to '/usr/home/christian/perl6/perl6-roast-data/rakudo.jvm/.precomp/54B30A4BDF363852FC8D6905165A5E0131320458.1.468265383996E9/77/7795C5BD3D21241ED31BB5DB19106B21CC622A86': File /usr/home/christian/perl6/perl6-roast-data/rakudo.jvm/.precomp/54B30A4BDF363852FC8D6905165A5E0131320458.1.468265383996E9/77/7795C5BD3D21241ED31BB5DB19106B21CC622A86 already exists
$ > Foo.pm6; RAKUDO_MODULE_DEBUG=1 ./perl6-j -I. -e 'use Foo'
87032 RMD: Loading settings CORE
87032 RMD: Setting up default paths: . blib