http://codereview.chromium.org/470001/diff/4001/4002 File src/math.js (right):
http://codereview.chromium.org/470001/diff/4001/4002#newcode132 src/math.js:132: if (n > r || (r === 0 && n === 0 && !%_IsSmi(r))) r = n; Interesting point. Considering that almost all calls are 2 argument calls, probably not worth the code bloat to 'avoid' doing work in the single iteration. On 2009/12/08 00:37:21, William Hesse wrote: > The only way this can give a wrong -0 answer is if the last 0 is -0 and there is > a +0. Maybe the single test (!%_IsSmi(r) && r === 0) after the loop is faster, > going to a search for +0 if it fails. It might not be worth it, but if -0 is > rare we don't need to test for on every iteration. This is only possibly worth > it on Max, not Min. http://codereview.chromium.org/470001 -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
