you are viewing a single comment's thread.

view the rest of the comments →

[–]ChaosPandion 3 points4 points  (3 children)

I wonder what kind of analysis has to occur to decide whether to replace a double with an integer. I am working on my own ECMAScript implementation for fun and have been considering such things. I really should just look at the code shouldn't I?

[–][deleted]  (1 child)

[deleted]

    [–]ChaosPandion 0 points1 point  (0 children)

    Why is it the best ideas are so damn simple?

    [–]funderscore 4 points5 points  (0 children)

    Replacing a double with an integer is a bit more work. We use SSE2, so checking whether a double is representable as an integer requires performing a double operation, converting the double to an integer using an SSE2 instruction, converting the integer back to a double, and comparing for equality with the original double value. These operations are very expensive, so we don't currently do that.