diff options
| author | 2014-10-16 15:41:48 +0100 | |
|---|---|---|
| committer | 2014-10-27 10:04:25 +0000 | |
| commit | 66c6d7bdfdd535e6ecf4461bba3804f1a7794fcd (patch) | |
| tree | 178908b5c657241305f99aa44949427c18d1900a /compiler/driver/compiler_driver.cc | |
| parent | 1ef3495abfa2a858b3cc7a1844383c8e7dff0b60 (diff) | |
Rewrite class initialization check elimination.
Split the notion of type being in dex cache away from the
class being initialized. Include static invokes in the class
initialization elimination pass.
Change-Id: Ie3760d8fd55b987f9507f32ef51456a57d79e3fb
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index a60c5bc98e..eb5739f3e4 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -1094,11 +1094,17 @@ bool CompilerDriver::ComputeStaticFieldInfo(uint32_t field_idx, const DexCompila if (resolved_field != nullptr && referrer_class != nullptr) { *is_volatile = IsFieldVolatile(resolved_field); std::pair<bool, bool> fast_path = IsFastStaticField( - dex_cache, referrer_class, resolved_field, field_idx, field_offset, - storage_index, is_referrers_class, is_initialized); + dex_cache, referrer_class, resolved_field, field_idx, storage_index); result = is_put ? fast_path.second : fast_path.first; } - if (!result) { + if (result) { + *field_offset = GetFieldOffset(resolved_field); + *is_referrers_class = IsStaticFieldInReferrerClass(referrer_class, resolved_field); + // *is_referrers_class == true implies no worrying about class initialization. + *is_initialized = (*is_referrers_class) || + (IsStaticFieldsClassInitialized(referrer_class, resolved_field) && + CanAssumeTypeIsPresentInDexCache(*mUnit->GetDexFile(), *storage_index)); + } else { // Conservative defaults. *is_volatile = true; *field_offset = MemberOffset(static_cast<size_t>(-1)); |