Updates:
Status: Accepted
Cc: svenpa...@chromium.org jkumme...@chromium.org
Comment #1 on issue 3813 by svenpa...@chromium.org: v8 fails to learn types
of bit twiddly function and deopts all over the place
https://code.google.com/p/v8/issues/detail?id=3813
We had a quick look at this, and it turns out to be an example of something
fundamental. We deopt at 'lowBits > 127' (the tagged-to-i part of it),
because we decided to do this comparison on Smis. Why Smis? Because we have
seen only Smi-valued lowBits so far when we evaluate the right side of the
disjunction 'highBits > 0 || lowBits > 127'. Alas, this turns out to be too
optimistic for the optimized code later, so we deopt. But there is no
mechanism to learn from deopts, so we do the same wrong decisions over and
over again until we give up.
There is a solution ("no-op ICs") to learn something from e.g. variables or
return values from functions which are not inlined. We discussed this
already several times for several years, but there has been no definite
outcome so far. TurboFan won't do any better (when it's able to handle full
JS) BTW for the same reasons, so at some point we need to do something
about that, so I'll leave this issue open.
As a quick fix, you could give the type feedback system a helping hand by
adding 'lowBits -= 0;' as the first instruction in the body of writeVarInt.
This will collect enough information to do the relevant operations on
doubles, but it won't be present in optimized code.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.