diff options
-rw-r--r-- | libnativeloader/Android.bp | 2 | ||||
-rw-r--r-- | openjdkjvmti/ti_redefine.cc | 15 | ||||
-rw-r--r-- | runtime/gc/space/image_space.cc | 16 | ||||
-rwxr-xr-x | test/etc/run-test-jar | 4 | ||||
-rw-r--r-- | tools/libcore_fugu_failures.txt | 10 |
5 files changed, 29 insertions, 18 deletions
diff --git a/libnativeloader/Android.bp b/libnativeloader/Android.bp index f30a3ac057..f1ef32d620 100644 --- a/libnativeloader/Android.bp +++ b/libnativeloader/Android.bp @@ -64,7 +64,7 @@ art_cc_library { "libdl_android", ], static_libs: [ - "PlatformProperties", + "libPlatformProperties", ], }, }, diff --git a/openjdkjvmti/ti_redefine.cc b/openjdkjvmti/ti_redefine.cc index 15ca423ea0..61a908bb60 100644 --- a/openjdkjvmti/ti_redefine.cc +++ b/openjdkjvmti/ti_redefine.cc @@ -1651,10 +1651,12 @@ bool Redefiner::ClassRedefinition::AllocateAndRememberNewDexFileCookie( art::MutableHandle<art::mirror::LongArray> old_cookie( hs.NewHandle<art::mirror::LongArray>(nullptr)); bool has_older_cookie = false; - // See if we already have a cookie that a previous redefinition got from the same classloader. + // See if we already have a cookie that a previous redefinition got from the same classloader + // and the same JavaDex file. for (auto old_data = cur_data->GetHolder().begin(); old_data != *cur_data; ++old_data) { - if (old_data.GetSourceClassLoader() == source_class_loader.Get()) { - // Since every instance of this classloader should have the same cookie associated with it we + if (old_data.GetSourceClassLoader() == source_class_loader.Get() && + old_data.GetJavaDexFile() == dex_file_obj.Get()) { + // Since every instance of this JavaDex file should have the same cookie associated with it we // can stop looking here. has_older_cookie = true; old_cookie.Assign(old_data.GetNewDexFileCookie()); @@ -1679,12 +1681,13 @@ bool Redefiner::ClassRedefinition::AllocateAndRememberNewDexFileCookie( // Save the cookie. cur_data->SetNewDexFileCookie(new_cookie.Get()); - // If there are other copies of this same classloader we need to make sure that we all have the - // same cookie. + // If there are other copies of the same classloader and the same JavaDex file we need to + // make sure that we all have the same cookie. if (has_older_cookie) { for (auto old_data = cur_data->GetHolder().begin(); old_data != *cur_data; ++old_data) { // We will let the GC take care of the cookie we allocated for this one. - if (old_data.GetSourceClassLoader() == source_class_loader.Get()) { + if (old_data.GetSourceClassLoader() == source_class_loader.Get() && + old_data.GetJavaDexFile() == dex_file_obj.Get()) { old_data.SetNewDexFileCookie(new_cookie.Get()); } } diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc index b1ab960173..e60651bd0a 100644 --- a/runtime/gc/space/image_space.cc +++ b/runtime/gc/space/image_space.cc @@ -3127,8 +3127,24 @@ class ImageSpace::BootImageLoader { return false; } } + + // As an optimization, madvise the oat file into memory if it's being used + // for execution with an active runtime. This can significantly improve + // ZygoteInit class preload performance. + if (executable_) { + Runtime* runtime = Runtime::Current(); + if (runtime != nullptr) { + Runtime::MadviseFileForRange(runtime->GetMadviseWillNeedSizeOdex(), + oat_file->Size(), + oat_file->Begin(), + oat_file->End(), + oat_file->GetLocation()); + } + } + space->oat_file_ = std::move(oat_file); space->oat_file_non_owned_ = space->oat_file_.get(); + return true; } diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index c27c9328c1..8d64eadc34 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -700,11 +700,11 @@ if USE_JVMTI == "y": # needed anymore since the plugin can do it for us now. FLAGS+=f" -Xplugin:{plugin}" - # For jvmti tests, set the threshold of compilation to 0, so we jit early to + # For jvmti tests, set the threshold of compilation to 1, so we jit early to # provide better test coverage for jvmti + jit. This means we won't run # the default --jit configuration but it is not too important test scenario for # jvmti tests. This is art specific flag, so don't use it with jvm. - FLAGS+=" -Xjitthreshold:0" + FLAGS+=" -Xjitthreshold:1" # Add the libdir to the argv passed to the main function. if ADD_LIBDIR_ARGUMENTS == "y": diff --git a/tools/libcore_fugu_failures.txt b/tools/libcore_fugu_failures.txt index 406767fab5..e02e3ff4c5 100644 --- a/tools/libcore_fugu_failures.txt +++ b/tools/libcore_fugu_failures.txt @@ -150,6 +150,7 @@ "test.java.lang.Float", "test.java.lang.Integer", "test.java.lang.Long", + "test.java.lang.StackWalker#main", "test.java.lang.StrictMath.CubeRootTests", "test.java.lang.StrictMath.ExactArithTests", "test.java.lang.StrictMath.Expm1Tests", @@ -229,14 +230,5 @@ "test.java.util.stream", "test.java.util.zip.ZipFile" ] -}, -{ - description: "Test aborted due to unknown error. Disable the test temporarily.", - result: ERROR, - bug: 241766511, - modes: [device], - names: [ - "test.java.lang.StackWalker" - ] } ] |