drive-by-comment

http://codereview.chromium.org/9065008/diff/1/src/math.js
File src/math.js (right):

http://codereview.chromium.org/9065008/diff/1/src/math.js#newcode130
src/math.js:130: return (arg1 === 0 && !%_IsSmi(arg1) && 1 / arg1 < 0) ?
arg2 : arg1;
You can drop the 1/arg1 test, and actually also the '=== 0' test.
How about just:
  return %_IsSmi(arg1) ? arg1 : arg2;
You already know that the values are equal, so just pick the best one
(the smi), which also works out to what you want for 0/-0.

http://codereview.chromium.org/9065008/diff/1/src/math.js#newcode163
src/math.js:163: return (arg1 === 0 && !%_IsSmi(arg1) && 1 / arg1 < 0) ?
arg1 : arg2;
Here you want to return the non-smi if the values are zero. Otherwise
you'd probably want the smi:
  return ((arg1 === 0) != (%_IsSmi(arg1))) ? arg1 : arg2;

http://codereview.chromium.org/9065008/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to