diff options
| author | 2016-04-13 11:03:46 -0700 | |
|---|---|---|
| committer | 2016-05-03 12:22:39 -0700 | |
| commit | f4b3487ee77e3c2e3d5372ae9e857cd3429bb808 (patch) | |
| tree | b48ab16dec4e8d1deab6556788f9a5fe2b62f77a | |
| parent | a6513729ae2ad0d2f9dd21d77ea6cf9ed9fa6eef (diff) | |
Remove -XOatFileManagerCompilerFilter argument.
Instead use the value of '-Xcompiler-option --compiler-filter=XXX' for
the target compiler filter to use to determine if the runtime should
try to invoke dex2oat when oat files are loaded.
Bug: 27641809
Change-Id: I1856e0e37df91835b81105567c70d8a285a88f62
| -rw-r--r-- | compiler/driver/compiler_options.cc | 2 | ||||
| -rw-r--r-- | compiler/driver/compiler_options.h | 1 | ||||
| -rw-r--r-- | compiler/jit/jit_compiler.cc | 2 | ||||
| -rw-r--r-- | runtime/compiler_filter.h | 2 | ||||
| -rw-r--r-- | runtime/oat_file_assistant.cc | 34 | ||||
| -rw-r--r-- | runtime/oat_file_assistant.h | 12 | ||||
| -rw-r--r-- | runtime/oat_file_assistant_test.cc | 58 | ||||
| -rw-r--r-- | runtime/oat_file_manager.cc | 9 | ||||
| -rw-r--r-- | runtime/oat_file_manager.h | 8 | ||||
| -rw-r--r-- | runtime/parsed_options.cc | 3 | ||||
| -rw-r--r-- | runtime/runtime.cc | 11 | ||||
| -rw-r--r-- | runtime/runtime_options.def | 1 | ||||
| -rw-r--r-- | test/595-profile-saving/run | 5 | ||||
| -rwxr-xr-x | test/etc/run-test-jar | 13 | ||||
| -rwxr-xr-x | test/run-test | 8 |
15 files changed, 101 insertions, 68 deletions
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc index 1bd4c3ad80..f20dba34a6 100644 --- a/compiler/driver/compiler_options.cc +++ b/compiler/driver/compiler_options.cc @@ -21,7 +21,7 @@ namespace art { CompilerOptions::CompilerOptions() - : compiler_filter_(kDefaultCompilerFilter), + : compiler_filter_(CompilerFilter::kDefaultCompilerFilter), huge_method_threshold_(kDefaultHugeMethodThreshold), large_method_threshold_(kDefaultLargeMethodThreshold), small_method_threshold_(kDefaultSmallMethodThreshold), diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index c67ab6ef14..6bbd3c5a19 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -31,7 +31,6 @@ namespace art { class CompilerOptions FINAL { public: // Guide heuristics to determine whether to compile method if profile data not available. - static const CompilerFilter::Filter kDefaultCompilerFilter = CompilerFilter::kSpeed; static const size_t kDefaultHugeMethodThreshold = 10000; static const size_t kDefaultLargeMethodThreshold = 600; static const size_t kDefaultSmallMethodThreshold = 60; diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index c2d7ff7795..178533849b 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -88,7 +88,7 @@ NO_RETURN static void Usage(const char* fmt, ...) { JitCompiler::JitCompiler() { compiler_options_.reset(new CompilerOptions( - CompilerOptions::kDefaultCompilerFilter, + CompilerFilter::kDefaultCompilerFilter, CompilerOptions::kDefaultHugeMethodThreshold, CompilerOptions::kDefaultLargeMethodThreshold, CompilerOptions::kDefaultSmallMethodThreshold, diff --git a/runtime/compiler_filter.h b/runtime/compiler_filter.h index 6289d8a22c..e8d74dd9e8 100644 --- a/runtime/compiler_filter.h +++ b/runtime/compiler_filter.h @@ -44,6 +44,8 @@ class CompilerFilter FINAL { kEverything, // Compile everything capable of being compiled. }; + static const Filter kDefaultCompilerFilter = kSpeed; + // Returns true if an oat file with this compiler filter contains // compiled executable code. static bool IsCompilationEnabled(Filter filter); diff --git a/runtime/oat_file_assistant.cc b/runtime/oat_file_assistant.cc index 3f95772b4f..a508e87c87 100644 --- a/runtime/oat_file_assistant.cc +++ b/runtime/oat_file_assistant.cc @@ -179,11 +179,38 @@ OatFileAssistant::DexOptNeeded OatFileAssistant::GetDexOptNeeded(CompilerFilter: return HasOriginalDexFiles() ? kDex2OatNeeded : kNoDexOptNeeded; } +// Figure out the currently specified compile filter option in the runtime. +// Returns true on success, false if the compiler filter is invalid, in which +// case error_msg describes the problem. +static bool GetRuntimeCompilerFilterOption(CompilerFilter::Filter* filter, + std::string* error_msg) { + CHECK(filter != nullptr); + CHECK(error_msg != nullptr); + + *filter = CompilerFilter::kDefaultCompilerFilter; + for (StringPiece option : Runtime::Current()->GetCompilerOptions()) { + if (option.starts_with("--compiler-filter=")) { + const char* compiler_filter_string = option.substr(strlen("--compiler-filter=")).data(); + if (!CompilerFilter::ParseCompilerFilter(compiler_filter_string, filter)) { + *error_msg = std::string("Unknown --compiler-filter value: ") + + std::string(compiler_filter_string); + return false; + } + } + } + return true; +} + OatFileAssistant::ResultOfAttemptToUpdate -OatFileAssistant::MakeUpToDate(CompilerFilter::Filter target, std::string* error_msg) { +OatFileAssistant::MakeUpToDate(std::string* error_msg) { + CompilerFilter::Filter target; + if (!GetRuntimeCompilerFilterOption(&target, error_msg)) { + return kUpdateNotAttempted; + } + switch (GetDexOptNeeded(target)) { case kNoDexOptNeeded: return kUpdateSucceeded; - case kDex2OatNeeded: return GenerateOatFile(target, error_msg); + case kDex2OatNeeded: return GenerateOatFile(error_msg); case kPatchOatNeeded: return RelocateOatFile(OdexFileName(), error_msg); case kSelfPatchOatNeeded: return RelocateOatFile(OatFileName(), error_msg); } @@ -634,7 +661,7 @@ OatFileAssistant::RelocateOatFile(const std::string* input_file, std::string* er } OatFileAssistant::ResultOfAttemptToUpdate -OatFileAssistant::GenerateOatFile(CompilerFilter::Filter target, std::string* error_msg) { +OatFileAssistant::GenerateOatFile(std::string* error_msg) { CHECK(error_msg != nullptr); Runtime* runtime = Runtime::Current(); @@ -678,7 +705,6 @@ OatFileAssistant::GenerateOatFile(CompilerFilter::Filter target, std::string* er args.push_back("--dex-file=" + dex_location_); args.push_back("--oat-fd=" + std::to_string(oat_file->Fd())); args.push_back("--oat-location=" + oat_file_name); - args.push_back("--compiler-filter=" + CompilerFilter::NameOfFilter(target)); if (!Dex2Oat(args, error_msg)) { // Manually delete the file. This ensures there is no garbage left over if diff --git a/runtime/oat_file_assistant.h b/runtime/oat_file_assistant.h index d3228deac7..85f4a47868 100644 --- a/runtime/oat_file_assistant.h +++ b/runtime/oat_file_assistant.h @@ -159,15 +159,12 @@ class OatFileAssistant { }; // Attempts to generate or relocate the oat file as needed to make it up to - // date with in a way that is at least as good as an oat file generated with - // the given compiler filter. - // Returns the result of attempting to update the code. + // date based on the current runtime and compiler options. // // If the result is not kUpdateSucceeded, the value of error_msg will be set // to a string describing why there was a failure or the update was not // attempted. error_msg must not be null. - ResultOfAttemptToUpdate MakeUpToDate(CompilerFilter::Filter target_compiler_filter, - std::string* error_msg); + ResultOfAttemptToUpdate MakeUpToDate(std::string* error_msg); // Returns an oat file that can be used for loading dex files. // Returns null if no suitable oat file was found. @@ -250,14 +247,15 @@ class OatFileAssistant { // attempted. error_msg must not be null. ResultOfAttemptToUpdate RelocateOatFile(const std::string* input_file, std::string* error_msg); - // Generate the oat file from the dex file using the given compiler filter. + // Generate the oat file from the dex file using the current runtime + // compiler options. // This does not check the current status before attempting to generate the // oat file. // // If the result is not kUpdateSucceeded, the value of error_msg will be set // to a string describing why there was a failure or the update was not // attempted. error_msg must not be null. - ResultOfAttemptToUpdate GenerateOatFile(CompilerFilter::Filter filter, std::string* error_msg); + ResultOfAttemptToUpdate GenerateOatFile(std::string* error_msg); // Executes dex2oat using the current runtime configuration overridden with // the given arguments. This does not check to see if dex2oat is enabled in diff --git a/runtime/oat_file_assistant_test.cc b/runtime/oat_file_assistant_test.cc index f50d1cb748..764b969eaa 100644 --- a/runtime/oat_file_assistant_test.cc +++ b/runtime/oat_file_assistant_test.cc @@ -453,8 +453,7 @@ TEST_F(OatFileAssistantTest, NoDexNoOat) { // Trying to make the oat file up to date should not fail or crash. std::string error_msg; - EXPECT_EQ(OatFileAssistant::kUpdateSucceeded, - oat_file_assistant.MakeUpToDate(CompilerFilter::kSpeed, &error_msg)); + EXPECT_EQ(OatFileAssistant::kUpdateSucceeded, oat_file_assistant.MakeUpToDate(&error_msg)); // Trying to get the best oat file should fail, but not crash. std::unique_ptr<OatFile> oat_file = oat_file_assistant.GetBestOatFile(); @@ -705,8 +704,9 @@ TEST_F(OatFileAssistantTest, StrippedDexOdexNoOat) { // Make the oat file up to date. std::string error_msg; + Runtime::Current()->AddCompilerOption("--compiler-filter=speed"); ASSERT_EQ(OatFileAssistant::kUpdateSucceeded, - oat_file_assistant.MakeUpToDate(CompilerFilter::kSpeed, &error_msg)) << error_msg; + oat_file_assistant.MakeUpToDate(&error_msg)) << error_msg; EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded, oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed)); @@ -768,8 +768,9 @@ TEST_F(OatFileAssistantTest, StrippedDexOdexOat) { // Make the oat file up to date. std::string error_msg; + Runtime::Current()->AddCompilerOption("--compiler-filter=speed"); ASSERT_EQ(OatFileAssistant::kUpdateSucceeded, - oat_file_assistant.MakeUpToDate(CompilerFilter::kSpeed, &error_msg)) << error_msg; + oat_file_assistant.MakeUpToDate(&error_msg)) << error_msg; EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded, oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed)); @@ -825,8 +826,9 @@ TEST_F(OatFileAssistantTest, ResourceOnlyDex) { // Make the oat file up to date. This should have no effect. std::string error_msg; + Runtime::Current()->AddCompilerOption("--compiler-filter=speed"); EXPECT_EQ(OatFileAssistant::kUpdateSucceeded, - oat_file_assistant.MakeUpToDate(CompilerFilter::kSpeed, &error_msg)) << error_msg; + oat_file_assistant.MakeUpToDate(&error_msg)) << error_msg; EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded, oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed)); @@ -876,8 +878,9 @@ TEST_F(OatFileAssistantTest, SelfRelocation) { // Make the oat file up to date. std::string error_msg; + Runtime::Current()->AddCompilerOption("--compiler-filter=speed"); ASSERT_EQ(OatFileAssistant::kUpdateSucceeded, - oat_file_assistant.MakeUpToDate(CompilerFilter::kSpeed, &error_msg)) << error_msg; + oat_file_assistant.MakeUpToDate(&error_msg)) << error_msg; EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded, oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed)); @@ -920,8 +923,9 @@ TEST_F(OatFileAssistantTest, NoSelfRelocation) { // Make the oat file up to date. std::string error_msg; + Runtime::Current()->AddCompilerOption("--compiler-filter=speed"); ASSERT_EQ(OatFileAssistant::kUpdateSucceeded, - oat_file_assistant.MakeUpToDate(CompilerFilter::kSpeed, &error_msg)) << error_msg; + oat_file_assistant.MakeUpToDate(&error_msg)) << error_msg; EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded, oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed)); @@ -1100,8 +1104,9 @@ TEST_F(OatFileAssistantTest, LoadDexNoAlternateOat) { OatFileAssistant oat_file_assistant( dex_location.c_str(), oat_location.c_str(), kRuntimeISA, false, true); std::string error_msg; + Runtime::Current()->AddCompilerOption("--compiler-filter=speed"); ASSERT_EQ(OatFileAssistant::kUpdateSucceeded, - oat_file_assistant.MakeUpToDate(CompilerFilter::kSpeed, &error_msg)) << error_msg; + oat_file_assistant.MakeUpToDate(&error_msg)) << error_msg; std::unique_ptr<OatFile> oat_file = oat_file_assistant.GetBestOatFile(); ASSERT_TRUE(oat_file.get() != nullptr); @@ -1131,8 +1136,9 @@ TEST_F(OatFileAssistantTest, LoadDexUnwriteableAlternateOat) { OatFileAssistant oat_file_assistant( dex_location.c_str(), oat_location.c_str(), kRuntimeISA, false, true); std::string error_msg; + Runtime::Current()->AddCompilerOption("--compiler-filter=speed"); ASSERT_EQ(OatFileAssistant::kUpdateNotAttempted, - oat_file_assistant.MakeUpToDate(CompilerFilter::kSpeed, &error_msg)); + oat_file_assistant.MakeUpToDate(&error_msg)); std::unique_ptr<OatFile> oat_file = oat_file_assistant.GetBestOatFile(); ASSERT_TRUE(oat_file.get() == nullptr); @@ -1147,8 +1153,9 @@ TEST_F(OatFileAssistantTest, GenNoDex) { OatFileAssistant oat_file_assistant( dex_location.c_str(), oat_location.c_str(), kRuntimeISA, false, true); std::string error_msg; + Runtime::Current()->AddCompilerOption("--compiler-filter=speed"); EXPECT_EQ(OatFileAssistant::kUpdateNotAttempted, - oat_file_assistant.GenerateOatFile(CompilerFilter::kSpeed, &error_msg)); + oat_file_assistant.GenerateOatFile(&error_msg)); } // Turn an absolute path into a path relative to the current working @@ -1227,8 +1234,9 @@ TEST_F(OatFileAssistantTest, ShortDexLocation) { // Trying to make it up to date should have no effect. std::string error_msg; + Runtime::Current()->AddCompilerOption("--compiler-filter=speed"); EXPECT_EQ(OatFileAssistant::kUpdateSucceeded, - oat_file_assistant.MakeUpToDate(CompilerFilter::kSpeed, &error_msg)); + oat_file_assistant.MakeUpToDate(&error_msg)); EXPECT_TRUE(error_msg.empty()); } @@ -1368,6 +1376,34 @@ TEST_F(OatFileAssistantNoDex2OatTest, LoadMultiDexOdexNoOat) { EXPECT_EQ(2u, dex_files.size()); } +TEST_F(OatFileAssistantTest, RuntimeCompilerFilterOptionUsed) { + std::string dex_location = GetScratchDir() + "/RuntimeCompilerFilterOptionUsed.jar"; + Copy(GetDexSrc1(), dex_location); + + OatFileAssistant oat_file_assistant(dex_location.c_str(), kRuntimeISA, false, false); + + std::string error_msg; + Runtime::Current()->AddCompilerOption("--compiler-filter=interpret-only"); + EXPECT_EQ(OatFileAssistant::kUpdateSucceeded, + oat_file_assistant.MakeUpToDate(&error_msg)) << error_msg; + EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded, + oat_file_assistant.GetDexOptNeeded(CompilerFilter::kInterpretOnly)); + EXPECT_EQ(OatFileAssistant::kDex2OatNeeded, + oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed)); + + Runtime::Current()->AddCompilerOption("--compiler-filter=speed"); + EXPECT_EQ(OatFileAssistant::kUpdateSucceeded, + oat_file_assistant.MakeUpToDate(&error_msg)) << error_msg; + EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded, + oat_file_assistant.GetDexOptNeeded(CompilerFilter::kInterpretOnly)); + EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded, + oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed)); + + Runtime::Current()->AddCompilerOption("--compiler-filter=bogus"); + EXPECT_EQ(OatFileAssistant::kUpdateNotAttempted, + oat_file_assistant.MakeUpToDate(&error_msg)); +} + TEST(OatFileAssistantUtilsTest, DexFilenameToOdexFilename) { std::string error_msg; std::string odex_file; diff --git a/runtime/oat_file_manager.cc b/runtime/oat_file_manager.cc index 9ab0072ea9..bc01da4fc4 100644 --- a/runtime/oat_file_manager.cc +++ b/runtime/oat_file_manager.cc @@ -44,8 +44,6 @@ static constexpr bool kDuplicateClassesCheck = kIsDebugBuild; // If true, then we attempt to load the application image if it exists. static constexpr bool kEnableAppImage = true; -CompilerFilter::Filter OatFileManager::filter_ = CompilerFilter::Filter::kSpeed; - const OatFile* OatFileManager::RegisterOatFile(std::unique_ptr<const OatFile> oat_file) { WriterMutexLock mu(Thread::Current(), *Locks::oat_file_manager_lock_); DCHECK(oat_file != nullptr); @@ -341,9 +339,10 @@ std::vector<std::unique_ptr<const DexFile>> OatFileManager::OpenDexFilesFromOat( const OatFile* source_oat_file = nullptr; - // Update the oat file on disk if we can. This may fail, but that's okay. - // Best effort is all that matters here. - switch (oat_file_assistant.MakeUpToDate(filter_, /*out*/ &error_msg)) { + // Update the oat file on disk if we can, based on the --compiler-filter + // option derived from the current runtime options. + // This may fail, but that's okay. Best effort is all that matters here. + switch (oat_file_assistant.MakeUpToDate(/*out*/ &error_msg)) { case OatFileAssistant::kUpdateFailed: LOG(WARNING) << error_msg; break; diff --git a/runtime/oat_file_manager.h b/runtime/oat_file_manager.h index f98102e844..7017dfc6ec 100644 --- a/runtime/oat_file_manager.h +++ b/runtime/oat_file_manager.h @@ -25,7 +25,6 @@ #include "base/macros.h" #include "base/mutex.h" -#include "compiler_filter.h" #include "jni.h" namespace art { @@ -116,10 +115,6 @@ class OatFileManager { void DumpForSigQuit(std::ostream& os); - static void SetCompilerFilter(CompilerFilter::Filter filter) { - filter_ = filter; - } - private: // Check for duplicate class definitions of the given oat file against all open oat files. // Return true if there are any class definition collisions in the oat_file. @@ -133,9 +128,6 @@ class OatFileManager { std::unordered_map<std::string, size_t> oat_file_count_ GUARDED_BY(Locks::oat_file_count_lock_); bool have_non_pic_oat_file_; - // The compiler filter used for oat files loaded by the oat file manager. - static CompilerFilter::Filter filter_; - DISALLOW_COPY_AND_ASSIGN(OatFileManager); }; diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc index b25a1bb90f..eac5b43ff2 100644 --- a/runtime/parsed_options.cc +++ b/runtime/parsed_options.cc @@ -292,9 +292,6 @@ std::unique_ptr<RuntimeParser> ParsedOptions::MakeParser(bool ignore_unrecognize .IntoKey(M::Experimental) .Define("-Xforce-nb-testing") .IntoKey(M::ForceNativeBridge) - .Define("-XOatFileManagerCompilerFilter:_") - .WithType<std::string>() - .IntoKey(M::OatFileManagerCompilerFilter) .Ignore({ "-ea", "-da", "-enableassertions", "-disableassertions", "--runtime-arg", "-esa", "-dsa", "-enablesystemassertions", "-disablesystemassertions", "-Xrs", "-Xint:_", diff --git a/runtime/runtime.cc b/runtime/runtime.cc index bb19cbd255..45ba7d0fc2 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -60,7 +60,6 @@ #include "base/unix_file/fd_file.h" #include "class_linker-inl.h" #include "compiler_callbacks.h" -#include "compiler_filter.h" #include "debugger.h" #include "elf_file.h" #include "entrypoints/runtime_asm_entrypoints.h" @@ -967,16 +966,6 @@ bool Runtime::Init(RuntimeArgumentMap&& runtime_options_in) { experimental_flags_ = runtime_options.GetOrDefault(Opt::Experimental); is_low_memory_mode_ = runtime_options.Exists(Opt::LowMemoryMode); - { - CompilerFilter::Filter filter; - std::string filter_str = runtime_options.GetOrDefault(Opt::OatFileManagerCompilerFilter); - if (!CompilerFilter::ParseCompilerFilter(filter_str.c_str(), &filter)) { - LOG(ERROR) << "Cannot parse compiler filter " << filter_str; - return false; - } - OatFileManager::SetCompilerFilter(filter); - } - XGcOption xgc_option = runtime_options.GetOrDefault(Opt::GcOption); heap_ = new gc::Heap(runtime_options.GetOrDefault(Opt::MemoryInitialSize), runtime_options.GetOrDefault(Opt::HeapGrowthLimit), diff --git a/runtime/runtime_options.def b/runtime/runtime_options.def index 2a96703109..6db0cb2cb6 100644 --- a/runtime/runtime_options.def +++ b/runtime/runtime_options.def @@ -134,6 +134,5 @@ RUNTIME_OPTIONS_KEY (void (*)(int32_t status), \ // We don't call abort(3) by default; see // Runtime::Abort. RUNTIME_OPTIONS_KEY (void (*)(), HookAbort, nullptr) -RUNTIME_OPTIONS_KEY (std::string, OatFileManagerCompilerFilter, "speed") #undef RUNTIME_OPTIONS_KEY diff --git a/test/595-profile-saving/run b/test/595-profile-saving/run index f12fac9207..068ad03ce0 100644 --- a/test/595-profile-saving/run +++ b/test/595-profile-saving/run @@ -16,13 +16,12 @@ # Use # --compiler-filter=interpret-only to make sure that the test is not compiled AOT -# -XOatFileManagerCompilerFilter:interpret-only to make sure the test is not compiled -# when loaded (by PathClassLoader) +# and to make sure the test is not compiled when loaded (by PathClassLoader) # -Xjitsaveprofilinginfo to enable profile saving # -Xusejit:false to disable jit and only test profiles. exec ${RUN} \ -Xcompiler-option --compiler-filter=interpret-only \ - --runtime-option -XOatFileManagerCompilerFilter:interpret-only \ + --runtime-option '-Xcompiler-option --compiler-filter=interpret-only' \ --runtime-option -Xjitsaveprofilinginfo \ --runtime-option -Xusejit:false \ "${@}" diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index d61fc8f8fc..01114b7690 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -323,11 +323,14 @@ fi if [ "$INTERPRETER" = "y" ]; then INT_OPTS="-Xint" if [ "$VERIFY" = "y" ] ; then + INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=interpret-only" COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=interpret-only" elif [ "$VERIFY" = "s" ]; then + INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=verify-at-runtime" COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=verify-at-runtime" DEX_VERIFY="${DEX_VERIFY} -Xverify:softfail" else # VERIFY = "n" + INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=verify-none" COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=verify-none" DEX_VERIFY="${DEX_VERIFY} -Xverify:none" fi @@ -336,18 +339,12 @@ fi if [ "$JIT" = "y" ]; then INT_OPTS="-Xusejit:true" if [ "$VERIFY" = "y" ] ; then + INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=verify-at-runtime" COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=verify-at-runtime" - if [ "$PREBUILD" = "n" ]; then - # Make sure that if we have noprebuild we still JIT as DexClassLoader will - # try to compile the dex file. - INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=verify-at-runtime" - fi else + INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=verify-none" COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=verify-none" DEX_VERIFY="${DEX_VERIFY} -Xverify:none" - if [ "$PREBUILD" = "n" ]; then - INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=verify-none" - fi fi fi diff --git a/test/run-test b/test/run-test index fc57d0914f..424c54f2c9 100755 --- a/test/run-test +++ b/test/run-test @@ -244,11 +244,11 @@ while true; do run_args="${run_args} --zygote" shift elif [ "x$1" = "x--interpreter" ]; then - run_args="${run_args} --interpreter --runtime-option -XOatFileManagerCompilerFilter:verify-at-runtime" + run_args="${run_args} --interpreter" image_suffix="-interpreter" shift elif [ "x$1" = "x--jit" ]; then - run_args="${run_args} --jit --runtime-option -XOatFileManagerCompilerFilter:verify-at-runtime" + run_args="${run_args} --jit" image_suffix="-jit" shift elif [ "x$1" = "x--optimizing" ]; then @@ -256,10 +256,10 @@ while true; do image_suffix="-optimizing" shift elif [ "x$1" = "x--no-verify" ]; then - run_args="${run_args} --no-verify --runtime-option -XOatFileManagerCompilerFilter:verify-none" + run_args="${run_args} --no-verify" shift elif [ "x$1" = "x--verify-soft-fail" ]; then - run_args="${run_args} --verify-soft-fail --runtime-option -XOatFileManagerCompilerFilter:verify-at-runtime" + run_args="${run_args} --verify-soft-fail" image_suffix="-interp-ac" shift elif [ "x$1" = "x--no-optimize" ]; then |