diff options
| author | 2015-04-24 18:17:40 +0000 | |
|---|---|---|
| committer | 2015-04-24 18:17:41 +0000 | |
| commit | eb5459ca861b58ee8a9907789f11400dcdddb87b (patch) | |
| tree | 36c1f328c48f0ec111ee31702cc4a82ddb2ad784 /compiler/driver/compiler_driver.h | |
| parent | ae803f6efbe8378b5423c51ee3c5564cae0e6e59 (diff) | |
| parent | 4c0eb42259d790fddcd9978b66328dbb3ab65615 (diff) | |
Merge "Ensure inlined static calls perform clinit checks in Optimizing."
Diffstat (limited to 'compiler/driver/compiler_driver.h')
| -rw-r--r-- | compiler/driver/compiler_driver.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 03c5c5c352..02de11e960 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -281,6 +281,18 @@ class CompilerDriver { ArtField* resolved_field, uint16_t field_idx, uint32_t* storage_index) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + // Return whether the declaring class of `resolved_method` is + // available to `referrer_class`. If this is true, compute the type + // index of the declaring class in the referrer's dex file and + // return it through the out argument `storage_index`; otherwise + // return DexFile::kDexNoIndex through `storage_index`. + bool IsClassOfStaticMethodAvailableToReferrer(mirror::DexCache* dex_cache, + mirror::Class* referrer_class, + mirror::ArtMethod* resolved_method, + uint16_t method_idx, + uint32_t* storage_index) + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + // Is static field's in referrer's class? bool IsStaticFieldInReferrerClass(mirror::Class* referrer_class, ArtField* resolved_field) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); @@ -459,6 +471,33 @@ class CompilerDriver { } private: + // Return whether the declaring class of `resolved_member` is + // available to `referrer_class` for read or write access using two + // Boolean values returned as a pair. If is true at least for read + // access, compute the type index of the declaring class in the + // referrer's dex file and return it through the out argument + // `storage_index`; otherwise return DexFile::kDexNoIndex through + // `storage_index`. + template <typename ArtMember> + std::pair<bool, bool> IsClassOfStaticMemberAvailableToReferrer(mirror::DexCache* dex_cache, + mirror::Class* referrer_class, + ArtMember* resolved_member, + uint16_t member_idx, + uint32_t* storage_index) + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + + // Can `referrer_class` access the resolved `member`? + // Dispatch call to mirror::Class::CanAccessResolvedField or + // mirror::Class::CanAccessResolvedMember depending on the value of + // ArtMember. + template <typename ArtMember> + static bool CanAccessResolvedMember(mirror::Class* referrer_class, + mirror::Class* access_to, + ArtMember* member, + mirror::DexCache* dex_cache, + uint32_t field_idx) + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + // These flags are internal to CompilerDriver for collecting INVOKE resolution statistics. // The only external contract is that unresolved method has flags 0 and resolved non-0. enum { |