// Disabled due to 10 second runtime on host // TODO: Update the test for hash-based dex cache arrays. Bug: 30627598
TEST_F(CompilerDriverTest, DISABLED_LARGE_CompileDexLibCore) {
CompileAllAndMakeExecutable(nullptr);
// All libcore references should resolve
ScopedObjectAccess soa(Thread::Current());
ASSERT_TRUE(java_lang_dex_file_ != nullptr); const DexFile& dex = *java_lang_dex_file_;
ObjPtr<mirror::DexCache> dex_cache = class_linker_->FindDexCache(soa.Self(), dex); for (size_t i = 0; i < dex_cache->NumStrings(); i++) { const ObjPtr<mirror::String> string = dex_cache->GetResolvedString(dex::StringIndex(i));
EXPECT_TRUE(string != nullptr) << "string_idx=" << i;
} for (size_t i = 0; i < dex_cache->NumResolvedTypes(); i++) { const ObjPtr<mirror::Class> type = dex_cache->GetResolvedType(dex::TypeIndex(i));
EXPECT_TRUE(type != nullptr)
<< "type_idx=" << i << " " << dex.GetTypeDescriptor(dex.GetTypeId(dex::TypeIndex(i)));
} for (size_t i = 0; i < dex_cache->NumResolvedMethods(); i++) { // FIXME: This is outdated for hash-based method array.
ArtMethod* method = dex_cache->GetResolvedMethod(i);
EXPECT_TRUE(method != nullptr) << "method_idx=" << i
<< " " << dex.GetMethodDeclaringClassDescriptor(dex.GetMethodId(i))
<< " " << dex.GetMethodName(dex.GetMethodId(i));
EXPECT_TRUE(method->GetEntryPointFromQuickCompiledCode() != nullptr) << "method_idx=" << i
<< " " << dex.GetMethodDeclaringClassDescriptor(dex.GetMethodId(i)) << " "
<< dex.GetMethodName(dex.GetMethodId(i));
} for (size_t i = 0; i < dex_cache->NumResolvedFields(); i++) { // FIXME: This is outdated for hash-based field array.
ArtField* field = dex_cache->GetResolvedField(i);
EXPECT_TRUE(field != nullptr) << "field_idx=" << i
<< " " << dex.GetFieldDeclaringClassDescriptor(dex.GetFieldId(i))
<< " " << dex.GetFieldName(dex.GetFieldId(i));
}
// TODO check Class::IsVerified for all classes
// TODO: check that all Method::GetCode() values are non-null
}
// Need to enable dex-file writability. Methods rejected to be compiled will run through the // dex-to-dex compiler. for (const DexFile* dex_file : GetDexFiles(class_loader)) {
ASSERT_TRUE(dex_file->EnableWrite());
}
CompileAllAndMakeExecutable(class_loader);
std::unordered_set<std::string> m = GetExpectedMethodsForClass("Main");
std::unordered_set<std::string> s = GetExpectedMethodsForClass("Second");
CheckCompiledMethods(class_loader, "LMain;", m);
CheckCompiledMethods(class_loader, "LSecond;", s);
}
// Test that a verify only compiler filter updates the CompiledClass map, // which will be used for OatClass. class CompilerDriverVerifyTest : public CompilerDriverTest { protected:
CompilerFilter::Filter GetCompilerFilter() const override { return CompilerFilter::kVerify;
}
// Test that a class of status ClassStatus::kRetryVerificationAtRuntime is indeed // recorded that way in the driver.
TEST_F(CompilerDriverVerifyTest, RetryVerifcationStatusCheckVerified) {
Thread* const self = Thread::Current();
jobject class_loader;
std::vector<const DexFile*> dex_files; const DexFile* dex_file = nullptr;
{
ScopedObjectAccess soa(self);
class_loader = LoadDex("ProfileTestMultiDex");
ASSERT_NE(class_loader, nullptr);
dex_files = GetDexFiles(class_loader);
ASSERT_GT(dex_files.size(), 0u);
dex_file = dex_files.front();
}
SetDexFilesForOatFile(dex_files);
callbacks_->SetDoesClassUnloading(true, compiler_driver_.get());
ClassReference ref(dex_file, 0u); // Test that the status is read from the compiler driver as expected.
static_assert(enum_cast<size_t>(ClassStatus::kLast) < std::numeric_limits<size_t>::max(), "Make sure incrementing the class status does not overflow."); for (size_t i = enum_cast<size_t>(ClassStatus::kRetryVerificationAtRuntime);
i <= enum_cast<size_t>(ClassStatus::kLast);
++i) { const ClassStatus expected_status = enum_cast<ClassStatus>(i); // Skip unsupported status that are not supposed to be ever recorded. if (expected_status == ClassStatus::kInitializing ||
expected_status == ClassStatus::kInitialized) { continue;
}
compiler_driver_->RecordClassStatus(ref, expected_status);
ClassStatus status = {};
ASSERT_TRUE(compiler_driver_->GetCompiledClass(ref, &status));
EXPECT_EQ(status, expected_status);
}
}
// TODO: need check-cast test (when stub complete & we can throw/catch
} // namespace art
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.