Skip to content
Permalink
Browse files

Mark BEGINish blocks; get better dyncomp fix

An earlier fix for #2684 was a bit too sweeping, and resulted in a
performance regression. This fix deals more precisely with the cases
known to be problematic. Includes a bump to NQP to get a QAST compiler
that uses the new annotation.
  • Loading branch information...
jnthn committed Feb 15, 2019
1 parent 121ca5f commit 4a2124a62caafbd8b8b7364546f66158ac1c4c69
Showing with 8 additions and 3 deletions.
  1. +7 −2 src/Perl6/Actions.nqp
  2. +1 −1 tools/build/NQP_REVISION
@@ -2346,11 +2346,15 @@ class Perl6::Actions is HLL::Actions does STDActions {
}

method statement_prefix:sym<BEGIN>($/) {
begin_time_lexical_fixup($<blorst>.ast.ann('past_block'));
my $qast_block := $<blorst>.ast.ann('past_block');
begin_time_lexical_fixup($qast_block);
$qast_block.annotate('BEGINISH', 1);
make $*W.add_phaser($/, 'BEGIN', wanted($<blorst>.ast,'BEGIN').ann('code_object'));
}
method statement_prefix:sym<CHECK>($/) {
begin_time_lexical_fixup($<blorst>.ast.ann('past_block'));
my $qast_block := $<blorst>.ast.ann('past_block');
begin_time_lexical_fixup($qast_block);
$qast_block.annotate('BEGINISH', 1);
make $*W.add_phaser($/, 'CHECK', wanted($<blorst>.ast,'CHECK').ann('code_object'));
}
method statement_prefix:sym<COMPOSE>($/) { make $*W.add_phaser($/, 'COMPOSE', unwanted($<blorst>.ast,'COMPOSE').ann('code_object')); }
@@ -5197,6 +5201,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
}
else {
$con_block.push($value_ast);
$con_block.annotate('BEGINISH', 1);
my $value_thunk := $W.create_code_obj_and_add_child($con_block, 'Block');
$value := $W.handle-begin-time-exceptions($/, 'evaluating a constant', $value_thunk);
$*W.add_constant_folded_result($value);
@@ -1 +1 @@
2018.12-87-gc267ae4
2018.12-88-gb5fe910

0 comments on commit 4a2124a

Please sign in to comment.
You can’t perform that action at this time.