Permalink
Browse files

Hack - direct references to &eval disable block inlining

  • Loading branch information...
1 parent b84eb2d commit a84439204e83a64dbf3a3cbcad2533e3b9566a49 @sorear committed Jun 1, 2011
Showing with 13 additions and 0 deletions.
  1. +12 −0 src/NieczaPassBegin.pm6
  2. +1 −0 t/spectest.data
View
@@ -158,6 +158,12 @@ augment class Op::Use { #OK exist
augment class Op::Lexical { #OK exist
method begin() {
+ # HACK - a direct reference to &eval or .eval prevents inlining
+ if $.name eq '&eval' {
+ loop (my $c = @*opensubs[*-1]; $c.unit === $*unit; $c = $c.outer) {
+ $c.strong_used = True;
+ }
+ }
my $typeconstraint = $.typeconstraint;
if $typeconstraint {
$typeconstraint = $*unit.get_item(
@@ -175,6 +181,12 @@ augment class Op::Lexical { #OK exist
augment class Op::CallMethod { #OK exist
method begin() {
+ # HACK - a direct reference to &eval or .eval prevents inlining
+ if $.name ~~ Str && $.name eq 'eval' {
+ loop (my $c = @*opensubs[*-1]; $c.unit === $*unit; $c = $c.outer) {
+ $c.strong_used = True;
+ }
+ }
for self.zyg { $_.begin } # XXX callsame
if $.private {
if $.ppath {
View
@@ -13,6 +13,7 @@ S02-builtin_data_types/nested_pairs.t
S02-builtin_data_types/parsing-bool.t
S02-builtin_data_types/subscripts_and_context.t
S02-lexical-conventions/unicode.t
+S02-literals/hash-interpolation.t
S02-literals/pair-boolean.t
S02-literals/string-interpolation.t
S02-literals/types.t

0 comments on commit a844392

Please sign in to comment.