OSDN Git Service

Treat some right shifts as narrowing conversions.
authorAndy McFadden <fadden@android.com>
Fri, 12 Jun 2009 14:26:17 +0000 (07:26 -0700)
committerAndy McFadden <fadden@android.com>
Mon, 15 Jun 2009 23:17:03 +0000 (16:17 -0700)
commit80d25ea84b6fa9342f1432a07ba0d0612ff72e48
tree2e3802764aac1c9278e5f9dec8337e00c702c59b
parent042002aab6d0cc744d65a4a788aa0e2597a193a8
Treat some right shifts as narrowing conversions.

Java bytecode optimizers like ProGuard will remove explicit integer
width conversions from certain sequences.  For example, after
right-shifting an integer 24 times, an int-to-byte instruction is
redundant.

This change teaches the verifier that right shifts sometimes reduce
(or at least don't increase) the width of an integer.  Previously, the
result of a right shift was always a full-sized int.
vm/analysis/CodeVerify.c