diff options
| author | 2017-04-06 11:42:56 +0000 | |
|---|---|---|
| committer | 2017-04-06 11:42:57 +0000 | |
| commit | 0dc3c953f3ba7eae3d1562e889bc13c0835b7879 (patch) | |
| tree | e72395eb564f86dbc2d620ba03879a2ff1d56067 | |
| parent | 7851a5339d5ebd6fd2a3a8d40abc15aad694d024 (diff) | |
| parent | 9c4f0d8ffd8fb1ce31b3f8de5ca8da497e0bee9a (diff) | |
Merge "Clean up after MIPS got read barriers support"
| -rw-r--r-- | compiler/common_compiler_test.h | 19 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver_test.cc | 3 | ||||
| -rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 26 | ||||
| -rw-r--r-- | runtime/reflection_test.cc | 1 | ||||
| -rwxr-xr-x | test/run-test | 25 |
5 files changed, 4 insertions, 70 deletions
diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h index 98dcf20714..0683577ec5 100644 --- a/compiler/common_compiler_test.h +++ b/compiler/common_compiler_test.h @@ -117,25 +117,6 @@ class CommonCompilerTest : public CommonRuntimeTest { std::list<std::vector<uint8_t>> header_code_and_maps_chunks_; }; -// TODO: When read barrier works with all Optimizing back ends, get rid of this. -#define TEST_DISABLED_FOR_READ_BARRIER_WITH_OPTIMIZING_FOR_UNSUPPORTED_INSTRUCTION_SETS() \ - if (kUseReadBarrier && GetCompilerKind() == Compiler::kOptimizing) { \ - switch (GetInstructionSet()) { \ - case kArm64: \ - case kThumb2: \ - case kX86: \ - case kX86_64: \ - /* Instruction set has read barrier support. */ \ - break; \ - \ - default: \ - /* Instruction set does not have barrier support. */ \ - printf("WARNING: TEST DISABLED FOR READ BARRIER WITH OPTIMIZING " \ - "FOR THIS INSTRUCTION SET\n"); \ - return; \ - } \ - } - } // namespace art #endif // ART_COMPILER_COMMON_COMPILER_TEST_H_ diff --git a/compiler/driver/compiler_driver_test.cc b/compiler/driver/compiler_driver_test.cc index 35aa1eef2d..fa1b3a304a 100644 --- a/compiler/driver/compiler_driver_test.cc +++ b/compiler/driver/compiler_driver_test.cc @@ -148,7 +148,6 @@ TEST_F(CompilerDriverTest, DISABLED_LARGE_CompileDexLibCore) { } TEST_F(CompilerDriverTest, AbstractMethodErrorStub) { - TEST_DISABLED_FOR_READ_BARRIER_WITH_OPTIMIZING_FOR_UNSUPPORTED_INSTRUCTION_SETS(); jobject class_loader; { ScopedObjectAccess soa(Thread::Current()); @@ -191,7 +190,6 @@ class CompilerDriverMethodsTest : public CompilerDriverTest { }; TEST_F(CompilerDriverMethodsTest, Selection) { - TEST_DISABLED_FOR_READ_BARRIER_WITH_OPTIMIZING_FOR_UNSUPPORTED_INSTRUCTION_SETS(); Thread* self = Thread::Current(); jobject class_loader; { @@ -299,7 +297,6 @@ class CompilerDriverProfileTest : public CompilerDriverTest { }; TEST_F(CompilerDriverProfileTest, ProfileGuidedCompilation) { - TEST_DISABLED_FOR_READ_BARRIER_WITH_OPTIMIZING_FOR_UNSUPPORTED_INSTRUCTION_SETS(); Thread* self = Thread::Current(); jobject class_loader; { diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index eb88fdee84..e542cbbe37 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -449,17 +449,6 @@ static bool IsInstructionSetSupported(InstructionSet instruction_set) { || instruction_set == kX86_64; } -// Read barrier are supported on ARM, ARM64, x86 and x86-64 at the moment. -// TODO: Add support for other architectures and remove this function -static bool InstructionSetSupportsReadBarrier(InstructionSet instruction_set) { - return instruction_set == kArm64 - || instruction_set == kThumb2 - || instruction_set == kMips - || instruction_set == kMips64 - || instruction_set == kX86 - || instruction_set == kX86_64; -} - // Strip pass name suffix to get optimization name. static std::string ConvertPassNameToOptimizationName(const std::string& pass_name) { size_t pos = pass_name.find(kPassNameSeparator); @@ -914,12 +903,6 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* arena, return nullptr; } - // When read barriers are enabled, do not attempt to compile for - // instruction sets that have no read barrier support. - if (kEmitCompilerReadBarrier && !InstructionSetSupportsReadBarrier(instruction_set)) { - return nullptr; - } - if (Compiler::IsPathologicalCase(*code_item, method_idx, dex_file)) { MaybeRecordStat(MethodCompilationStat::kNotCompiledPathological); return nullptr; @@ -1110,13 +1093,10 @@ CompiledMethod* OptimizingCompiler::Compile(const DexFile::CodeItem* code_item, if (kIsDebugBuild && IsCompilingWithCoreImage() && - IsInstructionSetSupported(compiler_driver->GetInstructionSet()) && - (!kEmitCompilerReadBarrier || - InstructionSetSupportsReadBarrier(compiler_driver->GetInstructionSet()))) { + IsInstructionSetSupported(compiler_driver->GetInstructionSet())) { // For testing purposes, we put a special marker on method names - // that should be compiled with this compiler (when the the - // instruction set is supported -- and has support for read - // barriers, if they are enabled). This makes sure we're not + // that should be compiled with this compiler (when the + // instruction set is supported). This makes sure we're not // regressing. std::string method_name = dex_file.PrettyMethod(method_idx); bool shouldCompile = method_name.find("$opt$") != std::string::npos; diff --git a/runtime/reflection_test.cc b/runtime/reflection_test.cc index e254dfe627..2f70ded8eb 100644 --- a/runtime/reflection_test.cc +++ b/runtime/reflection_test.cc @@ -509,7 +509,6 @@ class ReflectionTest : public CommonCompilerTest { }; TEST_F(ReflectionTest, StaticMainMethod) { - TEST_DISABLED_FOR_READ_BARRIER_WITH_OPTIMIZING_FOR_UNSUPPORTED_INSTRUCTION_SETS(); ScopedObjectAccess soa(Thread::Current()); jobject jclass_loader = LoadDex("Main"); StackHandleScope<1> hs(soa.Self()); diff --git a/test/run-test b/test/run-test index 91ffdfa2cc..e46099d2e2 100755 --- a/test/run-test +++ b/test/run-test @@ -716,36 +716,13 @@ chmod 755 "$check_cmd" export TEST_NAME=`basename ${test_dir}` -# arch_supports_read_barrier ARCH -# ------------------------------- -# Return whether the Optimizing compiler has read barrier support for ARCH. -function arch_supports_read_barrier() { - # Optimizing has read barrier support for ARM, ARM64, x86 and x86-64 at the - # moment. - [ "x$1" = xarm ] || [ "x$1" = xarm64 ] || [ "x$1" = xx86 ] || [ "x$1" = xx86_64 ] -} - # Tests named '<number>-checker-*' will also have their CFGs verified with # Checker when compiled with Optimizing on host. if [[ "$TEST_NAME" =~ ^[0-9]+-checker- ]]; then if [ "$runtime" = "art" -a "$image_suffix" = "" -a "$USE_JACK" = "true" ]; then - # Optimizing has read barrier support for certain architectures - # only. On other architectures, compiling is disabled when read - # barriers are enabled, meaning that we do not produce a CFG file - # as a side-effect of compilation, thus the Checker assertions - # cannot be checked. Disable Checker for those cases. - # - # TODO: Enable Checker when read barrier support is added to more - # architectures (b/12687968). - if [ "x$ART_USE_READ_BARRIER" != xfalse ] \ - && (([ "x$host_mode" = "xyes" ] \ - && ! arch_supports_read_barrier "$host_arch_name") \ - || ([ "x$target_mode" = "xyes" ] \ - && ! arch_supports_read_barrier "$target_arch_name")); then - run_checker="no" # In no-prebuild mode, the compiler is only invoked if both dex2oat and # patchoat are available. Disable Checker otherwise (b/22552692). - elif [ "$prebuild_mode" = "yes" ] \ + if [ "$prebuild_mode" = "yes" ] \ || [ "$have_patchoat" = "yes" -a "$have_dex2oat" = "yes" ]; then run_checker="yes" |