Speed-up for apps that use Dagger on ART

This is more of a harm-free heuristic improvement than a fix.
It rearranges the algorithm for determining whether a Field
(or Constructor/Method) is annotated. A cheap check (does the
Field/Method/Constructor has any annotations at all?) is pushed
ahead of a more expensive one (If the annotation were to be
present, what would its type index be?). This happens to work
well in practice in sample apps because the cheap check often
fails, allowing the algorithm to terminate earlier.

The second change is to skip() the field information
rather than to read each field in turn when looking for Method
or Constructor annotation information.

The second change is not a hotspot but looks like an easy
optimization that avoids many small method calls and a for
loop for little additional complexity.

Change-Id: I2118d650f2f1db4e103384483684306e42809093
1 file changed