diff options
author | 2023-01-30 14:29:11 +0000 | |
---|---|---|
committer | 2023-02-01 09:52:45 +0000 | |
commit | 0f6af5e3b51a7f5905d09a98ec8d531541666015 (patch) | |
tree | 7ed720cc521bb7f6e3b092cf6900a34d050c3aba /runtime/oat.cc | |
parent | d04ed700190056ecd367ee41e6b7f3b87dc7f901 (diff) |
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
Diffstat (limited to 'runtime/oat.cc')
-rw-r--r-- | runtime/oat.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/runtime/oat.cc b/runtime/oat.cc index 42bb7d4894..2c7a73f964 100644 --- a/runtime/oat.cc +++ b/runtime/oat.cc @@ -467,4 +467,27 @@ void OatHeader::Flatten(const SafeMap<std::string, std::string>* key_value_store key_value_store_size_ = data_ptr - reinterpret_cast<char*>(&key_value_store_); } +const uint8_t* OatHeader::GetOatAddress(StubType type) const { + DCHECK_LE(type, StubType::kLast); + switch (type) { + // TODO: We could maybe clean this up if we stored them in an array in the oat header. + case StubType::kQuickGenericJNITrampoline: + return static_cast<const uint8_t*>(GetQuickGenericJniTrampoline()); + case StubType::kJNIDlsymLookupTrampoline: + return static_cast<const uint8_t*>(GetJniDlsymLookupTrampoline()); + case StubType::kJNIDlsymLookupCriticalTrampoline: + return static_cast<const uint8_t*>(GetJniDlsymLookupCriticalTrampoline()); + case StubType::kQuickIMTConflictTrampoline: + return static_cast<const uint8_t*>(GetQuickImtConflictTrampoline()); + case StubType::kQuickResolutionTrampoline: + return static_cast<const uint8_t*>(GetQuickResolutionTrampoline()); + case StubType::kQuickToInterpreterBridge: + return static_cast<const uint8_t*>(GetQuickToInterpreterBridge()); + case StubType::kNterpTrampoline: + return static_cast<const uint8_t*>(GetNterpTrampoline()); + default: + UNREACHABLE(); + } +} + } // namespace art |