Comment #4 on issue 3951 by [email protected]: Joining large array
causes fatal error.
https://code.google.com/p/v8/issues/detail?id=3951
#1: This is not a regression.
The fast path for Array.join requires (among other things) that the result
fit into new space, which is obviously not the case for a 50M string.
The slow path copies the elements to a temporary array first (which is
unnecessary in this case, but is done because some elements might have to
be converted to strings first). This temporary array is created as "new
InternalArray(length);", which for huge lengths creates a dictionary mode
array. As we grow this dictionary to accomodate all the elements, we hit an
OOM.
The best fix is probably to make sure the temporary internal array is
created in fast mode -- either by making that the default for
InternalArray, or by introducing some form of per-callsite choice mechanism
(a constructor flag or something).
That said, at the end of the day, there's always going to be a limit to the
maximum array length that can be join()ed, and to the maximum string length
that can be created (through any means).
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.