diff options
| author | 2015-07-30 16:20:06 -0700 | |
|---|---|---|
| committer | 2015-08-05 18:15:22 -0700 | |
| commit | 54d220eb9cc51215d75b9e0fe921b94bebbb3fd6 (patch) | |
| tree | fe08749dea3ca6cad97bce48416beb37203efdf5 /runtime/class_linker.h | |
| parent | 275bc5e5f318ba6ea1bad6c89c2924d1248b7523 (diff) | |
Move ArtFields and ArtMethods to be a length prefixed array
Fixes race conditions between changing method and fields arrays
being seen in the wrong order by the GC.
Bug: 22832610
Change-Id: Ia21d6698f73ba207a6392c3d6b9be2658933073f
Diffstat (limited to 'runtime/class_linker.h')
| -rw-r--r-- | runtime/class_linker.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/class_linker.h b/runtime/class_linker.h index c53ff616e5..17d6be699d 100644 --- a/runtime/class_linker.h +++ b/runtime/class_linker.h @@ -344,9 +344,9 @@ class ClassLinker { mirror::ObjectArray<mirror::String>* AllocStringArray(Thread* self, size_t length) SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); - ArtField* AllocArtFieldArray(Thread* self, size_t length); + LengthPrefixedArray<ArtField>* AllocArtFieldArray(Thread* self, size_t length); - ArtMethod* AllocArtMethodArray(Thread* self, size_t length); + LengthPrefixedArray<ArtMethod>* AllocArtMethodArray(Thread* self, size_t length); mirror::PointerArray* AllocPointerArray(Thread* self, size_t length) SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); @@ -694,9 +694,10 @@ class ClassLinker { bool CanWeInitializeClass(mirror::Class* klass, bool can_init_statics, bool can_init_parents) SHARED_REQUIRES(Locks::mutator_lock_); - void UpdateClassVirtualMethods(mirror::Class* klass, ArtMethod* new_methods, - size_t new_num_methods) - SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Locks::classlinker_classes_lock_); + void UpdateClassVirtualMethods(mirror::Class* klass, + LengthPrefixedArray<ArtMethod>* new_methods) + SHARED_REQUIRES(Locks::mutator_lock_) + REQUIRES(!Locks::classlinker_classes_lock_); std::vector<const DexFile*> boot_class_path_; std::vector<std::unique_ptr<const DexFile>> opened_dex_files_; |