From 0f6af5e3b51a7f5905d09a98ec8d531541666015 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 30 Jan 2023 14:29:11 +0000 Subject: Reland "Write classes in runtime-generated app image." This reverts commit 24b3d648ff6c2c200003f55ac63fc910d7bfd40f. Bug: 260557058 Reason for revert: - Encode class loader context in image, and check it at load time. - Set nterp entrypoint to methods that can. Test: test.py Test: atest com.android.bluetooth.opp.BluetoothOppObexServerSessionTest#onPut_withUnsupportedMimeTypeInHeader_returnsHttpBadRequest Change-Id: Ibf4a8604c4a226d1acc021103668e211446bb53c --- runtime/oat_file_manager.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/oat_file_manager.cc') diff --git a/runtime/oat_file_manager.cc b/runtime/oat_file_manager.cc index 635122038a..b0bcd2f878 100644 --- a/runtime/oat_file_manager.cc +++ b/runtime/oat_file_manager.cc @@ -301,6 +301,7 @@ std::vector> OatFileManager::OpenDexFilesFromOat( ScopedTrace image_space_timing("Adding image space"); added_image_space = runtime->GetClassLinker()->AddImageSpace(image_space.get(), h_loader, + context.get(), /*out*/&dex_files, /*out*/&temp_error_msg); } @@ -590,7 +591,8 @@ std::vector> OatFileManager::OpenDexFilesFromOat_ // Initialize an OatFile instance backed by the loaded vdex. std::unique_ptr oat_file(OatFile::OpenFromVdex(MakeNonOwningPointerVector(dex_files), std::move(vdex_file), - dex_location)); + dex_location, + context.get())); if (oat_file != nullptr) { VLOG(class_linker) << "Registering " << oat_file->GetLocation(); *out_oat_file = RegisterOatFile(std::move(oat_file)); -- cgit v1.2.3-59-g8ed1b