OSDN Git Service

Shift register index tests to static pass.
authorAndy McFadden <fadden@android.com>
Wed, 3 Nov 2010 21:32:42 +0000 (14:32 -0700)
committerAndy McFadden <fadden@android.com>
Wed, 3 Nov 2010 21:36:12 +0000 (14:36 -0700)
commit6989a1e1106e401d4f8fa8dee361de7a643af739
tree82ca059ddf3b360d9f58952663a148aea62bb5db
parenta52eb22ce0fd0f86f05c5f9d27d0b9ed7826522c
Shift register index tests to static pass.

This rather hefty change moves the range tests on register index values
from the code-flow pass to the earlier static analysis pass.  The idea
is to test everything up front so that we don't have to do a bounds
check every time we get or set a register value during verification.

This allowed some simplification in the code-flow pass, since get/set
of a register no longer needs to have the method register count passed
in, and can no longer fail due to bad input.

As part of doing this, some of the static verification code was
cleaned up, e.g. the instruction decoding is now only done in one place.

This had no apparently effect on performance on nexus one -- verify+opt
of the bootstrap classes takes the same amount of time.  However, it
does reduce the compiled size of the humongous instruction verification
method by about 10%.

Also, cleaned up some instruction format stuff (e.g. removed 3rfs).

Bug 2534655.

Change-Id: I3c2a5877bca5ddc3d794b61a46b95a7e5a3c233f
dexdump/DexDump.c
libdex/Android.mk
libdex/InstrUtils.c
libdex/InstrUtils.h
vm/analysis/CodeVerify.c
vm/analysis/DexVerify.c
vm/analysis/VerifySubs.c
vm/analysis/VerifySubs.h