e174a4c18e
The IsPowerOfTwo function is used together with ShiftForPowerOfTwo. Both function do not work with zero. This caused the optimizing compiler to generate invalid code for the expression x ? 0 : 0 where it assumed that if one of the constants is a power-of-two, it can be computed by (1 << n). We check for 0 in a number of places, but instead I decided to fix Utils::IsPowerOfTwo itself and remove unnecessary checks for the zero case. TEST=tests/language/vm/if_conversion_vm_test.dart, runtime/vm/utils_test.cc R=kmillikin@google.com Review URL: https://codereview.chromium.org//23604024 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27033 260f80e4-7a28-3924-810f-c04153c831b5