Merge changes I1f50e09d,I8b2bb87a am: 1051fa2d74 am: 22359a67a7
am: ceba02d8f6
Change-Id: I4f139aa96c50addffb501f7a4bd34ef8bd671215
diff --git a/compiler/compiler.h b/compiler/compiler.h
index 908d366..cd4c591 100644
--- a/compiler/compiler.h
+++ b/compiler/compiler.h
@@ -25,11 +25,11 @@
namespace jit {
class JitCodeCache;
-}
+} // namespace jit
namespace mirror {
class ClassLoader;
class DexCache;
-}
+} // namespace mirror
class ArtMethod;
class CompilerDriver;
diff --git a/compiler/debug/elf_debug_writer.h b/compiler/debug/elf_debug_writer.h
index 07f7229..5d68810 100644
--- a/compiler/debug/elf_debug_writer.h
+++ b/compiler/debug/elf_debug_writer.h
@@ -29,7 +29,7 @@
class OatHeader;
namespace mirror {
class Class;
-}
+} // namespace mirror
namespace debug {
struct MethodDebugInfo;
diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h
index 5a82021..89c2537 100644
--- a/compiler/driver/compiler_options.h
+++ b/compiler/driver/compiler_options.h
@@ -31,7 +31,7 @@
namespace verifier {
class VerifierDepsTest;
-}
+} // namespace verifier
class DexFile;
diff --git a/compiler/optimizing/intrinsics_arm64.h b/compiler/optimizing/intrinsics_arm64.h
index 3c53517..ff59ce9 100644
--- a/compiler/optimizing/intrinsics_arm64.h
+++ b/compiler/optimizing/intrinsics_arm64.h
@@ -24,7 +24,8 @@
class MacroAssembler;
-}} // namespace vixl::aarch64
+} // namespace aarch64
+} // namespace vixl
namespace art {
diff --git a/compiler/utils/label.h b/compiler/utils/label.h
index 0f82ad5..4c6ae8e 100644
--- a/compiler/utils/label.h
+++ b/compiler/utils/label.h
@@ -29,24 +29,24 @@
namespace arm {
class ArmAssembler;
class Thumb2Assembler;
-}
+} // namespace arm
namespace arm64 {
class Arm64Assembler;
-}
+} // namespace arm64
namespace mips {
class MipsAssembler;
-}
+} // namespace mips
namespace mips64 {
class Mips64Assembler;
-}
+} // namespace mips64
namespace x86 {
class X86Assembler;
class NearLabel;
-}
+} // namespace x86
namespace x86_64 {
class X86_64Assembler;
class NearLabel;
-}
+} // namespace x86_64
class ExternalLabel {
public:
diff --git a/compiler/utils/managed_register.h b/compiler/utils/managed_register.h
index 184cdf5..2b7b2aa 100644
--- a/compiler/utils/managed_register.h
+++ b/compiler/utils/managed_register.h
@@ -26,24 +26,24 @@
namespace arm {
class ArmManagedRegister;
-}
+} // namespace arm
namespace arm64 {
class Arm64ManagedRegister;
-}
+} // namespace arm64
namespace mips {
class MipsManagedRegister;
-}
+} // namespace mips
namespace mips64 {
class Mips64ManagedRegister;
-}
+} // namespace mips64
namespace x86 {
class X86ManagedRegister;
-}
+} // namespace x86
namespace x86_64 {
class X86_64ManagedRegister;
-}
+} // namespace x86_64
class ManagedRegister : public ValueObject {
public:
diff --git a/runtime/arch/instruction_set_features.cc b/runtime/arch/instruction_set_features.cc
index 00d22c4..43c1711 100644
--- a/runtime/arch/instruction_set_features.cc
+++ b/runtime/arch/instruction_set_features.cc
@@ -33,33 +33,26 @@
std::unique_ptr<const InstructionSetFeatures> InstructionSetFeatures::FromVariant(
InstructionSet isa, const std::string& variant, std::string* error_msg) {
- std::unique_ptr<const InstructionSetFeatures> result;
switch (isa) {
case kArm:
case kThumb2:
- result.reset(ArmInstructionSetFeatures::FromVariant(variant, error_msg).release());
- break;
+ return ArmInstructionSetFeatures::FromVariant(variant, error_msg);
case kArm64:
- result.reset(Arm64InstructionSetFeatures::FromVariant(variant, error_msg).release());
- break;
+ return Arm64InstructionSetFeatures::FromVariant(variant, error_msg);
case kMips:
- result.reset(MipsInstructionSetFeatures::FromVariant(variant, error_msg).release());
- break;
+ return MipsInstructionSetFeatures::FromVariant(variant, error_msg);
case kMips64:
- result = Mips64InstructionSetFeatures::FromVariant(variant, error_msg);
- break;
+ return Mips64InstructionSetFeatures::FromVariant(variant, error_msg);
case kX86:
- result.reset(X86InstructionSetFeatures::FromVariant(variant, error_msg).release());
- break;
+ return X86InstructionSetFeatures::FromVariant(variant, error_msg);
case kX86_64:
- result.reset(X86_64InstructionSetFeatures::FromVariant(variant, error_msg).release());
+ return X86_64InstructionSetFeatures::FromVariant(variant, error_msg);
+
+ case kNone:
break;
- default:
- UNIMPLEMENTED(FATAL) << isa;
- UNREACHABLE();
}
- CHECK_EQ(result == nullptr, error_msg->size() != 0);
- return result;
+ UNIMPLEMENTED(FATAL) << isa;
+ UNREACHABLE();
}
std::unique_ptr<const InstructionSetFeatures> InstructionSetFeatures::FromBitmap(InstructionSet isa,
@@ -68,23 +61,25 @@
switch (isa) {
case kArm:
case kThumb2:
- result.reset(ArmInstructionSetFeatures::FromBitmap(bitmap).release());
+ result = ArmInstructionSetFeatures::FromBitmap(bitmap);
break;
case kArm64:
- result.reset(Arm64InstructionSetFeatures::FromBitmap(bitmap).release());
+ result = Arm64InstructionSetFeatures::FromBitmap(bitmap);
break;
case kMips:
- result.reset(MipsInstructionSetFeatures::FromBitmap(bitmap).release());
+ result = MipsInstructionSetFeatures::FromBitmap(bitmap);
break;
case kMips64:
result = Mips64InstructionSetFeatures::FromBitmap(bitmap);
break;
case kX86:
- result.reset(X86InstructionSetFeatures::FromBitmap(bitmap).release());
+ result = X86InstructionSetFeatures::FromBitmap(bitmap);
break;
case kX86_64:
- result.reset(X86_64InstructionSetFeatures::FromBitmap(bitmap).release());
+ result = X86_64InstructionSetFeatures::FromBitmap(bitmap);
break;
+
+ case kNone:
default:
UNIMPLEMENTED(FATAL) << isa;
UNREACHABLE();
@@ -94,120 +89,96 @@
}
std::unique_ptr<const InstructionSetFeatures> InstructionSetFeatures::FromCppDefines() {
- std::unique_ptr<const InstructionSetFeatures> result;
switch (kRuntimeISA) {
case kArm:
case kThumb2:
- result.reset(ArmInstructionSetFeatures::FromCppDefines().release());
- break;
+ return ArmInstructionSetFeatures::FromCppDefines();
case kArm64:
- result.reset(Arm64InstructionSetFeatures::FromCppDefines().release());
- break;
+ return Arm64InstructionSetFeatures::FromCppDefines();
case kMips:
- result.reset(MipsInstructionSetFeatures::FromCppDefines().release());
- break;
+ return MipsInstructionSetFeatures::FromCppDefines();
case kMips64:
- result = Mips64InstructionSetFeatures::FromCppDefines();
- break;
+ return Mips64InstructionSetFeatures::FromCppDefines();
case kX86:
- result.reset(X86InstructionSetFeatures::FromCppDefines().release());
- break;
+ return X86InstructionSetFeatures::FromCppDefines();
case kX86_64:
- result.reset(X86_64InstructionSetFeatures::FromCppDefines().release());
+ return X86_64InstructionSetFeatures::FromCppDefines();
+
+ case kNone:
break;
- default:
- UNIMPLEMENTED(FATAL) << kRuntimeISA;
- UNREACHABLE();
}
- return result;
+ UNIMPLEMENTED(FATAL) << kRuntimeISA;
+ UNREACHABLE();
}
std::unique_ptr<const InstructionSetFeatures> InstructionSetFeatures::FromCpuInfo() {
- std::unique_ptr<const InstructionSetFeatures> result;
switch (kRuntimeISA) {
case kArm:
case kThumb2:
- result.reset(ArmInstructionSetFeatures::FromCpuInfo().release());
- break;
+ return ArmInstructionSetFeatures::FromCpuInfo();
case kArm64:
- result.reset(Arm64InstructionSetFeatures::FromCpuInfo().release());
- break;
+ return Arm64InstructionSetFeatures::FromCpuInfo();
case kMips:
- result.reset(MipsInstructionSetFeatures::FromCpuInfo().release());
- break;
+ return MipsInstructionSetFeatures::FromCpuInfo();
case kMips64:
- result = Mips64InstructionSetFeatures::FromCpuInfo();
- break;
+ return Mips64InstructionSetFeatures::FromCpuInfo();
case kX86:
- result.reset(X86InstructionSetFeatures::FromCpuInfo().release());
- break;
+ return X86InstructionSetFeatures::FromCpuInfo();
case kX86_64:
- result.reset(X86_64InstructionSetFeatures::FromCpuInfo().release());
+ return X86_64InstructionSetFeatures::FromCpuInfo();
+
+ case kNone:
break;
- default:
- UNIMPLEMENTED(FATAL) << kRuntimeISA;
- UNREACHABLE();
}
- return result;
+ UNIMPLEMENTED(FATAL) << kRuntimeISA;
+ UNREACHABLE();
}
std::unique_ptr<const InstructionSetFeatures> InstructionSetFeatures::FromHwcap() {
- std::unique_ptr<const InstructionSetFeatures> result;
switch (kRuntimeISA) {
case kArm:
case kThumb2:
- result.reset(ArmInstructionSetFeatures::FromHwcap().release());
- break;
+ return ArmInstructionSetFeatures::FromHwcap();
case kArm64:
- result.reset(Arm64InstructionSetFeatures::FromHwcap().release());
- break;
+ return Arm64InstructionSetFeatures::FromHwcap();
case kMips:
- result.reset(MipsInstructionSetFeatures::FromHwcap().release());
- break;
+ return MipsInstructionSetFeatures::FromHwcap();
case kMips64:
- result = Mips64InstructionSetFeatures::FromHwcap();
- break;
+ return Mips64InstructionSetFeatures::FromHwcap();
case kX86:
- result.reset(X86InstructionSetFeatures::FromHwcap().release());
- break;
+ return X86InstructionSetFeatures::FromHwcap();
case kX86_64:
- result.reset(X86_64InstructionSetFeatures::FromHwcap().release());
+ return X86_64InstructionSetFeatures::FromHwcap();
+
+ case kNone:
break;
- default:
- UNIMPLEMENTED(FATAL) << kRuntimeISA;
- UNREACHABLE();
}
- return result;
+ UNIMPLEMENTED(FATAL) << kRuntimeISA;
+ UNREACHABLE();
}
std::unique_ptr<const InstructionSetFeatures> InstructionSetFeatures::FromAssembly() {
- std::unique_ptr<const InstructionSetFeatures> result;
switch (kRuntimeISA) {
case kArm:
case kThumb2:
- result.reset(ArmInstructionSetFeatures::FromAssembly().release());
- break;
+ return ArmInstructionSetFeatures::FromAssembly();
case kArm64:
- result.reset(Arm64InstructionSetFeatures::FromAssembly().release());
- break;
+ return Arm64InstructionSetFeatures::FromAssembly();
case kMips:
- result.reset(MipsInstructionSetFeatures::FromAssembly().release());
- break;
+ return MipsInstructionSetFeatures::FromAssembly();
case kMips64:
- result = Mips64InstructionSetFeatures::FromAssembly();
- break;
+ return Mips64InstructionSetFeatures::FromAssembly();
case kX86:
- result.reset(X86InstructionSetFeatures::FromAssembly().release());
- break;
+ return X86InstructionSetFeatures::FromAssembly();
case kX86_64:
- result.reset(X86_64InstructionSetFeatures::FromAssembly().release());
+ return X86_64InstructionSetFeatures::FromAssembly();
+
+ case kNone:
break;
- default:
- UNIMPLEMENTED(FATAL) << kRuntimeISA;
- UNREACHABLE();
}
- return result;
+ UNIMPLEMENTED(FATAL) << kRuntimeISA;
+ UNREACHABLE();
}
std::unique_ptr<const InstructionSetFeatures> InstructionSetFeatures::AddFeaturesFromString(
diff --git a/runtime/arch/memcmp16.cc b/runtime/arch/memcmp16.cc
index 813df2f..e714cfc 100644
--- a/runtime/arch/memcmp16.cc
+++ b/runtime/arch/memcmp16.cc
@@ -37,7 +37,7 @@
return MemCmp16(s0, s1, count);
}
-}
+} // namespace testing
} // namespace art
diff --git a/runtime/arch/memcmp16.h b/runtime/arch/memcmp16.h
index c449a14..b051a1c 100644
--- a/runtime/arch/memcmp16.h
+++ b/runtime/arch/memcmp16.h
@@ -59,7 +59,7 @@
// implementation.
int32_t MemCmp16Testing(const uint16_t* s0, const uint16_t* s1, size_t count);
-}
+} // namespace testing
} // namespace art
diff --git a/runtime/dex_file.cc b/runtime/dex_file.cc
index 3d68af1..aace8eb 100644
--- a/runtime/dex_file.cc
+++ b/runtime/dex_file.cc
@@ -204,7 +204,7 @@
verify_checksum,
error_msg);
if (dex_file != nullptr) {
- dex_file->mem_map_.reset(map.release());
+ dex_file->mem_map_ = std::move(map);
}
return dex_file;
}
@@ -323,7 +323,7 @@
verify_checksum,
error_msg);
if (dex_file != nullptr) {
- dex_file->mem_map_.reset(map.release());
+ dex_file->mem_map_ = std::move(map);
}
return dex_file;
@@ -397,7 +397,7 @@
}
return nullptr;
}
- dex_file->mem_map_.reset(map.release());
+ dex_file->mem_map_ = std::move(map);
if (!dex_file->DisableWrite()) {
*error_msg = StringPrintf("Failed to make dex file '%s' read only", location.c_str());
*error_code = ZipOpenErrorCode::kMakeReadOnlyError;
diff --git a/runtime/gc/allocation_listener.h b/runtime/gc/allocation_listener.h
index f60bc0c..d694a68 100644
--- a/runtime/gc/allocation_listener.h
+++ b/runtime/gc/allocation_listener.h
@@ -30,7 +30,7 @@
namespace mirror {
class Object;
-}
+} // namespace mirror
class Thread;
diff --git a/runtime/gc/allocation_record.h b/runtime/gc/allocation_record.h
index 90cff6a..227c7ad 100644
--- a/runtime/gc/allocation_record.h
+++ b/runtime/gc/allocation_record.h
@@ -33,7 +33,7 @@
namespace mirror {
class Class;
class Object;
-}
+} // namespace mirror
namespace gc {
diff --git a/runtime/handle_scope.h b/runtime/handle_scope.h
index c43a482..f248a11 100644
--- a/runtime/handle_scope.h
+++ b/runtime/handle_scope.h
@@ -36,7 +36,7 @@
namespace mirror {
class Object;
-}
+} // namespace mirror
// Basic handle scope, tracked by a list. May be variable sized.
class PACKED(4) BaseHandleScope {
diff --git a/runtime/jit/profiling_info.h b/runtime/jit/profiling_info.h
index d6881aa..788fa1f 100644
--- a/runtime/jit/profiling_info.h
+++ b/runtime/jit/profiling_info.h
@@ -29,11 +29,11 @@
namespace jit {
class JitCodeCache;
-}
+} // namespace jit
namespace mirror {
class Class;
-}
+} // namespace mirror
// Structure to store the classes seen at runtime for a specific instruction.
// Once the classes_ array is full, we consider the INVOKE to be megamorphic.
diff --git a/runtime/method_handles.h b/runtime/method_handles.h
index 5bea0ab..e8a2dce 100644
--- a/runtime/method_handles.h
+++ b/runtime/method_handles.h
@@ -29,7 +29,7 @@
namespace mirror {
class MethodHandle;
class MethodType;
-} // mirror
+} // namespace mirror
class ShadowFrame;
diff --git a/runtime/openjdkjvmti/ti_thread.h b/runtime/openjdkjvmti/ti_thread.h
index c7f75d8..939aea7 100644
--- a/runtime/openjdkjvmti/ti_thread.h
+++ b/runtime/openjdkjvmti/ti_thread.h
@@ -37,7 +37,7 @@
namespace art {
class ArtField;
-}
+} // namespace art
namespace openjdkjvmti {
diff --git a/runtime/thread_list.h b/runtime/thread_list.h
index 3375746..0ce1d78 100644
--- a/runtime/thread_list.h
+++ b/runtime/thread_list.h
@@ -34,7 +34,7 @@
namespace gc {
namespace collector {
class GarbageCollector;
- } // namespac collector
+ } // namespace collector
class GcPauseListener;
} // namespace gc
class Closure;
diff --git a/runtime/transaction.h b/runtime/transaction.h
index 0333fe8..921de03 100644
--- a/runtime/transaction.h
+++ b/runtime/transaction.h
@@ -36,7 +36,7 @@
class DexCache;
class Object;
class String;
-}
+} // namespace mirror
class InternTable;
class Transaction FINAL {
diff --git a/runtime/verifier/verifier_deps.h b/runtime/verifier/verifier_deps.h
index d69e4dc..70ce0c4 100644
--- a/runtime/verifier/verifier_deps.h
+++ b/runtime/verifier/verifier_deps.h
@@ -39,7 +39,7 @@
namespace mirror {
class Class;
class ClassLoader;
-}
+} // namespace mirror
namespace verifier {