Permalink
Browse files

Update call to !cursor_start in code-gen.

No measurable performane change.
  • Loading branch information...
1 parent b555f7f commit ff1a3367875f86d7e6afa417ab207e09366df699 @jnthn jnthn committed Feb 11, 2013
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/QAST/Compiler.nqp
View
@@ -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;
@@ -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);

0 comments on commit ff1a336

Please sign in to comment.