Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tiny performance tweaks in the parrot regex compiler
  • Loading branch information
timo committed Nov 20, 2013
1 parent af22bef commit bdbb63a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/vm/parrot/QAST/Compiler.nqp
Expand Up @@ -1381,7 +1381,7 @@ class QAST::Compiler is HLL::Compiler {
$ops.push_pirop('add', %*REG<pos>, '$I11');
}
}
$ops.push_pirop('add', %*REG<pos>, 1) unless $node.subtype eq 'zerowidth';
$ops.push_pirop('inc', %*REG<pos>) unless $node.subtype eq 'zerowidth';
$ops;
}

Expand Down Expand Up @@ -1467,13 +1467,13 @@ class QAST::Compiler is HLL::Compiler {
$ops.push_pirop('downcase', '$S10', '$S10');
$ops.push_pirop($cmpop, '$S10', $litpost, %*REG<fail>);
} elsif $litlen == 1 {
$ops.push_pirop('ord', '$I11', %*REG<tgt>, %*REG<pos>);
$ops.push_pirop($cmpop, '$I11', nqp::ord($litconst), %*REG<fail>);
$ops.push_pirop('ord', '$I12', %*REG<tgt>, %*REG<pos>);
$ops.push_pirop($cmpop, '$I12', nqp::ord($litconst), %*REG<fail>);
} else {
$ops.push_pirop('nqp_string_equal_at', '$I11', %*REG<tgt>, $litpost, %*REG<pos>);
$ops.push_pirop($cmpop, '$I11', 1, %*REG<fail>);
$ops.push_pirop('nqp_string_equal_at', '$I12', %*REG<tgt>, $litpost, %*REG<pos>);
$ops.push_pirop($cmpop, '$I12', 1, %*REG<fail>);
}
$ops.push_pirop('add', %*REG<pos>, $litlen);
$ops.push_pirop('set', %*REG<pos>, '$I11');
$ops;
}

Expand Down

0 comments on commit bdbb63a

Please sign in to comment.