Skip to content

Commit

Permalink
Update call to !cursor_start in code-gen.
Browse files Browse the repository at this point in the history
No measurable performane change.
  • Loading branch information
jnthn committed Feb 11, 2013
1 parent b555f7f commit ff1a336
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/QAST/Compiler.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ class QAST::Compiler is HLL::Compiler {
my %*REG;

# build the list of (unique) registers we need
my $reglist := nqp::split(' ', 'tgt string pos int off int eos int rep int cur pmc curclass pmc bstack pmc cstack pmc');
my $reglist := nqp::split(' ', 'start pmc tgt string pos int off int eos int rep int cur pmc curclass pmc bstack pmc cstack pmc');
while $reglist {
my $reg := nqp::shift($reglist);
my $name := %*REG{$reg} := $prefix ~ $reg;
Expand All @@ -1086,8 +1086,13 @@ class QAST::Compiler is HLL::Compiler {
%*REG<fail> := $faillabel;

# common prologue
my $startreg := '(' ~ nqp::join(', ', [%*REG<cur>, %*REG<tgt>, %*REG<pos>, %*REG<curclass>, %*REG<bstack>, '$I19']) ~ ')';
$ops.push_pirop('callmethod', '"!cursor_start"', 'self', :result($startreg));
$ops.push_pirop('callmethod', '"!cursor_start_all"', 'self', :result(%*REG<start>));
$ops.push_pirop('set', %*REG<cur>, %*REG<start> ~ '[0]');
$ops.push_pirop('set', %*REG<tgt>, %*REG<start> ~ '[1]');
$ops.push_pirop('set', %*REG<pos>, %*REG<start> ~ '[2]');
$ops.push_pirop('set', %*REG<curclass>, %*REG<start> ~ '[3]');
$ops.push_pirop('set', %*REG<bstack>, %*REG<start> ~ '[4]');
$ops.push_pirop('set', '$I19', %*REG<start> ~ '[5]');
$ops.push_pirop('store_lex', 'unicode:"$\x{a2}"', %*REG<cur>);
$ops.push_pirop('length', %*REG<eos>, %*REG<tgt>);
$ops.push_pirop('eq', '$I19', 1, $restartlabel);
Expand Down

0 comments on commit ff1a336

Please sign in to comment.