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.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'runtime/oat.h') diff --git a/runtime/oat.h b/runtime/oat.h index 3b32e11daa..e062baaee9 100644 --- a/runtime/oat.h +++ b/runtime/oat.h @@ -29,6 +29,18 @@ namespace art { enum class InstructionSet; class InstructionSetFeatures; +enum class StubType { + kJNIDlsymLookupTrampoline, + kJNIDlsymLookupCriticalTrampoline, + kQuickGenericJNITrampoline, + kQuickIMTConflictTrampoline, + kQuickResolutionTrampoline, + kQuickToInterpreterBridge, + kNterpTrampoline, + kLast = kNterpTrampoline, +}; +std::ostream& operator<<(std::ostream& stream, StubType stub_type); + class PACKED(4) OatHeader { public: static constexpr std::array kOatMagic { { 'o', 'a', 't', '\n' } }; @@ -111,6 +123,8 @@ class PACKED(4) OatHeader { bool IsConcurrentCopying() const; bool RequiresImage() const; + const uint8_t* GetOatAddress(StubType type) const; + private: bool KeyHasValue(const char* key, const char* value, size_t value_size) const; -- cgit v1.2.3-59-g8ed1b