diff options
author | 2020-10-02 13:54:19 +0100 | |
---|---|---|
committer | 2020-10-19 17:01:09 +0000 | |
commit | eb9eb00868106af52386d7113a8aafaa6d44e8b6 (patch) | |
tree | 05b1243b30b31d6e2d3215ebdaa329c90d9875f8 /compiler/linker/linker_patch.h | |
parent | 5fa36f99fdb5617d1ced977c637dcaa2762704fc (diff) |
Faster @CriticalNative for boot image.
The @CriticalNative call does not need the target method, so
we can avoid one instruction on x86, x86-64 and arm64. The
current approach for arm does not allow such optimization.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: aosp_blueline-userdebug boots.
Test: run-gtests.sh
Test: testrunner.py --target --64 --optimizing
Bug: 112189621
Change-Id: I11b7e415be2697757cbb11c9cccf4058d1d72d7d
Diffstat (limited to 'compiler/linker/linker_patch.h')
-rw-r--r-- | compiler/linker/linker_patch.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/linker/linker_patch.h b/compiler/linker/linker_patch.h index 4000fc2523..7da1e82d91 100644 --- a/compiler/linker/linker_patch.h +++ b/compiler/linker/linker_patch.h @@ -47,6 +47,7 @@ class LinkerPatch { kDataBimgRelRo, kMethodRelative, kMethodBssEntry, + kJniEntrypointRelative, kCallRelative, kTypeRelative, kTypeBssEntry, @@ -96,6 +97,16 @@ class LinkerPatch { return patch; } + static LinkerPatch RelativeJniEntrypointPatch(size_t literal_offset, + const DexFile* target_dex_file, + uint32_t pc_insn_offset, + uint32_t target_method_idx) { + LinkerPatch patch(literal_offset, Type::kJniEntrypointRelative, target_dex_file); + patch.method_idx_ = target_method_idx; + patch.pc_insn_offset_ = pc_insn_offset; + return patch; + } + static LinkerPatch RelativeCodePatch(size_t literal_offset, const DexFile* target_dex_file, uint32_t target_method_idx) { @@ -208,6 +219,7 @@ class LinkerPatch { MethodReference TargetMethod() const { DCHECK(patch_type_ == Type::kMethodRelative || patch_type_ == Type::kMethodBssEntry || + patch_type_ == Type::kJniEntrypointRelative || patch_type_ == Type::kCallRelative); return MethodReference(target_dex_file_, method_idx_); } @@ -245,6 +257,7 @@ class LinkerPatch { patch_type_ == Type::kDataBimgRelRo || patch_type_ == Type::kMethodRelative || patch_type_ == Type::kMethodBssEntry || + patch_type_ == Type::kJniEntrypointRelative || patch_type_ == Type::kTypeRelative || patch_type_ == Type::kTypeBssEntry || patch_type_ == Type::kPublicTypeBssEntry || |