(2014/08/11 22:37), P8 wrote:
> So that means V8 actually performs additional value checks (or
> conditions based on the flags register or something) under the surface
> after all such math operations? So that the machine code it compiles has
> conditional branches based on overflow?

Actually not "all". For example in

  funciont add1(a, b) { return a + b; }

  function add2(a, b) { return (a + b) | 0; }

add2() doesn't have the overflow check. All what I tried to say is that
add1() still returns SMI if the result falls in the SMI range.

I guess you can try to eliminate overflow checks with an approach like
add2 but I would not put that on top of my priority :) (Also, in this
particular example add2 might actually be slower for other reasons.)


Cheers,
Kenny

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" 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