Skip to content
Permalink
Browse files

Poison lowering if we see a quasi quote

It might refer to variables outside of itself, and we can't yet easily
track if that is the case. Macros are used very little, and will
probably be completely re-done based on the 007 work, so for now just do
the easiest thing possible to fix things like OO::Monitors that make use
of them.
  • Loading branch information...
jnthn committed Jan 4, 2019
1 parent 17bf741 commit 8aa733062b58913f6bbc22def2c4862cb613fb70
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/Perl6/Optimizer.nqp
@@ -35,6 +35,7 @@ my class Symbols {
has $!Nil;
has $!Failure;
has $!Seq;
has $!AST;
has $!LoweredAwayLexical;

# Top routine, for faking it when optimizing post-inline.
@@ -64,6 +65,7 @@ my class Symbols {
$!Nil := self.find_lexical('Nil');
$!Failure := self.find_lexical('Failure');
$!Seq := self.find_lexical('Seq');
$!AST := self.find_lexical('AST');
$!LoweredAwayLexical := self.find_symbol(['Rakudo', 'Internals', 'LoweredAwayLexical']);
nqp::pop(@!block_stack);
}
@@ -108,6 +110,7 @@ my class Symbols {
method Nil() { $!Nil }
method Failure() { $!Failure }
method Seq() { $!Seq }
method AST() { $!AST }
method LoweredAwayLexical() { $!LoweredAwayLexical }

# The following function is a nearly 1:1 copy of World.find_symbol.
@@ -2836,6 +2839,9 @@ class Perl6::Optimizer {
elsif nqp::istype($visit.value, $!symbols.Regex) {
@!block_var_stack[@!block_var_stack - 1].poison_topic_lowering();
}
elsif nqp::istype($visit.value, $!symbols.AST) {
@!block_var_stack[@!block_var_stack - 1].poison_lowering();
}
}
elsif nqp::istype($visit, QAST::ParamTypeCheck) {
self.optimize-param-typecheck: $visit;

0 comments on commit 8aa7330

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