On Tue, Jan 3, 2012 at 09:59, <[email protected]> wrote: > I implemented %_IsMinusZero for non-crankshaft, and running without > crankshaft > there seems to be no visible difference, so I guess this is not worth > implementing (there is a lot more work involved in crankshaft, too).
Well, that's good. I guess -0 happens fairly rarely too, and the IsSmi check catches most the Smi zeros. /L > > On 2012/01/03 07:57:48, Lasse Reichstein wrote: >> >> 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; >> Ignore that. If you have +0 as a HeapNumber, that approach isn't enough, >> and > > you >> >> do need to do the division. >> We could consider creating a %_IsMinusZero predicate to avoid the >> arithmetic. > > >> 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; >> Same problem here if +0 and -0 both are non-smi, so ariginal code is >> correct. > > > > > http://codereview.chromium.org/9065008/ -- Lasse R.H. Nielsen [email protected] 'Faith without judgement merely degrades the spirit divine' Google Denmark ApS - Frederiksborggade 20B, 1 sal - 1360 København K - Denmark - CVR nr. 28 86 69 84 -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
