[pmc]:  Fix the 'lineof' method of CodeString to be friendlier to utf8. Although the 'lineof' method in CodeString did some memoizing to be able to optimize future searches, the optimization was only helpful for fixed-width string encodings.  For utf8, the net result was to nearly always have to do a scan from the beginning of the string, which quickly becomes an O(n**2) operation. This change CodeString so that the first execution of 'lineof' caches a FixedIntegerArray of all line starting positions in the CodeString.  Subsequent requests for line numbers during codegen then become much faster -- for Rakudo-ng it reduces a  previously 150-second compile of Actions.pm to under 15 seconds.
[pmc]:  Fix the 'lineof' method of CodeString to be friendlier to utf8.
Although the 'lineof' method in CodeString did some memoizing to
be able to optimize future searches, the optimization was only
helpful for fixed-width string encodings.  For utf8, the net
result was to nearly always have to do a scan from the beginning
of the string, which quickly becomes an O(n**2) operation.
This change CodeString so that the first execution of 'lineof'
caches a FixedIntegerArray of all line starting positions in
the CodeString.  Subsequent requests for line numbers during
codegen then become much faster -- for Rakudo-ng it reduces a 
previously 150-second compile of Actions.pm to under 15 seconds.


git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@42350 d31e2699-5ff4-0310-a27c-f18f2fbe73fe

youprofit/parrot,tewk/parrot-select,youprofit/parrot,tkob/parrot,tkob/parrot,gitster/parrot,fernandobrito/parrot,youprofit/parrot,tewk/parrot-select,tewk/parrot-select,youprofit/parrot,youprofit/parrot,FROGGS/parrot,gagern/parrot,gitster/parrot,FROGGS/parrot,tkob/parrot,tewk/parrot-select,tkob/parrot,FROGGS/parrot,fernandobrito/parrot,fernandobrito/parrot,youprofit/parrot,gitster/parrot,tkob/parrot,youprofit/parrot,parrot/parrot,gagern/parrot,tkob/parrot,parrot/parrot,fernandobrito/parrot,tewk/parrot-select,gagern/parrot,parrot/parrot,FROGGS/parrot,tewk/parrot-select,gitster/parrot,youprofit/parrot,gagern/parrot,FROGGS/parrot,FROGGS/parrot,parrot/parrot,gagern/parrot,fernandobrito/parrot,gitster/parrot,tewk/parrot-select,fernandobrito/parrot,FROGGS/parrot,parrot/parrot,gitster/parrot,tkob/parrot,fernandobrito/parrot,FROGGS/parrot,gagern/parrot,gagern/parrot,tkob/parrot,gitster/parrot