diff options
81 files changed, 106 insertions, 89 deletions
diff --git a/compiler/dex/dex_to_dex_compiler.h b/compiler/dex/dex_to_dex_compiler.h index 7536c3126a..7253488f79 100644 --- a/compiler/dex/dex_to_dex_compiler.h +++ b/compiler/dex/dex_to_dex_compiler.h @@ -22,6 +22,7 @@ #include <unordered_set> #include "base/bit_vector.h" +#include "base/mutex.h" #include "dex/dex_file.h" #include "dex/invoke_type.h" #include "dex/method_reference.h" diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 610852257b..13c8684cc0 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -26,6 +26,7 @@ #include "base/arena_object.h" #include "base/array_ref.h" #include "base/iteration_range.h" +#include "base/mutex.h" #include "base/quasi_atomic.h" #include "base/stl_util.h" #include "base/transform_array_ref.h" diff --git a/runtime/arch/context.h b/runtime/arch/context.h index d067f667cb..5980b03190 100644 --- a/runtime/arch/context.h +++ b/runtime/arch/context.h @@ -21,7 +21,6 @@ #include <stdint.h> #include "base/macros.h" -#include "base/mutex.h" namespace art { diff --git a/runtime/base/mutator_locked_dumpable.h b/runtime/base/mutator_locked_dumpable.h index cf2199c100..afbd73200f 100644 --- a/runtime/base/mutator_locked_dumpable.h +++ b/runtime/base/mutator_locked_dumpable.h @@ -17,7 +17,7 @@ #ifndef ART_RUNTIME_BASE_MUTATOR_LOCKED_DUMPABLE_H_ #define ART_RUNTIME_BASE_MUTATOR_LOCKED_DUMPABLE_H_ -#include "base/mutex.h" +#include "base/locks.h" #include "thread-current-inl.h" namespace art { diff --git a/runtime/cha.cc b/runtime/cha.cc index 8e06fdae54..5110b7aedd 100644 --- a/runtime/cha.cc +++ b/runtime/cha.cc @@ -18,6 +18,7 @@ #include "art_method-inl.h" #include "base/logging.h" // For VLOG +#include "base/mutex.h" #include "jit/jit.h" #include "jit/jit_code_cache.h" #include "linear_alloc.h" diff --git a/runtime/cha.h b/runtime/cha.h index d1a1b7cfae..a07ee91813 100644 --- a/runtime/cha.h +++ b/runtime/cha.h @@ -21,7 +21,7 @@ #include <unordered_set> #include "base/enums.h" -#include "base/mutex.h" +#include "base/locks.h" #include "handle.h" #include "mirror/class.h" #include "oat_quick_method_header.h" diff --git a/runtime/class_linker-inl.h b/runtime/class_linker-inl.h index 6703205502..43f3ed36aa 100644 --- a/runtime/class_linker-inl.h +++ b/runtime/class_linker-inl.h @@ -21,6 +21,7 @@ #include "art_field-inl.h" #include "art_method-inl.h" +#include "base/mutex.h" #include "class_linker.h" #include "gc_root-inl.h" #include "handle_scope-inl.h" diff --git a/runtime/class_linker.h b/runtime/class_linker.h index dd5f911330..d3eab7cb1d 100644 --- a/runtime/class_linker.h +++ b/runtime/class_linker.h @@ -25,8 +25,8 @@ #include <vector> #include "base/enums.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "dex/class_accessor.h" #include "dex/dex_cache_resolved_classes.h" #include "dex/dex_file.h" diff --git a/runtime/class_loader_utils.h b/runtime/class_loader_utils.h index 945d659396..69476dfb98 100644 --- a/runtime/class_loader_utils.h +++ b/runtime/class_loader_utils.h @@ -18,7 +18,7 @@ #define ART_RUNTIME_CLASS_LOADER_UTILS_H_ #include "art_field-inl.h" -#include "base/mutex.h" +#include "base/locks.h" #include "handle_scope.h" #include "jni/jni_internal.h" #include "mirror/class_loader.h" diff --git a/runtime/common_dex_operations.h b/runtime/common_dex_operations.h index 15ab5f0387..5c5431d5d9 100644 --- a/runtime/common_dex_operations.h +++ b/runtime/common_dex_operations.h @@ -20,8 +20,8 @@ #include "android-base/logging.h" #include "art_field.h" #include "art_method.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "class_linker.h" #include "dex/code_item_accessors.h" #include "dex/primitive.h" diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h index 319c7c7111..29b7813881 100644 --- a/runtime/common_runtime_test.h +++ b/runtime/common_runtime_test.h @@ -27,7 +27,7 @@ #include "arch/instruction_set.h" #include "base/common_art_test.h" #include "base/globals.h" -#include "base/mutex.h" +#include "base/locks.h" #include "base/os.h" #include "base/unix_file/fd_file.h" #include "dex/art_dex_file_loader.h" diff --git a/runtime/common_throws.h b/runtime/common_throws.h index 6acff6f222..ca9c96ad21 100644 --- a/runtime/common_throws.h +++ b/runtime/common_throws.h @@ -17,7 +17,7 @@ #ifndef ART_RUNTIME_COMMON_THROWS_H_ #define ART_RUNTIME_COMMON_THROWS_H_ -#include "base/mutex.h" +#include "base/locks.h" #include "obj_ptr.h" namespace art { diff --git a/runtime/compiler_callbacks.h b/runtime/compiler_callbacks.h index b29eb7050d..18632dc6c6 100644 --- a/runtime/compiler_callbacks.h +++ b/runtime/compiler_callbacks.h @@ -17,7 +17,7 @@ #ifndef ART_RUNTIME_COMPILER_CALLBACKS_H_ #define ART_RUNTIME_COMPILER_CALLBACKS_H_ -#include "base/mutex.h" +#include "base/locks.h" #include "dex/class_reference.h" #include "class_status.h" diff --git a/runtime/debug_print.h b/runtime/debug_print.h index df00f064bd..e2990d4c2d 100644 --- a/runtime/debug_print.h +++ b/runtime/debug_print.h @@ -17,7 +17,7 @@ #ifndef ART_RUNTIME_DEBUG_PRINT_H_ #define ART_RUNTIME_DEBUG_PRINT_H_ -#include "base/mutex.h" +#include "base/locks.h" #include "mirror/object.h" // Helper functions for printing extra information for certain hard to diagnose bugs. diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h index c8bf6d08ab..e10a6e8b8c 100644 --- a/runtime/entrypoints/entrypoint_utils.h +++ b/runtime/entrypoints/entrypoint_utils.h @@ -21,8 +21,8 @@ #include <stdint.h> #include "base/callee_save_type.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "dex/dex_file_types.h" #include "dex/dex_instruction.h" #include "gc/allocator_type.h" diff --git a/runtime/entrypoints/quick/callee_save_frame.h b/runtime/entrypoints/quick/callee_save_frame.h index 1e309071f6..e555d68a27 100644 --- a/runtime/entrypoints/quick/callee_save_frame.h +++ b/runtime/entrypoints/quick/callee_save_frame.h @@ -20,7 +20,7 @@ #include "arch/instruction_set.h" #include "base/callee_save_type.h" #include "base/enums.h" -#include "base/mutex.h" +#include "base/locks.h" #include "quick/quick_method_frame_info.h" #include "thread-inl.h" diff --git a/runtime/entrypoints/quick/quick_alloc_entrypoints.h b/runtime/entrypoints/quick/quick_alloc_entrypoints.h index bd1e295e48..937ba8e002 100644 --- a/runtime/entrypoints/quick/quick_alloc_entrypoints.h +++ b/runtime/entrypoints/quick/quick_alloc_entrypoints.h @@ -17,7 +17,7 @@ #ifndef ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ALLOC_ENTRYPOINTS_H_ #define ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ALLOC_ENTRYPOINTS_H_ -#include "base/mutex.h" +#include "base/locks.h" #include "gc/allocator_type.h" #include "quick_entrypoints.h" diff --git a/runtime/entrypoints/quick/quick_entrypoints.h b/runtime/entrypoints/quick/quick_entrypoints.h index 795faa8ecc..243f7ec1e2 100644 --- a/runtime/entrypoints/quick/quick_entrypoints.h +++ b/runtime/entrypoints/quick/quick_entrypoints.h @@ -19,8 +19,8 @@ #include <jni.h> +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "deoptimization_kind.h" #include "offsets.h" diff --git a/runtime/fault_handler.h b/runtime/fault_handler.h index 24ef0b1e07..d3be51f509 100644 --- a/runtime/fault_handler.h +++ b/runtime/fault_handler.h @@ -23,7 +23,8 @@ #include <vector> -#include "base/mutex.h" // For annotalysis. +#include "base/globals.h" // For CanDoImplicitNullCheckOn. +#include "base/locks.h" // For annotalysis. namespace art { diff --git a/runtime/gc/accounting/bitmap.h b/runtime/gc/accounting/bitmap.h index ffef5662db..bdc686e419 100644 --- a/runtime/gc/accounting/bitmap.h +++ b/runtime/gc/accounting/bitmap.h @@ -24,8 +24,8 @@ #include <vector> #include "base/globals.h" +#include "base/locks.h" #include "base/mem_map.h" -#include "base/mutex.h" namespace art { diff --git a/runtime/gc/accounting/card_table.h b/runtime/gc/accounting/card_table.h index f163898177..b84f22f3f1 100644 --- a/runtime/gc/accounting/card_table.h +++ b/runtime/gc/accounting/card_table.h @@ -20,8 +20,8 @@ #include <memory> #include "base/globals.h" +#include "base/locks.h" #include "base/mem_map.h" -#include "base/mutex.h" namespace art { diff --git a/runtime/gc/accounting/heap_bitmap.h b/runtime/gc/accounting/heap_bitmap.h index c997f8dbfc..e4775563ec 100644 --- a/runtime/gc/accounting/heap_bitmap.h +++ b/runtime/gc/accounting/heap_bitmap.h @@ -20,8 +20,8 @@ #include <android-base/logging.h> #include "base/allocator.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "space_bitmap.h" namespace art { diff --git a/runtime/gc/accounting/read_barrier_table.h b/runtime/gc/accounting/read_barrier_table.h index 7eca792063..2e42f8da5b 100644 --- a/runtime/gc/accounting/read_barrier_table.h +++ b/runtime/gc/accounting/read_barrier_table.h @@ -21,8 +21,8 @@ #include "base/bit_utils.h" #include "base/globals.h" +#include "base/locks.h" #include "base/mem_map.h" -#include "base/mutex.h" #include "gc/space/space.h" namespace art { diff --git a/runtime/gc/accounting/remembered_set.h b/runtime/gc/accounting/remembered_set.h index b96f0d318c..469074fe50 100644 --- a/runtime/gc/accounting/remembered_set.h +++ b/runtime/gc/accounting/remembered_set.h @@ -19,7 +19,7 @@ #include "base/allocator.h" #include "base/globals.h" -#include "base/mutex.h" +#include "base/locks.h" #include "base/safe_map.h" #include <set> diff --git a/runtime/gc/accounting/space_bitmap.h b/runtime/gc/accounting/space_bitmap.h index fcc3007acd..8561f06f3a 100644 --- a/runtime/gc/accounting/space_bitmap.h +++ b/runtime/gc/accounting/space_bitmap.h @@ -24,8 +24,8 @@ #include <vector> #include "base/globals.h" +#include "base/locks.h" #include "base/mem_map.h" -#include "base/mutex.h" namespace art { diff --git a/runtime/gc/allocation_listener.h b/runtime/gc/allocation_listener.h index 7675a22433..a578252e7a 100644 --- a/runtime/gc/allocation_listener.h +++ b/runtime/gc/allocation_listener.h @@ -20,8 +20,8 @@ #include <list> #include <memory> +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "gc_root.h" #include "obj_ptr.h" diff --git a/runtime/gc/collector/immune_region.h b/runtime/gc/collector/immune_region.h index c9ac435b2b..80ee44cf68 100644 --- a/runtime/gc/collector/immune_region.h +++ b/runtime/gc/collector/immune_region.h @@ -18,7 +18,6 @@ #define ART_RUNTIME_GC_COLLECTOR_IMMUNE_REGION_H_ #include "base/macros.h" -#include "base/mutex.h" namespace art { namespace mirror { diff --git a/runtime/gc/collector/immune_spaces.h b/runtime/gc/collector/immune_spaces.h index 72cb60d465..5a8441a67a 100644 --- a/runtime/gc/collector/immune_spaces.h +++ b/runtime/gc/collector/immune_spaces.h @@ -17,8 +17,8 @@ #ifndef ART_RUNTIME_GC_COLLECTOR_IMMUNE_SPACES_H_ #define ART_RUNTIME_GC_COLLECTOR_IMMUNE_SPACES_H_ +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "gc/space/space.h" #include "immune_region.h" diff --git a/runtime/gc/collector/semi_space.h b/runtime/gc/collector/semi_space.h index bb42be6cd4..6fab371d73 100644 --- a/runtime/gc/collector/semi_space.h +++ b/runtime/gc/collector/semi_space.h @@ -20,8 +20,8 @@ #include <memory> #include "base/atomic.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "garbage_collector.h" #include "gc/accounting/heap_bitmap.h" #include "gc_root.h" diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc index d4af117e46..49446399fd 100644 --- a/runtime/gc/reference_processor.cc +++ b/runtime/gc/reference_processor.cc @@ -17,6 +17,7 @@ #include "reference_processor.h" #include "art_field-inl.h" +#include "base/mutex.h" #include "base/time_utils.h" #include "base/utils.h" #include "class_root.h" diff --git a/runtime/gc/reference_processor.h b/runtime/gc/reference_processor.h index c6c78367b0..17b546ac5e 100644 --- a/runtime/gc/reference_processor.h +++ b/runtime/gc/reference_processor.h @@ -18,7 +18,7 @@ #define ART_RUNTIME_GC_REFERENCE_PROCESSOR_H_ #include "base/globals.h" -#include "base/mutex.h" +#include "base/locks.h" #include "jni.h" #include "reference_queue.h" diff --git a/runtime/gc/reference_queue.cc b/runtime/gc/reference_queue.cc index 5c11e502c2..95871dae85 100644 --- a/runtime/gc/reference_queue.cc +++ b/runtime/gc/reference_queue.cc @@ -17,6 +17,7 @@ #include "reference_queue.h" #include "accounting/card_table-inl.h" +#include "base/mutex.h" #include "collector/concurrent_copying.h" #include "heap.h" #include "mirror/class-inl.h" diff --git a/runtime/gc/reference_queue.h b/runtime/gc/reference_queue.h index 09ab51a045..53518cc1c1 100644 --- a/runtime/gc/reference_queue.h +++ b/runtime/gc/reference_queue.h @@ -23,7 +23,7 @@ #include "base/atomic.h" #include "base/globals.h" -#include "base/mutex.h" +#include "base/locks.h" #include "base/timing_logger.h" #include "jni.h" #include "obj_ptr.h" @@ -31,6 +31,9 @@ #include "thread_pool.h" namespace art { + +class Mutex; + namespace mirror { class Reference; } // namespace mirror diff --git a/runtime/gc/scoped_gc_critical_section.h b/runtime/gc/scoped_gc_critical_section.h index 864bf878f6..8ad01580c2 100644 --- a/runtime/gc/scoped_gc_critical_section.h +++ b/runtime/gc/scoped_gc_critical_section.h @@ -17,7 +17,7 @@ #ifndef ART_RUNTIME_GC_SCOPED_GC_CRITICAL_SECTION_H_ #define ART_RUNTIME_GC_SCOPED_GC_CRITICAL_SECTION_H_ -#include "base/mutex.h" +#include "base/locks.h" #include "collector_type.h" #include "gc_cause.h" diff --git a/runtime/gc/space/bump_pointer_space.h b/runtime/gc/space/bump_pointer_space.h index 383bf7abaa..6d9fd047f4 100644 --- a/runtime/gc/space/bump_pointer_space.h +++ b/runtime/gc/space/bump_pointer_space.h @@ -19,6 +19,8 @@ #include "space.h" +#include "base/mutex.h" + namespace art { namespace mirror { diff --git a/runtime/gc/space/malloc_space.h b/runtime/gc/space/malloc_space.h index 5dd8136dcb..7d28516961 100644 --- a/runtime/gc/space/malloc_space.h +++ b/runtime/gc/space/malloc_space.h @@ -21,6 +21,7 @@ #include <ostream> #include "base/memory_tool.h" +#include "base/mutex.h" namespace art { namespace gc { diff --git a/runtime/gc/space/space.h b/runtime/gc/space/space.h index 545e3d83a4..dd5451bf2e 100644 --- a/runtime/gc/space/space.h +++ b/runtime/gc/space/space.h @@ -22,9 +22,9 @@ #include "base/atomic.h" #include "base/globals.h" +#include "base/locks.h" #include "base/macros.h" #include "base/mem_map.h" -#include "base/mutex.h" #include "gc/accounting/space_bitmap.h" #include "gc/collector/object_byte_pair.h" diff --git a/runtime/gc_root.h b/runtime/gc_root.h index 0bd43f95c0..32af62d5a5 100644 --- a/runtime/gc_root.h +++ b/runtime/gc_root.h @@ -17,8 +17,8 @@ #ifndef ART_RUNTIME_GC_ROOT_H_ #define ART_RUNTIME_GC_ROOT_H_ +#include "base/locks.h" // For Locks::mutator_lock_. #include "base/macros.h" -#include "base/mutex.h" // For Locks::mutator_lock_. #include "mirror/object_reference.h" #include "read_barrier_option.h" diff --git a/runtime/handle.h b/runtime/handle.h index b13c43ef34..0c9c0290c6 100644 --- a/runtime/handle.h +++ b/runtime/handle.h @@ -20,8 +20,8 @@ #include <android-base/logging.h> #include "base/casts.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "base/value_object.h" #include "jni.h" #include "obj_ptr.h" diff --git a/runtime/handle_scope.h b/runtime/handle_scope.h index 9eaf1ec71a..1a1c92f9c5 100644 --- a/runtime/handle_scope.h +++ b/runtime/handle_scope.h @@ -22,8 +22,8 @@ #include <android-base/logging.h> #include "base/enums.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "handle.h" #include "stack_reference.h" #include "verify_object.h" diff --git a/runtime/hidden_api.h b/runtime/hidden_api.h index 614154c7a0..d9d81f02ae 100644 --- a/runtime/hidden_api.h +++ b/runtime/hidden_api.h @@ -20,7 +20,7 @@ #include "art_field.h" #include "art_method.h" #include "base/hiddenapi_flags.h" -#include "base/mutex.h" +#include "base/locks.h" #include "intrinsics_enum.h" #include "mirror/class-inl.h" #include "reflection.h" diff --git a/runtime/imtable.h b/runtime/imtable.h index 3c52fb8ec0..48a8643933 100644 --- a/runtime/imtable.h +++ b/runtime/imtable.h @@ -23,8 +23,8 @@ #include "base/casts.h" #include "base/enums.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" namespace art { diff --git a/runtime/indirect_reference_table.h b/runtime/indirect_reference_table.h index 8c63c0045f..eb07035fda 100644 --- a/runtime/indirect_reference_table.h +++ b/runtime/indirect_reference_table.h @@ -26,9 +26,9 @@ #include <android-base/logging.h> #include "base/bit_utils.h" +#include "base/locks.h" #include "base/macros.h" #include "base/mem_map.h" -#include "base/mutex.h" #include "gc_root.h" #include "obj_ptr.h" #include "offsets.h" diff --git a/runtime/interpreter/interpreter.h b/runtime/interpreter/interpreter.h index d7e69a6755..e92d195729 100644 --- a/runtime/interpreter/interpreter.h +++ b/runtime/interpreter/interpreter.h @@ -17,7 +17,7 @@ #ifndef ART_RUNTIME_INTERPRETER_INTERPRETER_H_ #define ART_RUNTIME_INTERPRETER_INTERPRETER_H_ -#include "base/mutex.h" +#include "base/locks.h" #include "dex/dex_file.h" #include "obj_ptr.h" diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h index bf84227560..a633a63873 100644 --- a/runtime/interpreter/interpreter_common.h +++ b/runtime/interpreter/interpreter_common.h @@ -32,8 +32,8 @@ #include "art_field-inl.h" #include "art_method-inl.h" #include "base/enums.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "class_linker-inl.h" #include "class_root.h" #include "common_dex_operations.h" diff --git a/runtime/interpreter/interpreter_mterp_impl.h b/runtime/interpreter/interpreter_mterp_impl.h index d8a764f855..177b0fd360 100644 --- a/runtime/interpreter/interpreter_mterp_impl.h +++ b/runtime/interpreter/interpreter_mterp_impl.h @@ -17,8 +17,8 @@ #ifndef ART_RUNTIME_INTERPRETER_INTERPRETER_MTERP_IMPL_H_ #define ART_RUNTIME_INTERPRETER_INTERPRETER_MTERP_IMPL_H_ +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "dex/dex_file.h" #include "jvalue.h" #include "obj_ptr.h" diff --git a/runtime/interpreter/interpreter_switch_impl.h b/runtime/interpreter/interpreter_switch_impl.h index 9fc4239d05..d4dca11c60 100644 --- a/runtime/interpreter/interpreter_switch_impl.h +++ b/runtime/interpreter/interpreter_switch_impl.h @@ -17,8 +17,8 @@ #ifndef ART_RUNTIME_INTERPRETER_INTERPRETER_SWITCH_IMPL_H_ #define ART_RUNTIME_INTERPRETER_INTERPRETER_SWITCH_IMPL_H_ +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "dex/dex_file.h" #include "dex/code_item_accessors.h" #include "jvalue.h" diff --git a/runtime/interpreter/lock_count_data.h b/runtime/interpreter/lock_count_data.h index 3098d4f6b7..efa14c5bbc 100644 --- a/runtime/interpreter/lock_count_data.h +++ b/runtime/interpreter/lock_count_data.h @@ -20,7 +20,7 @@ #include <memory> #include <vector> -#include "base/mutex.h" +#include "base/locks.h" namespace art { diff --git a/runtime/interpreter/shadow_frame.h b/runtime/interpreter/shadow_frame.h index 660902142b..ca98999acd 100644 --- a/runtime/interpreter/shadow_frame.h +++ b/runtime/interpreter/shadow_frame.h @@ -21,8 +21,8 @@ #include <cstring> #include <string> +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "dex/dex_file.h" #include "lock_count_data.h" #include "read_barrier.h" diff --git a/runtime/java_frame_root_info.h b/runtime/java_frame_root_info.h index 452a76b89a..8141ea24fd 100644 --- a/runtime/java_frame_root_info.h +++ b/runtime/java_frame_root_info.h @@ -19,8 +19,8 @@ #include <iosfwd> +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "gc_root.h" namespace art { diff --git a/runtime/jit/debugger_interface.h b/runtime/jit/debugger_interface.h index 3d25910f26..fb5e81b03c 100644 --- a/runtime/jit/debugger_interface.h +++ b/runtime/jit/debugger_interface.h @@ -22,7 +22,7 @@ #include <vector> #include "base/array_ref.h" -#include "base/mutex.h" +#include "base/locks.h" namespace art { diff --git a/runtime/jni/jni_env_ext.cc b/runtime/jni/jni_env_ext.cc index efe43ee0e9..976f89b68c 100644 --- a/runtime/jni/jni_env_ext.cc +++ b/runtime/jni/jni_env_ext.cc @@ -21,6 +21,7 @@ #include "android-base/stringprintf.h" +#include "base/mutex.h" #include "base/to_str.h" #include "check_jni.h" #include "indirect_reference_table.h" diff --git a/runtime/jni/jni_env_ext.h b/runtime/jni/jni_env_ext.h index 3a007adcf0..61de07424f 100644 --- a/runtime/jni/jni_env_ext.h +++ b/runtime/jni/jni_env_ext.h @@ -19,8 +19,8 @@ #include <jni.h> +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "indirect_reference_table.h" #include "obj_ptr.h" #include "reference_table.h" diff --git a/runtime/jvalue.h b/runtime/jvalue.h index b42d995d5c..d03749c6ee 100644 --- a/runtime/jvalue.h +++ b/runtime/jvalue.h @@ -17,8 +17,8 @@ #ifndef ART_RUNTIME_JVALUE_H_ #define ART_RUNTIME_JVALUE_H_ +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include <stdint.h> diff --git a/runtime/managed_stack.h b/runtime/managed_stack.h index 6a0f075cb5..3fb83aca46 100644 --- a/runtime/managed_stack.h +++ b/runtime/managed_stack.h @@ -23,8 +23,8 @@ #include <android-base/logging.h> +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "base/bit_utils.h" namespace art { diff --git a/runtime/mirror/class_loader.h b/runtime/mirror/class_loader.h index e3cb12f16f..783ba6a1be 100644 --- a/runtime/mirror/class_loader.h +++ b/runtime/mirror/class_loader.h @@ -17,7 +17,7 @@ #ifndef ART_RUNTIME_MIRROR_CLASS_LOADER_H_ #define ART_RUNTIME_MIRROR_CLASS_LOADER_H_ -#include "base/mutex.h" +#include "base/locks.h" #include "obj_ptr.h" #include "object.h" #include "object_reference.h" diff --git a/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h index 58b199d639..c7429281f5 100644 --- a/runtime/mirror/dex_cache.h +++ b/runtime/mirror/dex_cache.h @@ -19,7 +19,7 @@ #include "array.h" #include "base/bit_utils.h" -#include "base/mutex.h" +#include "base/locks.h" #include "dex/dex_file_types.h" #include "gc_root.h" // Note: must not use -inl here to avoid circular dependency. #include "object.h" diff --git a/runtime/mirror/object_reference.h b/runtime/mirror/object_reference.h index d6a39aae5a..8636928620 100644 --- a/runtime/mirror/object_reference.h +++ b/runtime/mirror/object_reference.h @@ -19,7 +19,7 @@ #include "base/atomic.h" #include "base/globals.h" -#include "base/mutex.h" // For Locks::mutator_lock_. +#include "base/locks.h" // For Locks::mutator_lock_. #include "heap_poisoning.h" #include "obj_ptr.h" diff --git a/runtime/mirror/reference.h b/runtime/mirror/reference.h index 63c5ae5ff8..9ace4f7eef 100644 --- a/runtime/mirror/reference.h +++ b/runtime/mirror/reference.h @@ -18,8 +18,8 @@ #define ART_RUNTIME_MIRROR_REFERENCE_H_ #include "base/enums.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "obj_ptr.h" #include "object.h" #include "read_barrier_option.h" diff --git a/runtime/monitor_objects_stack_visitor.h b/runtime/monitor_objects_stack_visitor.h index c943402126..3968239e8d 100644 --- a/runtime/monitor_objects_stack_visitor.h +++ b/runtime/monitor_objects_stack_visitor.h @@ -20,7 +20,7 @@ #include <android-base/logging.h> #include "art_method.h" -#include "base/mutex.h" +#include "base/locks.h" #include "monitor.h" #include "stack.h" #include "thread.h" diff --git a/runtime/non_debuggable_classes.h b/runtime/non_debuggable_classes.h index e1b563339d..e2c51e62ce 100644 --- a/runtime/non_debuggable_classes.h +++ b/runtime/non_debuggable_classes.h @@ -19,7 +19,7 @@ #include <vector> -#include "base/mutex.h" +#include "base/locks.h" #include "jni.h" namespace art { diff --git a/runtime/nth_caller_visitor.h b/runtime/nth_caller_visitor.h index 71c6a82dc5..ffec179f2f 100644 --- a/runtime/nth_caller_visitor.h +++ b/runtime/nth_caller_visitor.h @@ -18,7 +18,7 @@ #define ART_RUNTIME_NTH_CALLER_VISITOR_H_ #include "art_method.h" -#include "base/mutex.h" +#include "base/locks.h" #include "stack.h" namespace art { diff --git a/runtime/oat_file_manager.cc b/runtime/oat_file_manager.cc index 2c882ece05..9552ca33f1 100644 --- a/runtime/oat_file_manager.cc +++ b/runtime/oat_file_manager.cc @@ -27,6 +27,7 @@ #include "base/bit_vector-inl.h" #include "base/file_utils.h" #include "base/logging.h" // For VLOG. +#include "base/mutex-inl.h" #include "base/stl_util.h" #include "base/systrace.h" #include "class_linker.h" diff --git a/runtime/oat_file_manager.h b/runtime/oat_file_manager.h index 7d96a7a678..99e1b7329e 100644 --- a/runtime/oat_file_manager.h +++ b/runtime/oat_file_manager.h @@ -23,8 +23,8 @@ #include <unordered_map> #include <vector> +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "jni.h" namespace art { diff --git a/runtime/obj_ptr.h b/runtime/obj_ptr.h index efbb66fdde..9e2ee295c7 100644 --- a/runtime/obj_ptr.h +++ b/runtime/obj_ptr.h @@ -21,8 +21,8 @@ #include <type_traits> #include "base/globals.h" +#include "base/locks.h" // For Locks::mutator_lock_. #include "base/macros.h" -#include "base/mutex.h" // For Locks::mutator_lock_. // Always inline ObjPtr methods even in debug builds. #define OBJPTR_INLINE __attribute__ ((always_inline)) diff --git a/runtime/object_lock.h b/runtime/object_lock.h index 5916f90858..15b763a3ab 100644 --- a/runtime/object_lock.h +++ b/runtime/object_lock.h @@ -17,8 +17,8 @@ #ifndef ART_RUNTIME_OBJECT_LOCK_H_ #define ART_RUNTIME_OBJECT_LOCK_H_ +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "handle.h" namespace art { diff --git a/runtime/read_barrier.h b/runtime/read_barrier.h index 0741da663b..3b89377860 100644 --- a/runtime/read_barrier.h +++ b/runtime/read_barrier.h @@ -19,8 +19,8 @@ #include <android-base/logging.h> +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "base/runtime_debug.h" #include "gc_root.h" #include "jni.h" diff --git a/runtime/reference_table.h b/runtime/reference_table.h index 6af5ca5224..638894462b 100644 --- a/runtime/reference_table.h +++ b/runtime/reference_table.h @@ -23,7 +23,7 @@ #include <vector> #include "base/allocator.h" -#include "base/mutex.h" +#include "base/locks.h" #include "gc_root.h" #include "obj_ptr.h" diff --git a/runtime/reflection.h b/runtime/reflection.h index 74580a21e0..574e302209 100644 --- a/runtime/reflection.h +++ b/runtime/reflection.h @@ -17,7 +17,7 @@ #ifndef ART_RUNTIME_REFLECTION_H_ #define ART_RUNTIME_REFLECTION_H_ -#include "base/mutex.h" +#include "base/locks.h" #include "dex/primitive.h" #include "jni.h" #include "obj_ptr.h" diff --git a/runtime/runtime_callbacks.h b/runtime/runtime_callbacks.h index 4cce15ed52..32ee3aa3b6 100644 --- a/runtime/runtime_callbacks.h +++ b/runtime/runtime_callbacks.h @@ -20,8 +20,8 @@ #include <vector> #include "base/array_ref.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "dex/dex_file.h" #include "handle.h" diff --git a/runtime/scoped_thread_state_change-inl.h b/runtime/scoped_thread_state_change-inl.h index 3089c24c59..2541ab528a 100644 --- a/runtime/scoped_thread_state_change-inl.h +++ b/runtime/scoped_thread_state_change-inl.h @@ -22,6 +22,7 @@ #include <android-base/logging.h> #include "base/casts.h" +#include "base/mutex.h" #include "jni/jni_env_ext-inl.h" #include "obj_ptr-inl.h" #include "runtime.h" diff --git a/runtime/scoped_thread_state_change.h b/runtime/scoped_thread_state_change.h index 0c42c5ae8d..b2ad90a1ea 100644 --- a/runtime/scoped_thread_state_change.h +++ b/runtime/scoped_thread_state_change.h @@ -19,8 +19,8 @@ #include "jni.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "base/value_object.h" #include "thread_state.h" diff --git a/runtime/stack.h b/runtime/stack.h index 9d30115bb1..0edf4f5375 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -20,8 +20,8 @@ #include <stdint.h> #include <string> +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "quick/quick_method_frame_info.h" #include "stack_map.h" diff --git a/runtime/subtype_check.h b/runtime/subtype_check.h index 106c7f1f75..493ea853e5 100644 --- a/runtime/subtype_check.h +++ b/runtime/subtype_check.h @@ -20,7 +20,7 @@ #include "subtype_check_bits_and_status.h" #include "subtype_check_info.h" -#include "base/mutex.h" +#include "base/locks.h" #include "mirror/class.h" #include "runtime.h" diff --git a/runtime/thread.h b/runtime/thread.h index ccde23614b..6db1943bac 100644 --- a/runtime/thread.h +++ b/runtime/thread.h @@ -30,8 +30,8 @@ #include "base/atomic.h" #include "base/enums.h" #include "base/globals.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "base/safe_map.h" #include "entrypoints/jni/jni_entrypoints.h" #include "entrypoints/quick/quick_entrypoints.h" @@ -563,11 +563,11 @@ class Thread { bool Interrupted(); // Implements java.lang.Thread.isInterrupted. bool IsInterrupted(); - void Interrupt(Thread* self) REQUIRES(!*wait_mutex_); + void Interrupt(Thread* self) REQUIRES(!wait_mutex_); void SetInterrupted(bool i) { tls32_.interrupted.store(i, std::memory_order_seq_cst); } - void Notify() REQUIRES(!*wait_mutex_); + void Notify() REQUIRES(!wait_mutex_); ALWAYS_INLINE void PoisonObjectPointers() { ++poison_object_cookie_; diff --git a/runtime/trace.h b/runtime/trace.h index 926a34f401..108996231d 100644 --- a/runtime/trace.h +++ b/runtime/trace.h @@ -28,6 +28,7 @@ #include "base/atomic.h" #include "base/globals.h" +#include "base/locks.h" #include "base/macros.h" #include "base/os.h" #include "base/safe_map.h" @@ -42,6 +43,7 @@ namespace art { class ArtField; class ArtMethod; class DexFile; +class LOCKABLE Mutex; class ShadowFrame; class Thread; @@ -173,57 +175,57 @@ class Trace final : public instrumentation::InstrumentationListener { uint32_t GetClockOverheadNanoSeconds(); void CompareAndUpdateStackTrace(Thread* thread, std::vector<ArtMethod*>* stack_trace) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_, !*streaming_lock_); + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_, !streaming_lock_); // InstrumentationListener implementation. void MethodEntered(Thread* thread, Handle<mirror::Object> this_object, ArtMethod* method, uint32_t dex_pc) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_, !*streaming_lock_) + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_, !streaming_lock_) override; void MethodExited(Thread* thread, Handle<mirror::Object> this_object, ArtMethod* method, uint32_t dex_pc, const JValue& return_value) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_, !*streaming_lock_) + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_, !streaming_lock_) override; void MethodUnwind(Thread* thread, Handle<mirror::Object> this_object, ArtMethod* method, uint32_t dex_pc) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_, !*streaming_lock_) + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_, !streaming_lock_) override; void DexPcMoved(Thread* thread, Handle<mirror::Object> this_object, ArtMethod* method, uint32_t new_dex_pc) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_, !*streaming_lock_) + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_, !streaming_lock_) override; void FieldRead(Thread* thread, Handle<mirror::Object> this_object, ArtMethod* method, uint32_t dex_pc, ArtField* field) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_) override; + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_) override; void FieldWritten(Thread* thread, Handle<mirror::Object> this_object, ArtMethod* method, uint32_t dex_pc, ArtField* field, const JValue& field_value) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_) override; + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_) override; void ExceptionThrown(Thread* thread, Handle<mirror::Throwable> exception_object) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_) override; + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_) override; void ExceptionHandled(Thread* thread, Handle<mirror::Throwable> exception_object) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_) override; + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_) override; void Branch(Thread* thread, ArtMethod* method, uint32_t dex_pc, int32_t dex_pc_offset) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_) override; + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_) override; void WatchedFramePop(Thread* thread, const ShadowFrame& frame) REQUIRES_SHARED(Locks::mutator_lock_) override; // Reuse an old stack trace if it exists, otherwise allocate a new one. @@ -258,20 +260,20 @@ class Trace final : public instrumentation::InstrumentationListener { // how to annotate this. NO_THREAD_SAFETY_ANALYSIS; void FinishTracing() - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_, !*streaming_lock_); + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_, !streaming_lock_); void ReadClocks(Thread* thread, uint32_t* thread_clock_diff, uint32_t* wall_clock_diff); void LogMethodTraceEvent(Thread* thread, ArtMethod* method, instrumentation::Instrumentation::InstrumentationEvent event, uint32_t thread_clock_diff, uint32_t wall_clock_diff) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_, !*streaming_lock_); + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_, !streaming_lock_); // Methods to output traced methods and threads. void GetVisitedMethods(size_t end_offset, std::set<ArtMethod*>* visited_methods) - REQUIRES(!*unique_methods_lock_); + REQUIRES(!unique_methods_lock_); void DumpMethodList(std::ostream& os, const std::set<ArtMethod*>& visited_methods) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_); + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_); void DumpThreadList(std::ostream& os) REQUIRES(!Locks::thread_list_lock_); // Methods to register seen entitites in streaming mode. The methods return true if the entity @@ -289,15 +291,15 @@ class Trace final : public instrumentation::InstrumentationListener { void FlushBuf() REQUIRES(streaming_lock_); - uint32_t EncodeTraceMethod(ArtMethod* method) REQUIRES(!*unique_methods_lock_); + uint32_t EncodeTraceMethod(ArtMethod* method) REQUIRES(!unique_methods_lock_); uint32_t EncodeTraceMethodAndAction(ArtMethod* method, TraceAction action) - REQUIRES(!*unique_methods_lock_); - ArtMethod* DecodeTraceMethod(uint32_t tmid) REQUIRES(!*unique_methods_lock_); - std::string GetMethodLine(ArtMethod* method) REQUIRES(!*unique_methods_lock_) + REQUIRES(!unique_methods_lock_); + ArtMethod* DecodeTraceMethod(uint32_t tmid) REQUIRES(!unique_methods_lock_); + std::string GetMethodLine(ArtMethod* method) REQUIRES(!unique_methods_lock_) REQUIRES_SHARED(Locks::mutator_lock_); void DumpBuf(uint8_t* buf, size_t buf_size, TraceClockSource clock_source) - REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_); + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!unique_methods_lock_); // Singleton instance of the Trace or null when no method tracing is active. static Trace* volatile the_trace_ GUARDED_BY(Locks::trace_lock_); diff --git a/runtime/verifier/reg_type.h b/runtime/verifier/reg_type.h index 3099b231e2..3369784bd1 100644 --- a/runtime/verifier/reg_type.h +++ b/runtime/verifier/reg_type.h @@ -24,8 +24,8 @@ #include "base/arena_object.h" #include "base/bit_vector.h" +#include "base/locks.h" #include "base/macros.h" -#include "base/mutex.h" #include "base/stringpiece.h" #include "dex/primitive.h" #include "gc_root.h" diff --git a/runtime/verifier/register_line.h b/runtime/verifier/register_line.h index 9bb60bb7c5..de66bf5b0e 100644 --- a/runtime/verifier/register_line.h +++ b/runtime/verifier/register_line.h @@ -23,7 +23,7 @@ #include <android-base/logging.h> -#include "base/mutex.h" +#include "base/locks.h" #include "base/safe_map.h" #include "base/scoped_arena_containers.h" diff --git a/runtime/verifier/verifier_deps.cc b/runtime/verifier/verifier_deps.cc index b666c1582c..d346a95e82 100644 --- a/runtime/verifier/verifier_deps.cc +++ b/runtime/verifier/verifier_deps.cc @@ -22,6 +22,7 @@ #include "art_method-inl.h" #include "base/indenter.h" #include "base/leb128.h" +#include "base/mutex-inl.h" #include "base/stl_util.h" #include "compiler_callbacks.h" #include "dex/dex_file-inl.h" diff --git a/runtime/verifier/verifier_deps.h b/runtime/verifier/verifier_deps.h index 0146b17020..dfd4a5c4fb 100644 --- a/runtime/verifier/verifier_deps.h +++ b/runtime/verifier/verifier_deps.h @@ -22,7 +22,7 @@ #include <vector> #include "base/array_ref.h" -#include "base/mutex.h" +#include "base/locks.h" #include "dex/dex_file_types.h" #include "handle.h" #include "obj_ptr.h" diff --git a/runtime/well_known_classes.h b/runtime/well_known_classes.h index 0b7ed0994c..66cbbec916 100644 --- a/runtime/well_known_classes.h +++ b/runtime/well_known_classes.h @@ -17,7 +17,7 @@ #ifndef ART_RUNTIME_WELL_KNOWN_CLASSES_H_ #define ART_RUNTIME_WELL_KNOWN_CLASSES_H_ -#include "base/mutex.h" +#include "base/locks.h" #include "jni.h" #include "obj_ptr.h" |