Indeed, good catch. We also noticed it and patched it before the commit. It
now uses handles and FlattenString first, and converts to vectors when we *
know* the strings are flat.
/L
On Mon, Oct 6, 2008 at 6:25 PM, Dean McNamee <[EMAIL PROTECTED]> wrote:

> TryFlatten ignores memory allocation failures.  What happens when the
> string can't be flattened?
>
> On Mon, Oct 6, 2008 at 2:47 PM,  <[EMAIL PROTECTED]>
> wrote:
> >
> > ...and here are my comments.
> >
> >
> > http://codereview.chromium.org/6269/diff/1/5
> > File src/runtime.cc (right):
> >
> > http://codereview.chromium.org/6269/diff/1/5#newcode935
> > Line 935: for(;;) {
> > Flat strings are relatively simple in structure so it should be possible
> > to get a hold of the string contents with straight-line code.
> >
> > http://codereview.chromium.org/6269/diff/1/5#newcode1006
> > Line 1006: Vector<const schar> string,
> > This argument should be on the same line as the function header with the
> > remaining arguments below it, indented to the same level.
> >
> > http://codereview.chromium.org/6269/diff/1/5#newcode1009
> > Line 1009: for (int i = start_index, n = string.length(); i < n; i++) {
> > I would move the declaration of n out before the loop.
> >
> > http://codereview.chromium.org/6269/diff/1/5#newcode1028
> > Line 1028: for (int i = start_index, n = subject_length -
> > pattern_length; i <= n; i++) {
> > I would move the declaration of n out just before the loop.
> >
> > http://codereview.chromium.org/6269/diff/1/5#newcode1060
> > Line 1060: int length = pattern.length();
> > Isn't this identical to pattern_length?
> >
> > http://codereview.chromium.org/6269
> >
> > > >
> >
>



-- 
Lasse R.H. Nielsen
[EMAIL PROTECTED]
'Faith without judgement merely degrades the spirit divine'

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to