OSDN Git Service

Don't force optimizations during class init in dexopt.
authorAndy McFadden <fadden@android.com>
Fri, 22 Oct 2010 19:41:33 +0000 (12:41 -0700)
committerAndy McFadden <fadden@android.com>
Fri, 22 Oct 2010 19:41:33 +0000 (12:41 -0700)
commitef22d6fa4d6e574a00669a0d2058c2d7cfa463b1
tree445ad93c46c42416f9c6962e24073665feab0f7b
parente877cc41c1a5d4f577c5f6fc6bacbe388dfd1d59
Don't force optimizations during class init in dexopt.

Some "optimizations" are mandatory, notably those having to do with
access to volatile fields.  We get into an odd situation in dexopt
where we have to initialize and execute <clinit> in a few classes
(primarily Class and Object), but if optimizations are disabled we
don't want to write optimized instructions into the output DEX.

This modifies the class init code to skip the mandatory optimizations
if we're in dexopt.  Either the optimization will happen as a normal
part of dexopt operation, or it won't (in which case it'll be applied
when the class is first loaded in a normal VM).

Bug 3099161.

Change-Id: I11ee5affd5e3ac5a1e8583241acdf3c4de033a96
vm/Init.c
vm/oo/Class.c