Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Be sure to use line info cache.
  • Loading branch information
jnthn committed Feb 27, 2013
1 parent b10e2ba commit c2910e2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -1402,7 +1402,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
}
if $past.name() eq '$?LINE' {
$past := $*W.add_constant('Int', 'int',
HLL::Compiler.lineof($/.orig, $/.from ));
HLL::Compiler.lineof($/.orig, $/.from, :cache(1)));
}
else {
$past := $*W.add_string_constant(pir::find_caller_lex__Ps('$?FILES') // '<unknown file>');
Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/Grammar.pm
Expand Up @@ -3326,7 +3326,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {

sub push_lines(@target, @pos) {
for @pos {
nqp::push(@target, HLL::Compiler.lineof(self.orig, $_));
nqp::push(@target, HLL::Compiler.lineof(self.orig, $_, :cache(1)));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/Optimizer.pm
Expand Up @@ -781,7 +781,7 @@ class Perl6::Optimizer {

method add_memo($past_node, $message, @extras?, :$type!) {
my $mnode := $past_node.node;
my $line := HLL::Compiler.lineof($mnode.orig, $mnode.from);
my $line := HLL::Compiler.lineof($mnode.orig, $mnode.from, :cache(1));
my $key := $message ~ (+@extras ?? "\n" ~ nqp::join("\n", @extras) !! "");
my %cont := $type eq 'deadly' ?? %!deadly !! %!worrying;
unless %cont{$key} {
Expand Down
6 changes: 3 additions & 3 deletions src/Perl6/World.pm
Expand Up @@ -332,7 +332,7 @@ class Perl6::World is HLL::World {
# during the deserialization.
method load_module($/, $module_name, $cur_GLOBALish) {
# Immediate loading.
my $line := HLL::Compiler.lineof($/.orig, $/.from);
my $line := HLL::Compiler.lineof($/.orig, $/.from, :cache(1));
my $module := Perl6::ModuleLoader.load_module($module_name, $cur_GLOBALish, :$line);

# During deserialization, ensure that we get this module loaded.
Expand Down Expand Up @@ -2384,7 +2384,7 @@ class Perl6::World is HLL::World {
}

# Build and throw exception object.
%opts<line> := HLL::Compiler.lineof($c.orig, $c.pos);
%opts<line> := HLL::Compiler.lineof($c.orig, $c.pos, :cache(1));
%opts<modules> := p6ize_recursive(@*MODULES);
%opts<pre> := @locprepost[0];
%opts<post> := @locprepost[1];
Expand Down Expand Up @@ -2473,7 +2473,7 @@ class Perl6::World is HLL::World {
$p6ex.SET_FILE_LINE(
nqp::box_s(pir::find_caller_lex__Ps('$?FILES'),
self.find_symbol(['Str'])),
nqp::box_i(HLL::Compiler.lineof($/.orig, $/.from),
nqp::box_i(HLL::Compiler.lineof($/.orig, $/.from, :cache(1)),
self.find_symbol(['Int'])),
);
}
Expand Down

0 comments on commit c2910e2

Please sign in to comment.