Skip to content

Commit

Permalink
Access register allocator via compiler instance
Browse files Browse the repository at this point in the history
This saves a lot of dynamic variable lookups, which are relatively
costly.
  • Loading branch information
jnthn committed Sep 6, 2021
1 parent 6641cc2 commit b07e568
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 102 deletions.
2 changes: 1 addition & 1 deletion src/vm/moar/NQP/Ops.nqp
Expand Up @@ -109,7 +109,7 @@ $ops.add_hll_op('nqp', 'falsey', -> $qastcomp, $op {
nqp::die('falsey op requires one child');
}
my $val := $qastcomp.as_mast($op[0]);
my $regalloc := $*REGALLOC;
my $regalloc := $qastcomp.regalloc;
if $val.result_kind == $MVM_reg_int64 {
my $not_reg := $regalloc.fresh_register($MVM_reg_int64);
MAST::Op.new(:op<not_i>, $not_reg, $val.result_reg);
Expand Down

0 comments on commit b07e568

Please sign in to comment.