Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bring back for ^N { } optimization again
  • Loading branch information
timo committed Jun 13, 2017
1 parent abfb52b commit 46b11f5
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions src/Perl6/Actions.nqp
Expand Up @@ -1377,17 +1377,14 @@ class Perl6::Actions is HLL::Actions does STDActions {
unless $past.ann('past_block') {
$past := make_topic_block_ref($/, $past, migrate_stmt_id => $*STATEMENT_ID);
}
$past := QAST::Want.new(
QAST::Op.new(
my $fornode := QAST::Op.new(
:op<p6for>, :node($/),
$cond,
block_closure($past),
),
'v', QAST::Op.new(
:op<p6for>, :node($/),
$cond,
block_closure($past),
),
);
$past := QAST::Want.new(
$fornode,
'v', QAST::Op.new(:op<p6sink>, $fornode),
);
$past[2].sunk(1);
my $sinkee := $past[0];
Expand Down Expand Up @@ -1767,17 +1764,14 @@ class Perl6::Actions is HLL::Actions does STDActions {

method statement_control:sym<for>($/) {
my $xblock := $<xblock>.ast;
my $past := QAST::Want.new(
QAST::Op.new(
my $fornode := QAST::Op.new(
:op<p6for>, :node($/),
$xblock[0],
block_closure($xblock[1]),
),
'v', QAST::Op.new(
:op<p6for>, :node($/),
$xblock[0],
block_closure($xblock[1]),
),
);
my $past := QAST::Want.new(
$fornode,
'v', QAST::Op.new(:op<p6sink>, $fornode),
);
if $*LABEL {
my $label := QAST::WVal.new( :value($*W.find_symbol([$*LABEL])), :named('label') );
Expand Down

0 comments on commit 46b11f5

Please sign in to comment.