OSDN Git Service

Emit return-void-barrier when appropriate.
authorAndy McFadden <fadden@android.com>
Mon, 13 Sep 2010 21:04:02 +0000 (14:04 -0700)
committerAndy McFadden <fadden@android.com>
Mon, 13 Sep 2010 23:08:27 +0000 (16:08 -0700)
commit3f4b63f47f50f200538e83fa3fac06947afa08b4
tree6015698317488b7fb76e85d031e91f92bb25813d
parentbbb4405532faee06fa63b37e0c64c75633c06f3a
Emit return-void-barrier when appropriate.

If SMP is enabled, and we're optimizing a constructor, and the
class in question has final fields, we replace all occurrences of
"return-void" with "return-void-barrier".

This is an "essential" optimization for SMP, meaning it will be done
regardless of the verification/optimization settings.

Also, split the updateCode() helper function into two versions (one
to update the whole 16-bit code unit, one to replace just the opcode).

Also, make the presence of a duplicate class in the bootstrap class
path a failure for optimization as well as verification.  Otherwise,
if you have "-Xdexopt:all", you could end up trying to optimize a
class loaded from a bootstrap DEX file, which doesn't work well
since those classes are mapped read-only in dexopt.

Bug 2965743.

Change-Id: I29e67133731b59beb6af5003f3cd69302c5c20f5
vm/analysis/DexPrepare.c
vm/analysis/Optimize.c