From 131d253a20e9cc50daca6ff084a67ace3d4d89d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bartolom=C3=A4us?= Date: Sun, 29 Dec 2019 22:22:33 +0100 Subject: [PATCH] [JVM] Restore old implementation of 'lazy gather' The performance optimization of 971174f4d8 broke things on the JVM backend. This is a known problem with nqp::null getting HLLized showing up again -- cmp. https://github.com/rakudo/rakudo/issues/1613 --- src/core.c/Rakudo/Iterator.pm6 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core.c/Rakudo/Iterator.pm6 b/src/core.c/Rakudo/Iterator.pm6 index f3a3d91e4ed..e5912927682 100644 --- a/src/core.c/Rakudo/Iterator.pm6 +++ b/src/core.c/Rakudo/Iterator.pm6 @@ -2234,17 +2234,29 @@ class Rakudo::Iterator { } method pull-one() is raw { +#?if !jvm nqp::ifnull( $!iterator, $!iterator := $!iterable.iterator ).pull-one +#?endif +#?if jvm + $!iterator := $!iterable.iterator unless $!iterator.DEFINITE; + $!iterator.pull-one +#?endif } method push-exactly(\target, int $n) { +#?if !jvm nqp::ifnull( $!iterator, $!iterator := $!iterable.iterator ).push-exactly(target, $n); +#?endif +#?if jvm + $!iterator := $!iterable.iterator unless $!iterator.DEFINITE; + $!iterator.push-exactly(target, $n); +#?endif } method is-lazy(--> True) { }