I would prefer replacing the BackingStore::cast call with
BackingStore::castOrEmptyFixedArray. Currently castOrEmptyFixedArray only
exists
for FixedDoubleArray, but you can introduce them for the other backing
stores as
well. Either that, or we postpone casting to the explicit type until we are
far
enough down the line to know which path we are in; and/or if the array may
be
empty.
Shortcutting for the empty_fixed_array is just too error-prone. I just
fixed 3
(~one year old) bugs related to prematurely shortcutting on empty arrays.
If other places in the code explicitly check for empty_fixed_array, we
should
probably replace them as well at some point.
https://codereview.chromium.org/11299190/
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev