https://codereview.chromium.org/1321773002/diff/60001/src/builtins.cc
File src/builtins.cc (left):

https://codereview.chromium.org/1321773002/diff/60001/src/builtins.cc#oldcode294
src/builtins.cc:294:
On 2015/08/31 at 10:42:51, Igor Sheludko wrote:
Spurious change.

I moved everything in to an anonymous namespace, where static is no
longer needed (I was told ;)

https://codereview.chromium.org/1321773002/diff/60001/src/builtins.cc
File src/builtins.cc (right):

https://codereview.chromium.org/1321773002/diff/60001/src/builtins.cc#newcode551
src/builtins.cc:551: if (!ClampedToInteger(args[1], &relative_start)) {
On 2015/08/31 at 10:42:51, Igor Sheludko wrote:
I think clamping could be wrong if we ever have a fast array larger
than kMaxInt. In this case slice(NaN) and slice(kMinInt-1) would produce
wrong results.
What about renaming it to something else and use the old logic for
IsHeapNumber() case.

I agree that the name ClampedToInteger is not a good name... will
certainly change it.
1. slice(NaN) will produce the correct result as NaN is mapped to 0
(according to spec)
2. MinInt-1 would be represented as a double which is out of int range,
hence ClampedToInteger would map it to kMinInt. Given that the length of
a FastArray is a signed Smi we have enough room to do proper range
checks. Since: relative_start = kMinInt - 1 = kMinInt. len is in [0,
Smi::kMaxValue].

https://codereview.chromium.org/1321773002/

--
--
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.

Reply via email to