Merge changes I8c4cec43,I00634b89,I0579db64
* changes:
Do not pass DexFile to ClassLinker::Lookup/ResolveString().
Do not pass DexFile to ClassLinker::ResolveMethodType().
Do not pass DexFile to ClassLinker::ResolveField*().
diff --git a/compiler/Android.bp b/compiler/Android.bp
index 37a18cb..fc19b54 100644
--- a/compiler/Android.bp
+++ b/compiler/Android.bp
@@ -181,15 +181,10 @@
],
},
},
- target: {
- android: {
- // For atrace.
- shared_libs: ["libcutils"],
- },
- },
generated_sources: ["art_compiler_operator_srcs"],
shared_libs: [
"libbase",
+ "libcutils", // for atrace.
"liblzma",
],
include_dirs: ["art/disassembler"],
diff --git a/compiler/compiler.cc b/compiler/compiler.cc
index c500921..bb614ae 100644
--- a/compiler/compiler.cc
+++ b/compiler/compiler.cc
@@ -16,7 +16,9 @@
#include "compiler.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/macros.h"
#include "driver/compiler_driver.h"
#include "optimizing/optimizing_compiler.h"
#include "utils.h"
diff --git a/compiler/debug/dwarf/writer.h b/compiler/debug/dwarf/writer.h
index 95912ad..afeb980 100644
--- a/compiler/debug/dwarf/writer.h
+++ b/compiler/debug/dwarf/writer.h
@@ -19,8 +19,10 @@
#include <type_traits>
#include <vector>
+
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
#include "leb128.h"
namespace art {
diff --git a/compiler/dex/dex_to_dex_compiler.cc b/compiler/dex/dex_to_dex_compiler.cc
index cc452fc..4769035 100644
--- a/compiler/dex/dex_to_dex_compiler.cc
+++ b/compiler/dex/dex_to_dex_compiler.cc
@@ -16,11 +16,13 @@
#include "dex_to_dex_compiler.h"
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "art_field-inl.h"
#include "art_method-inl.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG
+#include "base/macros.h"
#include "base/mutex.h"
#include "bytecode_utils.h"
#include "compiled_method.h"
diff --git a/compiler/dex/verification_results.cc b/compiler/dex/verification_results.cc
index 03c90d8..1e0b94d 100644
--- a/compiler/dex/verification_results.cc
+++ b/compiler/dex/verification_results.cc
@@ -16,7 +16,8 @@
#include "verification_results.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/mutex-inl.h"
#include "base/stl_util.h"
#include "driver/compiler_driver.h"
diff --git a/compiler/dex/verified_method.cc b/compiler/dex/verified_method.cc
index 524b0a6..8934201 100644
--- a/compiler/dex/verified_method.cc
+++ b/compiler/dex/verified_method.cc
@@ -19,7 +19,8 @@
#include <algorithm>
#include <memory>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "code_item_accessors-inl.h"
#include "dex_file.h"
#include "dex_instruction-inl.h"
diff --git a/compiler/driver/compiled_method_storage.cc b/compiler/driver/compiled_method_storage.cc
index c739333..c8c2b69 100644
--- a/compiler/driver/compiled_method_storage.cc
+++ b/compiler/driver/compiled_method_storage.cc
@@ -19,7 +19,8 @@
#include "compiled_method_storage.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "compiled_method.h"
#include "linker/linker_patch.h"
#include "thread-current-inl.h"
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index d51bded..fcc6b8b 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -32,6 +32,7 @@
#include "base/array_ref.h"
#include "base/bit_vector.h"
#include "base/enums.h"
+#include "base/logging.h" // For VLOG
#include "base/stl_util.h"
#include "base/systrace.h"
#include "base/time_utils.h"
@@ -1610,7 +1611,7 @@
: manager_(manager) {}
void Visit(size_t class_def_index) OVERRIDE REQUIRES(!Locks::mutator_lock_) {
- ATRACE_CALL();
+ ScopedTrace trace(__FUNCTION__);
Thread* const self = Thread::Current();
jobject jclass_loader = manager_->GetClassLoader();
const DexFile& dex_file = *manager_->GetDexFile();
@@ -1955,7 +1956,7 @@
: manager_(manager), log_level_(log_level) {}
virtual void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) OVERRIDE {
- ATRACE_CALL();
+ ScopedTrace trace(__FUNCTION__);
ScopedObjectAccess soa(Thread::Current());
const DexFile& dex_file = *manager_->GetDexFile();
const DexFile::ClassDef& class_def = dex_file.GetClassDef(class_def_index);
@@ -2084,7 +2085,7 @@
explicit SetVerifiedClassVisitor(const ParallelCompilationManager* manager) : manager_(manager) {}
virtual void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) OVERRIDE {
- ATRACE_CALL();
+ ScopedTrace trace(__FUNCTION__);
ScopedObjectAccess soa(Thread::Current());
const DexFile& dex_file = *manager_->GetDexFile();
const DexFile::ClassDef& class_def = dex_file.GetClassDef(class_def_index);
@@ -2148,7 +2149,7 @@
explicit InitializeClassVisitor(const ParallelCompilationManager* manager) : manager_(manager) {}
void Visit(size_t class_def_index) OVERRIDE {
- ATRACE_CALL();
+ ScopedTrace trace(__FUNCTION__);
jobject jclass_loader = manager_->GetClassLoader();
const DexFile& dex_file = *manager_->GetDexFile();
const DexFile::ClassDef& class_def = dex_file.GetClassDef(class_def_index);
@@ -2662,7 +2663,7 @@
explicit CompileClassVisitor(const ParallelCompilationManager* manager) : manager_(manager) {}
virtual void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) OVERRIDE {
- ATRACE_CALL();
+ ScopedTrace trace(__FUNCTION__);
const DexFile& dex_file = *manager_->GetDexFile();
const DexFile::ClassDef& class_def = dex_file.GetClassDef(class_def_index);
ClassLinker* class_linker = manager_->GetClassLinker();
diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc
index f33c5e1..88e3e5b 100644
--- a/compiler/jit/jit_compiler.cc
+++ b/compiler/jit/jit_compiler.cc
@@ -21,7 +21,9 @@
#include "arch/instruction_set.h"
#include "arch/instruction_set_features.h"
#include "art_method-inl.h"
+#include "base/logging.h" // For VLOG
#include "base/stringpiece.h"
+#include "base/systrace.h"
#include "base/time_utils.h"
#include "base/timing_logger.h"
#include "base/unix_file/fd_file.h"
@@ -162,6 +164,8 @@
}
bool JitCompiler::CompileMethod(Thread* self, ArtMethod* method, bool osr) {
+ SCOPED_TRACE << "JIT compiling " << method->PrettyMethod();
+
DCHECK(!method->IsProxyMethod());
DCHECK(method->GetDeclaringClass()->IsResolved());
diff --git a/compiler/jni/quick/arm/calling_convention_arm.cc b/compiler/jni/quick/arm/calling_convention_arm.cc
index 3e637bc..54f193b 100644
--- a/compiler/jni/quick/arm/calling_convention_arm.cc
+++ b/compiler/jni/quick/arm/calling_convention_arm.cc
@@ -16,7 +16,9 @@
#include "calling_convention_arm.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/macros.h"
#include "handle_scope-inl.h"
#include "utils/arm/managed_register_arm.h"
diff --git a/compiler/jni/quick/arm64/calling_convention_arm64.cc b/compiler/jni/quick/arm64/calling_convention_arm64.cc
index 3afd701..328ecbb 100644
--- a/compiler/jni/quick/arm64/calling_convention_arm64.cc
+++ b/compiler/jni/quick/arm64/calling_convention_arm64.cc
@@ -16,7 +16,8 @@
#include "calling_convention_arm64.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "handle_scope-inl.h"
#include "utils/arm64/managed_register_arm64.h"
diff --git a/compiler/jni/quick/calling_convention.cc b/compiler/jni/quick/calling_convention.cc
index 55c27d1..ff814c8 100644
--- a/compiler/jni/quick/calling_convention.cc
+++ b/compiler/jni/quick/calling_convention.cc
@@ -16,7 +16,7 @@
#include "calling_convention.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
#ifdef ART_ENABLE_CODEGEN_arm
#include "jni/quick/arm/calling_convention_arm.h"
diff --git a/compiler/jni/quick/jni_compiler.cc b/compiler/jni/quick/jni_compiler.cc
index 37f7d63..136e3db 100644
--- a/compiler/jni/quick/jni_compiler.cc
+++ b/compiler/jni/quick/jni_compiler.cc
@@ -25,7 +25,7 @@
#include "art_method.h"
#include "base/arena_allocator.h"
#include "base/enums.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/macros.h"
#include "calling_convention.h"
#include "class_linker.h"
diff --git a/compiler/jni/quick/mips/calling_convention_mips.cc b/compiler/jni/quick/mips/calling_convention_mips.cc
index 0e0716e..5ec1add 100644
--- a/compiler/jni/quick/mips/calling_convention_mips.cc
+++ b/compiler/jni/quick/mips/calling_convention_mips.cc
@@ -16,7 +16,8 @@
#include "calling_convention_mips.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "handle_scope-inl.h"
#include "utils/mips/managed_register_mips.h"
diff --git a/compiler/jni/quick/mips64/calling_convention_mips64.cc b/compiler/jni/quick/mips64/calling_convention_mips64.cc
index afe6a76..a7012ae 100644
--- a/compiler/jni/quick/mips64/calling_convention_mips64.cc
+++ b/compiler/jni/quick/mips64/calling_convention_mips64.cc
@@ -16,7 +16,8 @@
#include "calling_convention_mips64.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "handle_scope-inl.h"
#include "utils/mips64/managed_register_mips64.h"
diff --git a/compiler/jni/quick/x86/calling_convention_x86.cc b/compiler/jni/quick/x86/calling_convention_x86.cc
index 0bfcc3f..ad58e38 100644
--- a/compiler/jni/quick/x86/calling_convention_x86.cc
+++ b/compiler/jni/quick/x86/calling_convention_x86.cc
@@ -16,7 +16,8 @@
#include "calling_convention_x86.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "handle_scope-inl.h"
#include "utils/x86/managed_register_x86.h"
diff --git a/compiler/jni/quick/x86_64/calling_convention_x86_64.cc b/compiler/jni/quick/x86_64/calling_convention_x86_64.cc
index ba654f4..e5e96d0 100644
--- a/compiler/jni/quick/x86_64/calling_convention_x86_64.cc
+++ b/compiler/jni/quick/x86_64/calling_convention_x86_64.cc
@@ -16,8 +16,9 @@
#include "calling_convention_x86_64.h"
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
#include "handle_scope-inl.h"
#include "utils/x86_64/managed_register_x86_64.h"
diff --git a/compiler/linker/arm/relative_patcher_thumb2.cc b/compiler/linker/arm/relative_patcher_thumb2.cc
index 48747fc..7875517 100644
--- a/compiler/linker/arm/relative_patcher_thumb2.cc
+++ b/compiler/linker/arm/relative_patcher_thumb2.cc
@@ -16,6 +16,8 @@
#include "linker/arm/relative_patcher_thumb2.h"
+#include <sstream>
+
#include "arch/arm/asm_support_arm.h"
#include "art_method.h"
#include "base/bit_utils.h"
diff --git a/compiler/linker/error_delaying_output_stream.h b/compiler/linker/error_delaying_output_stream.h
index 33e6b5a..659f1dc 100644
--- a/compiler/linker/error_delaying_output_stream.h
+++ b/compiler/linker/error_delaying_output_stream.h
@@ -19,7 +19,9 @@
#include "output_stream.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/macros.h"
namespace art {
namespace linker {
diff --git a/compiler/linker/linker_patch.h b/compiler/linker/linker_patch.h
index 0ac1490..6f4e774 100644
--- a/compiler/linker/linker_patch.h
+++ b/compiler/linker/linker_patch.h
@@ -20,8 +20,9 @@
#include <iosfwd>
#include <stdint.h>
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
#include "method_reference.h"
namespace art {
diff --git a/compiler/linker/output_stream_test.cc b/compiler/linker/output_stream_test.cc
index ad29840..f93ea7a 100644
--- a/compiler/linker/output_stream_test.cc
+++ b/compiler/linker/output_stream_test.cc
@@ -17,7 +17,9 @@
#include "file_output_stream.h"
#include "vector_output_stream.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/macros.h"
#include "base/unix_file/fd_file.h"
#include "buffered_output_stream.h"
#include "common_runtime_test.h"
diff --git a/compiler/linker/vector_output_stream.cc b/compiler/linker/vector_output_stream.cc
index 75f90e5..f2cae5b 100644
--- a/compiler/linker/vector_output_stream.cc
+++ b/compiler/linker/vector_output_stream.cc
@@ -16,7 +16,7 @@
#include "vector_output_stream.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
namespace art {
namespace linker {
diff --git a/compiler/optimizing/block_builder.cc b/compiler/optimizing/block_builder.cc
index ed00032..58f591b 100644
--- a/compiler/optimizing/block_builder.cc
+++ b/compiler/optimizing/block_builder.cc
@@ -16,6 +16,7 @@
#include "block_builder.h"
+#include "base/logging.h" // FOR VLOG.
#include "bytecode_utils.h"
#include "quicken_info.h"
diff --git a/compiler/optimizing/code_generator_utils.cc b/compiler/optimizing/code_generator_utils.cc
index 96fe2a1..dd47a1f 100644
--- a/compiler/optimizing/code_generator_utils.cc
+++ b/compiler/optimizing/code_generator_utils.cc
@@ -15,9 +15,10 @@
*/
#include "code_generator_utils.h"
-#include "nodes.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "nodes.h"
namespace art {
diff --git a/compiler/optimizing/data_type.h b/compiler/optimizing/data_type.h
index d253036..548fe28 100644
--- a/compiler/optimizing/data_type.h
+++ b/compiler/optimizing/data_type.h
@@ -19,7 +19,8 @@
#include <iosfwd>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
namespace art {
diff --git a/compiler/optimizing/optimizing_compiler_stats.h b/compiler/optimizing/optimizing_compiler_stats.h
index a2e92d2..32a94ab 100644
--- a/compiler/optimizing/optimizing_compiler_stats.h
+++ b/compiler/optimizing/optimizing_compiler_stats.h
@@ -23,6 +23,7 @@
#include <type_traits>
#include "atomic.h"
+#include "base/logging.h" // For VLOG_IS_ON.
#include "globals.h"
namespace art {
diff --git a/compiler/utils/arm/assembler_arm_vixl.h b/compiler/utils/arm/assembler_arm_vixl.h
index 0e73e6b..1377e64 100644
--- a/compiler/utils/arm/assembler_arm_vixl.h
+++ b/compiler/utils/arm/assembler_arm_vixl.h
@@ -17,8 +17,10 @@
#ifndef ART_COMPILER_UTILS_ARM_ASSEMBLER_ARM_VIXL_H_
#define ART_COMPILER_UTILS_ARM_ASSEMBLER_ARM_VIXL_H_
+#include <android-base/logging.h>
+
#include "base/arena_containers.h"
-#include "base/logging.h"
+#include "base/macros.h"
#include "constants_arm.h"
#include "offsets.h"
#include "utils/arm/assembler_arm_shared.h"
diff --git a/compiler/utils/arm/constants_arm.h b/compiler/utils/arm/constants_arm.h
index 5b87e3e..66252be 100644
--- a/compiler/utils/arm/constants_arm.h
+++ b/compiler/utils/arm/constants_arm.h
@@ -21,9 +21,10 @@
#include <iosfwd>
+#include <android-base/logging.h>
+
#include "arch/arm/registers_arm.h"
#include "base/casts.h"
-#include "base/logging.h"
#include "globals.h"
namespace art {
diff --git a/compiler/utils/arm/jni_macro_assembler_arm_vixl.h b/compiler/utils/arm/jni_macro_assembler_arm_vixl.h
index c13c9af..4bc5d69 100644
--- a/compiler/utils/arm/jni_macro_assembler_arm_vixl.h
+++ b/compiler/utils/arm/jni_macro_assembler_arm_vixl.h
@@ -17,8 +17,10 @@
#ifndef ART_COMPILER_UTILS_ARM_JNI_MACRO_ASSEMBLER_ARM_VIXL_H_
#define ART_COMPILER_UTILS_ARM_JNI_MACRO_ASSEMBLER_ARM_VIXL_H_
+#include <android-base/logging.h>
+
#include "base/arena_containers.h"
-#include "base/logging.h"
+#include "base/macros.h"
#include "constants_arm.h"
#include "offsets.h"
#include "utils/arm/assembler_arm_shared.h"
diff --git a/compiler/utils/arm/managed_register_arm.h b/compiler/utils/arm/managed_register_arm.h
index 2be2d56..26f23b2 100644
--- a/compiler/utils/arm/managed_register_arm.h
+++ b/compiler/utils/arm/managed_register_arm.h
@@ -17,7 +17,8 @@
#ifndef ART_COMPILER_UTILS_ARM_MANAGED_REGISTER_ARM_H_
#define ART_COMPILER_UTILS_ARM_MANAGED_REGISTER_ARM_H_
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "constants_arm.h"
#include "debug/dwarf/register.h"
#include "utils/managed_register.h"
diff --git a/compiler/utils/arm64/assembler_arm64.cc b/compiler/utils/arm64/assembler_arm64.cc
index bb98958..c83fd44 100644
--- a/compiler/utils/arm64/assembler_arm64.cc
+++ b/compiler/utils/arm64/assembler_arm64.cc
@@ -15,7 +15,6 @@
*/
#include "assembler_arm64.h"
-#include "base/logging.h"
#include "entrypoints/quick/quick_entrypoints.h"
#include "heap_poisoning.h"
#include "offsets.h"
diff --git a/compiler/utils/arm64/assembler_arm64.h b/compiler/utils/arm64/assembler_arm64.h
index e5ec24a..8983af2 100644
--- a/compiler/utils/arm64/assembler_arm64.h
+++ b/compiler/utils/arm64/assembler_arm64.h
@@ -21,8 +21,10 @@
#include <memory>
#include <vector>
+#include <android-base/logging.h>
+
#include "base/arena_containers.h"
-#include "base/logging.h"
+#include "base/macros.h"
#include "offsets.h"
#include "utils/arm64/managed_register_arm64.h"
#include "utils/assembler.h"
diff --git a/compiler/utils/arm64/jni_macro_assembler_arm64.cc b/compiler/utils/arm64/jni_macro_assembler_arm64.cc
index 573bb6d..a5aa1c1 100644
--- a/compiler/utils/arm64/jni_macro_assembler_arm64.cc
+++ b/compiler/utils/arm64/jni_macro_assembler_arm64.cc
@@ -16,7 +16,6 @@
#include "jni_macro_assembler_arm64.h"
-#include "base/logging.h"
#include "entrypoints/quick/quick_entrypoints.h"
#include "managed_register_arm64.h"
#include "offsets.h"
diff --git a/compiler/utils/arm64/jni_macro_assembler_arm64.h b/compiler/utils/arm64/jni_macro_assembler_arm64.h
index ce39a13..f531b2a 100644
--- a/compiler/utils/arm64/jni_macro_assembler_arm64.h
+++ b/compiler/utils/arm64/jni_macro_assembler_arm64.h
@@ -21,10 +21,12 @@
#include <memory>
#include <vector>
+#include <android-base/logging.h>
+
#include "assembler_arm64.h"
#include "base/arena_containers.h"
#include "base/enums.h"
-#include "base/logging.h"
+#include "base/macros.h"
#include "offsets.h"
#include "utils/assembler.h"
#include "utils/jni_macro_assembler.h"
diff --git a/compiler/utils/arm64/managed_register_arm64.h b/compiler/utils/arm64/managed_register_arm64.h
index 7378a0a..9ce7ec9 100644
--- a/compiler/utils/arm64/managed_register_arm64.h
+++ b/compiler/utils/arm64/managed_register_arm64.h
@@ -17,8 +17,9 @@
#ifndef ART_COMPILER_UTILS_ARM64_MANAGED_REGISTER_ARM64_H_
#define ART_COMPILER_UTILS_ARM64_MANAGED_REGISTER_ARM64_H_
+#include <android-base/logging.h>
+
#include "arch/arm64/registers_arm64.h"
-#include "base/logging.h"
#include "debug/dwarf/register.h"
#include "utils/managed_register.h"
diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h
index e0cef85..5b0cd6b 100644
--- a/compiler/utils/assembler.h
+++ b/compiler/utils/assembler.h
@@ -19,6 +19,8 @@
#include <vector>
+#include <android-base/logging.h>
+
#include "arch/instruction_set.h"
#include "arch/instruction_set_features.h"
#include "arm/constants_arm.h"
@@ -26,7 +28,6 @@
#include "base/arena_object.h"
#include "base/array_ref.h"
#include "base/enums.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "debug/dwarf/debug_frame_opcode_writer.h"
#include "label.h"
diff --git a/compiler/utils/intrusive_forward_list.h b/compiler/utils/intrusive_forward_list.h
index 5a358ac..ccdd32a 100644
--- a/compiler/utils/intrusive_forward_list.h
+++ b/compiler/utils/intrusive_forward_list.h
@@ -23,8 +23,9 @@
#include <memory>
#include <type_traits>
+#include <android-base/logging.h>
+
#include "base/casts.h"
-#include "base/logging.h"
#include "base/macros.h"
namespace art {
diff --git a/compiler/utils/jni_macro_assembler.h b/compiler/utils/jni_macro_assembler.h
index 0fc1353..f5df926 100644
--- a/compiler/utils/jni_macro_assembler.h
+++ b/compiler/utils/jni_macro_assembler.h
@@ -19,12 +19,13 @@
#include <vector>
+#include <android-base/logging.h>
+
#include "arch/instruction_set.h"
#include "base/arena_allocator.h"
#include "base/arena_object.h"
#include "base/array_ref.h"
#include "base/enums.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "managed_register.h"
#include "offsets.h"
diff --git a/compiler/utils/label.h b/compiler/utils/label.h
index b9d4e9c..3c91b2f 100644
--- a/compiler/utils/label.h
+++ b/compiler/utils/label.h
@@ -17,8 +17,8 @@
#ifndef ART_COMPILER_UTILS_LABEL_H_
#define ART_COMPILER_UTILS_LABEL_H_
-#include "base/logging.h"
-#include "base/macros.h"
+#include <android-base/logging.h>
+#include <android-base/macros.h>
namespace art {
diff --git a/compiler/utils/mips/constants_mips.h b/compiler/utils/mips/constants_mips.h
index b4dfdbd..016c0db 100644
--- a/compiler/utils/mips/constants_mips.h
+++ b/compiler/utils/mips/constants_mips.h
@@ -19,8 +19,9 @@
#include <iosfwd>
+#include <android-base/logging.h>
+
#include "arch/mips/registers_mips.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "globals.h"
diff --git a/compiler/utils/mips64/constants_mips64.h b/compiler/utils/mips64/constants_mips64.h
index bc8e40b..310f23c 100644
--- a/compiler/utils/mips64/constants_mips64.h
+++ b/compiler/utils/mips64/constants_mips64.h
@@ -19,8 +19,9 @@
#include <iosfwd>
+#include <android-base/logging.h>
+
#include "arch/mips64/registers_mips64.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "globals.h"
diff --git a/compiler/utils/swap_space.cc b/compiler/utils/swap_space.cc
index 12d113d..1f9ad42 100644
--- a/compiler/utils/swap_space.cc
+++ b/compiler/utils/swap_space.cc
@@ -22,7 +22,6 @@
#include <numeric>
#include "base/bit_utils.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "base/mutex.h"
#include "thread-current-inl.h"
diff --git a/compiler/utils/swap_space.h b/compiler/utils/swap_space.h
index 2280f8b..76df527 100644
--- a/compiler/utils/swap_space.h
+++ b/compiler/utils/swap_space.h
@@ -24,7 +24,8 @@
#include <set>
#include <vector>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
#include "base/mutex.h"
diff --git a/compiler/utils/test_dex_file_builder.h b/compiler/utils/test_dex_file_builder.h
index 0da30fe..441ef8e 100644
--- a/compiler/utils/test_dex_file_builder.h
+++ b/compiler/utils/test_dex_file_builder.h
@@ -24,8 +24,9 @@
#include <set>
#include <vector>
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
#include "dex_file_loader.h"
#include "standard_dex_file.h"
diff --git a/compiler/utils/x86/constants_x86.h b/compiler/utils/x86/constants_x86.h
index 0bc1560..2e03b9f 100644
--- a/compiler/utils/x86/constants_x86.h
+++ b/compiler/utils/x86/constants_x86.h
@@ -19,8 +19,9 @@
#include <iosfwd>
+#include <android-base/logging.h>
+
#include "arch/x86/registers_x86.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "globals.h"
diff --git a/compiler/utils/x86_64/constants_x86_64.h b/compiler/utils/x86_64/constants_x86_64.h
index cc508a1..2af3e7b 100644
--- a/compiler/utils/x86_64/constants_x86_64.h
+++ b/compiler/utils/x86_64/constants_x86_64.h
@@ -19,8 +19,9 @@
#include <iosfwd>
+#include <android-base/logging.h>
+
#include "arch/x86_64/registers_x86_64.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "globals.h"
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 27bec1d..a70e551 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -345,7 +345,7 @@
CompilerOptions::kDefaultInlineMaxCodeUnits);
UsageError(" Default: %d", CompilerOptions::kDefaultInlineMaxCodeUnits);
UsageError("");
- UsageError(" --dump-timing: display a breakdown of where time was spent");
+ UsageError(" --dump-timings: display a breakdown of where time was spent");
UsageError("");
UsageError(" -g");
UsageError(" --generate-debug-info: Generate debug information for native debugging,");
diff --git a/dex2oat/dex2oat_image_test.cc b/dex2oat/dex2oat_image_test.cc
index a02fbf8..035b395 100644
--- a/dex2oat/dex2oat_image_test.cc
+++ b/dex2oat/dex2oat_image_test.cc
@@ -22,10 +22,11 @@
#include <sys/wait.h>
#include <unistd.h>
+#include <android-base/logging.h>
+
#include "common_runtime_test.h"
#include "base/file_utils.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "base/unix_file/fd_file.h"
#include "dex_file-inl.h"
diff --git a/dex2oat/dex2oat_test.cc b/dex2oat/dex2oat_test.cc
index ad287b0..8805aa1 100644
--- a/dex2oat/dex2oat_test.cc
+++ b/dex2oat/dex2oat_test.cc
@@ -22,11 +22,11 @@
#include <sys/wait.h>
#include <unistd.h>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "common_runtime_test.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "base/mutex-inl.h"
#include "bytecode_utils.h"
diff --git a/dex2oat/linker/elf_writer_quick.cc b/dex2oat/linker/elf_writer_quick.cc
index b139a12..5fc33dd 100644
--- a/dex2oat/linker/elf_writer_quick.cc
+++ b/dex2oat/linker/elf_writer_quick.cc
@@ -20,8 +20,9 @@
#include <unordered_map>
#include <unordered_set>
+#include <android-base/logging.h>
+
#include "base/casts.h"
-#include "base/logging.h"
#include "compiled_method.h"
#include "debug/elf_debug_writer.h"
#include "debug/method_debug_info.h"
diff --git a/dex2oat/linker/image_writer.cc b/dex2oat/linker/image_writer.cc
index 28521e1..f6ceb27 100644
--- a/dex2oat/linker/image_writer.cc
+++ b/dex2oat/linker/image_writer.cc
@@ -29,7 +29,7 @@
#include "art_method-inl.h"
#include "base/callee_save_type.h"
#include "base/enums.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/unix_file/fd_file.h"
#include "class_linker-inl.h"
#include "compiled_method.h"
diff --git a/dex2oat/linker/index_bss_mapping_encoder.h b/dex2oat/linker/index_bss_mapping_encoder.h
index 9bc1432..c6326ed 100644
--- a/dex2oat/linker/index_bss_mapping_encoder.h
+++ b/dex2oat/linker/index_bss_mapping_encoder.h
@@ -17,9 +17,10 @@
#ifndef ART_DEX2OAT_LINKER_INDEX_BSS_MAPPING_ENCODER_H_
#define ART_DEX2OAT_LINKER_INDEX_BSS_MAPPING_ENCODER_H_
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
#include "base/bit_vector-inl.h"
-#include "base/logging.h"
#include "index_bss_mapping.h"
namespace art {
diff --git a/dex2oat/linker/multi_oat_relative_patcher.cc b/dex2oat/linker/multi_oat_relative_patcher.cc
index 178a78f..1abaf7d 100644
--- a/dex2oat/linker/multi_oat_relative_patcher.cc
+++ b/dex2oat/linker/multi_oat_relative_patcher.cc
@@ -16,8 +16,9 @@
#include "multi_oat_relative_patcher.h"
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
#include "globals.h"
namespace art {
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index 57d02c5..b163eeb 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -26,6 +26,7 @@
#include "base/bit_vector-inl.h"
#include "base/enums.h"
#include "base/file_magic.h"
+#include "base/logging.h" // For VLOG
#include "base/stl_util.h"
#include "base/unix_file/fd_file.h"
#include "class_linker.h"
diff --git a/dexdump/dexdump_cfg.cc b/dexdump/dexdump_cfg.cc
index 62c970d..23ecf93 100644
--- a/dexdump/dexdump_cfg.cc
+++ b/dexdump/dexdump_cfg.cc
@@ -23,6 +23,7 @@
#include <map>
#include <ostream>
#include <set>
+#include <sstream>
#include "dex_file-inl.h"
#include "dex_instruction-inl.h"
diff --git a/dexdump/dexdump_main.cc b/dexdump/dexdump_main.cc
index 43c3d12..382b551 100644
--- a/dexdump/dexdump_main.cc
+++ b/dexdump/dexdump_main.cc
@@ -28,7 +28,9 @@
#include <string.h>
#include <unistd.h>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include <base/logging.h> // For InitLogging.
#include "mem_map.h"
#include "runtime.h"
diff --git a/dexlayout/dex_ir.cc b/dexlayout/dex_ir.cc
index 2af579c..90df2d7 100644
--- a/dexlayout/dex_ir.cc
+++ b/dexlayout/dex_ir.cc
@@ -674,20 +674,20 @@
// Add "fixup" references to types, strings, methods, and fields.
// This is temporary, as we will probably want more detailed parsing of the
// instructions here.
- std::unique_ptr<std::vector<TypeId*>> type_ids(new std::vector<TypeId*>());
- std::unique_ptr<std::vector<StringId*>> string_ids(new std::vector<StringId*>());
- std::unique_ptr<std::vector<MethodId*>> method_ids(new std::vector<MethodId*>());
- std::unique_ptr<std::vector<FieldId*>> field_ids(new std::vector<FieldId*>());
+ std::vector<TypeId*> type_ids;
+ std::vector<StringId*> string_ids;
+ std::vector<MethodId*> method_ids;
+ std::vector<FieldId*> field_ids;
if (GetIdsFromByteCode(*this,
code_item,
- type_ids.get(),
- string_ids.get(),
- method_ids.get(),
- field_ids.get())) {
- CodeFixups* fixups = new CodeFixups(type_ids.release(),
- string_ids.release(),
- method_ids.release(),
- field_ids.release());
+ /*out*/ &type_ids,
+ /*out*/ &string_ids,
+ /*out*/ &method_ids,
+ /*out*/ &field_ids)) {
+ CodeFixups* fixups = new CodeFixups(std::move(type_ids),
+ std::move(string_ids),
+ std::move(method_ids),
+ std::move(field_ids));
code_item->SetCodeFixups(fixups);
}
diff --git a/dexlayout/dex_ir.h b/dexlayout/dex_ir.h
index 8421774..b25e164 100644
--- a/dexlayout/dex_ir.h
+++ b/dexlayout/dex_ir.h
@@ -1013,25 +1013,25 @@
class CodeFixups {
public:
- CodeFixups(std::vector<TypeId*>* type_ids,
- std::vector<StringId*>* string_ids,
- std::vector<MethodId*>* method_ids,
- std::vector<FieldId*>* field_ids)
- : type_ids_(type_ids),
- string_ids_(string_ids),
- method_ids_(method_ids),
- field_ids_(field_ids) { }
+ CodeFixups(std::vector<TypeId*> type_ids,
+ std::vector<StringId*> string_ids,
+ std::vector<MethodId*> method_ids,
+ std::vector<FieldId*> field_ids)
+ : type_ids_(std::move(type_ids)),
+ string_ids_(std::move(string_ids)),
+ method_ids_(std::move(method_ids)),
+ field_ids_(std::move(field_ids)) { }
- std::vector<TypeId*>* TypeIds() const { return type_ids_.get(); }
- std::vector<StringId*>* StringIds() const { return string_ids_.get(); }
- std::vector<MethodId*>* MethodIds() const { return method_ids_.get(); }
- std::vector<FieldId*>* FieldIds() const { return field_ids_.get(); }
+ const std::vector<TypeId*>& TypeIds() const { return type_ids_; }
+ const std::vector<StringId*>& StringIds() const { return string_ids_; }
+ const std::vector<MethodId*>& MethodIds() const { return method_ids_; }
+ const std::vector<FieldId*>& FieldIds() const { return field_ids_; }
private:
- std::unique_ptr<std::vector<TypeId*>> type_ids_;
- std::unique_ptr<std::vector<StringId*>> string_ids_;
- std::unique_ptr<std::vector<MethodId*>> method_ids_;
- std::unique_ptr<std::vector<FieldId*>> field_ids_;
+ std::vector<TypeId*> type_ids_;
+ std::vector<StringId*> string_ids_;
+ std::vector<MethodId*> method_ids_;
+ std::vector<FieldId*> field_ids_;
DISALLOW_COPY_AND_ASSIGN(CodeFixups);
};
diff --git a/dexlayout/dex_visualize.cc b/dexlayout/dex_visualize.cc
index 4b46341..e4ed69b 100644
--- a/dexlayout/dex_visualize.cc
+++ b/dexlayout/dex_visualize.cc
@@ -188,20 +188,16 @@
DumpAddressRange(code_item, class_index);
const dex_ir::CodeFixups* fixups = code_item->GetCodeFixups();
if (fixups != nullptr) {
- std::vector<dex_ir::TypeId*>* type_ids = fixups->TypeIds();
- for (dex_ir::TypeId* type_id : *type_ids) {
+ for (dex_ir::TypeId* type_id : fixups->TypeIds()) {
DumpTypeId(type_id, class_index);
}
- std::vector<dex_ir::StringId*>* string_ids = fixups->StringIds();
- for (dex_ir::StringId* string_id : *string_ids) {
+ for (dex_ir::StringId* string_id : fixups->StringIds()) {
DumpStringId(string_id, class_index);
}
- std::vector<dex_ir::MethodId*>* method_ids = fixups->MethodIds();
- for (dex_ir::MethodId* method_id : *method_ids) {
+ for (dex_ir::MethodId* method_id : fixups->MethodIds()) {
DumpMethodId(method_id, class_index);
}
- std::vector<dex_ir::FieldId*>* field_ids = fixups->FieldIds();
- for (dex_ir::FieldId* field_id : *field_ids) {
+ for (dex_ir::FieldId* field_id : fixups->FieldIds()) {
DumpFieldId(field_id, class_index);
}
}
diff --git a/dexlayout/dexdiag.cc b/dexlayout/dexdiag.cc
index e83f98e..b250701 100644
--- a/dexlayout/dexdiag.cc
+++ b/dexlayout/dexdiag.cc
@@ -26,6 +26,7 @@
#include "android-base/stringprintf.h"
+#include "base/logging.h" // For InitLogging.
#include "base/stringpiece.h"
#include "dex_file.h"
diff --git a/dexlayout/dexlayout.cc b/dexlayout/dexlayout.cc
index d904a52..33155b6 100644
--- a/dexlayout/dexlayout.cc
+++ b/dexlayout/dexlayout.cc
@@ -33,6 +33,7 @@
#include "android-base/stringprintf.h"
+#include "base/logging.h" // For VLOG_IS_ON.
#include "dex_file-inl.h"
#include "dex_file_layout.h"
#include "dex_file_loader.h"
@@ -1656,11 +1657,11 @@
continue;
}
// Add const-strings.
- for (dex_ir::StringId* id : *fixups->StringIds()) {
+ for (dex_ir::StringId* id : fixups->StringIds()) {
from_hot_method[id->GetIndex()] = true;
}
// Add field classes, names, and types.
- for (dex_ir::FieldId* id : *fixups->FieldIds()) {
+ for (dex_ir::FieldId* id : fixups->FieldIds()) {
// TODO: Only visit field ids from static getters and setters.
from_hot_method[id->Class()->GetStringId()->GetIndex()] = true;
from_hot_method[id->Name()->GetIndex()] = true;
@@ -1668,7 +1669,7 @@
}
// For clinits, add referenced method classes, names, and protos.
if (is_clinit) {
- for (dex_ir::MethodId* id : *fixups->MethodIds()) {
+ for (dex_ir::MethodId* id : fixups->MethodIds()) {
from_hot_method[id->Class()->GetStringId()->GetIndex()] = true;
from_hot_method[id->Name()->GetIndex()] = true;
is_shorty[id->Proto()->Shorty()->GetIndex()] = true;
diff --git a/dexlayout/dexlayout_main.cc b/dexlayout/dexlayout_main.cc
index 17097f1..5bb7196 100644
--- a/dexlayout/dexlayout_main.cc
+++ b/dexlayout/dexlayout_main.cc
@@ -29,7 +29,9 @@
#include <sys/types.h>
#include <unistd.h>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/logging.h" // For InitLogging.
#include "jit/profile_compilation_info.h"
#include "mem_map.h"
#include "runtime.h"
diff --git a/dexlist/dexlist.cc b/dexlist/dexlist.cc
index 3bd903d..630eacb 100644
--- a/dexlist/dexlist.cc
+++ b/dexlist/dexlist.cc
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include "base/logging.h" // For InitLogging.
#include "dex_file-inl.h"
#include "dex_file_loader.h"
#include "mem_map.h"
diff --git a/dexoptanalyzer/dexoptanalyzer.cc b/dexoptanalyzer/dexoptanalyzer.cc
index 39c9b99..eead2dc 100644
--- a/dexoptanalyzer/dexoptanalyzer.cc
+++ b/dexoptanalyzer/dexoptanalyzer.cc
@@ -16,9 +16,11 @@
#include <string>
+#include "base/logging.h" // For InitLogging.
#include "android-base/stringprintf.h"
#include "android-base/strings.h"
#include "base/file_utils.h"
+#include "base/logging.h" // For InitLogging.
#include "compiler_filter.h"
#include "class_loader_context.h"
#include "dex_file.h"
diff --git a/openjdkjvm/OpenjdkJvm.cc b/openjdkjvm/OpenjdkJvm.cc
index 29ebefd..1b8233a 100644
--- a/openjdkjvm/OpenjdkJvm.cc
+++ b/openjdkjvm/OpenjdkJvm.cc
@@ -40,9 +40,10 @@
#include <sys/time.h>
#include <unistd.h>
+#include <android-base/logging.h>
+
#include "../../libcore/ojluni/src/main/native/jvm.h" // TODO(narayan): fix it
-#include "base/logging.h"
#include "base/macros.h"
#include "common_throws.h"
#include "gc/heap.h"
diff --git a/openjdkjvmti/OpenjdkJvmTi.cc b/openjdkjvmti/OpenjdkJvmTi.cc
index 6b2d5d6..aae8055 100644
--- a/openjdkjvmti/OpenjdkJvmTi.cc
+++ b/openjdkjvmti/OpenjdkJvmTi.cc
@@ -33,12 +33,14 @@
#include <type_traits>
#include <vector>
+#include <android-base/logging.h>
+
#include <jni.h>
#include "jvmti.h"
#include "art_jvmti.h"
-#include "base/logging.h"
+#include "base/logging.h" // For gLogVerbosity.
#include "base/mutex.h"
#include "events-inl.h"
#include "jni_env_ext-inl.h"
diff --git a/openjdkjvmti/art_jvmti.h b/openjdkjvmti/art_jvmti.h
index e8e62c2..2a8c2e9 100644
--- a/openjdkjvmti/art_jvmti.h
+++ b/openjdkjvmti/art_jvmti.h
@@ -39,9 +39,10 @@
#include <jni.h>
+#include <android-base/logging.h>
+
#include "deopt_manager.h"
#include "base/casts.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "base/strlcpy.h"
#include "base/mutex.h"
diff --git a/openjdkjvmti/events.cc b/openjdkjvmti/events.cc
index 912e754..330a3de 100644
--- a/openjdkjvmti/events.cc
+++ b/openjdkjvmti/events.cc
@@ -36,7 +36,6 @@
#include "art_field-inl.h"
#include "art_jvmti.h"
#include "art_method-inl.h"
-#include "base/logging.h"
#include "deopt_manager.h"
#include "dex_file_types.h"
#include "gc/allocation_listener.h"
diff --git a/openjdkjvmti/events.h b/openjdkjvmti/events.h
index 7bdd9a5..81edb93 100644
--- a/openjdkjvmti/events.h
+++ b/openjdkjvmti/events.h
@@ -20,7 +20,10 @@
#include <bitset>
#include <vector>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/macros.h"
+#include "base/mutex.h"
#include "jvmti.h"
#include "thread.h"
diff --git a/openjdkjvmti/jvmti_allocator.h b/openjdkjvmti/jvmti_allocator.h
index 11af7b6..bd4c85b 100644
--- a/openjdkjvmti/jvmti_allocator.h
+++ b/openjdkjvmti/jvmti_allocator.h
@@ -32,8 +32,9 @@
#ifndef ART_OPENJDKJVMTI_JVMTI_ALLOCATOR_H_
#define ART_OPENJDKJVMTI_JVMTI_ALLOCATOR_H_
-#include "base/logging.h"
-#include "base/macros.h"
+#include <android-base/logging.h>
+#include <android-base/macros.h>
+
#include "jvmti.h"
#include "ti_allocator.h"
diff --git a/openjdkjvmti/jvmti_weak_table-inl.h b/openjdkjvmti/jvmti_weak_table-inl.h
index 5d20946..6990042 100644
--- a/openjdkjvmti/jvmti_weak_table-inl.h
+++ b/openjdkjvmti/jvmti_weak_table-inl.h
@@ -36,8 +36,9 @@
#include <limits>
+#include <android-base/logging.h>
+
#include "art_jvmti.h"
-#include "base/logging.h"
#include "gc/allocation_listener.h"
#include "instrumentation.h"
#include "jni_env_ext-inl.h"
diff --git a/openjdkjvmti/ti_class_loader.cc b/openjdkjvmti/ti_class_loader.cc
index b551b55..701ba80 100644
--- a/openjdkjvmti/ti_class_loader.cc
+++ b/openjdkjvmti/ti_class_loader.cc
@@ -33,11 +33,11 @@
#include <limits>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "art_field-inl.h"
#include "art_jvmti.h"
-#include "base/logging.h"
#include "dex_file.h"
#include "dex_file_types.h"
#include "events-inl.h"
diff --git a/openjdkjvmti/ti_redefine.cc b/openjdkjvmti/ti_redefine.cc
index 5b125f6..c18b354 100644
--- a/openjdkjvmti/ti_redefine.cc
+++ b/openjdkjvmti/ti_redefine.cc
@@ -33,13 +33,13 @@
#include <limits>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "art_field-inl.h"
#include "art_jvmti.h"
#include "art_method-inl.h"
#include "base/array_ref.h"
-#include "base/logging.h"
#include "base/stringpiece.h"
#include "class_linker-inl.h"
#include "debugger.h"
diff --git a/openjdkjvmti/ti_thread.cc b/openjdkjvmti/ti_thread.cc
index b7b81ce..555c5a7 100644
--- a/openjdkjvmti/ti_thread.cc
+++ b/openjdkjvmti/ti_thread.cc
@@ -31,10 +31,11 @@
#include "ti_thread.h"
-#include "android-base/strings.h"
+#include <android-base/logging.h>
+#include <android-base/strings.h>
+
#include "art_field-inl.h"
#include "art_jvmti.h"
-#include "base/logging.h"
#include "base/mutex.h"
#include "events-inl.h"
#include "gc/system_weak.h"
diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc
index ae82d72..eb648cb 100644
--- a/patchoat/patchoat.cc
+++ b/patchoat/patchoat.cc
@@ -30,6 +30,7 @@
#include "art_field-inl.h"
#include "art_method-inl.h"
#include "base/dumpable.h"
+#include "base/logging.h" // For InitLogging.
#include "base/memory_tool.h"
#include "base/scoped_flock.h"
#include "base/stringpiece.h"
diff --git a/profman/profman.cc b/profman/profman.cc
index a5a5546..0bef205 100644
--- a/profman/profman.cc
+++ b/profman/profman.cc
@@ -32,6 +32,7 @@
#include "android-base/strings.h"
#include "base/dumpable.h"
+#include "base/logging.h" // For InitLogging.
#include "base/scoped_flock.h"
#include "base/stringpiece.h"
#include "base/time_utils.h"
diff --git a/runtime/Android.bp b/runtime/Android.bp
index a136ccb..6477347 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -39,6 +39,7 @@
"base/hex_dump.cc",
"base/logging.cc",
"base/mutex.cc",
+ "base/runtime_debug.cc",
"base/safe_copy.cc",
"base/scoped_arena_allocator.cc",
"base/scoped_flock.cc",
diff --git a/runtime/arch/arm/context_arm.h b/runtime/arch/arm/context_arm.h
index fa9aa46..b980296 100644
--- a/runtime/arch/arm/context_arm.h
+++ b/runtime/arch/arm/context_arm.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_ARCH_ARM_CONTEXT_ARM_H_
#define ART_RUNTIME_ARCH_ARM_CONTEXT_ARM_H_
+#include <android-base/logging.h>
+
#include "arch/context.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "registers_arm.h"
diff --git a/runtime/arch/arm/fault_handler_arm.cc b/runtime/arch/arm/fault_handler_arm.cc
index ef2b342..315bf95 100644
--- a/runtime/arch/arm/fault_handler_arm.cc
+++ b/runtime/arch/arm/fault_handler_arm.cc
@@ -21,7 +21,7 @@
#include "art_method.h"
#include "base/enums.h"
#include "base/hex_dump.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/macros.h"
#include "globals.h"
#include "thread-current-inl.h"
diff --git a/runtime/arch/arm/instruction_set_features_arm.cc b/runtime/arch/arm/instruction_set_features_arm.cc
index b789fc7..801254f 100644
--- a/runtime/arch/arm/instruction_set_features_arm.cc
+++ b/runtime/arch/arm/instruction_set_features_arm.cc
@@ -25,10 +25,9 @@
#include <fstream>
-#include "android-base/stringprintf.h"
-#include "android-base/strings.h"
-
-#include "base/logging.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
#if defined(__arm__)
extern "C" bool artCheckForArmSdivInstruction();
diff --git a/runtime/arch/arm/thread_arm.cc b/runtime/arch/arm/thread_arm.cc
index ff4f81b..18585c7 100644
--- a/runtime/arch/arm/thread_arm.cc
+++ b/runtime/arch/arm/thread_arm.cc
@@ -16,9 +16,10 @@
#include "thread.h"
+#include <android-base/logging.h>
+
#include "asm_support_arm.h"
#include "base/enums.h"
-#include "base/logging.h"
namespace art {
diff --git a/runtime/arch/arm64/context_arm64.h b/runtime/arch/arm64/context_arm64.h
index 36aded0..e64cfb8 100644
--- a/runtime/arch/arm64/context_arm64.h
+++ b/runtime/arch/arm64/context_arm64.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_ARCH_ARM64_CONTEXT_ARM64_H_
#define ART_RUNTIME_ARCH_ARM64_CONTEXT_ARM64_H_
+#include <android-base/logging.h>
+
#include "arch/context.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "registers_arm64.h"
diff --git a/runtime/arch/arm64/fault_handler_arm64.cc b/runtime/arch/arm64/fault_handler_arm64.cc
index d535c7e..d282c8c 100644
--- a/runtime/arch/arm64/fault_handler_arm64.cc
+++ b/runtime/arch/arm64/fault_handler_arm64.cc
@@ -21,7 +21,7 @@
#include "art_method.h"
#include "base/enums.h"
#include "base/hex_dump.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/macros.h"
#include "globals.h"
#include "registers_arm64.h"
diff --git a/runtime/arch/arm64/instruction_set_features_arm64.cc b/runtime/arch/arm64/instruction_set_features_arm64.cc
index d830ccf..9e9cb16 100644
--- a/runtime/arch/arm64/instruction_set_features_arm64.cc
+++ b/runtime/arch/arm64/instruction_set_features_arm64.cc
@@ -19,10 +19,10 @@
#include <fstream>
#include <sstream>
-#include "android-base/stringprintf.h"
-#include "android-base/strings.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
-#include "base/logging.h"
#include "base/stl_util.h"
namespace art {
diff --git a/runtime/arch/arm64/thread_arm64.cc b/runtime/arch/arm64/thread_arm64.cc
index 3483b70..19c4a6a 100644
--- a/runtime/arch/arm64/thread_arm64.cc
+++ b/runtime/arch/arm64/thread_arm64.cc
@@ -16,9 +16,10 @@
#include "thread.h"
+#include <android-base/logging.h>
+
#include "asm_support_arm64.h"
#include "base/enums.h"
-#include "base/logging.h"
namespace art {
diff --git a/runtime/arch/code_offset.h b/runtime/arch/code_offset.h
index ab04b1e..8e8dde4 100644
--- a/runtime/arch/code_offset.h
+++ b/runtime/arch/code_offset.h
@@ -19,8 +19,10 @@
#include <iosfwd>
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
+#include "base/macros.h"
#include "instruction_set.h"
namespace art {
diff --git a/runtime/arch/instruction_set_features_test.cc b/runtime/arch/instruction_set_features_test.cc
index 67e2f35..1e3275c 100644
--- a/runtime/arch/instruction_set_features_test.cc
+++ b/runtime/arch/instruction_set_features_test.cc
@@ -19,12 +19,11 @@
#include <gtest/gtest.h>
#ifdef ART_TARGET_ANDROID
-#include "android-base/properties.h"
+#include <android-base/properties.h>
#endif
-#include "android-base/stringprintf.h"
-
-#include "base/logging.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
namespace art {
diff --git a/runtime/arch/mips/context_mips.h b/runtime/arch/mips/context_mips.h
index 7dcff63..7e073b2 100644
--- a/runtime/arch/mips/context_mips.h
+++ b/runtime/arch/mips/context_mips.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_ARCH_MIPS_CONTEXT_MIPS_H_
#define ART_RUNTIME_ARCH_MIPS_CONTEXT_MIPS_H_
+#include <android-base/logging.h>
+
#include "arch/context.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "registers_mips.h"
diff --git a/runtime/arch/mips/entrypoints_init_mips.cc b/runtime/arch/mips/entrypoints_init_mips.cc
index dca3382..209f367 100644
--- a/runtime/arch/mips/entrypoints_init_mips.cc
+++ b/runtime/arch/mips/entrypoints_init_mips.cc
@@ -18,6 +18,7 @@
#include "arch/mips/asm_support_mips.h"
#include "atomic.h"
+#include "base/logging.h"
#include "entrypoints/entrypoint_utils.h"
#include "entrypoints/jni/jni_entrypoints.h"
#include "entrypoints/math_entrypoints.h"
diff --git a/runtime/arch/mips/fault_handler_mips.cc b/runtime/arch/mips/fault_handler_mips.cc
index 6dce54e..f82dc08 100644
--- a/runtime/arch/mips/fault_handler_mips.cc
+++ b/runtime/arch/mips/fault_handler_mips.cc
@@ -20,7 +20,7 @@
#include "art_method.h"
#include "base/callee_save_type.h"
#include "base/hex_dump.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/macros.h"
#include "globals.h"
#include "quick_method_frame_info_mips.h"
diff --git a/runtime/arch/mips/instruction_set_features_mips.cc b/runtime/arch/mips/instruction_set_features_mips.cc
index 6d4145b..952ed25 100644
--- a/runtime/arch/mips/instruction_set_features_mips.cc
+++ b/runtime/arch/mips/instruction_set_features_mips.cc
@@ -19,10 +19,9 @@
#include <fstream>
#include <sstream>
-#include "android-base/stringprintf.h"
-#include "android-base/strings.h"
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
-#include "base/logging.h"
#include "base/stl_util.h"
namespace art {
diff --git a/runtime/arch/mips/instruction_set_features_mips.h b/runtime/arch/mips/instruction_set_features_mips.h
index ee539ed..76bc639 100644
--- a/runtime/arch/mips/instruction_set_features_mips.h
+++ b/runtime/arch/mips/instruction_set_features_mips.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_ARCH_MIPS_INSTRUCTION_SET_FEATURES_MIPS_H_
#define ART_RUNTIME_ARCH_MIPS_INSTRUCTION_SET_FEATURES_MIPS_H_
+#include <android-base/logging.h>
+
#include "arch/instruction_set_features.h"
-#include "base/logging.h"
#include "base/macros.h"
namespace art {
diff --git a/runtime/arch/mips/registers_mips.h b/runtime/arch/mips/registers_mips.h
index 57af150..f500b58 100644
--- a/runtime/arch/mips/registers_mips.h
+++ b/runtime/arch/mips/registers_mips.h
@@ -19,7 +19,8 @@
#include <iosfwd>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
#include "globals.h"
diff --git a/runtime/arch/mips/thread_mips.cc b/runtime/arch/mips/thread_mips.cc
index 0a9ab7a..0be7a7f 100644
--- a/runtime/arch/mips/thread_mips.cc
+++ b/runtime/arch/mips/thread_mips.cc
@@ -16,9 +16,10 @@
#include "thread.h"
+#include <android-base/logging.h>
+
#include "asm_support_mips.h"
#include "base/enums.h"
-#include "base/logging.h"
namespace art {
diff --git a/runtime/arch/mips64/context_mips64.h b/runtime/arch/mips64/context_mips64.h
index 89fbf8f..b2a6138 100644
--- a/runtime/arch/mips64/context_mips64.h
+++ b/runtime/arch/mips64/context_mips64.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_ARCH_MIPS64_CONTEXT_MIPS64_H_
#define ART_RUNTIME_ARCH_MIPS64_CONTEXT_MIPS64_H_
+#include <android-base/logging.h>
+
#include "arch/context.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "registers_mips64.h"
diff --git a/runtime/arch/mips64/fault_handler_mips64.cc b/runtime/arch/mips64/fault_handler_mips64.cc
index bdce520..ba6fff0 100644
--- a/runtime/arch/mips64/fault_handler_mips64.cc
+++ b/runtime/arch/mips64/fault_handler_mips64.cc
@@ -21,7 +21,7 @@
#include "art_method.h"
#include "base/callee_save_type.h"
#include "base/hex_dump.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/macros.h"
#include "globals.h"
#include "quick_method_frame_info_mips64.h"
diff --git a/runtime/arch/mips64/registers_mips64.h b/runtime/arch/mips64/registers_mips64.h
index 30de2cc..bca260a 100644
--- a/runtime/arch/mips64/registers_mips64.h
+++ b/runtime/arch/mips64/registers_mips64.h
@@ -19,7 +19,8 @@
#include <iosfwd>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
#include "globals.h"
diff --git a/runtime/arch/mips64/thread_mips64.cc b/runtime/arch/mips64/thread_mips64.cc
index 3ce5e50..c1c390b 100644
--- a/runtime/arch/mips64/thread_mips64.cc
+++ b/runtime/arch/mips64/thread_mips64.cc
@@ -16,9 +16,10 @@
#include "thread.h"
+#include <android-base/logging.h>
+
#include "asm_support_mips64.h"
#include "base/enums.h"
-#include "base/logging.h"
namespace art {
diff --git a/runtime/arch/x86/context_x86.h b/runtime/arch/x86/context_x86.h
index 303dfe3..0ebb22b 100644
--- a/runtime/arch/x86/context_x86.h
+++ b/runtime/arch/x86/context_x86.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_ARCH_X86_CONTEXT_X86_H_
#define ART_RUNTIME_ARCH_X86_CONTEXT_X86_H_
+#include <android-base/logging.h>
+
#include "arch/context.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "registers_x86.h"
diff --git a/runtime/arch/x86/fault_handler_x86.cc b/runtime/arch/x86/fault_handler_x86.cc
index 527332f..e6a9124 100644
--- a/runtime/arch/x86/fault_handler_x86.cc
+++ b/runtime/arch/x86/fault_handler_x86.cc
@@ -21,7 +21,7 @@
#include "art_method.h"
#include "base/enums.h"
#include "base/hex_dump.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/macros.h"
#include "base/safe_copy.h"
#include "globals.h"
diff --git a/runtime/arch/x86/instruction_set_features_x86.cc b/runtime/arch/x86/instruction_set_features_x86.cc
index ea5a90d..9846251 100644
--- a/runtime/arch/x86/instruction_set_features_x86.cc
+++ b/runtime/arch/x86/instruction_set_features_x86.cc
@@ -19,11 +19,11 @@
#include <fstream>
#include <sstream>
-#include "android-base/stringprintf.h"
-#include "android-base/strings.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
#include "arch/x86_64/instruction_set_features_x86_64.h"
-#include "base/logging.h"
namespace art {
diff --git a/runtime/arch/x86/registers_x86.h b/runtime/arch/x86/registers_x86.h
index 23027ed..ded3520 100644
--- a/runtime/arch/x86/registers_x86.h
+++ b/runtime/arch/x86/registers_x86.h
@@ -19,7 +19,8 @@
#include <iosfwd>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
#include "globals.h"
diff --git a/runtime/arch/x86_64/context_x86_64.h b/runtime/arch/x86_64/context_x86_64.h
index f8e2845..d242693 100644
--- a/runtime/arch/x86_64/context_x86_64.h
+++ b/runtime/arch/x86_64/context_x86_64.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_ARCH_X86_64_CONTEXT_X86_64_H_
#define ART_RUNTIME_ARCH_X86_64_CONTEXT_X86_64_H_
+#include <android-base/logging.h>
+
#include "arch/context.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "registers_x86_64.h"
diff --git a/runtime/arch/x86_64/registers_x86_64.h b/runtime/arch/x86_64/registers_x86_64.h
index dda1d5f..4f22431 100644
--- a/runtime/arch/x86_64/registers_x86_64.h
+++ b/runtime/arch/x86_64/registers_x86_64.h
@@ -19,7 +19,8 @@
#include <iosfwd>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
#include "globals.h"
diff --git a/runtime/art_field-inl.h b/runtime/art_field-inl.h
index 02ae0e3..941f9e9 100644
--- a/runtime/art_field-inl.h
+++ b/runtime/art_field-inl.h
@@ -19,7 +19,8 @@
#include "art_field.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "class_linker.h"
#include "dex_file-inl.h"
#include "gc/accounting/card_table-inl.h"
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h
index 31abf94..327081f 100644
--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -21,7 +21,6 @@
#include "art_field.h"
#include "base/callee_save_type.h"
-#include "base/logging.h"
#include "class_linker-inl.h"
#include "code_item_accessors-inl.h"
#include "common_throws.h"
diff --git a/runtime/art_method.h b/runtime/art_method.h
index 60e436c..f433223 100644
--- a/runtime/art_method.h
+++ b/runtime/art_method.h
@@ -19,11 +19,14 @@
#include <cstddef>
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
#include "base/casts.h"
#include "base/enums.h"
#include "base/iteration_range.h"
-#include "base/logging.h"
+#include "base/macros.h"
+#include "base/runtime_debug.h"
#include "dex_file.h"
#include "dex_instruction_iterator.h"
#include "gc_root.h"
diff --git a/runtime/atomic.h b/runtime/atomic.h
index d8621cc..ec3eb6d 100644
--- a/runtime/atomic.h
+++ b/runtime/atomic.h
@@ -22,8 +22,9 @@
#include <limits>
#include <vector>
+#include <android-base/logging.h>
+
#include "arch/instruction_set.h"
-#include "base/logging.h"
#include "base/macros.h"
namespace art {
diff --git a/runtime/barrier.cc b/runtime/barrier.cc
index 9bcda35..4329a5a 100644
--- a/runtime/barrier.cc
+++ b/runtime/barrier.cc
@@ -16,7 +16,9 @@
#include "barrier.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/aborting.h"
#include "base/mutex.h"
#include "base/time_utils.h"
#include "thread.h"
diff --git a/runtime/base/aborting.h b/runtime/base/aborting.h
new file mode 100644
index 0000000..8906c96
--- /dev/null
+++ b/runtime/base/aborting.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_RUNTIME_BASE_ABORTING_H_
+#define ART_RUNTIME_BASE_ABORTING_H_
+
+#include <atomic>
+
+namespace art {
+
+// 0 if not abort, non-zero if an abort is in progress. Used on fatal exit to prevents recursive
+// aborts. Global declaration allows us to disable some error checking to ensure fatal shutdown
+// makes forward progress.
+extern std::atomic<unsigned int> gAborting;
+
+} // namespace art
+
+#endif // ART_RUNTIME_BASE_ABORTING_H_
diff --git a/runtime/base/allocator.cc b/runtime/base/allocator.cc
index bb00638..2da88c3 100644
--- a/runtime/base/allocator.cc
+++ b/runtime/base/allocator.cc
@@ -19,8 +19,9 @@
#include <inttypes.h>
#include <stdlib.h>
+#include <android-base/logging.h>
+
#include "atomic.h"
-#include "base/logging.h"
namespace art {
diff --git a/runtime/base/arena_allocator.cc b/runtime/base/arena_allocator.cc
index 2e35f8a..cc413c5 100644
--- a/runtime/base/arena_allocator.cc
+++ b/runtime/base/arena_allocator.cc
@@ -23,7 +23,8 @@
#include <iomanip>
#include <numeric>
-#include "logging.h"
+#include <android-base/logging.h>
+
#include "mem_map.h"
#include "mutex.h"
#include "systrace.h"
diff --git a/runtime/base/arena_allocator.h b/runtime/base/arena_allocator.h
index a327cb0..9e03658 100644
--- a/runtime/base/arena_allocator.h
+++ b/runtime/base/arena_allocator.h
@@ -20,11 +20,11 @@
#include <stddef.h>
#include <stdint.h>
-#include "base/bit_utils.h"
-#include "base/dchecked_vector.h"
-#include "base/memory_tool.h"
+#include "bit_utils.h"
+#include "dchecked_vector.h"
#include "debug_stack.h"
#include "macros.h"
+#include "memory_tool.h"
#include "mutex.h"
namespace art {
diff --git a/runtime/base/arena_object.h b/runtime/base/arena_object.h
index ed00bab..06884c2 100644
--- a/runtime/base/arena_object.h
+++ b/runtime/base/arena_object.h
@@ -17,8 +17,10 @@
#ifndef ART_RUNTIME_BASE_ARENA_OBJECT_H_
#define ART_RUNTIME_BASE_ARENA_OBJECT_H_
-#include "base/arena_allocator.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "arena_allocator.h"
+#include "macros.h"
#include "scoped_arena_allocator.h"
namespace art {
diff --git a/runtime/base/array_ref.h b/runtime/base/array_ref.h
index 630a036..ef86512 100644
--- a/runtime/base/array_ref.h
+++ b/runtime/base/array_ref.h
@@ -20,7 +20,7 @@
#include <type_traits>
#include <vector>
-#include "base/logging.h"
+#include <android-base/logging.h>
namespace art {
diff --git a/runtime/base/bit_field.h b/runtime/base/bit_field.h
index a80ca28..86007d6 100644
--- a/runtime/base/bit_field.h
+++ b/runtime/base/bit_field.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_BASE_BIT_FIELD_H_
#define ART_RUNTIME_BASE_BIT_FIELD_H_
+#include <android-base/logging.h>
+
#include "globals.h"
-#include "logging.h"
namespace art {
diff --git a/runtime/base/bit_utils.h b/runtime/base/bit_utils.h
index 5d83654..34cddbf 100644
--- a/runtime/base/bit_utils.h
+++ b/runtime/base/bit_utils.h
@@ -20,7 +20,8 @@
#include <limits>
#include <type_traits>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/stl_util_identity.h"
namespace art {
diff --git a/runtime/base/bit_utils_iterator.h b/runtime/base/bit_utils_iterator.h
index 8514de6..2d3d050 100644
--- a/runtime/base/bit_utils_iterator.h
+++ b/runtime/base/bit_utils_iterator.h
@@ -21,9 +21,10 @@
#include <limits>
#include <type_traits>
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
#include "base/iteration_range.h"
-#include "base/logging.h"
#include "base/stl_util.h"
namespace art {
diff --git a/runtime/base/bit_vector-inl.h b/runtime/base/bit_vector-inl.h
index 0e67f77..e67d4e2 100644
--- a/runtime/base/bit_vector-inl.h
+++ b/runtime/base/bit_vector-inl.h
@@ -17,9 +17,11 @@
#ifndef ART_RUNTIME_BASE_BIT_VECTOR_INL_H_
#define ART_RUNTIME_BASE_BIT_VECTOR_INL_H_
-#include "base/bit_utils.h"
#include "bit_vector.h"
-#include "logging.h"
+
+#include <android-base/logging.h>
+
+#include "base/bit_utils.h"
namespace art {
diff --git a/runtime/base/bounded_fifo.h b/runtime/base/bounded_fifo.h
index 7bcd382..1520770 100644
--- a/runtime/base/bounded_fifo.h
+++ b/runtime/base/bounded_fifo.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_BASE_BOUNDED_FIFO_H_
#define ART_RUNTIME_BASE_BOUNDED_FIFO_H_
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
namespace art {
diff --git a/runtime/base/casts.h b/runtime/base/casts.h
index 92c493a..ac1a10c 100644
--- a/runtime/base/casts.h
+++ b/runtime/base/casts.h
@@ -24,8 +24,7 @@
#include <limits>
#include <type_traits>
-#include "base/logging.h"
-#include "base/macros.h"
+#include <android-base/logging.h>
namespace art {
diff --git a/runtime/base/dchecked_vector.h b/runtime/base/dchecked_vector.h
index 77f0ea2..7236ac3 100644
--- a/runtime/base/dchecked_vector.h
+++ b/runtime/base/dchecked_vector.h
@@ -21,7 +21,7 @@
#include <type_traits>
#include <vector>
-#include "base/logging.h"
+#include <android-base/logging.h>
namespace art {
diff --git a/runtime/base/debug_stack.h b/runtime/base/debug_stack.h
index 886065d..1331e10 100644
--- a/runtime/base/debug_stack.h
+++ b/runtime/base/debug_stack.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_BASE_DEBUG_STACK_H_
#define ART_RUNTIME_BASE_DEBUG_STACK_H_
-#include "base/logging.h"
-#include "base/macros.h"
+#include <android-base/logging.h>
+#include <android-base/macros.h>
+
#include "globals.h"
namespace art {
diff --git a/runtime/base/file_magic.cc b/runtime/base/file_magic.cc
index dffb9b4..ac2e184 100644
--- a/runtime/base/file_magic.cc
+++ b/runtime/base/file_magic.cc
@@ -20,9 +20,9 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
-#include "base/logging.h"
#include "base/unix_file/fd_file.h"
#include "dex_file.h"
diff --git a/runtime/base/file_utils.cc b/runtime/base/file_utils.cc
index 323a065..db49860 100644
--- a/runtime/base/file_utils.cc
+++ b/runtime/base/file_utils.cc
@@ -89,7 +89,7 @@
}
}
-bool PrintFileToLog(const std::string& file_name, LogSeverity level) {
+bool PrintFileToLog(const std::string& file_name, android::base::LogSeverity level) {
File file(file_name, O_RDONLY, false);
if (!file.IsOpened()) {
return false;
diff --git a/runtime/base/file_utils.h b/runtime/base/file_utils.h
index 007f3b4..e4555ad 100644
--- a/runtime/base/file_utils.h
+++ b/runtime/base/file_utils.h
@@ -21,13 +21,14 @@
#include <string>
+#include <android-base/logging.h>
+
#include "arch/instruction_set.h"
-#include "base/logging.h"
namespace art {
bool ReadFileToString(const std::string& file_name, std::string* result);
-bool PrintFileToLog(const std::string& file_name, LogSeverity level);
+bool PrintFileToLog(const std::string& file_name, android::base::LogSeverity level);
// Find $ANDROID_ROOT, /system, or abort.
std::string GetAndroidRoot();
diff --git a/runtime/base/hash_set.h b/runtime/base/hash_set.h
index c743342..47e6d93 100644
--- a/runtime/base/hash_set.h
+++ b/runtime/base/hash_set.h
@@ -25,8 +25,10 @@
#include <type_traits>
#include <utility>
+#include <android-base/logging.h>
+
#include "bit_utils.h"
-#include "logging.h"
+#include "macros.h"
namespace art {
diff --git a/runtime/base/histogram-inl.h b/runtime/base/histogram-inl.h
index be20920..3ce0140 100644
--- a/runtime/base/histogram-inl.h
+++ b/runtime/base/histogram-inl.h
@@ -24,6 +24,8 @@
#include "histogram.h"
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
#include "base/time_utils.h"
#include "utils.h"
diff --git a/runtime/base/histogram.h b/runtime/base/histogram.h
index e0c921e..7544a9c 100644
--- a/runtime/base/histogram.h
+++ b/runtime/base/histogram.h
@@ -19,7 +19,7 @@
#include <string>
#include <vector>
-#include "base/logging.h"
+#include <android-base/macros.h>
namespace art {
diff --git a/runtime/base/logging.cc b/runtime/base/logging.cc
index 4776357..90eb74c 100644
--- a/runtime/base/logging.cc
+++ b/runtime/base/logging.cc
@@ -20,7 +20,8 @@
#include <limits>
#include <sstream>
-#include "base/mutex.h"
+#include "aborting.h"
+#include "mutex.h"
#include "thread-current-inl.h"
#include "utils.h"
@@ -34,55 +35,6 @@
namespace art {
-// We test here that the runtime-debug-checks are actually a no-op constexpr false in release
-// builds, as we can't check that in gtests (which are always debug).
-
-#ifdef NDEBUG
-namespace {
-DECLARE_RUNTIME_DEBUG_FLAG(kTestForConstexpr);
-static_assert(!kTestForConstexpr, "Issue with DECLARE_RUNTIME_DEBUG_FLAG in NDEBUG.");
-}
-#endif
-
-// Implementation of runtime debug flags. This should be compile-time optimized away in release
-// builds.
-namespace {
-bool gSlowEnabled = false; // Default for slow flags is "off."
-
-// Use a function with a static to ensure our vector storage doesn't have initialization order
-// issues.
-std::vector<bool*>& GetFlagPtrs() {
- static std::vector<bool*> g_flag_ptrs;
- return g_flag_ptrs;
-}
-
-bool RegisterRuntimeDebugFlagImpl(bool* flag_ptr) {
- GetFlagPtrs().push_back(flag_ptr);
- return gSlowEnabled;
-}
-
-void SetRuntimeDebugFlagsEnabledImpl(bool enabled) {
- gSlowEnabled = enabled;
- for (bool* flag_ptr : GetFlagPtrs()) {
- *flag_ptr = enabled;
- }
-}
-
-} // namespace
-
-bool RegisterRuntimeDebugFlag(bool* flag_ptr) {
- if (kIsDebugBuild) {
- return RegisterRuntimeDebugFlagImpl(flag_ptr);
- }
- return false;
-}
-
-void SetRuntimeDebugFlagsEnabled(bool enabled) {
- if (kIsDebugBuild) {
- SetRuntimeDebugFlagsEnabledImpl(enabled);
- }
-}
-
LogVerbosity gLogVerbosity;
std::atomic<unsigned int> gAborting(0);
diff --git a/runtime/base/logging.h b/runtime/base/logging.h
index 5703b3c..c562bdf 100644
--- a/runtime/base/logging.h
+++ b/runtime/base/logging.h
@@ -63,48 +63,6 @@
// Global log verbosity setting, initialized by InitLogging.
extern LogVerbosity gLogVerbosity;
-// Runtime debug flags are flags that have a runtime component, that is, their value can be changed.
-// This is meant to implement fast vs slow debug builds, in that certain debug flags can be turned
-// on and off. To that effect, expose two macros to help implement and globally drive these flags:
-//
-// In the header, declare a (class) flag like this:
-//
-// class C {
-// DECLARE_RUNTIME_DEBUG_FLAG(kFlag);
-// };
-//
-// This will declare a flag kFlag that is a constexpr false in release builds, and a static field
-// in debug builds. Usage is than uniform as C::kFlag.
-//
-// In the cc file, define the flag like this:
-//
-// DEFINE_RUNTIME_DEBUG_FLAG(C, kFlag);
-//
-// This will define the static storage, as necessary, and register the flag with the runtime
-// infrastructure to toggle the value.
-
-#ifdef NDEBUG
-#define DECLARE_RUNTIME_DEBUG_FLAG(x) \
- static constexpr bool x = false;
-// Note: the static_assert in the following only works for public flags. Fix this when we cross
-// the line at some point.
-#define DEFINE_RUNTIME_DEBUG_FLAG(C, x) \
- static_assert(!C::x, "Unexpected enabled flag in release build");
-#else
-#define DECLARE_RUNTIME_DEBUG_FLAG(x) \
- static bool x;
-#define DEFINE_RUNTIME_DEBUG_FLAG(C, x) \
- bool C::x = RegisterRuntimeDebugFlag(&C::x);
-#endif // NDEBUG
-
-bool RegisterRuntimeDebugFlag(bool* runtime_debug_flag);
-void SetRuntimeDebugFlagsEnabled(bool enabled);
-
-// 0 if not abort, non-zero if an abort is in progress. Used on fatal exit to prevents recursive
-// aborts. Global declaration allows us to disable some error checking to ensure fatal shutdown
-// makes forward progress.
-extern std::atomic<unsigned int> gAborting;
-
// Configure logging based on ANDROID_LOG_TAGS environment variable.
// We need to parse a string that looks like
//
diff --git a/runtime/base/logging_test.cc b/runtime/base/logging_test.cc
index d380b9e..404e080 100644
--- a/runtime/base/logging_test.cc
+++ b/runtime/base/logging_test.cc
@@ -22,6 +22,7 @@
#include "base/bit_utils.h"
#include "base/macros.h"
#include "common_runtime_test.h"
+#include "runtime_debug.h"
namespace art {
diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h
index c0cf487..7077298 100644
--- a/runtime/base/mutex.h
+++ b/runtime/base/mutex.h
@@ -24,8 +24,10 @@
#include <iosfwd>
#include <string>
+#include <android-base/logging.h>
+
#include "atomic.h"
-#include "base/logging.h"
+#include "base/aborting.h"
#include "base/macros.h"
#include "globals.h"
diff --git a/runtime/base/runtime_debug.cc b/runtime/base/runtime_debug.cc
new file mode 100644
index 0000000..4f8a8ec
--- /dev/null
+++ b/runtime/base/runtime_debug.cc
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "runtime_debug.h"
+
+#include <vector>
+
+#include "globals.h"
+
+namespace art {
+
+// We test here that the runtime-debug-checks are actually a no-op constexpr false in release
+// builds, as we can't check that in gtests (which are always debug).
+
+#ifdef NDEBUG
+namespace {
+DECLARE_RUNTIME_DEBUG_FLAG(kTestForConstexpr);
+static_assert(!kTestForConstexpr, "Issue with DECLARE_RUNTIME_DEBUG_FLAG in NDEBUG.");
+}
+#endif
+
+// Implementation of runtime debug flags. This should be compile-time optimized away in release
+// builds.
+namespace {
+bool gSlowEnabled = false; // Default for slow flags is "off."
+
+// Use a function with a static to ensure our vector storage doesn't have initialization order
+// issues.
+std::vector<bool*>& GetFlagPtrs() {
+ static std::vector<bool*> g_flag_ptrs;
+ return g_flag_ptrs;
+}
+
+bool RegisterRuntimeDebugFlagImpl(bool* flag_ptr) {
+ GetFlagPtrs().push_back(flag_ptr);
+ return gSlowEnabled;
+}
+
+void SetRuntimeDebugFlagsEnabledImpl(bool enabled) {
+ gSlowEnabled = enabled;
+ for (bool* flag_ptr : GetFlagPtrs()) {
+ *flag_ptr = enabled;
+ }
+}
+
+} // namespace
+
+bool RegisterRuntimeDebugFlag(bool* flag_ptr) {
+ if (kIsDebugBuild) {
+ return RegisterRuntimeDebugFlagImpl(flag_ptr);
+ }
+ return false;
+}
+
+void SetRuntimeDebugFlagsEnabled(bool enabled) {
+ if (kIsDebugBuild) {
+ SetRuntimeDebugFlagsEnabledImpl(enabled);
+ }
+}
+
+} // namespace art
diff --git a/runtime/base/runtime_debug.h b/runtime/base/runtime_debug.h
new file mode 100644
index 0000000..89a0361
--- /dev/null
+++ b/runtime/base/runtime_debug.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_RUNTIME_BASE_RUNTIME_DEBUG_H_
+#define ART_RUNTIME_BASE_RUNTIME_DEBUG_H_
+
+namespace art {
+
+// Runtime debug flags are flags that have a runtime component, that is, their value can be changed.
+// This is meant to implement fast vs slow debug builds, in that certain debug flags can be turned
+// on and off. To that effect, expose two macros to help implement and globally drive these flags:
+//
+// In the header, declare a (class) flag like this:
+//
+// class C {
+// DECLARE_RUNTIME_DEBUG_FLAG(kFlag);
+// };
+//
+// This will declare a flag kFlag that is a constexpr false in release builds, and a static field
+// in debug builds. Usage is than uniform as C::kFlag.
+//
+// In the cc file, define the flag like this:
+//
+// DEFINE_RUNTIME_DEBUG_FLAG(C, kFlag);
+//
+// This will define the static storage, as necessary, and register the flag with the runtime
+// infrastructure to toggle the value.
+
+#ifdef NDEBUG
+#define DECLARE_RUNTIME_DEBUG_FLAG(x) \
+ static constexpr bool x = false;
+// Note: the static_assert in the following only works for public flags. Fix this when we cross
+// the line at some point.
+#define DEFINE_RUNTIME_DEBUG_FLAG(C, x) \
+ static_assert(!C::x, "Unexpected enabled flag in release build");
+#else
+#define DECLARE_RUNTIME_DEBUG_FLAG(x) \
+ static bool x;
+#define DEFINE_RUNTIME_DEBUG_FLAG(C, x) \
+ bool C::x = RegisterRuntimeDebugFlag(&C::x);
+#endif // NDEBUG
+
+bool RegisterRuntimeDebugFlag(bool* runtime_debug_flag);
+void SetRuntimeDebugFlagsEnabled(bool enabled);
+
+} // namespace art
+
+#endif // ART_RUNTIME_BASE_RUNTIME_DEBUG_H_
diff --git a/runtime/base/scoped_arena_allocator.h b/runtime/base/scoped_arena_allocator.h
index 8f50fd4..35e337f 100644
--- a/runtime/base/scoped_arena_allocator.h
+++ b/runtime/base/scoped_arena_allocator.h
@@ -17,10 +17,11 @@
#ifndef ART_RUNTIME_BASE_SCOPED_ARENA_ALLOCATOR_H_
#define ART_RUNTIME_BASE_SCOPED_ARENA_ALLOCATOR_H_
+#include <android-base/logging.h>
+
#include "arena_allocator.h"
#include "debug_stack.h"
#include "globals.h"
-#include "logging.h"
#include "macros.h"
namespace art {
diff --git a/runtime/base/scoped_flock.cc b/runtime/base/scoped_flock.cc
index b8df689..514b97b 100644
--- a/runtime/base/scoped_flock.cc
+++ b/runtime/base/scoped_flock.cc
@@ -19,9 +19,9 @@
#include <sys/file.h>
#include <sys/stat.h>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
-#include "base/logging.h"
#include "base/unix_file/fd_file.h"
namespace art {
diff --git a/runtime/base/scoped_flock.h b/runtime/base/scoped_flock.h
index 1b933c0..db6c819 100644
--- a/runtime/base/scoped_flock.h
+++ b/runtime/base/scoped_flock.h
@@ -20,9 +20,8 @@
#include <memory>
#include <string>
-#include "android-base/unique_fd.h"
+#include <android-base/unique_fd.h>
-#include "base/logging.h"
#include "base/macros.h"
#include "base/unix_file/fd_file.h"
#include "os.h"
diff --git a/runtime/base/stl_util.h b/runtime/base/stl_util.h
index b272972..02f3765 100644
--- a/runtime/base/stl_util.h
+++ b/runtime/base/stl_util.h
@@ -21,7 +21,7 @@
#include <set>
#include <sstream>
-#include "base/logging.h"
+#include <android-base/logging.h>
namespace art {
diff --git a/runtime/base/stringpiece.cc b/runtime/base/stringpiece.cc
index 2570bad..672431c 100644
--- a/runtime/base/stringpiece.cc
+++ b/runtime/base/stringpiece.cc
@@ -19,7 +19,7 @@
#include <ostream>
#include <utility>
-#include "logging.h"
+#include <android-base/logging.h>
namespace art {
diff --git a/runtime/base/systrace.h b/runtime/base/systrace.h
index c6b6ff1..dc2206e 100644
--- a/runtime/base/systrace.h
+++ b/runtime/base/systrace.h
@@ -19,8 +19,8 @@
#define ATRACE_TAG ATRACE_TAG_DALVIK
#include <cutils/trace.h>
-#include <utils/Trace.h>
+#include <sstream>
#include <string>
#include "android-base/stringprintf.h"
@@ -46,10 +46,37 @@
}
};
-#define SCOPED_TRACE(fmtstr, ...) \
- ::art::ScopedTrace trace ## __LINE__([&]() { \
- return ::android::base::StringPrintf((fmtstr), __VA_ARGS__); \
- })
+// Helper for the SCOPED_TRACE macro. Do not use directly.
+class ScopedTraceNoStart {
+ public:
+ ScopedTraceNoStart() {
+ }
+
+ ~ScopedTraceNoStart() {
+ ATRACE_END();
+ }
+
+ // Message helper for the macro. Do not use directly.
+ class ScopedTraceMessageHelper {
+ public:
+ ScopedTraceMessageHelper() {
+ }
+ ~ScopedTraceMessageHelper() {
+ ATRACE_BEGIN(buffer_.str().c_str());
+ }
+
+ std::ostream& stream() {
+ return buffer_;
+ }
+
+ private:
+ std::ostringstream buffer_;
+ };
+};
+
+#define SCOPED_TRACE \
+ ::art::ScopedTraceNoStart trace ## __LINE__; \
+ (ATRACE_ENABLED()) && ::art::ScopedTraceNoStart::ScopedTraceMessageHelper().stream()
} // namespace art
diff --git a/runtime/base/timing_logger.cc b/runtime/base/timing_logger.cc
index b8d6931..23ec3e1 100644
--- a/runtime/base/timing_logger.cc
+++ b/runtime/base/timing_logger.cc
@@ -18,8 +18,9 @@
#include "timing_logger.h"
+#include <android-base/logging.h>
+
#include "base/histogram-inl.h"
-#include "base/logging.h"
#include "base/stl_util.h"
#include "base/systrace.h"
#include "base/time_utils.h"
diff --git a/runtime/base/unix_file/fd_file.cc b/runtime/base/unix_file/fd_file.cc
index 792c581..37f239d 100644
--- a/runtime/base/unix_file/fd_file.cc
+++ b/runtime/base/unix_file/fd_file.cc
@@ -23,7 +23,7 @@
#include <limits>
-#include "base/logging.h"
+#include <android-base/logging.h>
// Includes needed for FdFile::Copy().
#ifdef __linux__
diff --git a/runtime/cha.cc b/runtime/cha.cc
index 6c011e8..a53d7e5 100644
--- a/runtime/cha.cc
+++ b/runtime/cha.cc
@@ -17,6 +17,7 @@
#include "cha.h"
#include "art_method-inl.h"
+#include "base/logging.h" // For VLOG
#include "jit/jit.h"
#include "jit/jit_code_cache.h"
#include "linear_alloc.h"
diff --git a/runtime/check_jni.cc b/runtime/check_jni.cc
index c3dd702..0b9bf22 100644
--- a/runtime/check_jni.cc
+++ b/runtime/check_jni.cc
@@ -21,11 +21,12 @@
#include <iomanip>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "art_field-inl.h"
#include "art_method-inl.h"
-#include "base/logging.h"
+#include "base/macros.h"
#include "base/to_str.h"
#include "class_linker-inl.h"
#include "class_linker.h"
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index ef1647c..6db4d92 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -30,6 +30,7 @@
#include "base/file_utils.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/runtime_debug.h"
#include "base/stl_util.h"
#include "base/unix_file/fd_file.h"
#include "class_linker.h"
diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h
index 5be8d5b..0f931e3 100644
--- a/runtime/common_runtime_test.h
+++ b/runtime/common_runtime_test.h
@@ -22,6 +22,8 @@
#include <string>
+#include <android-base/logging.h>
+
#include "arch/instruction_set.h"
#include "base/mutex.h"
#include "globals.h"
@@ -32,6 +34,9 @@
namespace art {
+using LogSeverity = android::base::LogSeverity;
+using ScopedLogSeverity = android::base::ScopedLogSeverity;
+
// OBJ pointer helpers to avoid needing .Decode everywhere.
#define EXPECT_OBJ_PTR_EQ(a, b) EXPECT_EQ(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr());
#define ASSERT_OBJ_PTR_EQ(a, b) ASSERT_EQ(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr());
diff --git a/runtime/common_throws.cc b/runtime/common_throws.cc
index cd52bb6..575d18e 100644
--- a/runtime/common_throws.cc
+++ b/runtime/common_throws.cc
@@ -18,11 +18,11 @@
#include <sstream>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "art_field-inl.h"
#include "art_method-inl.h"
-#include "base/logging.h"
#include "class_linker-inl.h"
#include "dex_file-inl.h"
#include "dex_instruction-inl.h"
@@ -441,7 +441,7 @@
return addr == monitor_offset;
}
-static bool IsValidImplicitCheck(uintptr_t addr, ArtMethod* method, const Instruction& instr)
+static bool IsValidImplicitCheck(uintptr_t addr, const Instruction& instr)
REQUIRES_SHARED(Locks::mutator_lock_) {
if (!CanDoImplicitNullCheckOn(addr)) {
return false;
@@ -483,9 +483,10 @@
case Instruction::IPUT_BYTE:
case Instruction::IPUT_CHAR:
case Instruction::IPUT_SHORT: {
- ArtField* field =
- Runtime::Current()->GetClassLinker()->ResolveField(instr.VRegC_22c(), method, false);
- return (addr == 0) || (addr == field->GetOffset().Uint32Value());
+ // We might be doing an implicit null check with an offset that doesn't correspond
+ // to the instruction, for example with two field accesses and the first one being
+ // eliminated or re-ordered.
+ return true;
}
case Instruction::IGET_OBJECT_QUICK:
@@ -506,7 +507,10 @@
case Instruction::IPUT_SHORT_QUICK:
case Instruction::IPUT_WIDE_QUICK:
case Instruction::IPUT_OBJECT_QUICK: {
- return (addr == 0u) || (addr == instr.VRegC_22c());
+ // We might be doing an implicit null check with an offset that doesn't correspond
+ // to the instruction, for example with two field accesses and the first one being
+ // eliminated or re-ordered.
+ return true;
}
case Instruction::AGET_OBJECT:
@@ -550,7 +554,7 @@
const DexFile::CodeItem* code = method->GetCodeItem();
CHECK_LT(throw_dex_pc, code->insns_size_in_code_units_);
const Instruction* instr = Instruction::At(&code->insns_[throw_dex_pc]);
- if (check_address && !IsValidImplicitCheck(addr, method, *instr)) {
+ if (check_address && !IsValidImplicitCheck(addr, *instr)) {
const DexFile* dex_file = method->GetDeclaringClass()->GetDexCache()->GetDexFile();
LOG(FATAL) << "Invalid address for an implicit NullPointerException check: "
<< "0x" << std::hex << addr << std::dec
diff --git a/runtime/dex_file-inl.h b/runtime/dex_file-inl.h
index 1880968..4025a1a 100644
--- a/runtime/dex_file-inl.h
+++ b/runtime/dex_file-inl.h
@@ -19,7 +19,6 @@
#include "base/bit_utils.h"
#include "base/casts.h"
-#include "base/logging.h"
#include "base/stringpiece.h"
#include "cdex/compact_dex_file.h"
#include "dex_file.h"
diff --git a/runtime/dex_file.cc b/runtime/dex_file.cc
index af79207..2d02415 100644
--- a/runtime/dex_file.cc
+++ b/runtime/dex_file.cc
@@ -29,7 +29,6 @@
#include "android-base/stringprintf.h"
#include "base/enums.h"
-#include "base/logging.h"
#include "base/stl_util.h"
#include "dex_file-inl.h"
#include "leb128.h"
diff --git a/runtime/dex_file.h b/runtime/dex_file.h
index 944a308..561b367 100644
--- a/runtime/dex_file.h
+++ b/runtime/dex_file.h
@@ -21,8 +21,10 @@
#include <string>
#include <vector>
+#include <android-base/logging.h>
+
#include "base/iteration_range.h"
-#include "base/logging.h"
+#include "base/macros.h"
#include "base/value_object.h"
#include "dex_file_types.h"
#include "dex_instruction_iterator.h"
diff --git a/runtime/dex_file_layout.h b/runtime/dex_file_layout.h
index 4c960c3..9fac5f8 100644
--- a/runtime/dex_file_layout.h
+++ b/runtime/dex_file_layout.h
@@ -21,7 +21,7 @@
#include <cstdint>
#include <iosfwd>
-#include "base/logging.h"
+#include <android-base/logging.h>
namespace art {
diff --git a/runtime/dex_file_tracking_registrar.cc b/runtime/dex_file_tracking_registrar.cc
index 874d8ea..4de4376 100644
--- a/runtime/dex_file_tracking_registrar.cc
+++ b/runtime/dex_file_tracking_registrar.cc
@@ -19,6 +19,8 @@
#include <deque>
#include <tuple>
+#include <android-base/logging.h>
+
// For dex tracking through poisoning. Note: Requires forcing sanitization. This is the reason for
// the ifdefs and early include.
#ifdef ART_DEX_FILE_ACCESS_TRACKING
@@ -28,7 +30,6 @@
#endif
#include "base/memory_tool.h"
-#include "base/logging.h"
#include "dex_file-inl.h"
namespace art {
diff --git a/runtime/dex_instruction.h b/runtime/dex_instruction.h
index 4041820..3ced692 100644
--- a/runtime/dex_instruction.h
+++ b/runtime/dex_instruction.h
@@ -17,7 +17,8 @@
#ifndef ART_RUNTIME_DEX_INSTRUCTION_H_
#define ART_RUNTIME_DEX_INSTRUCTION_H_
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
#include "globals.h"
diff --git a/runtime/dex_instruction_iterator.h b/runtime/dex_instruction_iterator.h
index be583a2..eabe009 100644
--- a/runtime/dex_instruction_iterator.h
+++ b/runtime/dex_instruction_iterator.h
@@ -19,8 +19,10 @@
#include <iterator>
+#include <android-base/logging.h>
+
#include "dex_instruction.h"
-#include "base/logging.h"
+#include "base/macros.h"
namespace art {
diff --git a/runtime/dex_to_dex_decompiler.cc b/runtime/dex_to_dex_decompiler.cc
index a5ebade..a4e4fb5 100644
--- a/runtime/dex_to_dex_decompiler.cc
+++ b/runtime/dex_to_dex_decompiler.cc
@@ -16,7 +16,9 @@
#include "dex_to_dex_decompiler.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/macros.h"
#include "base/mutex.h"
#include "bytecode_utils.h"
#include "dex_file-inl.h"
diff --git a/runtime/elf_file.cc b/runtime/elf_file.cc
index afe4eeb..d057ff3 100644
--- a/runtime/elf_file.cc
+++ b/runtime/elf_file.cc
@@ -25,7 +25,6 @@
#include "android-base/strings.h"
#include "arch/instruction_set.h"
-#include "base/logging.h"
#include "base/stl_util.h"
#include "base/unix_file/fd_file.h"
#include "elf_file_impl.h"
diff --git a/runtime/elf_utils.h b/runtime/elf_utils.h
index 418d937..0cac8e8 100644
--- a/runtime/elf_utils.h
+++ b/runtime/elf_utils.h
@@ -19,11 +19,11 @@
#include <sys/cdefs.h>
+#include <android-base/logging.h>
+
// Explicitly include our own elf.h to avoid Linux and other dependencies.
#include "./elf.h"
-#include "base/logging.h"
-
namespace art {
// Architecture dependent flags for the ELF header.
diff --git a/runtime/entrypoints/jni/jni_entrypoints.cc b/runtime/entrypoints/jni/jni_entrypoints.cc
index 7ec360a..780e221 100644
--- a/runtime/entrypoints/jni/jni_entrypoints.cc
+++ b/runtime/entrypoints/jni/jni_entrypoints.cc
@@ -14,8 +14,9 @@
* limitations under the License.
*/
+#include <android-base/logging.h>
+
#include "art_method-inl.h"
-#include "base/logging.h"
#include "entrypoints/entrypoint_utils.h"
#include "java_vm_ext.h"
#include "mirror/object-inl.h"
diff --git a/runtime/entrypoints/quick/quick_default_init_entrypoints.h b/runtime/entrypoints/quick/quick_default_init_entrypoints.h
index 8acaa90..8c90800 100644
--- a/runtime/entrypoints/quick/quick_default_init_entrypoints.h
+++ b/runtime/entrypoints/quick/quick_default_init_entrypoints.h
@@ -17,7 +17,7 @@
#ifndef ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_INIT_ENTRYPOINTS_H_
#define ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_INIT_ENTRYPOINTS_H_
-#include "base/logging.h"
+#include "base/logging.h" // FOR VLOG_IS_ON.
#include "entrypoints/jni/jni_entrypoints.h"
#include "entrypoints/runtime_asm_entrypoints.h"
#include "quick_alloc_entrypoints.h"
diff --git a/runtime/entrypoints/quick/quick_deoptimization_entrypoints.cc b/runtime/entrypoints/quick/quick_deoptimization_entrypoints.cc
index 5f40711..c782c9c 100644
--- a/runtime/entrypoints/quick/quick_deoptimization_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_deoptimization_entrypoints.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG_IS_ON.
#include "base/mutex.h"
#include "base/systrace.h"
#include "callee_save_frame.h"
diff --git a/runtime/entrypoints/quick/quick_jni_entrypoints.cc b/runtime/entrypoints/quick/quick_jni_entrypoints.cc
index 29a62c8..b13b6fb 100644
--- a/runtime/entrypoints/quick/quick_jni_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_jni_entrypoints.cc
@@ -14,9 +14,10 @@
* limitations under the License.
*/
+#include <android-base/logging.h>
+
#include "art_method-inl.h"
#include "base/casts.h"
-#include "base/logging.h"
#include "entrypoints/entrypoint_utils-inl.h"
#include "indirect_reference_table.h"
#include "mirror/object-inl.h"
diff --git a/runtime/fault_handler.cc b/runtime/fault_handler.cc
index 6a4e5b5..f66836f 100644
--- a/runtime/fault_handler.cc
+++ b/runtime/fault_handler.cc
@@ -21,6 +21,7 @@
#include <sys/ucontext.h>
#include "art_method-inl.h"
+#include "base/logging.h" // For VLOG
#include "base/safe_copy.h"
#include "base/stl_util.h"
#include "dex_file_types.h"
diff --git a/runtime/gc/accounting/atomic_stack.h b/runtime/gc/accounting/atomic_stack.h
index 3d0e817..e5b5694 100644
--- a/runtime/gc/accounting/atomic_stack.h
+++ b/runtime/gc/accounting/atomic_stack.h
@@ -23,8 +23,9 @@
#include <memory>
#include <string>
+#include <android-base/logging.h>
+
#include "atomic.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "mem_map.h"
#include "stack_reference.h"
diff --git a/runtime/gc/accounting/bitmap-inl.h b/runtime/gc/accounting/bitmap-inl.h
index cd3923a..ca6b479 100644
--- a/runtime/gc/accounting/bitmap-inl.h
+++ b/runtime/gc/accounting/bitmap-inl.h
@@ -21,9 +21,10 @@
#include <memory>
+#include <android-base/logging.h>
+
#include "atomic.h"
#include "base/bit_utils.h"
-#include "base/logging.h"
namespace art {
namespace gc {
diff --git a/runtime/gc/accounting/card_table-inl.h b/runtime/gc/accounting/card_table-inl.h
index 6ff5359..5f2f2dd 100644
--- a/runtime/gc/accounting/card_table-inl.h
+++ b/runtime/gc/accounting/card_table-inl.h
@@ -17,10 +17,12 @@
#ifndef ART_RUNTIME_GC_ACCOUNTING_CARD_TABLE_INL_H_
#define ART_RUNTIME_GC_ACCOUNTING_CARD_TABLE_INL_H_
+#include "card_table.h"
+
+#include <android-base/logging.h>
+
#include "atomic.h"
#include "base/bit_utils.h"
-#include "base/logging.h"
-#include "card_table.h"
#include "mem_map.h"
#include "space_bitmap.h"
diff --git a/runtime/gc/accounting/card_table.cc b/runtime/gc/accounting/card_table.cc
index 01b5896..934e57a 100644
--- a/runtime/gc/accounting/card_table.cc
+++ b/runtime/gc/accounting/card_table.cc
@@ -18,7 +18,6 @@
#include <sys/mman.h>
-#include "base/logging.h"
#include "base/systrace.h"
#include "card_table-inl.h"
#include "gc/heap.h"
diff --git a/runtime/gc/accounting/heap_bitmap.h b/runtime/gc/accounting/heap_bitmap.h
index 4237e7e..c997f8d 100644
--- a/runtime/gc/accounting/heap_bitmap.h
+++ b/runtime/gc/accounting/heap_bitmap.h
@@ -17,8 +17,11 @@
#ifndef ART_RUNTIME_GC_ACCOUNTING_HEAP_BITMAP_H_
#define ART_RUNTIME_GC_ACCOUNTING_HEAP_BITMAP_H_
+#include <android-base/logging.h>
+
#include "base/allocator.h"
-#include "base/logging.h"
+#include "base/macros.h"
+#include "base/mutex.h"
#include "space_bitmap.h"
namespace art {
diff --git a/runtime/gc/accounting/mod_union_table.cc b/runtime/gc/accounting/mod_union_table.cc
index 1b3d0da..0dd05cd 100644
--- a/runtime/gc/accounting/mod_union_table.cc
+++ b/runtime/gc/accounting/mod_union_table.cc
@@ -18,6 +18,7 @@
#include <memory>
+#include "base/logging.h" // For VLOG
#include "base/stl_util.h"
#include "bitmap-inl.h"
#include "card_table-inl.h"
diff --git a/runtime/gc/accounting/space_bitmap-inl.h b/runtime/gc/accounting/space_bitmap-inl.h
index b37dd96..ba83369 100644
--- a/runtime/gc/accounting/space_bitmap-inl.h
+++ b/runtime/gc/accounting/space_bitmap-inl.h
@@ -21,9 +21,10 @@
#include <memory>
+#include <android-base/logging.h>
+
#include "atomic.h"
#include "base/bit_utils.h"
-#include "base/logging.h"
namespace art {
namespace gc {
diff --git a/runtime/gc/allocation_record.cc b/runtime/gc/allocation_record.cc
index 2257b81..2ee4239 100644
--- a/runtime/gc/allocation_record.cc
+++ b/runtime/gc/allocation_record.cc
@@ -18,6 +18,7 @@
#include "art_method-inl.h"
#include "base/enums.h"
+#include "base/logging.h" // For VLOG
#include "base/stl_util.h"
#include "obj_ptr-inl.h"
#include "object_callbacks.h"
diff --git a/runtime/gc/allocator/dlmalloc.cc b/runtime/gc/allocator/dlmalloc.cc
index ef916f8..6506220 100644
--- a/runtime/gc/allocator/dlmalloc.cc
+++ b/runtime/gc/allocator/dlmalloc.cc
@@ -16,8 +16,9 @@
#include "dlmalloc.h"
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
// ART specific morecore implementation defined in space.cc.
static void* art_heap_morecore(void* m, intptr_t increment);
diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc
index b742ac4..928abe8 100644
--- a/runtime/gc/allocator/rosalloc.cc
+++ b/runtime/gc/allocator/rosalloc.cc
@@ -23,6 +23,7 @@
#include "android-base/stringprintf.h"
+#include "base/logging.h" // For VLOG
#include "base/memory_tool.h"
#include "base/mutex-inl.h"
#include "gc/space/memory_tool_settings.h"
diff --git a/runtime/gc/allocator/rosalloc.h b/runtime/gc/allocator/rosalloc.h
index 2c90773..6e5cf0e 100644
--- a/runtime/gc/allocator/rosalloc.h
+++ b/runtime/gc/allocator/rosalloc.h
@@ -26,9 +26,10 @@
#include <unordered_set>
#include <vector>
+#include <android-base/logging.h>
+
#include "base/allocator.h"
#include "base/bit_utils.h"
-#include "base/logging.h"
#include "base/mutex.h"
#include "globals.h"
#include "thread.h"
diff --git a/runtime/gc/collector/garbage_collector.cc b/runtime/gc/collector/garbage_collector.cc
index c5a341f..fa34270 100644
--- a/runtime/gc/collector/garbage_collector.cc
+++ b/runtime/gc/collector/garbage_collector.cc
@@ -22,7 +22,7 @@
#include "base/dumpable.h"
#include "base/histogram-inl.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG_IS_ON.
#include "base/mutex-inl.h"
#include "base/systrace.h"
#include "base/time_utils.h"
diff --git a/runtime/gc/collector/immune_spaces.cc b/runtime/gc/collector/immune_spaces.cc
index 1024050..3b59618 100644
--- a/runtime/gc/collector/immune_spaces.cc
+++ b/runtime/gc/collector/immune_spaces.cc
@@ -19,6 +19,7 @@
#include <tuple>
#include <vector>
+#include "base/logging.h" // For VLOG.
#include "gc/space/space-inl.h"
#include "mirror/object.h"
#include "oat_file.h"
diff --git a/runtime/gc/collector/mark_compact.cc b/runtime/gc/collector/mark_compact.cc
index aef98de..34cc129 100644
--- a/runtime/gc/collector/mark_compact.cc
+++ b/runtime/gc/collector/mark_compact.cc
@@ -16,7 +16,9 @@
#include "mark_compact.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/macros.h"
#include "base/mutex-inl.h"
#include "base/timing_logger.h"
#include "gc/accounting/heap_bitmap-inl.h"
diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc
index c6caf4b..fdfe949 100644
--- a/runtime/gc/collector/mark_sweep.cc
+++ b/runtime/gc/collector/mark_sweep.cc
@@ -25,7 +25,7 @@
#include "base/bounded_fifo.h"
#include "base/enums.h"
#include "base/file_utils.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/macros.h"
#include "base/mutex-inl.h"
#include "base/systrace.h"
diff --git a/runtime/gc/collector/semi_space.cc b/runtime/gc/collector/semi_space.cc
index 9fb37b6..3150781 100644
--- a/runtime/gc/collector/semi_space.cc
+++ b/runtime/gc/collector/semi_space.cc
@@ -22,7 +22,7 @@
#include <sstream>
#include <vector>
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/macros.h"
#include "base/mutex-inl.h"
#include "base/timing_logger.h"
diff --git a/runtime/gc/gc_cause.cc b/runtime/gc/gc_cause.cc
index 8712080..d88fcdc 100644
--- a/runtime/gc/gc_cause.cc
+++ b/runtime/gc/gc_cause.cc
@@ -15,7 +15,10 @@
*/
#include "gc_cause.h"
-#include "base/logging.h"
+
+#include <android-base/logging.h>
+
+#include "base/macros.h"
#include "globals.h"
#include <ostream>
diff --git a/runtime/gc/heap-inl.h b/runtime/gc/heap-inl.h
index 2047646..52dd104 100644
--- a/runtime/gc/heap-inl.h
+++ b/runtime/gc/heap-inl.h
@@ -401,8 +401,7 @@
return true;
}
// TODO: Grow for allocation is racy, fix it.
- VLOG(heap) << "Growing heap from " << PrettySize(max_allowed_footprint_) << " to "
- << PrettySize(new_footprint) << " for a " << PrettySize(alloc_size) << " allocation";
+ VlogHeapGrowth(max_allowed_footprint_, new_footprint, alloc_size);
max_allowed_footprint_ = new_footprint;
}
}
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index f29ae92..f7be4c8 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -30,6 +30,7 @@
#include "base/dumpable.h"
#include "base/file_utils.h"
#include "base/histogram-inl.h"
+#include "base/logging.h" // For VLOG.
#include "base/memory_tool.h"
#include "base/stl_util.h"
#include "base/systrace.h"
@@ -799,12 +800,11 @@
bool has_waited = false;
uint64_t wait_start = NanoTime();
if (thread_flip_running_) {
- ATRACE_BEGIN("IncrementDisableThreadFlip");
+ ScopedTrace trace("IncrementDisableThreadFlip");
while (thread_flip_running_) {
has_waited = true;
thread_flip_cond_->Wait(self);
}
- ATRACE_END();
}
++disable_thread_flip_count_;
if (has_waited) {
@@ -4156,5 +4156,10 @@
return verification_.get();
}
+void Heap::VlogHeapGrowth(size_t max_allowed_footprint, size_t new_footprint, size_t alloc_size) {
+ VLOG(heap) << "Growing heap from " << PrettySize(max_allowed_footprint) << " to "
+ << PrettySize(new_footprint) << " for a " << PrettySize(alloc_size) << " allocation";
+}
+
} // namespace gc
} // namespace art
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index ac0d82e..0d11658 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -22,11 +22,14 @@
#include <unordered_set>
#include <vector>
+#include <android-base/logging.h>
+
#include "allocator_type.h"
#include "arch/instruction_set.h"
#include "atomic.h"
-#include "base/logging.h"
+#include "base/macros.h"
#include "base/mutex.h"
+#include "base/runtime_debug.h"
#include "base/time_utils.h"
#include "gc/collector/gc_type.h"
#include "gc/collector/iteration.h"
@@ -1096,6 +1099,9 @@
void TraceHeapSize(size_t heap_size);
+ // Remove a vlog code from heap-inl.h which is transitively included in half the world.
+ static void VlogHeapGrowth(size_t max_allowed_footprint, size_t new_footprint, size_t alloc_size);
+
// All-known continuous spaces, where objects lie within fixed bounds.
std::vector<space::ContinuousSpace*> continuous_spaces_ GUARDED_BY(Locks::mutator_lock_);
diff --git a/runtime/gc/space/dlmalloc_space.cc b/runtime/gc/space/dlmalloc_space.cc
index 576a35c..a3eef90 100644
--- a/runtime/gc/space/dlmalloc_space.cc
+++ b/runtime/gc/space/dlmalloc_space.cc
@@ -16,6 +16,7 @@
#include "dlmalloc_space-inl.h"
+#include "base/logging.h" // For VLOG.
#include "base/time_utils.h"
#include "gc/accounting/card_table.h"
#include "gc/accounting/space_bitmap-inl.h"
diff --git a/runtime/gc/space/image_space_fs.h b/runtime/gc/space/image_space_fs.h
index a0ecb95..6ce81e9 100644
--- a/runtime/gc/space/image_space_fs.h
+++ b/runtime/gc/space/image_space_fs.h
@@ -23,7 +23,7 @@
#include "android-base/stringprintf.h"
#include "base/file_utils.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/macros.h"
#include "base/unix_file/fd_file.h"
#include "globals.h"
diff --git a/runtime/gc/space/large_object_space.cc b/runtime/gc/space/large_object_space.cc
index 45f4f82..d2efb10 100644
--- a/runtime/gc/space/large_object_space.cc
+++ b/runtime/gc/space/large_object_space.cc
@@ -20,7 +20,9 @@
#include <memory>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/macros.h"
#include "base/memory_tool.h"
#include "base/mutex-inl.h"
#include "base/stl_util.h"
diff --git a/runtime/gc/space/malloc_space.cc b/runtime/gc/space/malloc_space.cc
index dcb7837..17274b5 100644
--- a/runtime/gc/space/malloc_space.cc
+++ b/runtime/gc/space/malloc_space.cc
@@ -18,6 +18,7 @@
#include "android-base/stringprintf.h"
+#include "base/logging.h" // For VLOG
#include "gc/accounting/card_table-inl.h"
#include "gc/accounting/space_bitmap-inl.h"
#include "gc/heap.h"
diff --git a/runtime/gc/space/rosalloc_space.cc b/runtime/gc/space/rosalloc_space.cc
index 5d1f191..3a685cb 100644
--- a/runtime/gc/space/rosalloc_space.cc
+++ b/runtime/gc/space/rosalloc_space.cc
@@ -17,6 +17,7 @@
#include "rosalloc_space-inl.h"
+#include "base/logging.h" // For VLOG.
#include "base/time_utils.h"
#include "gc/accounting/card_table.h"
#include "gc/accounting/space_bitmap-inl.h"
diff --git a/runtime/gc/space/space.cc b/runtime/gc/space/space.cc
index 74ce273..2c6afa7 100644
--- a/runtime/gc/space/space.cc
+++ b/runtime/gc/space/space.cc
@@ -16,7 +16,9 @@
#include "space.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/macros.h"
#include "gc/accounting/heap_bitmap.h"
#include "gc/accounting/space_bitmap-inl.h"
#include "gc/heap.h"
diff --git a/runtime/gc/verification.cc b/runtime/gc/verification.cc
index 3cd04a6..d99b377 100644
--- a/runtime/gc/verification.cc
+++ b/runtime/gc/verification.cc
@@ -86,7 +86,7 @@
mirror::Object* ref,
bool fatal) const {
// Lowest priority logging first:
- PrintFileToLog("/proc/self/maps", LogSeverity::FATAL_WITHOUT_ABORT);
+ PrintFileToLog("/proc/self/maps", android::base::LogSeverity::FATAL_WITHOUT_ABORT);
MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), true);
// Buffer the output in the string stream since it is more important than the stack traces
// and we want it to have log priority. The stack traces are printed from Runtime::Abort
diff --git a/runtime/handle.h b/runtime/handle.h
index ccff575..18e503d 100644
--- a/runtime/handle.h
+++ b/runtime/handle.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_HANDLE_H_
#define ART_RUNTIME_HANDLE_H_
+#include <android-base/logging.h>
+
#include "base/casts.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "base/mutex.h"
#include "base/value_object.h"
diff --git a/runtime/handle_scope.h b/runtime/handle_scope.h
index f248a11..28a2302 100644
--- a/runtime/handle_scope.h
+++ b/runtime/handle_scope.h
@@ -19,8 +19,9 @@
#include <stack>
+#include <android-base/logging.h>
+
#include "base/enums.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "base/mutex.h"
#include "handle.h"
diff --git a/runtime/hprof/hprof.cc b/runtime/hprof/hprof.cc
index 6a1a8c7..f4fc85b 100644
--- a/runtime/hprof/hprof.cc
+++ b/runtime/hprof/hprof.cc
@@ -36,11 +36,13 @@
#include <set>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "art_field-inl.h"
#include "art_method-inl.h"
-#include "base/logging.h"
+#include "base/macros.h"
+#include "base/mutex.h"
#include "base/time_utils.h"
#include "base/unix_file/fd_file.h"
#include "class_linker.h"
diff --git a/runtime/indenter.h b/runtime/indenter.h
index 69b9732..6361dd2 100644
--- a/runtime/indenter.h
+++ b/runtime/indenter.h
@@ -20,7 +20,8 @@
#include <ostream>
#include <streambuf>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
namespace art {
diff --git a/runtime/index_bss_mapping.h b/runtime/index_bss_mapping.h
index d9f4e66..dcbc05c 100644
--- a/runtime/index_bss_mapping.h
+++ b/runtime/index_bss_mapping.h
@@ -17,8 +17,9 @@
#ifndef ART_RUNTIME_INDEX_BSS_MAPPING_H_
#define ART_RUNTIME_INDEX_BSS_MAPPING_H_
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
namespace art {
diff --git a/runtime/indirect_reference_table.h b/runtime/indirect_reference_table.h
index 6675099..00184e2 100644
--- a/runtime/indirect_reference_table.h
+++ b/runtime/indirect_reference_table.h
@@ -23,8 +23,10 @@
#include <limits>
#include <string>
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
+#include "base/macros.h"
#include "base/mutex.h"
#include "gc_root.h"
#include "obj_ptr.h"
diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h
index 5937801..269b013 100644
--- a/runtime/interpreter/interpreter_common.h
+++ b/runtime/interpreter/interpreter_common.h
@@ -26,13 +26,14 @@
#include <iostream>
#include <sstream>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "art_field-inl.h"
#include "art_method-inl.h"
#include "base/enums.h"
-#include "base/logging.h"
#include "base/macros.h"
+#include "base/mutex.h"
#include "class_linker-inl.h"
#include "common_dex_operations.h"
#include "common_throws.h"
diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc
index 31e7986..dece830 100644
--- a/runtime/interpreter/unstarted_runtime.cc
+++ b/runtime/interpreter/unstarted_runtime.cc
@@ -26,12 +26,12 @@
#include <locale>
#include <unordered_map>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "art_method-inl.h"
#include "base/casts.h"
#include "base/enums.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "class_linker.h"
#include "common_throws.h"
diff --git a/runtime/jdwp/jdwp.h b/runtime/jdwp/jdwp.h
index aeeda1e..d712b10 100644
--- a/runtime/jdwp/jdwp.h
+++ b/runtime/jdwp/jdwp.h
@@ -18,6 +18,7 @@
#define ART_RUNTIME_JDWP_JDWP_H_
#include "atomic.h"
+#include "base/logging.h" // For VLOG.
#include "base/mutex.h"
#include "jdwp/jdwp_bits.h"
#include "jdwp/jdwp_constants.h"
diff --git a/runtime/jdwp/jdwp_adb.cc b/runtime/jdwp/jdwp_adb.cc
index ede4f9e..d68430f 100644
--- a/runtime/jdwp/jdwp_adb.cc
+++ b/runtime/jdwp/jdwp_adb.cc
@@ -22,7 +22,7 @@
#include "android-base/stringprintf.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "jdwp/jdwp_priv.h"
#include "thread-current-inl.h"
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc
index 41cb642..9409b76 100644
--- a/runtime/jdwp/jdwp_event.cc
+++ b/runtime/jdwp/jdwp_event.cc
@@ -25,7 +25,7 @@
#include "art_field-inl.h"
#include "art_method-inl.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "debugger.h"
#include "jdwp/jdwp_constants.h"
#include "jdwp/jdwp_expand_buf.h"
diff --git a/runtime/jdwp/jdwp_expand_buf.cc b/runtime/jdwp/jdwp_expand_buf.cc
index f0b8c91..4b4ca0e 100644
--- a/runtime/jdwp/jdwp_expand_buf.cc
+++ b/runtime/jdwp/jdwp_expand_buf.cc
@@ -23,7 +23,8 @@
#include <stdlib.h>
#include <string.h>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "jdwp/jdwp.h"
#include "jdwp/jdwp_bits.h"
diff --git a/runtime/jdwp/jdwp_handler.cc b/runtime/jdwp/jdwp_handler.cc
index 618332b..89eef88 100644
--- a/runtime/jdwp/jdwp_handler.cc
+++ b/runtime/jdwp/jdwp_handler.cc
@@ -24,7 +24,7 @@
#include "atomic.h"
#include "base/hex_dump.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/macros.h"
#include "debugger.h"
#include "jdwp/jdwp_constants.h"
diff --git a/runtime/jdwp/jdwp_main.cc b/runtime/jdwp/jdwp_main.cc
index e6c6068..e275554 100644
--- a/runtime/jdwp/jdwp_main.cc
+++ b/runtime/jdwp/jdwp_main.cc
@@ -23,7 +23,7 @@
#include "android-base/stringprintf.h"
#include "atomic.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/time_utils.h"
#include "debugger.h"
#include "jdwp/jdwp_priv.h"
diff --git a/runtime/jdwp/jdwp_socket.cc b/runtime/jdwp/jdwp_socket.cc
index 97662f0..673a942 100644
--- a/runtime/jdwp/jdwp_socket.cc
+++ b/runtime/jdwp/jdwp_socket.cc
@@ -28,7 +28,7 @@
#include "android-base/stringprintf.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "jdwp/jdwp_priv.h"
namespace art {
diff --git a/runtime/jit/debugger_interface.cc b/runtime/jit/debugger_interface.cc
index 135d9b1..4d1c85a 100644
--- a/runtime/jit/debugger_interface.cc
+++ b/runtime/jit/debugger_interface.cc
@@ -16,7 +16,8 @@
#include "debugger_interface.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/mutex.h"
#include "thread-current-inl.h"
#include "thread.h"
diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc
index 0d95bc6..783d05d 100644
--- a/runtime/jit/jit.cc
+++ b/runtime/jit/jit.cc
@@ -20,8 +20,9 @@
#include "art_method-inl.h"
#include "base/enums.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/memory_tool.h"
+#include "base/runtime_debug.h"
#include "debugger.h"
#include "entrypoints/runtime_asm_entrypoints.h"
#include "interpreter/interpreter.h"
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index a5c167e..6f03a68 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -21,6 +21,7 @@
#include "arch/context.h"
#include "art_method-inl.h"
#include "base/enums.h"
+#include "base/logging.h" // For VLOG.
#include "base/stl_util.h"
#include "base/systrace.h"
#include "base/time_utils.h"
diff --git a/runtime/jit/profile_compilation_info.cc b/runtime/jit/profile_compilation_info.cc
index bb0048d..7754777 100644
--- a/runtime/jit/profile_compilation_info.cc
+++ b/runtime/jit/profile_compilation_info.cc
@@ -35,6 +35,7 @@
#include "base/arena_allocator.h"
#include "base/dumpable.h"
#include "base/file_utils.h"
+#include "base/logging.h" // For VLOG.
#include "base/mutex.h"
#include "base/scoped_flock.h"
#include "base/stl_util.h"
diff --git a/runtime/jit/profile_saver.cc b/runtime/jit/profile_saver.cc
index acbc6e6..ee11cfd 100644
--- a/runtime/jit/profile_saver.cc
+++ b/runtime/jit/profile_saver.cc
@@ -25,6 +25,7 @@
#include "art_method-inl.h"
#include "base/enums.h"
+#include "base/logging.h" // For VLOG.
#include "base/scoped_arena_containers.h"
#include "base/stl_util.h"
#include "base/systrace.h"
diff --git a/runtime/jni_internal.cc b/runtime/jni_internal.cc
index 1e55158..48fc5f7 100644
--- a/runtime/jni_internal.cc
+++ b/runtime/jni_internal.cc
@@ -28,7 +28,7 @@
#include "atomic.h"
#include "base/allocator.h"
#include "base/enums.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/mutex.h"
#include "base/stl_util.h"
#include "class_linker-inl.h"
diff --git a/runtime/leb128.h b/runtime/leb128.h
index 31459af..2bfed7f 100644
--- a/runtime/leb128.h
+++ b/runtime/leb128.h
@@ -19,8 +19,10 @@
#include <vector>
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
+#include "base/macros.h"
#include "globals.h"
namespace art {
diff --git a/runtime/lock_word.h b/runtime/lock_word.h
index b9aa0b7..fac1a75 100644
--- a/runtime/lock_word.h
+++ b/runtime/lock_word.h
@@ -20,8 +20,9 @@
#include <cstdint>
#include <iosfwd>
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
#include "read_barrier.h"
namespace art {
diff --git a/runtime/managed_stack.h b/runtime/managed_stack.h
index 07078ec..d1c230f 100644
--- a/runtime/managed_stack.h
+++ b/runtime/managed_stack.h
@@ -21,7 +21,8 @@
#include <cstring>
#include <string>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
#include "base/mutex.h"
#include "base/bit_utils.h"
diff --git a/runtime/mem_map.cc b/runtime/mem_map.cc
index f5d12d5..8abf8a6 100644
--- a/runtime/mem_map.cc
+++ b/runtime/mem_map.cc
@@ -35,6 +35,7 @@
#include "base/allocator.h"
#include "base/bit_utils.h"
#include "base/file_utils.h"
+#include "base/logging.h" // For VLOG_IS_ON.
#include "base/memory_tool.h"
#include "globals.h"
#include "utils.h"
diff --git a/runtime/memory_region.cc b/runtime/memory_region.cc
index 13cc5c9..862ff73 100644
--- a/runtime/memory_region.cc
+++ b/runtime/memory_region.cc
@@ -19,9 +19,6 @@
#include <stdint.h>
#include <string.h>
-#include "base/logging.h"
-#include "globals.h"
-
namespace art {
void MemoryRegion::CopyFrom(size_t offset, const MemoryRegion& from) const {
diff --git a/runtime/memory_region.h b/runtime/memory_region.h
index 7cf5d49..23e0aec 100644
--- a/runtime/memory_region.h
+++ b/runtime/memory_region.h
@@ -20,10 +20,11 @@
#include <stdint.h>
#include <type_traits>
+#include <android-base/logging.h>
+
#include "arch/instruction_set.h"
#include "base/bit_utils.h"
#include "base/casts.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "base/value_object.h"
#include "globals.h"
diff --git a/runtime/method_info.h b/runtime/method_info.h
index 5a72125..6485af9 100644
--- a/runtime/method_info.h
+++ b/runtime/method_info.h
@@ -17,7 +17,9 @@
#ifndef ART_RUNTIME_METHOD_INFO_H_
#define ART_RUNTIME_METHOD_INFO_H_
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/macros.h"
#include "leb128.h"
#include "memory_region.h"
diff --git a/runtime/mirror/array-inl.h b/runtime/mirror/array-inl.h
index 2281245..636c84c 100644
--- a/runtime/mirror/array-inl.h
+++ b/runtime/mirror/array-inl.h
@@ -19,11 +19,11 @@
#include "array.h"
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "base/bit_utils.h"
#include "base/casts.h"
-#include "base/logging.h"
#include "class.h"
#include "gc/heap-inl.h"
#include "obj_ptr-inl.h"
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index 892c039..a0a2f46 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -20,6 +20,7 @@
#include "art_field-inl.h"
#include "art_method-inl.h"
+#include "base/logging.h" // For VLOG.
#include "class-inl.h"
#include "class_ext.h"
#include "class_linker-inl.h"
diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h
index 8b11c12..8d4d44b 100644
--- a/runtime/mirror/dex_cache-inl.h
+++ b/runtime/mirror/dex_cache-inl.h
@@ -19,11 +19,12 @@
#include "dex_cache.h"
+#include <android-base/logging.h>
+
#include "art_field.h"
#include "art_method.h"
#include "base/casts.h"
#include "base/enums.h"
-#include "base/logging.h"
#include "class_linker.h"
#include "dex_file.h"
#include "gc/heap-inl.h"
diff --git a/runtime/mirror/dex_cache.cc b/runtime/mirror/dex_cache.cc
index 2f63dff..eb4db00 100644
--- a/runtime/mirror/dex_cache.cc
+++ b/runtime/mirror/dex_cache.cc
@@ -17,7 +17,6 @@
#include "dex_cache-inl.h"
#include "art_method-inl.h"
-#include "base/logging.h"
#include "class_linker.h"
#include "gc/accounting/card_table-inl.h"
#include "gc/heap.h"
diff --git a/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h
index f75786b..509db02 100644
--- a/runtime/mirror/dex_cache.h
+++ b/runtime/mirror/dex_cache.h
@@ -19,6 +19,7 @@
#include "array.h"
#include "base/bit_utils.h"
+#include "base/mutex.h"
#include "dex_file_types.h"
#include "object.h"
#include "object_array.h"
diff --git a/runtime/monitor.cc b/runtime/monitor.cc
index d5520d9..1252905 100644
--- a/runtime/monitor.cc
+++ b/runtime/monitor.cc
@@ -21,6 +21,7 @@
#include "android-base/stringprintf.h"
#include "art_method-inl.h"
+#include "base/logging.h" // For VLOG.
#include "base/mutex.h"
#include "base/stl_util.h"
#include "base/systrace.h"
diff --git a/runtime/monitor_pool.cc b/runtime/monitor_pool.cc
index d00f979..cf5934b 100644
--- a/runtime/monitor_pool.cc
+++ b/runtime/monitor_pool.cc
@@ -16,7 +16,7 @@
#include "monitor_pool.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/mutex-inl.h"
#include "monitor.h"
#include "thread-current-inl.h"
diff --git a/runtime/native/dalvik_system_ZygoteHooks.cc b/runtime/native/dalvik_system_ZygoteHooks.cc
index a7bee39..fd80aae 100644
--- a/runtime/native/dalvik_system_ZygoteHooks.cc
+++ b/runtime/native/dalvik_system_ZygoteHooks.cc
@@ -18,11 +18,14 @@
#include <stdlib.h>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "arch/instruction_set.h"
#include "art_method-inl.h"
-#include "base/logging.h"
+#include "base/macros.h"
+#include "base/mutex.h"
+#include "base/runtime_debug.h"
#include "debugger.h"
#include "java_vm_ext.h"
#include "jit/jit.h"
diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
index c79f51b..8f8fd71 100644
--- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
+++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
@@ -16,8 +16,9 @@
#include "org_apache_harmony_dalvik_ddmc_DdmServer.h"
+#include <android-base/logging.h>
+
#include "base/array_ref.h"
-#include "base/logging.h"
#include "debugger.h"
#include "jni_internal.h"
#include "native_util.h"
diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
index f5057b0..7b73382 100644
--- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
+++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
@@ -16,8 +16,9 @@
#include "org_apache_harmony_dalvik_ddmc_DdmVmInternal.h"
+#include <android-base/logging.h>
+
#include "base/file_utils.h"
-#include "base/logging.h"
#include "base/mutex.h"
#include "debugger.h"
#include "gc/heap.h"
diff --git a/runtime/native_bridge_art_interface.cc b/runtime/native_bridge_art_interface.cc
index cd8315c..10d1091 100644
--- a/runtime/native_bridge_art_interface.cc
+++ b/runtime/native_bridge_art_interface.cc
@@ -22,7 +22,7 @@
#include "art_method-inl.h"
#include "base/enums.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/macros.h"
#include "dex_file-inl.h"
#include "jni_internal.h"
diff --git a/runtime/native_stack_dump.cc b/runtime/native_stack_dump.cc
index f166714..ec94552 100644
--- a/runtime/native_stack_dump.cc
+++ b/runtime/native_stack_dump.cc
@@ -40,6 +40,7 @@
#include "android-base/stringprintf.h"
#include "arch/instruction_set.h"
+#include "base/aborting.h"
#include "base/file_utils.h"
#include "base/memory_tool.h"
#include "base/mutex.h"
diff --git a/runtime/non_debuggable_classes.cc b/runtime/non_debuggable_classes.cc
index 7db199c..8484e2c 100644
--- a/runtime/non_debuggable_classes.cc
+++ b/runtime/non_debuggable_classes.cc
@@ -16,7 +16,6 @@
#include "non_debuggable_classes.h"
-#include "base/logging.h"
#include "jni_internal.h"
#include "mirror/class-inl.h"
#include "nativehelper/scoped_local_ref.h"
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index c82df71..32f8df7 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -39,6 +39,7 @@
#include "base/bit_vector.h"
#include "base/enums.h"
#include "base/file_utils.h"
+#include "base/logging.h" // For VLOG_IS_ON.
#include "base/stl_util.h"
#include "base/systrace.h"
#include "base/unix_file/fd_file.h"
@@ -314,7 +315,7 @@
if (requested_base != nullptr && begin_ != requested_base) {
// Host can fail this check. Do not dump there to avoid polluting the output.
if (kIsTargetBuild && (kIsDebugBuild || VLOG_IS_ON(oat))) {
- PrintFileToLog("/proc/self/maps", LogSeverity::WARNING);
+ PrintFileToLog("/proc/self/maps", android::base::LogSeverity::WARNING);
}
*error_msg = StringPrintf("Failed to find oatdata symbol at expected address: "
"oatdata=%p != expected=%p. See process maps in the log.",
@@ -1068,7 +1069,7 @@
dl_iterate_context context0 = { Begin(), &dlopen_mmaps_, 0, 0};
if (dl_iterate_phdr(dl_iterate_context::callback, &context0) == 0) {
// OK, give up and print an error.
- PrintFileToLog("/proc/self/maps", LogSeverity::WARNING);
+ PrintFileToLog("/proc/self/maps", android::base::LogSeverity::WARNING);
LOG(ERROR) << "File " << elf_filename << " loaded with dlopen but cannot find its mmaps.";
}
}
diff --git a/runtime/oat_file_assistant.cc b/runtime/oat_file_assistant.cc
index cd18ce1..8707e73 100644
--- a/runtime/oat_file_assistant.cc
+++ b/runtime/oat_file_assistant.cc
@@ -24,7 +24,7 @@
#include "android-base/strings.h"
#include "base/file_utils.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/stl_util.h"
#include "class_linker.h"
#include "compiler_filter.h"
diff --git a/runtime/oat_file_manager.cc b/runtime/oat_file_manager.cc
index b86f479..91a138a 100644
--- a/runtime/oat_file_manager.cc
+++ b/runtime/oat_file_manager.cc
@@ -26,7 +26,7 @@
#include "art_field-inl.h"
#include "base/bit_vector-inl.h"
#include "base/file_utils.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/stl_util.h"
#include "base/systrace.h"
#include "class_linker.h"
diff --git a/runtime/os_linux.cc b/runtime/os_linux.cc
index a463f70..1b3e000 100644
--- a/runtime/os_linux.cc
+++ b/runtime/os_linux.cc
@@ -23,7 +23,8 @@
#include <cstddef>
#include <memory>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/unix_file/fd_file.h"
namespace art {
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc
index 85af560..a3c0036 100644
--- a/runtime/parsed_options.cc
+++ b/runtime/parsed_options.cc
@@ -18,8 +18,10 @@
#include <sstream>
+#include <android-base/logging.h>
+
#include "base/file_utils.h"
-#include "base/logging.h"
+#include "base/macros.h"
#include "base/stringpiece.h"
#include "debugger.h"
#include "gc/heap.h"
diff --git a/runtime/plugin.cc b/runtime/plugin.cc
index 6aa0787..7d86f1d 100644
--- a/runtime/plugin.cc
+++ b/runtime/plugin.cc
@@ -20,8 +20,6 @@
#include "android-base/stringprintf.h"
-#include "base/logging.h"
-
namespace art {
using android::base::StringPrintf;
diff --git a/runtime/plugin.h b/runtime/plugin.h
index f077aaf..909c710 100644
--- a/runtime/plugin.h
+++ b/runtime/plugin.h
@@ -18,7 +18,8 @@
#define ART_RUNTIME_PLUGIN_H_
#include <string>
-#include "base/logging.h"
+
+#include <android-base/logging.h>
namespace art {
diff --git a/runtime/primitive.h b/runtime/primitive.h
index a429914..5b163d8 100644
--- a/runtime/primitive.h
+++ b/runtime/primitive.h
@@ -19,7 +19,8 @@
#include <sys/types.h>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
namespace art {
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc
index f94923e..a7771ab 100644
--- a/runtime/quick_exception_handler.cc
+++ b/runtime/quick_exception_handler.cc
@@ -19,6 +19,7 @@
#include "arch/context.h"
#include "art_method-inl.h"
#include "base/enums.h"
+#include "base/logging.h" // For VLOG_IS_ON.
#include "dex_file_types.h"
#include "dex_instruction.h"
#include "entrypoints/entrypoint_utils.h"
diff --git a/runtime/quick_exception_handler.h b/runtime/quick_exception_handler.h
index 12b63c9..1103dab 100644
--- a/runtime/quick_exception_handler.h
+++ b/runtime/quick_exception_handler.h
@@ -17,7 +17,8 @@
#ifndef ART_RUNTIME_QUICK_EXCEPTION_HANDLER_H_
#define ART_RUNTIME_QUICK_EXCEPTION_HANDLER_H_
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
#include "base/mutex.h"
#include "deoptimization_kind.h"
diff --git a/runtime/read_barrier.h b/runtime/read_barrier.h
index d4b9f43..e8df2ad 100644
--- a/runtime/read_barrier.h
+++ b/runtime/read_barrier.h
@@ -17,9 +17,11 @@
#ifndef ART_RUNTIME_READ_BARRIER_H_
#define ART_RUNTIME_READ_BARRIER_H_
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
#include "base/mutex.h"
+#include "base/runtime_debug.h"
#include "gc_root.h"
#include "jni.h"
#include "mirror/object_reference.h"
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index d15de38..7239ad3 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -57,6 +57,7 @@
#include "asm_support.h"
#include "asm_support_check.h"
#include "atomic.h"
+#include "base/aborting.h"
#include "base/arena_allocator.h"
#include "base/dumpable.h"
#include "base/enums.h"
diff --git a/runtime/runtime_common.cc b/runtime/runtime_common.cc
index eb69d91..59af918 100644
--- a/runtime/runtime_common.cc
+++ b/runtime/runtime_common.cc
@@ -23,10 +23,12 @@
#include <sstream>
#include <string>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
+#include "base/aborting.h"
#include "base/file_utils.h"
-#include "base/logging.h"
+#include "base/logging.h" // For LogHelper, GetCmdLine.
#include "base/macros.h"
#include "base/mutex.h"
#include "native_stack_dump.h"
@@ -430,7 +432,7 @@
logger(LOG_STREAM(FATAL_WITHOUT_ABORT));
}
if (kIsDebugBuild && signal_number == SIGSEGV) {
- PrintFileToLog("/proc/self/maps", LogSeverity::FATAL_WITHOUT_ABORT);
+ PrintFileToLog("/proc/self/maps", android::base::LogSeverity::FATAL_WITHOUT_ABORT);
}
Runtime* runtime = Runtime::Current();
diff --git a/runtime/safe_map.h b/runtime/safe_map.h
index f298691..33e45bd 100644
--- a/runtime/safe_map.h
+++ b/runtime/safe_map.h
@@ -21,8 +21,9 @@
#include <memory>
#include <type_traits>
+#include <android-base/logging.h>
+
#include "base/allocator.h"
-#include "base/logging.h"
namespace art {
diff --git a/runtime/scoped_thread_state_change-inl.h b/runtime/scoped_thread_state_change-inl.h
index aa96871..a9702a7 100644
--- a/runtime/scoped_thread_state_change-inl.h
+++ b/runtime/scoped_thread_state_change-inl.h
@@ -19,6 +19,8 @@
#include "scoped_thread_state_change.h"
+#include <android-base/logging.h>
+
#include "base/casts.h"
#include "jni_env_ext-inl.h"
#include "obj_ptr-inl.h"
diff --git a/runtime/scoped_thread_state_change.cc b/runtime/scoped_thread_state_change.cc
index 94354fc..6a86cc6 100644
--- a/runtime/scoped_thread_state_change.cc
+++ b/runtime/scoped_thread_state_change.cc
@@ -19,7 +19,6 @@
#include <type_traits>
#include "base/casts.h"
-#include "base/logging.h"
#include "java_vm_ext.h"
#include "obj_ptr-inl.h"
#include "runtime-inl.h"
diff --git a/runtime/signal_catcher.cc b/runtime/signal_catcher.cc
index bf5d718..d9c4da9 100644
--- a/runtime/signal_catcher.cc
+++ b/runtime/signal_catcher.cc
@@ -35,6 +35,7 @@
#include "arch/instruction_set.h"
#include "base/file_utils.h"
+#include "base/logging.h" // For GetCmdLine.
#include "base/time_utils.h"
#include "base/unix_file/fd_file.h"
#include "class_linker.h"
diff --git a/runtime/signal_set.h b/runtime/signal_set.h
index 6f88852..5361323 100644
--- a/runtime/signal_set.h
+++ b/runtime/signal_set.h
@@ -19,7 +19,7 @@
#include <signal.h>
-#include "base/logging.h"
+#include <android-base/logging.h>
namespace art {
diff --git a/runtime/stride_iterator.h b/runtime/stride_iterator.h
index 0560c33..511c2c6 100644
--- a/runtime/stride_iterator.h
+++ b/runtime/stride_iterator.h
@@ -19,7 +19,7 @@
#include <iterator>
-#include "base/logging.h"
+#include <android-base/logging.h>
namespace art {
diff --git a/runtime/string_reference.h b/runtime/string_reference.h
index d0ab4e4..24a4253 100644
--- a/runtime/string_reference.h
+++ b/runtime/string_reference.h
@@ -19,7 +19,8 @@
#include <stdint.h>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "dex_file-inl.h"
#include "dex_file_reference.h"
#include "dex_file_types.h"
diff --git a/runtime/thread-inl.h b/runtime/thread-inl.h
index b5a9626..62b0789 100644
--- a/runtime/thread-inl.h
+++ b/runtime/thread-inl.h
@@ -19,6 +19,7 @@
#include "thread.h"
+#include "base/aborting.h"
#include "base/casts.h"
#include "base/mutex-inl.h"
#include "base/time_utils.h"
diff --git a/runtime/thread_linux.cc b/runtime/thread_linux.cc
index b922d94..9673eee 100644
--- a/runtime/thread_linux.cc
+++ b/runtime/thread_linux.cc
@@ -14,9 +14,11 @@
* limitations under the License.
*/
+#include "thread.h"
+
#include <signal.h>
-#include "thread.h"
+#include "base/logging.h" // For VLOG.
#include "utils.h"
namespace art {
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index 9f55314..e43b9f4 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -28,6 +28,7 @@
#include "nativehelper/scoped_local_ref.h"
#include "nativehelper/scoped_utf_chars.h"
+#include "base/aborting.h"
#include "base/histogram-inl.h"
#include "base/mutex-inl.h"
#include "base/systrace.h"
@@ -364,11 +365,11 @@
// Run the checkpoint on the suspended threads.
for (const auto& thread : suspended_count_modified_threads) {
if (!thread->IsSuspended()) {
- if (ATRACE_ENABLED()) {
+ ScopedTrace trace([&]() {
std::ostringstream oss;
thread->ShortDump(oss);
- ATRACE_BEGIN((std::string("Waiting for suspension of thread ") + oss.str()).c_str());
- }
+ return std::string("Waiting for suspension of thread ") + oss.str();
+ });
// Busy wait until the thread is suspended.
const uint64_t start_time = NanoTime();
do {
@@ -377,7 +378,6 @@
const uint64_t total_delay = NanoTime() - start_time;
// Shouldn't need to wait for longer than 1000 microseconds.
constexpr uint64_t kLongWaitThreshold = MsToNs(1);
- ATRACE_END();
if (UNLIKELY(total_delay > kLongWaitThreshold)) {
LOG(WARNING) << "Long wait of " << PrettyDuration(total_delay) << " for "
<< *thread << " suspension!";
diff --git a/runtime/thread_pool.cc b/runtime/thread_pool.cc
index cffaffc..386cdf0 100644
--- a/runtime/thread_pool.cc
+++ b/runtime/thread_pool.cc
@@ -22,11 +22,11 @@
#include <pthread.h>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include "base/bit_utils.h"
#include "base/casts.h"
-#include "base/logging.h"
#include "base/stl_util.h"
#include "base/time_utils.h"
#include "runtime.h"
diff --git a/runtime/transaction.cc b/runtime/transaction.cc
index e923aff..c9766bc 100644
--- a/runtime/transaction.cc
+++ b/runtime/transaction.cc
@@ -16,7 +16,8 @@
#include "transaction.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/stl_util.h"
#include "gc/accounting/card_table-inl.h"
#include "gc_root-inl.h"
diff --git a/runtime/type_reference.h b/runtime/type_reference.h
index f7daa2b..10a67b1 100644
--- a/runtime/type_reference.h
+++ b/runtime/type_reference.h
@@ -19,7 +19,8 @@
#include <stdint.h>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "dex_file_types.h"
#include "string_reference.h"
diff --git a/runtime/utf.cc b/runtime/utf.cc
index 7e06482..93fcb32 100644
--- a/runtime/utf.cc
+++ b/runtime/utf.cc
@@ -16,7 +16,8 @@
#include "utf.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "mirror/array.h"
#include "mirror/object-inl.h"
#include "utf-inl.h"
diff --git a/runtime/utils.h b/runtime/utils.h
index ede32dc..789498c 100644
--- a/runtime/utils.h
+++ b/runtime/utils.h
@@ -23,9 +23,10 @@
#include <random>
#include <string>
+#include <android-base/logging.h>
+
#include "arch/instruction_set.h"
#include "base/casts.h"
-#include "base/logging.h"
#include "base/stringpiece.h"
#include "globals.h"
#include "primitive.h"
diff --git a/runtime/utils/dex_cache_arrays_layout-inl.h b/runtime/utils/dex_cache_arrays_layout-inl.h
index 9d4e9fb..855b856 100644
--- a/runtime/utils/dex_cache_arrays_layout-inl.h
+++ b/runtime/utils/dex_cache_arrays_layout-inl.h
@@ -19,8 +19,9 @@
#include "dex_cache_arrays_layout.h"
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
#include "gc_root.h"
#include "globals.h"
#include "mirror/dex_cache.h"
diff --git a/runtime/vdex_file.cc b/runtime/vdex_file.cc
index fb9d24f..fe768a1 100644
--- a/runtime/vdex_file.cc
+++ b/runtime/vdex_file.cc
@@ -20,8 +20,9 @@
#include <memory>
+#include <android-base/logging.h>
+
#include "base/bit_utils.h"
-#include "base/logging.h"
#include "base/stl_util.h"
#include "base/unix_file/fd_file.h"
#include "dex_file.h"
diff --git a/runtime/verifier/method_verifier-inl.h b/runtime/verifier/method_verifier-inl.h
index a7fa9f3..445a6ff 100644
--- a/runtime/verifier/method_verifier-inl.h
+++ b/runtime/verifier/method_verifier-inl.h
@@ -19,7 +19,8 @@
#include "method_verifier.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "handle_scope-inl.h"
#include "mirror/class_loader.h"
#include "mirror/dex_cache.h"
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index 8bd00b8..24f83b8 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -22,8 +22,9 @@
#include "art_field-inl.h"
#include "art_method-inl.h"
+#include "base/aborting.h"
#include "base/enums.h"
-#include "base/logging.h"
+#include "base/logging.h" // For VLOG.
#include "base/mutex-inl.h"
#include "base/stl_util.h"
#include "base/systrace.h"
@@ -282,7 +283,7 @@
bool allow_soft_failures,
HardFailLogMode log_level,
std::string* error) {
- SCOPED_TRACE("VerifyClass %s", PrettyDescriptor(dex_file->GetClassDescriptor(class_def)).c_str());
+ SCOPED_TRACE << "VerifyClass " << PrettyDescriptor(dex_file->GetClassDescriptor(class_def));
// A class must not be abstract and final.
if ((class_def.access_flags_ & (kAccAbstract | kAccFinal)) == (kAccAbstract | kAccFinal)) {
diff --git a/runtime/verifier/reg_type_cache.cc b/runtime/verifier/reg_type_cache.cc
index a3f08c8..c68fa0f 100644
--- a/runtime/verifier/reg_type_cache.cc
+++ b/runtime/verifier/reg_type_cache.cc
@@ -18,6 +18,7 @@
#include <type_traits>
+#include "base/aborting.h"
#include "base/arena_bit_vector.h"
#include "base/bit_vector-inl.h"
#include "base/casts.h"
diff --git a/runtime/verifier/register_line-inl.h b/runtime/verifier/register_line-inl.h
index a9c9428..39d73f5 100644
--- a/runtime/verifier/register_line-inl.h
+++ b/runtime/verifier/register_line-inl.h
@@ -19,6 +19,7 @@
#include "register_line.h"
+#include "base/logging.h" // For VLOG.
#include "method_verifier.h"
#include "reg_type_cache-inl.h"
@@ -192,6 +193,27 @@
SetResultTypeToUnknown(verifier);
}
+inline void RegisterLine::ClearRegToLockDepth(size_t reg, size_t depth) {
+ CHECK_LT(depth, 32u);
+ DCHECK(IsSetLockDepth(reg, depth));
+ auto it = reg_to_lock_depths_.find(reg);
+ DCHECK(it != reg_to_lock_depths_.end());
+ uint32_t depths = it->second ^ (1 << depth);
+ if (depths != 0) {
+ it->second = depths;
+ } else {
+ reg_to_lock_depths_.erase(it);
+ }
+ // Need to unlock every register at the same lock depth. These are aliased locks.
+ uint32_t mask = 1 << depth;
+ for (auto& pair : reg_to_lock_depths_) {
+ if ((pair.second & mask) != 0) {
+ VLOG(verifier) << "Also unlocking " << pair.first;
+ pair.second ^= mask;
+ }
+ }
+}
+
inline void RegisterLineArenaDelete::operator()(RegisterLine* ptr) const {
if (ptr != nullptr) {
ptr->~RegisterLine();
diff --git a/runtime/verifier/register_line.h b/runtime/verifier/register_line.h
index 71eb4d6..82f63b2 100644
--- a/runtime/verifier/register_line.h
+++ b/runtime/verifier/register_line.h
@@ -20,6 +20,8 @@
#include <memory>
#include <vector>
+#include <android-base/logging.h>
+
#include "base/scoped_arena_containers.h"
#include "safe_map.h"
@@ -401,26 +403,7 @@
return true;
}
- void ClearRegToLockDepth(size_t reg, size_t depth) {
- CHECK_LT(depth, 32u);
- DCHECK(IsSetLockDepth(reg, depth));
- auto it = reg_to_lock_depths_.find(reg);
- DCHECK(it != reg_to_lock_depths_.end());
- uint32_t depths = it->second ^ (1 << depth);
- if (depths != 0) {
- it->second = depths;
- } else {
- reg_to_lock_depths_.erase(it);
- }
- // Need to unlock every register at the same lock depth. These are aliased locks.
- uint32_t mask = 1 << depth;
- for (auto& pair : reg_to_lock_depths_) {
- if ((pair.second & mask) != 0) {
- VLOG(verifier) << "Also unlocking " << pair.first;
- pair.second ^= mask;
- }
- }
- }
+ void ClearRegToLockDepth(size_t reg, size_t depth);
void ClearAllRegToLockDepths(size_t reg) {
reg_to_lock_depths_.erase(reg);
diff --git a/runtime/well_known_classes.cc b/runtime/well_known_classes.cc
index 9722db9..5a653fe 100644
--- a/runtime/well_known_classes.cc
+++ b/runtime/well_known_classes.cc
@@ -20,9 +20,9 @@
#include <sstream>
-#include "android-base/stringprintf.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
-#include "base/logging.h"
#include "entrypoints/quick/quick_entrypoints_enum.h"
#include "jni_internal.h"
#include "mirror/class.h"
diff --git a/runtime/zip_archive.h b/runtime/zip_archive.h
index 821cc5c..75f8757 100644
--- a/runtime/zip_archive.h
+++ b/runtime/zip_archive.h
@@ -21,7 +21,8 @@
#include <memory>
#include <string>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/unix_file/random_access_file.h"
#include "globals.h"
#include "mem_map.h"
diff --git a/simulator/code_simulator_arm64.cc b/simulator/code_simulator_arm64.cc
index 939d2e2..a64bd0b 100644
--- a/simulator/code_simulator_arm64.cc
+++ b/simulator/code_simulator_arm64.cc
@@ -16,7 +16,7 @@
#include "code_simulator_arm64.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
using namespace vixl::aarch64; // NOLINT(build/namespaces)
diff --git a/simulator/code_simulator_container.cc b/simulator/code_simulator_container.cc
index a5f05dc..9f52b32 100644
--- a/simulator/code_simulator_container.cc
+++ b/simulator/code_simulator_container.cc
@@ -18,6 +18,7 @@
#include "code_simulator_container.h"
+#include "base/logging.h" // For VLOG.
#include "code_simulator.h"
#include "globals.h"
diff --git a/simulator/code_simulator_container.h b/simulator/code_simulator_container.h
index 31a915e..a219715 100644
--- a/simulator/code_simulator_container.h
+++ b/simulator/code_simulator_container.h
@@ -17,8 +17,9 @@
#ifndef ART_SIMULATOR_CODE_SIMULATOR_CONTAINER_H_
#define ART_SIMULATOR_CODE_SIMULATOR_CONTAINER_H_
+#include <android-base/logging.h>
+
#include "arch/instruction_set.h"
-#include "base/logging.h"
namespace art {
diff --git a/test/004-JniTest/jni_test.cc b/test/004-JniTest/jni_test.cc
index bc5a0a6..4561895 100644
--- a/test/004-JniTest/jni_test.cc
+++ b/test/004-JniTest/jni_test.cc
@@ -20,8 +20,10 @@
#include <iostream>
#include <vector>
+#include <android-base/logging.h>
+
#include "art_method-inl.h"
-#include "base/logging.h"
+#include "base/runtime_debug.h"
#include "jni.h"
namespace art {
diff --git a/test/044-proxy/native_proxy.cc b/test/044-proxy/native_proxy.cc
index f168719..f3178f9 100644
--- a/test/044-proxy/native_proxy.cc
+++ b/test/044-proxy/native_proxy.cc
@@ -16,7 +16,7 @@
#include "jni.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
namespace art {
diff --git a/test/137-cfi/cfi.cc b/test/137-cfi/cfi.cc
index 66270fd..ef758e8 100644
--- a/test/137-cfi/cfi.cc
+++ b/test/137-cfi/cfi.cc
@@ -25,11 +25,11 @@
#include "jni.h"
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
#include <backtrace/Backtrace.h>
-#include "android-base/stringprintf.h"
#include "base/file_utils.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "gc/heap.h"
#include "gc/space/image_space.h"
diff --git a/test/642-fp-callees/fp_callees.cc b/test/642-fp-callees/fp_callees.cc
index 600f969..17bb55b 100644
--- a/test/642-fp-callees/fp_callees.cc
+++ b/test/642-fp-callees/fp_callees.cc
@@ -14,8 +14,9 @@
* limitations under the License.
*/
+#include <android-base/logging.h>
+
#include "base/casts.h"
-#include "base/logging.h"
#include "jni.h"
namespace art {
diff --git a/test/671-npe-field-opts/expected.txt b/test/671-npe-field-opts/expected.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/671-npe-field-opts/expected.txt
diff --git a/test/671-npe-field-opts/info.txt b/test/671-npe-field-opts/info.txt
new file mode 100644
index 0000000..f1e5846
--- /dev/null
+++ b/test/671-npe-field-opts/info.txt
@@ -0,0 +1,3 @@
+Regression test for the compiler, which used to
+re-order or remove field access in a way that would confuse the runtime
+when validating a NPE.
diff --git a/test/671-npe-field-opts/src/Main.java b/test/671-npe-field-opts/src/Main.java
new file mode 100644
index 0000000..a5e81ce
--- /dev/null
+++ b/test/671-npe-field-opts/src/Main.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class Main {
+ static Main obj;
+ // Make 'doCheck' volatile to prevent optimizations
+ // in $noinline$bar like LICM that could hoist the null check
+ // out of the loop.
+ static volatile boolean doCheck = true;
+
+ float floatField;
+ int intField;
+
+ public static void main(String[] args) {
+ try {
+ $noinline$bar();
+ throw new Error("Expected NPE");
+ } catch (NullPointerException e) {
+ check(e, 29, 52, "$noinline$bar");
+ }
+
+ try {
+ $noinline$foo();
+ throw new Error("Expected NPE");
+ } catch (NullPointerException e) {
+ check(e, 36, 44, "$noinline$foo");
+ }
+ }
+
+ public static float $noinline$foo() {
+ int v1 = obj.intField;
+ float v2 = obj.floatField;
+ return v2;
+ }
+
+ public static float $noinline$bar() {
+ float a = 0;
+ while (doCheck) {
+ float f = obj.floatField;
+ int i = obj.intField;
+ a = (float)i + f;
+ }
+ return a;
+ }
+
+ static void check(NullPointerException npe, int mainLine, int methodLine, String methodName) {
+ StackTraceElement[] trace = npe.getStackTrace();
+ checkElement(trace[0], "Main", methodName, "Main.java", methodLine);
+ checkElement(trace[1], "Main", "main", "Main.java", mainLine);
+ }
+
+ static void checkElement(StackTraceElement element,
+ String declaringClass, String methodName,
+ String fileName, int lineNumber) {
+ assertEquals(declaringClass, element.getClassName());
+ assertEquals(methodName, element.getMethodName());
+ assertEquals(fileName, element.getFileName());
+ assertEquals(lineNumber, element.getLineNumber());
+ }
+
+ static void assertEquals(Object expected, Object actual) {
+ if (!expected.equals(actual)) {
+ String msg = "Expected \"" + expected + "\" but got \"" + actual + "\"";
+ throw new AssertionError(msg);
+ }
+ }
+
+ static void assertEquals(int expected, int actual) {
+ if (expected != actual) {
+ throw new AssertionError("Expected " + expected + " got " + actual);
+ }
+ }
+}
diff --git a/test/900-hello-plugin/load_unload.cc b/test/900-hello-plugin/load_unload.cc
index 19312b4..cab0abf 100644
--- a/test/900-hello-plugin/load_unload.cc
+++ b/test/900-hello-plugin/load_unload.cc
@@ -17,9 +17,10 @@
#include <jni.h>
#include <stdio.h>
+#include <android-base/logging.h>
+#include <android-base/macros.h>
+
#include "art_method-inl.h"
-#include "base/logging.h"
-#include "base/macros.h"
#include "java_vm_ext.h"
#include "runtime.h"
diff --git a/test/936-search-onload/search_onload.cc b/test/936-search-onload/search_onload.cc
index 90d87e0..23cea83 100644
--- a/test/936-search-onload/search_onload.cc
+++ b/test/936-search-onload/search_onload.cc
@@ -18,8 +18,9 @@
#include <inttypes.h>
-#include "android-base/stringprintf.h"
-#include "base/logging.h"
+#include <android-base/macros.h>
+#include <android-base/stringprintf.h>
+
#include "base/macros.h"
#include "jni.h"
#include "jvmti.h"
diff --git a/test/983-source-transform-verify/source_transform.cc b/test/983-source-transform-verify/source_transform.cc
index ca3f88b..3010d7a 100644
--- a/test/983-source-transform-verify/source_transform.cc
+++ b/test/983-source-transform-verify/source_transform.cc
@@ -25,7 +25,6 @@
#include "jni.h"
#include "jvmti.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "bytecode_utils.h"
#include "dex_file.h"
diff --git a/test/common/runtime_state.cc b/test/common/runtime_state.cc
index 3458080..1eed80e 100644
--- a/test/common/runtime_state.cc
+++ b/test/common/runtime_state.cc
@@ -16,9 +16,11 @@
#include "jni.h"
+#include <android-base/logging.h>
+#include <android-base/macros.h>
+
#include "art_method-inl.h"
#include "base/enums.h"
-#include "base/logging.h"
#include "dex_file-inl.h"
#include "instrumentation.h"
#include "jit/jit.h"
diff --git a/test/common/stack_inspect.cc b/test/common/stack_inspect.cc
index 80a2780..046b1fb 100644
--- a/test/common/stack_inspect.cc
+++ b/test/common/stack_inspect.cc
@@ -16,7 +16,9 @@
#include "jni.h"
-#include "base/logging.h"
+#include <android-base/logging.h>
+
+#include "base/mutex.h"
#include "dex_file-inl.h"
#include "jni_internal.h"
#include "mirror/class-inl.h"
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index 31f43fc..4844d1e 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -184,6 +184,10 @@
elif [ "x$1" = "x--prebuild" ]; then
PREBUILD="y"
shift
+ elif [ "x$1" = "x--compact-dex-level" ]; then
+ shift
+ COMPILE_FLAGS="${COMPILE_FLAGS} --compact-dex-level=$1"
+ shift
elif [ "x$1" = "x--jvmti-redefine-stress" ]; then
# APP_IMAGE doesn't really work with jvmti redefine stress
USE_JVMTI="y"
diff --git a/test/knownfailures.json b/test/knownfailures.json
index 5cd7888..ae1830a 100644
--- a/test/knownfailures.json
+++ b/test/knownfailures.json
@@ -383,7 +383,7 @@
"tests": ["629-vdex-speed",
"634-vdex-duplicate"],
"description": ["Profile driven dexlayout does not work with vdex or dex verifier."],
- "variant": "speed-profile"
+ "variant": "speed-profile | cdex-fast"
},
{
"test_patterns": ["616-cha.*"],
@@ -649,5 +649,11 @@
"tests": "661-oat-writer-layout",
"variant": "interp-ac | interpreter | jit | no-dex2oat | no-prebuild | no-image | trace",
"description": ["Test is designed to only check --compiler-filter=speed"]
+ },
+ {
+ "tests": ["628-vdex", "975-iface-private"],
+ "variant": "cdex-fast",
+ "description": ["CompactDex doesn't yet work with input-vdex or 975-iface private"]
}
+
]
diff --git a/test/run-test b/test/run-test
index fdb2ee4..75fe15c 100755
--- a/test/run-test
+++ b/test/run-test
@@ -225,6 +225,11 @@
run_args="${run_args} --prebuild"
prebuild_mode="yes"
shift;
+ elif [ "x$1" = "x--compact-dex-level" ]; then
+ option="$1"
+ shift
+ run_args="${run_args} $option $1"
+ shift;
elif [ "x$1" = "x--strip-dex" ]; then
run_args="${run_args} --strip-dex"
shift;
@@ -660,6 +665,7 @@
echo " -Xcompiler-option Pass an option to the compiler."
echo " --build-option Pass an option to the build script."
echo " --runtime-option Pass an option to the runtime."
+ echo " --compact-dex-level Specify a compact dex level to the compiler."
echo " --debug Wait for the default debugger to attach."
echo " --debug-agent <agent-path>"
echo " Wait for the given debugger agent to attach. Currently"
diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py
index 554b8a5..9399857 100755
--- a/test/testrunner/testrunner.py
+++ b/test/testrunner/testrunner.py
@@ -141,6 +141,7 @@
VARIANT_TYPE_DICT['debuggable'] = {'ndebuggable', 'debuggable'}
VARIANT_TYPE_DICT['gc'] = {'gcstress', 'gcverify', 'cms'}
VARIANT_TYPE_DICT['prebuild'] = {'no-prebuild', 'no-dex2oat', 'prebuild'}
+ VARIANT_TYPE_DICT['cdex_level'] = {'cdex-none', 'cdex-fast'}
VARIANT_TYPE_DICT['relocate'] = {'relocate-npatchoat', 'relocate', 'no-relocate'}
VARIANT_TYPE_DICT['jni'] = {'jni', 'forcecopy', 'checkjni'}
VARIANT_TYPE_DICT['address_sizes'] = {'64', '32'}
@@ -183,6 +184,9 @@
if not _user_input_variants['prebuild']: # Default
_user_input_variants['prebuild'].add('prebuild')
+ if not _user_input_variants['cdex_level']: # Default
+ _user_input_variants['cdex_level'].add('cdex-none')
+
# By default only run without jvmti
if not _user_input_variants['jvmti']:
_user_input_variants['jvmti'].add('no-jvmti')
@@ -339,10 +343,11 @@
_user_input_variants['relocate'], _user_input_variants['trace'],
_user_input_variants['gc'], _user_input_variants['jni'],
_user_input_variants['image'], _user_input_variants['pictest'],
- _user_input_variants['debuggable'], _user_input_variants['jvmti'])
+ _user_input_variants['debuggable'], _user_input_variants['jvmti'],
+ _user_input_variants['cdex_level'])
for test, target, run, prebuild, compiler, relocate, trace, gc, \
- jni, image, pictest, debuggable, jvmti in config:
+ jni, image, pictest, debuggable, jvmti, cdex_level in config:
for address_size in _user_input_variants['address_sizes_target'][target]:
if stop_testrunner:
# When ART_TEST_KEEP_GOING is set to false, then as soon as a test
@@ -356,6 +361,7 @@
test_name += target + '-run-test-'
test_name += run + '-'
test_name += prebuild + '-'
+ test_name += cdex_level + '-'
test_name += compiler + '-'
test_name += relocate + '-'
test_name += trace + '-'
@@ -369,7 +375,7 @@
test_name += address_size
variant_set = {target, run, prebuild, compiler, relocate, trace, gc, jni,
- image, pictest, debuggable, jvmti, address_size}
+ image, pictest, debuggable, jvmti, cdex_level, address_size}
options_test = options_all
@@ -386,6 +392,9 @@
elif prebuild == 'no-dex2oat':
options_test += ' --no-prebuild --no-dex2oat'
+ # Add option and remove the cdex- prefix.
+ options_test += ' --compact-dex-level ' + cdex_level.replace('cdex-','')
+
if compiler == 'optimizing':
options_test += ' --optimizing'
elif compiler == 'regalloc_gc':
@@ -806,6 +815,7 @@
regex += '(' + '|'.join(VARIANT_TYPE_DICT['pictest']) + ')-'
regex += '(' + '|'.join(VARIANT_TYPE_DICT['debuggable']) + ')-'
regex += '(' + '|'.join(VARIANT_TYPE_DICT['jvmti']) + ')-'
+ regex += '(' + '|'.join(VARIANT_TYPE_DICT['cdex_level']) + ')-'
regex += '(' + '|'.join(RUN_TEST_SET) + ')'
regex += '(' + '|'.join(VARIANT_TYPE_DICT['address_sizes']) + ')$'
match = re.match(regex, test_name)
@@ -822,8 +832,9 @@
_user_input_variants['pictest'].add(match.group(10))
_user_input_variants['debuggable'].add(match.group(11))
_user_input_variants['jvmti'].add(match.group(12))
- _user_input_variants['address_sizes'].add(match.group(14))
- return {match.group(13)}
+ _user_input_variants['cdex_level'].add(match.group(13))
+ _user_input_variants['address_sizes'].add(match.group(15))
+ return {match.group(14)}
raise ValueError(test_name + " is not a valid test")
diff --git a/test/ti-agent/common_load.cc b/test/ti-agent/common_load.cc
index d85f33a..9a7352e 100644
--- a/test/ti-agent/common_load.cc
+++ b/test/ti-agent/common_load.cc
@@ -17,7 +17,8 @@
#include <jni.h>
#include <stdio.h>
-#include "base/logging.h"
+#include <android-base/logging.h>
+
#include "base/macros.h"
#include "jni_binder.h"
diff --git a/tools/jfuzz/README.md b/tools/jfuzz/README.md
index 10d175b..4edfe1b 100644
--- a/tools/jfuzz/README.md
+++ b/tools/jfuzz/README.md
@@ -28,6 +28,8 @@
(higher values yield deeper nested conditionals)
-n : defines a fuzzing nest for for/while/do-while loops
(higher values yield deeper nested loops)
+ -t : defines a fuzzing nest for try-catch-finally blocks
+ (higher values yield deeper nested try-catch-finally blocks)
-v : prints version number and exits
-h : prints help and exits
diff --git a/tools/jfuzz/jfuzz.cc b/tools/jfuzz/jfuzz.cc
index 7990c6c..a6034c8 100644
--- a/tools/jfuzz/jfuzz.cc
+++ b/tools/jfuzz/jfuzz.cc
@@ -31,8 +31,6 @@
* Operators.
*/
-#define EMIT(x) fputs((x)[random0(sizeof(x)/sizeof(const char*))], out_);
-
static constexpr const char* kIncDecOps[] = { "++", "--" };
static constexpr const char* kIntUnaryOps[] = { "+", "-", "~" };
static constexpr const char* kFpUnaryOps[] = { "+", "-" };
@@ -51,11 +49,21 @@
static constexpr const char* kRelOps[] = { "==", "!=", ">", ">=", "<", "<=" };
/*
+ * Exceptions.
+ */
+static const char* kExceptionTypes[] = {
+ "IllegalStateException",
+ "NullPointerException",
+ "IllegalArgumentException",
+ "ArrayIndexOutOfBoundsException"
+};
+
+/*
* Version of JFuzz. Increase this each time changes are made to the program
* to preserve the property that a given version of JFuzz yields the same
* fuzzed program for a deterministic random seed.
*/
-const char* VERSION = "1.4";
+const char* VERSION = "1.5";
/*
* Maximum number of array dimensions, together with corresponding maximum size
@@ -64,6 +72,14 @@
static const uint32_t kMaxDim = 10;
static const uint32_t kMaxDimSize[kMaxDim + 1] = { 0, 1000, 32, 10, 6, 4, 3, 3, 2, 2, 2 };
+/*
+ * Utility function to return the number of elements in an array.
+ */
+template <typename T, uint32_t N>
+constexpr uint32_t countof(T const (&)[N]) {
+ return N;
+}
+
/**
* A class that generates a random program that compiles correctly. The program
* is generated using rules that generate various programming constructs. Each rule
@@ -78,7 +94,8 @@
uint32_t expr_depth,
uint32_t stmt_length,
uint32_t if_nest,
- uint32_t loop_nest)
+ uint32_t loop_nest,
+ uint32_t try_nest)
: out_(out),
fuzz_random_engine_(seed),
fuzz_seed_(seed),
@@ -86,6 +103,7 @@
fuzz_stmt_length_(stmt_length),
fuzz_if_nest_(if_nest),
fuzz_loop_nest_(loop_nest),
+ fuzz_try_nest_(try_nest),
return_type_(randomType()),
array_type_(randomType()),
array_dim_(random1(kMaxDim)),
@@ -97,6 +115,7 @@
loop_nest_(0),
switch_nest_(0),
do_nest_(0),
+ try_nest_(0),
boolean_local_(0),
int_local_(0),
long_local_(0),
@@ -168,6 +187,12 @@
}
}
+ // Emits a random strong selected from an array of operator strings.
+ template <std::uint32_t N>
+ inline void emitOneOf(const char* const (&ops)[N]) {
+ fputs(ops[random0(N)], out_);
+ }
+
//
// Expressions.
//
@@ -177,9 +202,9 @@
if (tp == kBoolean) {
fputc('!', out_);
} else if (isInteger(tp)) {
- EMIT(kIntUnaryOps);
+ emitOneOf(kIntUnaryOps);
} else { // isFP(tp)
- EMIT(kFpUnaryOps);
+ emitOneOf(kFpUnaryOps);
}
}
@@ -188,38 +213,38 @@
if (tp == kBoolean) {
// Not applicable, just leave "as is".
} else { // isInteger(tp) || isFP(tp)
- EMIT(kIncDecOps);
+ emitOneOf(kIncDecOps);
}
}
// Emit a binary operator (same type in-out).
void emitBinaryOp(Type tp) {
if (tp == kBoolean) {
- EMIT(kBoolBinOps);
+ emitOneOf(kBoolBinOps);
} else if (isInteger(tp)) {
- EMIT(kIntBinOps);
+ emitOneOf(kIntBinOps);
} else { // isFP(tp)
- EMIT(kFpBinOps);
+ emitOneOf(kFpBinOps);
}
}
// Emit an assignment operator (same type in-out).
void emitAssignmentOp(Type tp) {
if (tp == kBoolean) {
- EMIT(kBoolAssignOps);
+ emitOneOf(kBoolAssignOps);
} else if (isInteger(tp)) {
- EMIT(kIntAssignOps);
+ emitOneOf(kIntAssignOps);
} else { // isFP(tp)
- EMIT(kFpAssignOps);
+ emitOneOf(kFpAssignOps);
}
}
// Emit a relational operator (one type in, boolean out).
void emitRelationalOp(Type tp) {
if (tp == kBoolean) {
- EMIT(kBoolRelOps);
+ emitOneOf(kBoolRelOps);
} else { // isInteger(tp) || isFP(tp)
- EMIT(kRelOps);
+ emitOneOf(kRelOps);
}
}
@@ -808,7 +833,7 @@
fputs("{\n", out_);
indentation_ += 2;
emitIndentation();
- fprintf(out_, "int i%u = %d;", loop_nest_, isWhile ? -1 : 0);
+ fprintf(out_, "int i%u = %d;\n", loop_nest_, isWhile ? -1 : 0);
emitIndentation();
if (isWhile) {
fprintf(out_, "while (++i%u < ", loop_nest_);
@@ -871,6 +896,73 @@
return mayFollowTrue || mayFollowFalse;
}
+ bool emitTry() {
+ fputs("try {\n", out_);
+ indentation_ += 2;
+ bool mayFollow = emitStatementList();
+ indentation_ -= 2;
+ emitIndentation();
+ fputc('}', out_);
+ return mayFollow;
+ }
+
+ bool emitCatch() {
+ uint32_t count = random1(countof(kExceptionTypes));
+ bool mayFollow = false;
+ for (uint32_t i = 0; i < count; ++i) {
+ fprintf(out_, " catch (%s ex%u_%u) {\n", kExceptionTypes[i], try_nest_, i);
+ indentation_ += 2;
+ mayFollow |= emitStatementList();
+ indentation_ -= 2;
+ emitIndentation();
+ fputc('}', out_);
+ }
+ return mayFollow;
+ }
+
+ bool emitFinally() {
+ fputs(" finally {\n", out_);
+ indentation_ += 2;
+ bool mayFollow = emitStatementList();
+ indentation_ -= 2;
+ emitIndentation();
+ fputc('}', out_);
+ return mayFollow;
+ }
+
+ // Emit a try-catch-finally block.
+ bool emitTryCatchFinally() {
+ // Apply a hard limit on the number of catch blocks. This is for
+ // javac which fails if blocks within try-catch-finally are too
+ // large (much less than you'd expect).
+ if (try_nest_ > fuzz_try_nest_) {
+ return emitAssignment(); // fall back
+ }
+
+ ++try_nest_; // Entering try-catch-finally
+
+ bool mayFollow = emitTry();
+ switch (random0(3)) {
+ case 0: // try..catch
+ mayFollow |= emitCatch();
+ break;
+ case 1: // try..finally
+ mayFollow &= emitFinally();
+ break;
+ case 2: // try..catch..finally
+ // When determining whether code may follow, we observe that a
+ // finally block always follows after try and catch
+ // block. Code may only follow if the finally block permits
+ // and either the try or catch block allows code to follow.
+ mayFollow = (mayFollow | emitCatch()) & emitFinally();
+ break;
+ }
+ fputc('\n', out_);
+
+ --try_nest_; // Leaving try-catch-finally
+ return mayFollow;
+ }
+
// Emit a switch statement.
bool emitSwitch() {
// Continuing if nest becomes less likely as the depth grows.
@@ -915,6 +1007,11 @@
return mayFollow;
}
+ bool emitNopCall() {
+ fputs("nop();\n", out_);
+ return true;
+ }
+
// Emit an assignment statement.
bool emitAssignment() {
Type tp = randomType();
@@ -930,16 +1027,18 @@
// Emit a single statement. Returns true if statements may follow.
bool emitStatement() {
switch (random1(16)) { // favor assignments
- case 1: return emitReturn(false); break;
- case 2: return emitContinue(); break;
- case 3: return emitBreak(); break;
- case 4: return emitScope(); break;
- case 5: return emitArrayInit(); break;
- case 6: return emitForLoop(); break;
- case 7: return emitDoLoop(); break;
- case 8: return emitIfStmt(); break;
- case 9: return emitSwitch(); break;
- default: return emitAssignment(); break;
+ case 1: return emitReturn(false); break;
+ case 2: return emitContinue(); break;
+ case 3: return emitBreak(); break;
+ case 4: return emitScope(); break;
+ case 5: return emitArrayInit(); break;
+ case 6: return emitForLoop(); break;
+ case 7: return emitDoLoop(); break;
+ case 8: return emitIfStmt(); break;
+ case 9: return emitSwitch(); break;
+ case 10: return emitTryCatchFinally(); break;
+ case 11: return emitNopCall(); break;
+ default: return emitAssignment(); break;
}
}
@@ -1109,6 +1208,11 @@
fputs(" }\n", out_);
}
+ // Emit a static void method.
+ void emitStaticNopMethod() {
+ fputs(" public static void nop() {}\n", out_);
+ }
+
// Emit program header. Emit command line options in the comments.
void emitHeader() {
fputs("\n/**\n * AOSP JFuzz Tester.\n", out_);
@@ -1133,6 +1237,7 @@
emitArrayDecl();
emitTestConstructor();
emitTestMethod();
+ emitStaticNopMethod();
emitMainMethod();
indentation_ -= 2;
fputs("}\n\n", out_);
@@ -1167,6 +1272,7 @@
const uint32_t fuzz_stmt_length_;
const uint32_t fuzz_if_nest_;
const uint32_t fuzz_loop_nest_;
+ const uint32_t fuzz_try_nest_;
// Return and array setup.
const Type return_type_;
@@ -1182,6 +1288,7 @@
uint32_t loop_nest_;
uint32_t switch_nest_;
uint32_t do_nest_;
+ uint32_t try_nest_;
uint32_t boolean_local_;
uint32_t int_local_;
uint32_t long_local_;
@@ -1203,6 +1310,7 @@
uint32_t stmt_length = 8;
uint32_t if_nest = 2;
uint32_t loop_nest = 3;
+ uint32_t try_nest = 2;
// Parse options.
while (1) {
@@ -1226,6 +1334,9 @@
case 'n':
loop_nest = strtoul(optarg, nullptr, 0);
break;
+ case 't':
+ try_nest = strtoul(optarg, nullptr, 0);
+ break;
case 'v':
fprintf(stderr, "jfuzz version %s\n", VERSION);
return 0;
@@ -1234,7 +1345,7 @@
fprintf(stderr,
"usage: %s [-s seed] "
"[-d expr-depth] [-l stmt-length] "
- "[-i if-nest] [-n loop-nest] [-v] [-h]\n",
+ "[-i if-nest] [-n loop-nest] [-t try-nest] [-v] [-h]\n",
argv[0]);
return 1;
}
@@ -1244,7 +1355,7 @@
srand(seed);
// Generate fuzzed program.
- JFuzz fuzz(stdout, seed, expr_depth, stmt_length, if_nest, loop_nest);
+ JFuzz fuzz(stdout, seed, expr_depth, stmt_length, if_nest, loop_nest, try_nest);
fuzz.emitProgram();
return 0;
}
diff --git a/tools/libjdwp_oj_art_failures.txt b/tools/libjdwp_oj_art_failures.txt
index e1cc831..145022e 100644
--- a/tools/libjdwp_oj_art_failures.txt
+++ b/tools/libjdwp_oj_art_failures.txt
@@ -79,5 +79,11 @@
result: EXEC_FAILED,
bug: 69591477,
name: "org.apache.harmony.jpda.tests.jdwp.VirtualMachine.ExitTest#testExit001"
+},
+{
+ description: "Test times out on fugu-debug",
+ result: EXEC_FAILED,
+ bug: 70459916,
+ name: "org.apache.harmony.jpda.tests.jdwp.VMDebug.VMDebugTest#testVMDebug"
}
]